From eb7e2287c4ef8209936974e427716df48aee0e6f Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 5 Sep 2022 10:54:16 -0400 Subject: [PATCH] Change bounce behavior - Always allow bounce after fast fall - Allow for more bounces - Lose speed on bounces that don't reach max --- src/k_kart.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b31556fc4..77ec7c20a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9311,20 +9311,28 @@ static void K_KartSpindash(player_t *player) { // Handle fastfall bounce. const fixed_t maxBounce = player->mo->scale * 10; - const fixed_t minBounce = player->mo->scale * 2; - fixed_t bounce = abs(player->fastfall) / 4; + const fixed_t minBounce = player->mo->scale; + fixed_t bounce = 2 * abs(player->fastfall) / 3; if (bounce > maxBounce) { bounce = maxBounce; } - - if (bounce > minBounce) + else { - S_StartSound(player->mo, sfx_ffbonc); - player->mo->momz = bounce * P_MobjFlip(player->mo); + // Lose speed on bad bounce. + player->mo->momx /= 2; + player->mo->momy /= 2; + + if (bounce < minBounce) + { + bounce = minBounce; + } } + S_StartSound(player->mo, sfx_ffbonc); + player->mo->momz = bounce * P_MobjFlip(player->mo); + player->fastfall = 0; return; }