From 213749b1152e95eef1d3f06593dd629161c60ae2 Mon Sep 17 00:00:00 2001 From: Sryder Date: Thu, 7 Jun 2018 19:56:26 +0100 Subject: [PATCH] Big voices change When using a taunt voice (item usage) there's a 5 second delay on more taunts and a 2 second delay on other voices When using other voices, there's at least a 2 second delay on all other voices --- src/d_player.h | 3 ++- src/dehacked.c | 3 ++- src/k_kart.c | 73 +++++++++++++++++++++++++++++++++----------------- 3 files changed, 53 insertions(+), 26 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 80e633dc..bd5004de 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -246,7 +246,8 @@ typedef enum k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir") k_lapanimation, // Used to make a swoopy lap lakitu, maybe other effects in the future k_cardanimation, // Used to determine the position of some full-screen Battle Mode graphics - k_sounds, // Used this to stop and then force music restores as it hits zero + k_voices, // Used to stop the player saying more voices than it should + k_tauntvoices, // Used to specifically stop taunt voice spam k_boosting, // Determines if you're currently shroom-boosting k_floorboost, // Prevents Mushroom sounds for a breif duration when triggered by a floor panel diff --git a/src/dehacked.c b/src/dehacked.c index 71d1d8f4..70b6965e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7550,7 +7550,8 @@ static const char *const KARTSTUFF_LIST[] = { "THROWDIR", "LAPANIMATION", "CARDANIMATION", - "SOUNDS", + "VOICES", + "TAUNTVOICES", "BOOSTING", "FLOORBOOST", diff --git a/src/k_kart.c b/src/k_kart.c index 1be69abc..14436041 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1111,8 +1111,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) else player->kartstuff[k_cardanimation] = 0; - if (player->kartstuff[k_sounds]) - player->kartstuff[k_sounds]--; + if (player->kartstuff[k_voices]) + player->kartstuff[k_voices]--; + + if (player->kartstuff[k_tauntvoices]) + player->kartstuff[k_tauntvoices]--; // ??? /* @@ -1190,7 +1193,48 @@ void K_KartPlayerAfterThink(player_t *player) static void K_PlayTauntSound(mobj_t *source) { + if (source->player && source->player->kartstuff[k_tauntvoices]) // Prevents taunt sounds from playing every time the button is pressed + return; + S_StartSound(source, sfx_taunt1+P_RandomKey(4)); + + if (source->player) + { + source->player->kartstuff[k_tauntvoices] = 175; + source->player->kartstuff[k_voices] = 70; + } +} + +static void K_PlayVoiceSound(mobj_t *source) +{ + if (source->player && source->player->kartstuff[k_voices]) // Prevents taunt sounds from playing every time the button is pressed + return; + + S_StartSound(source, sfx_slow); + + if (source->player) + { + source->player->kartstuff[k_voices] = 70; + + if (source->player->kartstuff[k_tauntvoices] < 70) + source->player->kartstuff[k_tauntvoices] = 70; + } +} + +static void K_PlayHitEmSound(mobj_t *source) +{ + if (source->player && source->player->kartstuff[k_voices]) // Prevents taunt sounds from playing every time the button is pressed + return; + + S_StartSound(source, sfx_hitem); + + if (source->player) + { + source->player->kartstuff[k_voices] = 70; + + if (source->player->kartstuff[k_tauntvoices] < 70) + source->player->kartstuff[k_tauntvoices] = 70; + } } void K_MomentumToFacing(player_t *player) @@ -1379,11 +1423,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source) || (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) return; - if (source && source != player->mo && source->player && !source->player->kartstuff[k_sounds]) - { - S_StartSound(source, sfx_hitem); - source->player->kartstuff[k_sounds] = 50; - } + K_PlayHitEmSound(source); player->kartstuff[k_mushroomtimer] = 0; player->kartstuff[k_driftboost] = 0; @@ -2241,11 +2281,7 @@ void K_DoMushroom(player_t *player, boolean doPFlag) if (doPFlag) player->pflags |= PF_ATTACKDOWN; - if (player->kartstuff[k_sounds]) // Prevents taunt sounds from playing every time the button is pressed - return; - K_PlayTauntSound(player->mo); - player->kartstuff[k_sounds] = 50; } static void K_DoLightning(player_t *player, boolean bluelightning) @@ -2276,11 +2312,7 @@ static void K_DoLightning(player_t *player, boolean bluelightning) continue; } - if (player->kartstuff[k_sounds]) // Prevents taunt sounds from playing every time the button is pressed - return; - K_PlayTauntSound(player->mo); - player->kartstuff[k_sounds] = 50; } void K_DoBouncePad(mobj_t *mo, fixed_t vertispeed) @@ -2739,15 +2771,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground) K_KartUpdatePosition(player); - if (!player->kartstuff[k_positiondelay] && !player->exiting) + if (!player->exiting) { if (player->kartstuff[k_oldposition] <= player->kartstuff[k_position]) // But first, if you lost a place, player->kartstuff[k_oldposition] = player->kartstuff[k_position]; // then the other player taunts. else if (player->kartstuff[k_oldposition] > player->kartstuff[k_position]) // Otherwise, { - S_StartSound(player->mo, sfx_slow); // Say "YOU'RE TOO SLOW!" + K_PlayOvertakeSound(player->mo); // Say "YOU'RE TOO SLOW!" player->kartstuff[k_oldposition] = player->kartstuff[k_position]; // Restore the old position, - player->kartstuff[k_positiondelay] = 5*TICRATE; // and set up a timer. } } @@ -3382,12 +3413,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground) S_StartSound(player->mo, sfx_sboost); player->kartstuff[k_mushroomtimer] = -((21*(player->kartstuff[k_boostcharge]*player->kartstuff[k_boostcharge]))/425)+131; // max time is 70, min time is 7; yay parabooolas - - if (!player->kartstuff[k_sounds]) // Prevents taunt sounds from playing every time the button is pressed - { - K_PlayTauntSound(player->mo); - player->kartstuff[k_sounds] = 50; - } } // You overcharged your engine? Those things are expensive!!! else if (player->kartstuff[k_boostcharge] > 50)