//ISpeedMod Functions #region //SpeedDecrease and SpeedReset are ISpeedMod standard using DamageUtilities //SpeedIncrease has no functionality public void SpeedDecrease(float amount) { if (speed >= 0) { DamageUtilities.SpeedDecrease(this, amount); } }
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); } }
public void SpeedReset() { DamageUtilities.SpeedReset(this); }
//IVulnerable Functions #region //Heal & KIll are IVulnerable Standard using DamageUtilities //Injure slows the Spawner until it becomes ISOLATED then deals damage as IVulnerable standard with DamageUtilities public void Heal(float amount) { DamageUtilities.Heal(this, amount); }
public void SpeedIncrease(float amount) { DamageUtilities.SpeedIncrease(this, amount); }