// 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}"); }
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)}"); }