protected void OnDamageTaken(int Health) { if (Health == CurrentHealth) { return; } if (Health < CurrentHealth) { AudioSystem.Play(HurtSound); if (AbilitySystem.HasActiveTag(TypeTag.Poison)) { StartCoroutine(PlayEffect(PoisonedEffect)); } else { StartCoroutine(PlayEffect(DamageEffect)); } } if (Health <= 0) { IsAlive = false; Grid.setOccupied((Vector3Int)GridPos, false); Animator.SetBool("Death", true); AudioSystem.Play(DeathSound); StartCoroutine(PlayEffect(DeathEffect)); } CurrentHealth = Health; }