/// <summary> /// Replaces the RefillStamina in the base game. /// </summary> /// <param name="orig">The original RefillStamina method</param> /// <param name="self">The Player instance</param> private void modRefillStamina(On.Celeste.Player.orig_RefillStamina orig, Player self) { // invoking the original method is not really useful, but another mod may try to hook it, so don't break it if the Stamina variant is disabled orig.Invoke(self); if (Settings.Stamina != 11) { self.Stamina = determineBaseStamina(); } }
/// <summary> /// Replaces the RefillStamina in the base game. /// </summary> /// <param name="orig">The original RefillStamina method</param> /// <param name="self">The Player instance</param> private void modRefillStamina(On.Celeste.Player.orig_RefillStamina orig, Player self) { if (Settings.DontRefillStaminaOnGround && !SaveData.Instance.Assists.InfiniteStamina && !forceRefillStamina) { // we don't want to refill stamina at all. return; } // invoking the original method is not really useful, but another mod may try to hook it, so don't break it if the Stamina variant is disabled orig.Invoke(self); if (Settings.Stamina != 11) { self.Stamina = determineBaseStamina(); } }