Пример #1
0
    void DetermineDamage(int damageRolls, SoldierStats attackerStats, bool isPlayerAttacking)
    {
        int totalDamage = 0;

        for (int i = 0; i < damageRolls; i++)
        {
            int rand = Mathf.CeilToInt(Random.Range(DAMAGE_ROLL_MIN, DAMAGE_ROLL_MAX));
            totalDamage += (rand + attackerStats.attackMod);
        }
        if (isPlayerAttacking)
        {
            planet.EnemyTakeDamage(totalDamage);
        }
        else
        {
            planet.PlayerTakeDamage(totalDamage);
        }
    }