Port freeplay, grow music and invin music toggles from saturn

This commit is contained in:
NepDisk 2025-02-20 18:12:03 -05:00
parent 7a186c057d
commit 71225707bf
6 changed files with 24 additions and 19 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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))

View file

@ -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);