From 94aea179edb9d472ebee18fbc313c72a05a3f60e Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 15 Jan 2024 21:31:36 -0800 Subject: [PATCH] E-Braking on ground: cancels Insta-Whip - Lets you keep your Whip while fast-falling. - Make sure Insta-Whip can't interrupt Guard and vice-versa. --- src/k_kart.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b5ae9b39e..286eac51a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -8582,9 +8582,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) S_StartSound(player->mo, sfx_s1af); player->oldGuard = true; - - if (!K_PowerUpRemaining(player, POWERUP_BARRIER)) - player->instaWhipCharge = 0; } else if (player->oldGuard) { @@ -10827,6 +10824,11 @@ boolean K_PlayerGuard(const player_t *player) return true; } + if (player->instaWhipCharge != 0) + { + return false; + } + if (player->spheres == 0) return false; @@ -11676,7 +11678,19 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->instaWhipCharge = 0; } - if (chargingwhip) + if (chargingwhip && K_PressingEBrake(player)) + { + // 1) E-braking on the ground: cancels Insta-Whip. + // Still lets you keep your Whip while fast-falling. + // 2) Do not interrupt Guard. + if (P_IsObjectOnGround(player->mo) || K_PlayerGuard(player)) + { + if (player->instaWhipCharge) + player->defenseLockout = PUNISHWINDOW; + player->instaWhipCharge = 0; + } + } + else if (chargingwhip) { player->instaWhipCharge = min(player->instaWhipCharge + 1, INSTAWHIP_TETHERBLOCK + 1);