From 9e37127dd2d73181321b5babccda09ab5180d17e Mon Sep 17 00:00:00 2001 From: max4805 Date: Sat, 17 Sep 2022 22:24:25 +0200 Subject: [PATCH] Make seekers bump on sideways jumpthrus properly Backport of https://github.com/max4805/MaxHelpingHand/commit/9e11fdc5ba1d761360c7d3c4f3eae333c10a8c47 --- Entities/SidewaysJumpThru.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Entities/SidewaysJumpThru.cs b/Entities/SidewaysJumpThru.cs index 8702623..03b8b83 100644 --- a/Entities/SidewaysJumpThru.cs +++ b/Entities/SidewaysJumpThru.cs @@ -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; @@ -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; @@ -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(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; }