Пример #1
0
        private CombatLogEvent WeaponDamageAttack(double speed, double multiplier = 1, DamageType damageType = DamageType.Physical)
        {
            int baseDmg = Random.Next(MainHandMin, MainHandMax + 1);

            int apDmg = (int)(ActualAttackPower * speed / 14);
            int value = (int)((baseDmg + apDmg) * multiplier);

            value = AdjustForAW(value);

            // TODO: handle Physical + Magic attack type ?
            if ((damageType & DamageType.Physical) != 0)
                value = AdjustPhysicalAttack(value);
            else
                value = AdjustMagicalAttack(value);

            var evt = new CombatLogEvent();
            evt.DamageAmount = value;
            evt.DamageType = damageType;

            return evt;
        }
Пример #2
0
        private CombatLogEvent SpellDamageAttack(int baseMin, int baseMax, DamageType damageType, double apScale = 0, double spScale = 0)
        {
            int baseDmg = Random.Next(baseMin, baseMax + 1);

            int apDmg = (int)(ActualAttackPower * apScale);
            int spDmg = (int)(ActualSpellPower * spScale);
            int value = baseDmg + apDmg + spDmg;

            value = AdjustForAW(value);

            // TODO: handle Physical + Magic attack type ?
            if ((damageType & DamageType.Physical) != 0)
                value = AdjustPhysicalAttack(value);
            else
                value = AdjustMagicalAttack(value);

            var evt = new CombatLogEvent();
            evt.DamageAmount = value;
            evt.DamageType = damageType;

            return evt;
        }
Пример #3
0
 private void ScaleDamage(CombatLogEvent evt, double scale)
 {
     evt.DamageAmount = (int)(evt.DamageAmount * scale);
 }
Пример #4
0
        private void HandOfLightDamage(CombatLogEvent evt)
        {
            CombatLogEvent hol = new CombatLogEvent();
            hol.Spell = HoLSpell;
            hol.Time = evt.Time;

            hol.DamageAmount = (int)(evt.DamageAmount * Mastery * 2.1);
            hol.DamageType = DamageType.Holy;

            hol.AttackType = AttackType.Hit; // TODO can this miss/etc?
            hol.DefenseType = DefenseType.None; // TODO ^ ?

            AdjustForInq(hol);
            RaiseCombatLogEvent(hol);
        }
Пример #5
0
 private void AdjustForInq(CombatLogEvent evt)
 {
     if (Sim.Buff("Inquisition").IsActive)
         evt.DamageAmount = (int)(evt.DamageAmount * 1.3);
 }
Пример #6
0
        private void OnCombatLogEvent(CombatLogEvent evt)
        {
            string name = evt.Spell != null ? evt.Spell.Name : "Melee";

            long amount;
            _damage.TryGetValue(name, out amount);

            amount += evt.DamageAmount;

            if (amount != 0)
                _damage[name] = amount;
        }