Esempio n. 1
0
        public void Step(Level level)
        {
            if (Settings.Mode == GhostModuleMode.Off)
            {
                return;
            }

            string target = level.Session.Level;

            Logger.Log("ghost", $"Stepping into {level.Session.Area.GetSID()} {target}");

            Player player = level.Tracker.GetEntity <Player>();

            // Write the ghost, even if we haven't gotten an IL PB.
            // Maybe we left the level prematurely earlier?
            if (GhostRecorder?.Data != null &&
                (Settings.Mode & GhostModuleMode.Record) == GhostModuleMode.Record)
            {
                GhostRecorder.Data.Target = target;
                GhostRecorder.Data.Run    = Run;
                GhostRecorder.Data.Write();
            }

            GhostManager?.RemoveSelf();

            level.Add(GhostManager = new GhostManager(player, level));

            if (GhostRecorder != null)
            {
                GhostRecorder.RemoveSelf();
            }
            level.Add(GhostRecorder = new GhostRecorder(player));
            GhostRecorder.Data      = new GhostData(level.Session);
            GhostRecorder.Data.Name = Settings.Name;
        }
Esempio n. 2
0
        public void OnLoadLevel(On.Celeste.Level.orig_LoadLevel orig, Level level, Player.IntroTypes playerIntro, bool isFromLoader)
        {
            orig(level, playerIntro, isFromLoader);

            if (isFromLoader)
            {
                GhostManager?.RemoveSelf();
                GhostManager = null;
                GhostRecorder?.RemoveSelf();
                GhostRecorder = null;
                Run           = Guid.NewGuid();
            }

            Step(level);
        }