public void Injure(float amount) { if (!isInvulnerable) { DamageUtilities.Injure(this, amount); } }
//Bespoke Injure functionality //Checks that the player is neither invulnerable nor recently injured before applying damage and updating the sprite. //A coroutine is used to reset the player to the default, injurable state using InjuryReset() below. public void Injure(float amount) { if ((!isInvulnerable) && (!wasInjured)) { DamageUtilities.Injure(this, amount); wasInjured = true; sprite.color = Color.red; StartCoroutine(InjuryReset()); } }
public void Injure(float amount) { if (isIsolated == true) { DamageUtilities.Injure(this, amount); } else { SpeedDecrease(amount / 10); } }