Esempio n. 1
0
    public int EnemyDamageAfterCalculation(IHavePlayerStats _player, IHaveEnemyStats _enemy)
    {
        int blockChance = FindProbability();

        if (blockChance <= _player.BlockChance)
        {
            return(0);
        }
        else
        {
            return(_enemy.Damage - (_player.Armour));
        }
    }
Esempio n. 2
0
    public int PlayerDamageAfterCalculation(IHavePlayerStats _player, IHaveEnemyStats _enemy)
    {
        int finalDamage    = 0;
        int criticalChance = FindProbability();

        Debug.Log(criticalChance);
        if (criticalChance <= (_player.CriticalChance + _player.SwordStats.CriticalChance))
        {
            finalDamage = _player.Damage * (_player.CriticalDamage / 100);
            Debug.Log("CRITICAL !!");
        }
        else
        {
            finalDamage = _player.Damage;
        }
        return(finalDamage + _player.SwordStats.Damage - (_enemy.Armour));
    }