//public bool CanHeal() //{ // //include item stipulation here // if( // return true; // else // return false; //} /* [Stamina Methods] */ public void DecreaseStamina(float decrease) { decrease = Mathf.Clamp(decrease, 0, maxStamina.GetValue()); currentStamina -= decrease; OnStaminaChanged?.Invoke(maxStamina.GetValue(), currentStamina); resetStaminaTimer(); }
private void OnEnable() { currentHealth = stats.maxHealth; if (GameManager.Instance != null && this == GameManager.Instance.CurrentViking) { OnHealthChanged?.Invoke(this, currentHealth, stats.maxHealth); OnStaminaChanged?.Invoke(this, currentStamina, stats.maxStamina); } }
private void StamRegen() { currentStamina = (float)Mathf.Clamp(currentStamina + (staminaRegenRate.GetValue() * Time.deltaTime), 0.0f, maxStamina.GetValue()); OnStaminaChanged?.Invoke(maxStamina.GetValue(), currentStamina); }
public void SetUpAgility(int amount) { staminaMax += amount; OnStaminaChanged?.Invoke(this, EventArgs.Empty); }
public void SetupStamina(int amount) { staminaMax += amount; stamina += amount; OnStaminaChanged?.Invoke(this, EventArgs.Empty); }
public void PlusStamina(int amount) { stamina = Mathf.Clamp(stamina + amount, 0, staminaMax); OnStaminaChanged?.Invoke(this, EventArgs.Empty); }