diff --git a/src/dehacked.c b/src/dehacked.c index 28f20332..e4baf095 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8038,6 +8038,18 @@ struct { {"SKSSKID",SKSSKID}, {"SKSGASP",SKSGASP}, {"SKSJUMP",SKSJUMP}, + // SRB2kart + {"SKSKWIN",SKSKWIN}, // Win quote + {"SKSKLOSE",SKSKLOSE}, // Lose quote + {"SKSKPAN1",SKSKPAN1}, // Pain + {"SKSKPAN2",SKSKPAN2}, + {"SKSKATK1",SKSKATK1}, // Offense item taunt + {"SKSKATK2",SKSKATK2}, + {"SKSKBST1",SKSKBST1}, // Boost item taunt + {"SKSKBST2",SKSKBST2}, + {"SKSKSLOW",SKSKSLOW}, // Overtake taunt + {"SKSKHITM",SKSKHITM}, // Hit confirm taunt + {"SKSKPOWR",SKSKPOWR}, // Power item taunt // 3D Floor/Fake Floor/FOF/whatever flags {"FF_EXISTS",FF_EXISTS}, ///< Always set, to check for validity. diff --git a/src/f_finale.c b/src/f_finale.c index ab79fa78..e4854988 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -308,8 +308,8 @@ static void F_IntroDrawScene(void) { // Need to use M_Random otherwise it always uses the same sound INT32 rskin = M_RandomKey(numskins); - UINT8 rtaunt = M_RandomKey(4); - sfxenum_t rsound = skins[rskin].soundsid[SKSPLTNT1+rtaunt]; + UINT8 rtaunt = M_RandomKey(2); + sfxenum_t rsound = skins[rskin].soundsid[SKSKBST1+rtaunt]; S_StartSound(NULL, rsound); } background = W_CachePatchName("KARTKREW", PU_CACHE); diff --git a/src/k_kart.c b/src/k_kart.c index da085225..c4490a9b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1360,32 +1360,36 @@ static void K_RegularVoiceTimers(player_t *player) player->kartstuff[k_tauntvoices] = 4*TICRATE; } -static void K_PlayTauntSound(mobj_t *source) +static void K_PlayAttackTaunt(mobj_t *source) { -#if 1 - sfxenum_t pick = P_RandomKey(4); // Gotta roll the RNG every time this is called for sync reasons + sfxenum_t pick = P_RandomKey(2); // Gotta roll the RNG every time this is called for sync reasons boolean tasteful = (!source->player || !source->player->kartstuff[k_tauntvoices]); if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2)) - S_StartSound(source, sfx_taunt1+pick); + S_StartSound(source, sfx_kattk1+pick); if (!tasteful) return; K_TauntVoiceTimers(source->player); -#else - if (source->player && source->player->kartstuff[k_tauntvoices]) // Prevents taunt sounds from playing every time the button is pressed +} + +static void K_PlayBoostTaunt(mobj_t *source) +{ + sfxenum_t pick = P_RandomKey(2); // Gotta roll the RNG every time this is called for sync reasons + boolean tasteful = (!source->player || !source->player->kartstuff[k_tauntvoices]); + + if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2)) + S_StartSound(source, sfx_kbost1+pick); + + if (!tasteful) return; - S_StartSound(source, sfx_taunt1+P_RandomKey(4)); - K_TauntVoiceTimers(source->player); -#endif } static void K_PlayOvertakeSound(mobj_t *source) { -#if 1 boolean tasteful = (!source->player || !source->player->kartstuff[k_voices]); if (!G_RaceGametype()) // Only in race @@ -1396,33 +1400,28 @@ static void K_PlayOvertakeSound(mobj_t *source) return; if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2)) - S_StartSound(source, sfx_slow); + S_StartSound(source, sfx_kslow); if (!tasteful) return; K_RegularVoiceTimers(source->player); -#else - if (source->player && source->player->kartstuff[k_voices]) // Prevents taunt sounds from playing every time the button is pressed - return; - - if (!G_RaceGametype()) // Only in race - return; - - // 4 seconds from before race begins, 10 seconds afterwards - if (leveltime < starttime+(10*TICRATE)) - return; - - S_StartSound(source, sfx_slow); - - K_RegularVoiceTimers(source->player); -#endif } static void K_PlayHitEmSound(mobj_t *source) { if (cv_kartvoices.value) - S_StartSound(source, sfx_hitem); + S_StartSound(source, sfx_khitem); + else + S_StartSound(source, sfx_s1c9); // The only lost gameplay functionality with voices disabled + + K_RegularVoiceTimers(source->player); +} + +static void K_PlayPowerGloatSound(mobj_t *source) +{ + if (cv_kartvoices.value) + S_StartSound(source, sfx_kgloat); K_RegularVoiceTimers(source->player); } @@ -2671,8 +2670,6 @@ void K_DoSneaker(player_t *player, boolean doPFlag) if (doPFlag) player->pflags |= PF_ATTACKDOWN; - - K_PlayTauntSound(player->mo); } static void K_DoShrink(player_t *player) @@ -2691,8 +2688,6 @@ static void K_DoShrink(player_t *player) && players[i].kartstuff[k_position] < player->kartstuff[k_position]) P_DamageMobj(players[i].mo, player->mo, player->mo, 64); } - - K_PlayTauntSound(player->mo); } static void K_DoSPB(player_t *victim, player_t *source) @@ -3765,7 +3760,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (ATTACK_IS_DOWN && player->kartstuff[k_eggmanheld]) { K_ThrowKartItem(player, false, MT_FAKEITEM, -1, false); - K_PlayTauntSound(player->mo); + K_PlayAttackTaunt(player->mo); player->kartstuff[k_eggmanheld] = 0; K_CleanHnextList(player->mo); } @@ -3774,6 +3769,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) && player->kartstuff[k_rocketsneakertimer] > 1) { K_DoSneaker(player, true); + K_PlayBoostTaunt(player->mo); player->kartstuff[k_rocketsneakertimer] -= 5; if (player->kartstuff[k_rocketsneakertimer] < 1) player->kartstuff[k_rocketsneakertimer] = 1; @@ -3790,6 +3786,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO) { K_DoSneaker(player, true); + K_PlayBoostTaunt(player->mo); player->kartstuff[k_itemamount]--; } break; @@ -3798,6 +3795,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) && player->kartstuff[k_rocketsneakertimer] == 0) { K_DoSneaker(player, true); + K_PlayBoostTaunt(player->mo); player->kartstuff[k_rocketsneakertimer] = itemtime; player->kartstuff[k_itemamount]--; } @@ -3816,7 +3814,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) P_RestoreMusic(player); if (!cv_kartinvinsfx.value && !P_IsLocalPlayer(player)) S_StartSound(player->mo, sfx_kinvnc); - K_PlayTauntSound(player->mo); + K_PlayPowerGloatSound(player->mo); player->kartstuff[k_itemamount]--; } break; @@ -3827,7 +3825,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mobj_t *mo; mobj_t *prev = player->mo; - //K_PlayTauntSound(player->mo); + //K_PlayAttackTaunt(player->mo); player->kartstuff[k_itemheld] = 1; S_StartSound(player->mo, sfx_s254); @@ -3852,7 +3850,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Banana x3 thrown { K_ThrowKartItem(player, false, MT_BANANA, -1, false); - K_PlayTauntSound(player->mo); + K_PlayAttackTaunt(player->mo); player->kartstuff[k_itemamount]--; K_UpdateHnextList(player); } @@ -3886,7 +3884,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mobj_t *mo = NULL; mobj_t *prev = player->mo; - //K_PlayTauntSound(player->mo); + //K_PlayAttackTaunt(player->mo); player->kartstuff[k_itemheld] = 1; S_StartSound(player->mo, sfx_s3k3a); @@ -3916,7 +3914,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Orbinaut x3 thrown { K_ThrowKartItem(player, true, MT_ORBINAUT, 1, false); - K_PlayTauntSound(player->mo); + K_PlayAttackTaunt(player->mo); player->kartstuff[k_itemamount]--; K_UpdateHnextList(player); } @@ -3931,7 +3929,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mobj_t *mo = NULL; mobj_t *prev = player->mo; - //K_PlayTauntSound(player->mo); + //K_PlayAttackTaunt(player->mo); player->kartstuff[k_itemheld] = 1; S_StartSound(player->mo, sfx_s3k3a); @@ -3963,7 +3961,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) K_ThrowKartItem(player, true, MT_JAWZ, 1, false); else if (player->kartstuff[k_throwdir] == -1) // Throwing backward gives you a dud that doesn't home in K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false); - K_PlayTauntSound(player->mo); + K_PlayAttackTaunt(player->mo); player->kartstuff[k_itemamount]--; K_UpdateHnextList(player); } @@ -3988,7 +3986,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) { K_ThrowKartItem(player, false, MT_SSMINE, 1, true); - K_PlayTauntSound(player->mo); + K_PlayAttackTaunt(player->mo); player->kartstuff[k_itemamount]--; player->kartstuff[k_itemheld] = 0; K_CleanHnextList(player->mo); @@ -4000,7 +3998,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_itemamount]--; K_ThrowKartItem(player, true, MT_BALLHOG, 1, false); S_StartSound(player->mo, sfx_mario7); - K_PlayTauntSound(player->mo); + K_PlayAttackTaunt(player->mo); } break; case KITEM_SPB: @@ -4038,14 +4036,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_itemamount]--; - K_PlayTauntSound(player->mo); + K_PlayAttackTaunt(player->mo); } break; case KITEM_GROW: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO && player->kartstuff[k_growshrinktimer] <= 0) // Grow holds the item box hostage { - K_PlayTauntSound(player->mo); + K_PlayPowerGloatSound(player->mo); player->mo->scalespeed = FRACUNIT/TICRATE; player->mo->destscale = 3*(mapheaderinfo[gamemap-1]->mobj_scale)/2; if (cv_kartdebugshrink.value && !player->bot) @@ -4063,6 +4061,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { K_DoShrink(player); player->kartstuff[k_itemamount]--; + K_PlayPowerGloatSound(player->mo); } break; case KITEM_THUNDERSHIELD: @@ -4076,6 +4075,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { K_DoThunderShield(player); player->kartstuff[k_itemamount]--; + K_PlayAttackTaunt(player->mo); } break; case KITEM_HYUDORO: @@ -4089,7 +4089,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO && !player->kartstuff[k_pogospring]) { - K_PlayTauntSound(player->mo); + K_PlayBoostTaunt(player->mo); K_DoPogoSpring(player->mo, 32<kartstuff[k_pogospring] = 1; player->kartstuff[k_itemamount]--; @@ -4099,7 +4099,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { K_ThrowKartItem(player, false, MT_SINK, 1, true); - K_PlayTauntSound(player->mo); + K_PlayAttackTaunt(player->mo); player->kartstuff[k_itemamount]--; player->kartstuff[k_itemheld] = 0; } diff --git a/src/p_spec.c b/src/p_spec.c index 87894d05..103b31aa 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4231,7 +4231,7 @@ DoneSection2: if (player->laps >= (unsigned)cv_numlaps.value) { - if (!splitscreen && P_IsLocalPlayer(player)) + if (P_IsLocalPlayer(player)) S_StartSound(NULL, sfx_s3k6a); else if (player->kartstuff[k_position] == 1) S_StartSound(NULL, sfx_s253); diff --git a/src/p_user.c b/src/p_user.c index 53faf8f3..f5fd405c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1120,27 +1120,22 @@ void P_PlayLivesJingle(player_t *player) void P_PlayRinglossSound(mobj_t *source) { - sfxenum_t key = P_RandomKey(4); + sfxenum_t key = P_RandomKey(2); if (cv_kartvoices.value) - S_StartSound(source, (mariomode) ? sfx_mario8 : sfx_altow1 + key); + S_StartSound(source, (mariomode) ? sfx_mario8 : sfx_khurt1 + key); else S_StartSound(source, sfx_slip); } void P_PlayDeathSound(mobj_t *source) { - sfxenum_t key = P_RandomKey(4); - if (cv_kartvoices.value) - S_StartSound(source, sfx_altdi1 + key); - else - S_StartSound(source, sfx_s3k35); + S_StartSound(source, sfx_s3k35); } void P_PlayVictorySound(mobj_t *source) { - sfxenum_t key = P_RandomKey(4); if (cv_kartvoices.value) - S_StartSound(source, sfx_victr1 + key); + S_StartSound(source, sfx_kwin); } // @@ -1736,9 +1731,9 @@ void P_DoPlayerExit(player_t *player) if (cv_kartvoices.value) { if (K_IsPlayerLosing(player)) - S_StartSound(player->mo, sfx_klose); + S_StartSound((P_IsLocalPlayer(player) ? player->mo : NULL), sfx_klose); else - S_StartSound(player->mo, sfx_kwin); + S_StartSound((P_IsLocalPlayer(player) ? player->mo : NULL), sfx_kwin); } player->exiting = 3*TICRATE; diff --git a/src/sounds.c b/src/sounds.c index 991941e0..3a739a94 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -814,14 +814,17 @@ sfxinfo_t S_sfx[NUMSFX] = {"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds - {"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR}, - {"klose", false, 64, 0, -1, NULL, 0, SKSLOSE, -1, LUMPERROR}, - {"slow", false, 128, 32, -1, NULL, 0, SKSSLOW, -1, LUMPERROR}, - {"taunt1", false, 64, 96, -1, NULL, 0, SKSPLTNT1, -1, LUMPERROR}, - {"taunt2", false, 64, 96, -1, NULL, 0, SKSPLTNT2, -1, LUMPERROR}, - {"taunt3", false, 64, 96, -1, NULL, 0, SKSPLTNT3, -1, LUMPERROR}, - {"taunt4", false, 64, 96, -1, NULL, 0, SKSPLTNT4, -1, LUMPERROR}, - {"hitem", false, 64, 32, -1, NULL, 0, SKSHITEM, -1, LUMPERROR}, + {"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR}, + {"klose", false, 64, 96, -1, NULL, 0, SKSKLOSE, -1, LUMPERROR}, + {"khurt1", false, 64, 96, -1, NULL, 0, SKSKPAN1, -1, LUMPERROR}, + {"khurt2", false, 64, 96, -1, NULL, 0, SKSKPAN2, -1, LUMPERROR}, + {"kattk1", false, 64, 96, -1, NULL, 0, SKSKATK1, -1, LUMPERROR}, + {"kattk2", false, 64, 96, -1, NULL, 0, SKSKATK2, -1, LUMPERROR}, + {"kbost1", false, 64, 96, -1, NULL, 0, SKSKBST1, -1, LUMPERROR}, + {"kbost2", false, 64, 96, -1, NULL, 0, SKSKBST2, -1, LUMPERROR}, + {"kslow", false, 128, 32, -1, NULL, 0, SKSKSLOW, -1, LUMPERROR}, + {"khitem", false, 64, 32, -1, NULL, 0, SKSKHITM, -1, LUMPERROR}, + {"kgloat", false, 64, 40, -1, NULL, 0, SKSKPOWR, -1, LUMPERROR}, // skin sounds free slots to add sounds at run time (Boris HACK!!!) // initialized to NULL diff --git a/src/sounds.h b/src/sounds.h index 2f073273..b9daad4e 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -39,14 +39,17 @@ typedef enum SKSGASP, SKSJUMP, // SRB2kart - SKSWIN, - SKSLOSE, - SKSSLOW, - SKSPLTNT1, - SKSPLTNT2, - SKSPLTNT3, - SKSPLTNT4, - SKSHITEM, + SKSKWIN, // Win quote + SKSKLOSE, // Lose quote + SKSKPAN1, // Pain + SKSKPAN2, + SKSKATK1, // Offense item taunt + SKSKATK2, + SKSKBST1, // Boost item taunt + SKSKBST2, + SKSKSLOW, // Overtake taunt + SKSKHITM, // Hit confirm taunt + SKSKPOWR, // Power item taunt NUMSKINSOUNDS } skinsound_t; @@ -887,12 +890,15 @@ typedef enum sfx_kwin, sfx_klose, - sfx_slow, - sfx_taunt1, - sfx_taunt2, - sfx_taunt3, - sfx_taunt4, - sfx_hitem, + sfx_kslow, + sfx_kattk1, + sfx_kattk2, + sfx_kbost1, + sfx_kbost2, + sfx_khurt1, + sfx_khurt2, + sfx_kgloat, + sfx_khitem, // free slots for S_AddSoundFx() at run-time -------------------- sfx_freeslot0,