Пример #1
0
        public int CalculateSpellHealing(MDRActor source, MDRActor target)
        {
            int characterSpellLevel = (int)Math.Max(1, source.SpellPower(this));

            float levelFactor = Util.Clamp(4 * (1 - (SpellLevel / characterSpellLevel)), 1f, 4f);

            int bonusHealing = Util.Roll(DamageMod);

            int finalHealing = (int)(DamageBase * levelFactor) + bonusHealing;

            return(finalHealing);
        }
Пример #2
0
        /** Calculates damage delt by given spell to given target. */
        public int CalculateSpellDamage(MDRActor source, MDRActor target, out int resisted)
        {
            int characterSpellLevel = (int)Math.Max(1, source.SpellPower(this));

            float levelFactor = Util.Clamp(4 * (1 - (SpellLevel / characterSpellLevel)), 1f, 4f);

            int bonusDamage = Util.Roll(DamageMod);

            int finalDamage = (int)(DamageBase * levelFactor) + bonusDamage;

            if (KillSpell && (target.Hits > finalDamage))
            {
                finalDamage = 0;
            }

            //todo: resistance.
            resisted = 0;

            return(finalDamage);
        }