Exemplo n.º 1
0
        protected int CalculateDamage(GameObject unit)
        {
            Character target = unit.GetComponent <Character>();

            // Calculate the current units rune bonuses
            CalculateRuneStats();
            int damage = Mathf.RoundToInt(
                // Standard atk-def calc
                (Mathf.Pow(currentAtk, 2) + totalRuneAtk) / (target.GetCurrentDef() + target.GetRuneDef())
                // Level compensation
                * (1 + (currentLevel * 2 - target.currentLevel) / 50)
                // Elemental multiplier
                * ElementalAffinity.CalcElementalDamage(attackElement, target.element));

            return(damage);
        }
Exemplo n.º 2
0
        protected int CalculateMultiHitDamage(int attackValue, GameObject unit)
        {
            Character target = unit.GetComponent <Character>();

//		Debug.Log(string.Format("{0}'s atk: {1}, {2}'s def: {3}",
//			source.name, source.GetCurrentAtk(), target.name, target.GetCurrentDef()));
//		Debug.Log(string.Format("{0}'s attack element: {1}, {2} element: {3}",
//			source.name, source.GetAttackElement(), target.name, target.element));
            // Calculate the current units rune bonuses
            CalculateRuneStats();
            int damage = Mathf.RoundToInt(
                // Standard atk-def calc
                Mathf.Pow(attackValue, 2) / (target.GetCurrentDef() + target.GetRuneDef())
                // Level compensation
                * (1 + (currentLevel * 2 - target.currentLevel) / 50)
                // Elemental multiplier
                * ElementalAffinity.CalcElementalDamage(attackElement, target.element));

            return(damage);
        }