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(); } }
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(); } }