diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 70680f355..0b6ae694b 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1027,6 +1027,9 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_chatnotifications); CV_RegisterVar(&cv_chatbacktint); + CV_RegisterVar(&cv_growmusic); + CV_RegisterVar(&cv_supermusic); + CV_RegisterVar(&cv_songcredits); CV_RegisterVar(&cv_tutorialprompt); CV_RegisterVar(&cv_showfocuslost); diff --git a/src/g_game.c b/src/g_game.c index 0a203217c..adc7af2b1 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -421,6 +421,14 @@ consvar_t cv_pauseifunfocused = CVAR_INIT ("pauseifunfocused", "Yes", CV_SAVE, C // Display song credits consvar_t cv_songcredits = CVAR_INIT ("songcredits", "On", CV_SAVE, CV_OnOff, NULL); +// Show "FREE PLAY" when you're alone. :( +consvar_t cv_showfreeplay = CVAR_INIT ("showfreeplay", "On", CV_SAVE, CV_OnOff, NULL); + +// We can disable special tunes! +static CV_PossibleValue_t powermusic_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "SFX"}, {0, NULL}}; +consvar_t cv_growmusic = CVAR_INIT ("growmusic", "On", CV_SAVE, powermusic_cons_t, NULL); +consvar_t cv_supermusic = CVAR_INIT ("supermusic", "On", CV_SAVE, powermusic_cons_t, NULL); + consvar_t cv_invertmouse = CVAR_INIT ("invertmouse", "Off", CV_SAVE, CV_OnOff, NULL); consvar_t cv_invincmusicfade = CVAR_INIT ("invincmusicfade", "300", CV_SAVE, CV_Unsigned, NULL); diff --git a/src/g_game.h b/src/g_game.h index 4ff12b60a..5192de72d 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -66,6 +66,8 @@ extern consvar_t cv_tutorialprompt; extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection; extern consvar_t cv_shoutname, cv_shoutcolor, cv_autoshout; extern consvar_t cv_songcredits; +extern consvar_t cv_showfreeplay; +extern consvar_t cv_growmusic, cv_supermusic; extern consvar_t cv_pauseifunfocused; diff --git a/src/k_hud.c b/src/k_hud.c index 956a4af07..0d109a85d 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -4174,6 +4174,9 @@ void K_drawKartFreePlay(void) if (modeattacking || grandprixinfo.gp || bossinfo.boss || stplyr->spectator) return; + if (!cv_showfreeplay.value) + return; + if (lt_exitticker < TICRATE/2) return; diff --git a/src/k_kart.c b/src/k_kart.c index d30bc13e9..cc3805208 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6507,28 +6507,17 @@ static void K_UpdateEngineSounds(player_t *player) S_StartSoundAtVolume(player->mo, (sfx_krta00 + player->karthud[khud_enginesnd]) + (class * numsnds), volume); } - static void K_UpdateInvincibilitySounds(player_t *player) { INT32 sfxnum = sfx_None; + boolean localplayer = P_IsLocalPlayer(player); - if (player->mo->health > 0 && !P_IsLocalPlayer(player)) // used to be !P_IsDisplayPlayer(player) + if (player->mo->health > 0) { - if (cv_kartinvinsfx.value) - { - if (player->growshrinktimer > 0) // Prioritize Grow - sfxnum = sfx_alarmg; - else if (player->invincibilitytimer > 0) - sfxnum = sfx_alarmi; - - } - else - { - if (player->growshrinktimer > 0) - sfxnum = sfx_kgrow; - else if (player->invincibilitytimer > 0) - sfxnum = sfx_kinvnc; - } + if (player->growshrinktimer > 0 && (!localplayer || cv_growmusic.value == 2)) // Prioritize Grow + sfxnum = cv_kartinvinsfx.value ? sfx_alarmg : sfx_kgrow; + else if (player->invincibilitytimer > 0 && (!localplayer || cv_supermusic.value == 2)) + sfxnum = cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc; } if (sfxnum != sfx_None && !S_SoundPlaying(player->mo, sfxnum)) diff --git a/src/p_user.c b/src/p_user.c index 53a0da17d..8bdef27cd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -870,13 +870,13 @@ void P_RestoreMusic(player_t *player) } // Item - Grow - if (wantedmus == 1) + if ((wantedmus == 1) && cv_growmusic.value == 1) { S_ChangeMusicInternal("kgrow", true); S_SetRestoreMusicFadeInCvar(&cv_growmusicfade); } // Item - Invincibility - else if (wantedmus == 2) + else if ((wantedmus == 2) && cv_supermusic.value == 1) { S_ChangeMusicInternal("kinvnc", true); S_SetRestoreMusicFadeInCvar(&cv_invincmusicfade);