private static IEnumerator onSeekerRegenerateCoroutine(On.Celeste.Seeker.orig_RegenerateCoroutine orig, Seeker self)
        {
            IEnumerator origEnum = orig(self);

            while (origEnum.MoveNext())
            {
                yield return(origEnum.Current);
            }

            // make the seeker check for flag touch switches as well.
            self.Collider = (Collider)seekerPushRadius.GetValue(self);
            turnOnTouchSwitchesCollidingWith(self);
            self.Collider = (Collider)seekerPhysicsHitbox.GetValue(self);
        }
示例#2
0
        private IEnumerator patchSeekerRegenerateCoroutine(On.Celeste.Seeker.orig_RegenerateCoroutine orig, Seeker self)
        {
            IEnumerator original = orig(self);

            Session session       = self.SceneAs <Level>().Session;
            bool    origNoRefills = session.Inventory.NoRefills;

            while (original.MoveNext())
            {
                yield return(original.Current);

                if (original.Current != null && original.Current.GetType() == typeof(float) && (float)original.Current == 0.15f)
                {
                    // modify dash refills between the last "yield return" and the end of the method.
                    origNoRefills = session.Inventory.NoRefills;
                    session.Inventory.NoRefills = areRefillsOnGroundDisabled(origNoRefills);
                }
            }
            session.Inventory.NoRefills = origNoRefills;
        }