コード例 #1
0
ファイル: Objectives.cs プロジェクト: thehaunted88/Core
        public virtual string GetStatus(PvPBattle b, PlayerMobile p)
        {
            if (b == null || b.Deleted)
            {
                return(String.Empty);
            }

            if (p == null || p.Deleted)
            {
                return(String.Empty);
            }

            var lines = new StringBuilder();

            if (PointsTotal > 0)
            {
                lines.AppendLine("Points Total: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.Points), PointsTotal);
            }

            if (PointsGained > 0)
            {
                lines.AppendLine("Points Gained: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.PointsGained), PointsGained);
            }

            if (PointsLost > 0)
            {
                lines.AppendLine("Points Lost: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.PointsLost), PointsLost);
            }

            if (Kills > 0)
            {
                lines.AppendLine("Kills: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.Kills), Kills);
            }

            if (Deaths > 0)
            {
                lines.AppendLine("Deaths: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.Deaths), Deaths);
            }

            if (Resurrections > 0)
            {
                lines.AppendLine("Resurrections: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.Resurrections), Resurrections);
            }

            if (DamageTaken > 0)
            {
                lines.AppendLine("Damage Taken: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.DamageTaken), DamageTaken);
            }

            if (DamageDone > 0)
            {
                lines.AppendLine("Damage Done: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.DamageDone), DamageDone);
            }

            if (HealingTaken > 0)
            {
                lines.AppendLine("Healing Taken: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.HealingTaken), HealingTaken);
            }

            if (HealingDone > 0)
            {
                lines.AppendLine("Healing Done: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o.HealingDone), HealingDone);
            }

            return(lines.ToString());
        }
コード例 #2
0
ファイル: Objectives.cs プロジェクト: thehaunted88/Core
        public virtual double ComputeScore(PvPBattle b, PlayerMobile p, ref double min, ref double max, ref double total)
        {
            if (b == null || b.Deleted)
            {
                return(0);
            }

            if (p == null || p.Deleted)
            {
                return(0);
            }

            double val, score = 0.0;

            if (PointsTotal > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.Points) / (double)PointsTotal);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (PointsGained > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.PointsGained) / (double)PointsGained);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (PointsLost > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.PointsLost) / (double)PointsLost);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (Kills > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.Kills) / (double)Kills);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (Deaths > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.Deaths) / (double)Deaths);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (Resurrections > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.Resurrections) / (double)Resurrections);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (DamageTaken > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.DamageTaken) / (double)DamageTaken);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (DamageDone > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.DamageDone) / (double)DamageDone);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (HealingTaken > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.HealingTaken) / (double)HealingTaken);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (HealingDone > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o.HealingDone) / (double)HealingDone);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            return(score);
        }