From 301d1ffec6cad49458d3c7a37b0363ceb57ff528 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 10 Jul 2018 18:16:53 -0400 Subject: [PATCH] Sound & timer fixes - Don't decrease spinout when boosting - Don't increase banana dragging when in the air or if you're not moving (Not sure about this one, just thought that this would feel better than it always increasing once we add the visual effect) - Play a sound for banana dragging - Correct finish line sounds --- src/k_kart.c | 10 ++++++++-- src/p_spec.c | 6 +++--- src/sounds.c | 6 +++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 2abc74d54..41da73af3 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2651,7 +2651,12 @@ static void K_MoveHeldObjects(player_t *player) mobj_t *cur = player->mo->hnext; mobj_t *targ = player->mo; - player->kartstuff[k_bananadrag]++; + if (P_IsObjectOnGround(player->mo) && player->speed > 0) + { + player->kartstuff[k_bananadrag]++; + if (player->kartstuff[k_bananadrag] > TICRATE && leveltime % 7 == 0) + S_StartSound(player->mo, sfx_cdfm70); + } while (cur && !P_MobjWasRemoved(cur)) { @@ -2745,7 +2750,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_spinouttimer]) { - if (P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1) + if ((P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1) + && (player->kartstuff[k_sneakertimer] == 0)) player->kartstuff[k_spinouttimer]--; if (player->kartstuff[k_spinouttimer] == 0) player->kartstuff[k_spinouttype] = 0; // Reset type diff --git a/src/p_spec.c b/src/p_spec.c index 27e2d8867..a3a8d11e0 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4223,10 +4223,10 @@ DoneSection2: } } - if (player->kartstuff[k_position] == 1) + if (P_IsLocalPlayer(player)) + S_StartSound(NULL, sfx_s3k6a); + else if (player->kartstuff[k_position] == 1) S_StartSound(NULL, sfx_s253); - else if (P_IsLocalPlayer(player)) - S_StartSound(NULL, sfx_s24f); P_DoPlayerExit(player); } diff --git a/src/sounds.c b/src/sounds.c index f9823bcbc..1fb171d21 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -362,7 +362,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s24c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s24d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s24e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s24f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Normal finish + {"s24f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s250", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s251", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s252", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -453,7 +453,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart final lap {"s3k69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart finish {"s3k6b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k6d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -677,7 +677,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"cdfm67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"cdfm70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"cdfm70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Trail item dragging {"cdfm71", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm72", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm73", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},