Пример #1
0
    public void GetDamage(int amountOfDamage, HealthManager shooter, GameObject bullet)
    {
        if (m_healthManager == shooter)
        {
            return;
        }

        int damageGive;
        int damageRecieve;

        damageRecieve = (amountOfDamage * m_DamageMultiplicator) + m_DamageAdd;


        if (m_AmountOfArmor > 0)
        {
            damageGive = damageRecieve - m_AmountOfArmor;
        }
        else
        {
            damageGive = damageRecieve;
        }

        if (m_AmountOfArmor > 0)
        {
            m_AmountOfArmor -= damageRecieve;
        }

        if (damageGive > 0)
        {
            m_healthManager.DeacreseLife(damageGive, bullet);
        }
    }