private void OnLevelLoadLevel(On.Celeste.Level.orig_LoadLevel orig, Celeste.Level self, Celeste.Player.IntroTypes playerIntro, bool isFromLoader)
        {
            orig(self, playerIntro, isFromLoader);

            Session.SpawnedOshiros.Clear();
            Session.SpawnedBadelineChasers.Clear();

            if (Settings.Enabled)
            {
                Celeste.Player player = self.Tracker.GetEntity <Celeste.Player>();

                if (!isFromLoader)
                {
                    ApplyRules(self, "ScreenChange");

                    if (self.NewLevel)
                    {
                        ApplyRules(self, "NewRoom");
                    }
                }

                if (player != null)
                {
                    int chaserCount = self.Tracker.CountEntities <BadelineOldsite>() + self.Tracker.CountEntities <EveryTimeCustomChaser>();
                    int added       = 0;
                    while (added < Session.ChaserCount)
                    {
                        if (chaserCount >= 7)
                        {
                            break;
                        }
                        EveryTimeCustomChaser chaser = new EveryTimeCustomChaser(player.Position + Vector2.UnitY * 32, chaserCount++);
                        self.Add(chaser);
                        Session.SpawnedBadelineChasers.Add(chaser);
                        added++;
                    }

                    player.Add(new Coroutine(OshiroSpawnRoutine(player, Session.OshiroCount)));
                }
            }
        }
        private static void LoadLevel(On.Celeste.Level.orig_LoadLevel orig, Celeste.Level self, Celeste.Player.IntroTypes playerIntro, bool isFromLoader)
        {
            orig(self, playerIntro, isFromLoader);
            if (playerIntro != Celeste.Player.IntroTypes.Transition || isFromLoader)
            {
                Celeste.Player player = self.Tracker.GetEntity <Celeste.Player>();

                foreach (Celeste.EntityID key in (FactoryHelperModule.Instance._Session as FactoryHelperSession).Batteries)
                {
                    self.Add(new Battery(player, key));
                }
            }
        }
Example #3
0
        private void onLoadLevel(On.Celeste.Level.orig_LoadLevel orig, Celeste.Level self, Celeste.Player.IntroTypes playerIntro, bool isFromLoader)
        {
            orig(self, playerIntro, isFromLoader);

            if (!self.Entities.Any(entity => entity is DashCountIndicator))
            {
                // add the entity showing the dash count (it will be invisible unless the option is enabled)
                self.Add(new DashCountIndicator());
                self.Entities.UpdateLists();
            }
        }