Esempio n. 1
0
    public void receiveDamage(float damage, Unit attacker)
    {
        float actualDamage = Mathf.Max(damage - Mathf.Max(Armor - attacker.ArmorIgnore, 0), 0);

        damageReceived += actualDamage;
        if (actualDamage > 0)
        {
            lastAttacker = attacker;
        }
        graphics.showDamage(actualDamage);
        if (damageReceived >= Hp)
        {
            die();
        }
    }
Esempio n. 2
0
    public void ReceiveDamage(float damage, Unit attacker)
    {
        float actualDamage = Mathf.Max(damage - Mathf.Max(Armor - attacker.ArmorIgnore, 0), 0);

        actualDamage    = Mathf.Round(actualDamage);
        damageReceived += actualDamage;
        if (actualDamage > 0)
        {
            deadState.LastAttacker = attacker;
        }
        graphics.showDamage(actualDamage);
        if (damageReceived >= Hp)
        {
            deadState.StartDeath();
        }
    }