private static Celeste.PlayerDeadBody PlayerDie(On.Celeste.Player.orig_Die orig, Celeste.Player self, Vector2 direction, bool evenIfInvincible, bool registerDeathInStats)
        {
            Celeste.Session session = (self.Scene as Celeste.Level).Session;

            Celeste.PlayerDeadBody playerDeadBody = orig(self, direction, evenIfInvincible, registerDeathInStats);

            if (playerDeadBody != null)
            {
                Celeste.Strawberry goldenStrawb = null;
                foreach (Celeste.Follower follower in self.Leader.Followers)
                {
                    if (follower.Entity is Celeste.Strawberry && (follower.Entity as Celeste.Strawberry).Golden && !(follower.Entity as Celeste.Strawberry).Winged)
                    {
                        goldenStrawb = (follower.Entity as Celeste.Strawberry);
                    }
                }
                Vector2?specialBoxLevel = (FactoryHelperModule.Instance._Session as FactoryHelperSession).SpecialBoxPosition;
                if (goldenStrawb == null && specialBoxLevel != null)
                {
                    playerDeadBody.DeathAction = delegate
                    {
                        Engine.Scene = new Celeste.LevelExit(Celeste.LevelExit.Mode.Restart, session);
                    };
                }
            }
            return(playerDeadBody);
        }
 private void OnStrawberryOnCollect(On.Celeste.Strawberry.orig_OnCollect orig, Celeste.Strawberry self)
 {
     orig(self);
     if (Settings.Enabled)
     {
         ApplyRules(self.Scene, "CollectBerry");
     }
 }