Exemplo n.º 1
0
 private void hook_update(On.Celeste.SummitCheckpoint.orig_Update orig, SummitCheckpoint self)
 {
     if (Settings.Enabled)
     {
         if (!self.Activated)
         {
             Player player = self.CollideFirst <Player>();
             if (player != null && player.OnGround(1) && player.Speed.Y >= 0f)
             {
                 Level level = self.Scene as Level;
                 self.Activated = true;
                 level.Session.SetFlag("summit_checkpoint_" + self.Number, true);
                 level.Session.RespawnPoint = new Vector2?((Vector2)typeof(SummitCheckpoint).GetField("respawn", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(self));
                 level.Session.UpdateLevelStartDashes();
                 level.Session.HitCheckpoint = true;
                 level.Displacement.AddBurst(self.Position, 0.5f, 4f, 24f, 0.5f, null, null);
                 level.Add(new SummitCheckpoint.ConfettiRenderer(self.Position));
                 Audio.Play("event:/lollyde/origflagsound", self.Position);
             }
         }
     }
     else
     {
         orig(self);
     }
 }
Exemplo n.º 2
0
        private void UpdateTimerStateOnTouchFlag(On.Celeste.SummitCheckpoint.orig_Update orig, SummitCheckpoint self)
        {
            bool lastActivated = self.Activated;

            orig(self);
            if (!SpeedrunToolModule.LivesplitMode && !lastActivated && self.Activated)
            {
                UpdateTimerState();
            }
        }
Exemplo n.º 3
0
        private static void SummitCheckpointOnUpdate(On.Celeste.SummitCheckpoint.orig_Update orig, SummitCheckpoint self)
        {
            bool lastActivated = self.Activated;

            orig(self);
            if (!lastActivated && self.Activated)
            {
                if (Engine.Scene is Level level && level.GetPlayer() is Player player)
                {
                    player.Add(new Coroutine(WaitSessionReady(level.Session)));
                }
            }
        }