Skip to content

Commit

Permalink
Make seekers bump on sideways jumpthrus properly
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie480 committed Sep 17, 2022
1 parent 739e61a commit 9e37127
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Entities/SidewaysJumpThru.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public static void activateHooks() {
IL.Celeste.Player.SlipCheck += modCollideChecks; // make climbing on jumpthrus not slippery
IL.Celeste.Player.NormalUpdate += modCollideChecks; // get the wall slide effect
IL.Celeste.Player.OnCollideH += modCollideChecks; // handle dashes against jumpthrus properly, without "shifting" down
IL.Celeste.Seeker.OnCollideH += modCollideChecks; // make seekers bump against jumpthrus, instead of vibrating at maximum velocity

// don't make Madeline duck when dashing against a sideways jumpthru
On.Celeste.Player.DuckFreeAt += preventDuckWhenDashingAgainstJumpthru;
Expand Down Expand Up @@ -106,6 +107,7 @@ public static void deactivateHooks() {
IL.Celeste.Player.SlipCheck -= modCollideChecks;
IL.Celeste.Player.NormalUpdate -= modCollideChecks;
IL.Celeste.Player.OnCollideH -= modCollideChecks;
IL.Celeste.Seeker.OnCollideH -= modCollideChecks;
hookOnUpdateSprite?.Dispose();

On.Celeste.Player.DuckFreeAt -= preventDuckWhenDashingAgainstJumpthru;
Expand Down Expand Up @@ -233,7 +235,7 @@ private static bool entityCollideCheckWithSidewaysJumpthrus(Entity self, Vector2
// and we are checking the collision on the left side of the player for example.
bool collideOnLeftSideOfPlayer = (self.Position.X > checkAtPosition.X);
SidewaysJumpThru jumpthru = self.CollideFirstOutside<SidewaysJumpThru>(checkAtPosition);
return jumpthru != null && self is Player && jumpthru.AllowLeftToRight == collideOnLeftSideOfPlayer
return jumpthru != null && (self is Player || self is Seeker) && jumpthru.AllowLeftToRight == collideOnLeftSideOfPlayer
&& jumpthru.Bottom >= self.Top + checkAtPosition.Y - self.Position.Y + 3;
}

Expand Down

0 comments on commit 9e37127

Please sign in to comment.