private IEnumerator modBadelineBoostRoutine(On.Celeste.BadelineBoost.orig_BoostRoutine orig, BadelineBoost self, Player player) { IEnumerator coroutine = orig(self, player); while (coroutine.MoveNext()) { yield return(coroutine.Current); } // apply the dash refill rules here (this does not call RefillDash) if (Settings.DashCount != -1) { // this will run in 0.15 seconds: if (player.Dashes < player.Inventory.Dashes) player.Dashes++; // let's take that into account and deduce 1 from the dash count if required. if (Settings.DashCount < player.Inventory.Dashes) { player.Dashes = Settings.DashCount - 1; } else { player.Dashes = Settings.DashCount; } } // using a Badeline Boost refills dashes OnDashRefill?.Invoke(); yield break; }
/// <summary> /// Replaces the RefillDash in the base game. /// </summary> /// <param name="orig">The original RefillDash method</param> /// <param name="self">The Player instance</param> private bool modRefillDash(On.Celeste.Player.orig_RefillDash orig, Player self) { // trigger the "on dash refill" event OnDashRefill?.Invoke(); if (Settings.DashCount == -1) { return(orig.Invoke(self)); } else if (self.Dashes < Settings.DashCount) { self.Dashes = Settings.DashCount; return(true); } return(false); }
private void triggerOnDashRefill() { OnDashRefill?.Invoke(); }