void IHealthEntity.DoDamage(float damageAmount, GameObject playerThatShot) { if (currentHealth <= 0) //if we're playing the death anim, we dont take damage { return; } currentHealth -= damageAmount; CustomFunctions.HitPause(); CustomFunctions.PlaySound(getHitSound); if (currentHealth <= 0) { Die(playerThatShot); } }
public void TakeHitEffect(float damageAmount, GameObject playerThatShot) { if (currentParryState != ParryState.IsParrying) { RefreshDamageDisplay(); CustomFunctions.HitPause(); CustomFunctions.PlaySound(getHitSound); DisplayDamageOnMap(damageAmount, false); StopCoroutine(HitEffectSpriteBlink()); StartCoroutine(HitEffectSpriteBlink()); } else { ResetParry(); CustomFunctions.PlaySound(parryHitSound); RefreshDamageDisplay(); DisplayDamageOnMap(damageAmount, true); CustomFunctions.HitPause(); } //print("Take hit effect with current health " + currentHealth); }