public bool UseStamina(float staminaAmount, bool forceStaminaUse) { if (stamina - staminaAmount >= 0 || forceStaminaUse) { stamina -= staminaAmount; StartCoroutine(PauseStaminaRegen()); } else { Debug.Log("Not enough stamina..."); return(false); } if (isPlayer) { if (stamina < 0) { stamina = 0; playerStaminaStatBar.ChangeBar(); return(false); } playerStaminaStatBar.ChangeBar(); } return(true); }
public void UseMana(float manaAmount) { if (mana - manaAmount >= 0) { mana -= manaAmount; } else { Debug.Log("Not enough mana..."); } if (isPlayer) { playerManaStatBar.ChangeBar(); } }
public void TakeDamage(float damageAmount) { health -= damageAmount; if (isPlayer) { playerHealthStatBar.ChangeBar(); } if (health <= 0) { Die(); } else { audioManager.PlayRandomSound(audioManager.humanMaleGruntSounds, transform.position); } }