Пример #1
0
        public void CalculateDamage(DamageCalcType damageCalcType)
        {
            spell_damage = 0;

            switch (damageCalcType)
            {
            case DamageCalcType.Default:
                damage       = unit.get_naked_damage();
                bonus_damage = ((int)unit.statsDamage - (int)damage) + unit.bonus_damage;
                break;

            case DamageCalcType.Stats:
                damage       = unit.statsDamage;
                bonus_damage = (int)unit.bonus_damage;
                break;

            case DamageCalcType.DPA:
                damage       = unit.damage;
                bonus_damage = (double)onAttackStats.GetDamage("ATTACK_DAMAGE");     // get full damage from crits or smth like that ...
                if (bonus_damage != 0)
                {
                    bonus_damage -= onAttackStats.GetKeyProbability("ATTACK_DAMAGE") * damage; // bonus damage = full_damage - base_damage
                }
                bonus_damage += (double)onAttackStats.GetDamage("ATTACK_BONUS_DAMAGE");        // some other damage bonuses (from range bash)

                /////////////////
                // spell damage
                /////////////////

                spell_damage += (double)onAttackStats.GetDamage("DAMAGE_SPELL");
                spell_damage += onEnemyStats.GetDouble("DPS_SPELL") * unit.cooldown;
                break;

            default:
                damage       = 0;
                bonus_damage = 0;
                break;
            }

            //currentHeroDamage = damage;
            //currentHeroBonusDamage = bonus_damage;
            total_damage      = damage + bonus_damage;
            additional_damage = total_damage - (Damage)unit.damage;
        }
Пример #2
0
        public void CalculateDamage(DamageCalcType damageCalcType)
        {
            spell_damage = 0;

            switch (damageCalcType)
            {
                case DamageCalcType.Default:
                    damage = unit.get_naked_damage();
                    bonus_damage = ((int)unit.statsDamage - (int)damage) + unit.bonus_damage;
                    break;

                case DamageCalcType.Stats:
                    damage = unit.statsDamage;
                    bonus_damage = (int)unit.bonus_damage;
                    break;

                case DamageCalcType.DPA:
                    damage = unit.damage;
                    bonus_damage = (double)onAttackStats.GetDamage("ATTACK_DAMAGE"); // get full damage from crits or smth like that ...
                    if (bonus_damage != 0) bonus_damage -= onAttackStats.GetKeyProbability("ATTACK_DAMAGE") * damage; // bonus damage = full_damage - base_damage
                    bonus_damage += (double)onAttackStats.GetDamage("ATTACK_BONUS_DAMAGE"); // some other damage bonuses (from range bash)

                    /////////////////
                    // spell damage
                    /////////////////

                    spell_damage += (double)onAttackStats.GetDamage("DAMAGE_SPELL");
                    spell_damage += onEnemyStats.GetDouble("DPS_SPELL") * unit.cooldown;
                    break;

                default:
                    damage = 0;
                    bonus_damage = 0;
                    break;
            }

            //currentHeroDamage = damage;
            //currentHeroBonusDamage = bonus_damage;
            total_damage = damage + bonus_damage;
            additional_damage = total_damage - (Damage)unit.damage;
        }