示例#1
0
        // Simulates damage done
        static public void SimulateDamage(String spellName)
        {
            int    damage           = 0;
            int    duration         = 0;
            int    maxHit           = 0;
            int    totalRegenerated = 0;
            int    manaPool         = CalculationHelpers.CalculateItemSetMana(itemList);
            Spell  spell            = CalculationHelpers.GetSpell(spellList, spellName);
            double critPercentage   = CalculationHelpers.CalculateItemSetCritPercentage(itemList);
            int    spellPower       = CalculationHelpers.SumItemSetAttribute(itemList, "Damage");
            int    spellHit         = CalculationHelpers.SumItemSetAttribute(itemList, "Hit");

            for (int currentMana = manaPool; currentMana >= spell.Mana; currentMana = (currentMana - spell.Mana))
            {
                int hitDamage = CalculationHelpers.CalculateSpellDamage(spell, spellPower, critPercentage, spellHit, isBoss);
                damage += hitDamage;
                maxHit  = (hitDamage > maxHit) ? hitDamage : maxHit;

                duration += Math.Max(spell.CastTime, spell.Cooldown);

                // regenerate mana
                int regeneratedMana = CalculateRegeneratedMana(duration, totalRegenerated);
                totalRegenerated += regeneratedMana;
                currentMana      += regeneratedMana;
            }

            Console.WriteLine();
            Console.WriteLine($"[{spell.Name}]");
            Console.WriteLine($"Max Hit: {maxHit}");
            Console.WriteLine($"Total Damage: {damage}");
            Console.WriteLine($"Total Mana Regenerated: {totalRegenerated}");
            Console.WriteLine($"Total Duration (seconds): {duration}");
            Console.WriteLine($"DPS: {damage / duration}");
        }
示例#2
0
        static public int CalculateRegeneratedMana(int duration, int totalRegenerated)
        {
            int MP5 = CalculationHelpers.SumItemSetAttribute(itemList, "MP5");
            int MP2 = (MP5 * 2) / 5;
            int effectiveDuration = (duration % 2 == 0) ? duration : duration - 1;

            return((effectiveDuration / 2 * MP2) - totalRegenerated);
        }
示例#3
0
        private static void PrintStats()
        {
            // get and loop through all properties that are of type int and not "WoWHeadId"
            PropertyInfo[] attributes = typeof(Item).GetProperties();
            foreach (PropertyInfo attribute in attributes)
            {
                if (attribute.PropertyType == typeof(int) && attribute.Name != "WoWHeadId")
                {
                    Console.WriteLine($"Total {attribute.Name}: {CalculationHelpers.SumItemSetAttribute(itemList, attribute.Name)}");
                }
            }

            Console.WriteLine();
            Console.WriteLine($"Total Mana: {CalculationHelpers.CalculateItemSetMana(itemList)}");
            Console.WriteLine($"Crit Percent: {CalculationHelpers.CalculateItemSetCritPercentage(itemList)}");
        }