public static int ReduceArmor(int damage, Stats stats, Target target) { var mitigationValue = (0.1 * target.Armor) / (8.5 * stats.Character.Level + 40); var mitigation = 1 - (mitigationValue / (1 + mitigationValue)); return(damage * WowMath.ToInt(mitigation)); }
public static int Calculate(Outcome outcome, Stats stats, Weapon weapon) { switch (outcome) { case Outcome.Glancing: int glanceModifier = RollGlance(stats.GlanceModifier); return(WowMath.ToInt(glanceModifier * GetWeaponDamage(weapon) / 100f)); case Outcome.Hit: return(GetWeaponDamage(weapon)); case Outcome.Crit: return(WowMath.ToInt(GetWeaponDamage(weapon) * stats.CritModifier)); case Outcome.Miss: case Outcome.Dodge: case Outcome.Parry: default: return(0); } }