private void OnExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     foreach (BingoVariant variant in typeof(BingoVariant).GetEnumValues())
     {
         BingoMonitor.SetVariantEnabled(variant, false);
     }
 }
        private void HijackExitBegin(On.Celeste.LevelExit.orig_Begin orig, LevelExit self)
        {
            orig(self);
            var settings = this.InRandomizerSettings;

            this.endingSettings = settings;
            if (settings == null || settings.Algorithm != LogicType.Endless)
            {
                return;
            }

            LevelExit.Mode mode = (LevelExit.Mode) typeof(LevelExit).GetField("mode", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(self);
            if (mode != LevelExit.Mode.Completed)
            {
                return;
            }

            var newSettings = settings.Copy();

            newSettings.EndlessLevel++;
            Audio.SetMusic(SFX.music_complete_bside);
            Audio.SetAmbience(null);

            this.genTask = Task.Run(() => {
                try {
                    return(RandoLogic.GenerateMap(newSettings));
                } catch (GenerationError e) {
                    LevelEnterExt.ErrorMessage = e.Message ?? "Failed to generate area";
                    LevelEnter.Go(new Session(new AreaKey(1).SetSID("")), false);
                    return(AreaKey.None);
                }
            });
        }
Example #3
0
            private static void OnLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
            {
                DiscordPresence.startTimestamp = 0;
                DiscordPresence.endTimestamp   = 0;

                UpdateText(CoreModule.Settings.DiscordTextInMenu);
            }
Example #4
0
 public void OnExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     if (mode == LevelExit.Mode.Completed ||
         mode == LevelExit.Mode.CompletedInterlude)
     {
         Step(level);
     }
 }
        public LevelExitToLobby(LevelExit.Mode exitMode, Session currentSession) : base()
        {
            Add(new HudRenderer());

            // calling the LevelExit constructor triggers the Level.Exit Everest event, so that makes mods less confused about what's going on.
            new LevelExit(exitMode, currentSession);
            this.exitMode = exitMode;
        }
 private void onLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     ExistingColorGrades.Remove("trigger");
     if (Settings.ColorGrading >= ExistingColorGrades.Count)
     {
         Settings.ColorGrading  = -1;
         Settings.ModColorGrade = null;
     }
 }
 private static void onLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     if (mode == LevelExit.Mode.SaveAndQuit)
     {
         // if saving in a No Refill Field, be sure to restore the refills.
         Player player = level.Tracker.GetEntity <Player>();
         if (player != null && player.CollideCheck <NoRefillField>())
         {
             level.Session.Inventory.NoRefills = false;
         }
     }
 }
Example #8
0
        /// <summary>
        /// Reset values if player exits or restarts chapter.
        /// </summary>
        /// <param name="level">Level object.</param>
        /// <param name="exit">Level exit object.</param>
        /// <param name="mode">Level exit mode.</param>
        /// <param name="session">Current session.</param>
        /// <param name="snow">???</param>
        private void OnLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
        {
            Log($"OnLevelExit: mode={mode}");
            switch (mode)
            {
            case LevelExit.Mode.GoldenBerryRestart:
            case LevelExit.Mode.SaveAndQuit:
                break;

            default:
                // Reset player life count
                lifeCount     = 1;
                infiniteLives = true;
                SaveSessionData();
                break;
            }
        }
Example #9
0
 internal static void Exit(_Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 => OnExit?.Invoke(level, exit, mode, session, snow);
        private void LevelExitOnCtor(On.Celeste.LevelExit.orig_ctor orig, LevelExit self, LevelExit.Mode mode, Session session, HiresSnow snow)
        {
            orig(self, mode, session, snow);

            Clear();
        }
Example #11
0
 private static void onLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     discardGradient();
 }
 private static void saveNewLazilyLoadedPaths(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     writeNewPaths(session.Area.GetSID());
 }
Example #13
0
 private static void OnExitHandler(Level exitLevel, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     On.Celeste.Level.TransitionTo -= TransitionLightSources;
 }
Example #14
0
        private static void LevelExitOnCtor(On.Celeste.LevelExit.orig_ctor orig, LevelExit self, LevelExit.Mode mode,
                                            Session session, HiresSnow snow)
        {
            orig(self, mode, session, snow);

            if (mode != LevelExit.Mode.GoldenBerryRestart)
            {
                Reset();
            }
        }
        private void EndlessCantRestart(On.Celeste.LevelExit.orig_ctor orig, LevelExit self, LevelExit.Mode mode, Session session, HiresSnow snow)
        {
            var settings = this.InRandomizerSettings;

            if (settings != null && settings.Algorithm == LogicType.Endless && (mode == LevelExit.Mode.Restart || mode == LevelExit.Mode.GoldenBerryRestart))
            {
                mode = LevelExit.Mode.SaveAndQuit;
            }

            orig(self, mode, session, snow);
        }
        private static void onLevelExitConstructor(On.Celeste.LevelExit.orig_ctor orig, LevelExit self, LevelExit.Mode mode, Session session, HiresSnow snow)
        {
            orig(self, mode, session, snow);

            if (mode == LevelExit.Mode.Restart || mode == LevelExit.Mode.GoldenBerryRestart)
            {
                // be sure to keep the lobby info in the session, even if we are resetting it.
                temporaryLobbySIDHolder    = CollabModule.Instance.Session.LobbySID;
                temporaryRoomHolder        = CollabModule.Instance.Session.LobbyRoom;
                temporarySpawnPointHolder  = new Vector2(CollabModule.Instance.Session.LobbySpawnPointX, CollabModule.Instance.Session.LobbySpawnPointY);
                temporarySaveAllowedHolder = CollabModule.Instance.Session.SaveAndReturnToLobbyAllowed;
            }
            if ((mode == LevelExit.Mode.GiveUp || mode == LevelExit.Mode.Completed) && CollabModule.Instance.Session.LobbySID != null)
            {
                // be sure that Return to Map and such from a collab entry returns to the lobby, not to the collab entry.
                SaveData.Instance.LastArea_Safe = AreaData.Get(CollabModule.Instance.Session.LobbySID).ToKey();
            }
        }
Example #17
0
 private void onLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     onLevelExit();
 }
Example #18
0
 private void Level_OnExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     spawnHelper.extendedPathfinder = false;
 }
 private void OnExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     Debug.WriteLine($"OnExit({level}, {exit}, {mode}, {session}, {snow})");
 }
 private void onLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     ResetVariantsOnLevelExit();
 }
Example #21
0
 internal static void LevelExit(On.Celeste.LevelExit.orig_ctor orig, LevelExit self, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     if (EmoteModMain.anim_by_game == 1)
     {
         cancelEmote();
     }
     orig(self, mode, session, snow);
 }
 private void onLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     snowBackdropAddedByEVM = false;
 }
 private void LevelExitOnCtor(On.Celeste.LevelExit.orig_ctor orig, LevelExit self, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     orig(self, mode, session, snow);
     previousRoom = null;
     if (mode == LevelExit.Mode.Restart && !StateManager.Instance.IsSaved)
     {
         SpeedrunToolModule.Settings.RoomTimer = SpeedrunToolSettings.RoomTimerStrings.First();
     }
 }
Example #24
0
 private void onLevelExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     // reset the cooldown
     climbJumpGrabCooldown = -1f;
 }
Example #25
0
        private void checkForTriggerUnhooking(On.Celeste.LevelExit.orig_ctor orig, LevelExit self, LevelExit.Mode mode, Session session, HiresSnow snow)
        {
            orig(self, mode, session, snow);

            // SaveAndQuit => leaving
            // GiveUp => leaving
            // Restart => restarting
            // GoldenBerryRestart => restarting
            // Completed => leaving
            // CompletedInterlude => leaving
            // we want to unhook the trigger if and only if we are actually leaving the level.
            if (triggerIsHooked && mode != LevelExit.Mode.Restart && mode != LevelExit.Mode.GoldenBerryRestart)
            {
                // we want to get rid of the trigger now.
                unhookTrigger();
            }
        }