Add option to play power items sfx for growmusic and supermusic

This commit is contained in:
indev authored and Alug committed 2024-07-19 18:17:23 +02:00
1 parent 556ced63cf
commit 520165128a
3 files changed
+13 -21

No files matched your search

+3 -2
View File
@@ -417,8 +417,9 @@ consvar_t cv_songcredits = {"songcredits", "On", CV_SAVE, CV_OnOff, NULL, 0, NUL
consvar_t cv_showfreeplay = { "showfreeplay", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
// We can disable special tunes!
consvar_t cv_growmusic = {"growmusic", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_supermusic = {"supermusic", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t powermusic_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "SFX"}, {0, NULL}};
consvar_t cv_growmusic = {"growmusic", "On", CV_SAVE, powermusic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_supermusic = {"supermusic", "On", CV_SAVE, powermusic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
/*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair2 = {"crosshair2", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+8 -17
View File
@@ -4963,23 +4963,14 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd)
static void K_UpdateInvincibilitySounds(player_t *player)
{
INT32 sfxnum = sfx_None;
boolean localplayer = P_IsLocalPlayer(player);
if (player->mo->health > 0 && !P_IsLocalPlayer(player))
if (player->mo->health > 0)
{
if (cv_kartinvinsfx.value)
{
if (player->kartstuff[k_growshrinktimer] > 0) // Prioritize Grow
sfxnum = sfx_alarmg;
else if (player->kartstuff[k_invincibilitytimer] > 0)
sfxnum = sfx_alarmi;
}
else
{
if (player->kartstuff[k_growshrinktimer] > 0)
sfxnum = sfx_kgrow;
else if (player->kartstuff[k_invincibilitytimer] > 0)
sfxnum = sfx_kinvnc;
}
if (player->kartstuff[k_growshrinktimer] > 0 && (!localplayer || cv_growmusic.value == 2)) // Prioritize Grow
sfxnum = cv_kartinvinsfx.value ? sfx_alarmg : sfx_kgrow;
else if (player->kartstuff[k_invincibilitytimer] > 0 && (!localplayer || cv_supermusic.value == 2))
sfxnum = cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc;
}
if (sfxnum != sfx_None && !S_SoundPlaying(player->mo, sfxnum))
@@ -6199,7 +6190,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
P_SetScale(overlay, player->mo->scale);
}
player->kartstuff[k_invincibilitytimer] = itemtime+(2*TICRATE); // 10 seconds
if (P_IsLocalPlayer(player) && cv_supermusic.value && cv_birdmusic.value)
if (P_IsLocalPlayer(player) && cv_supermusic.value == 1 && cv_birdmusic.value)
S_ChangeMusicSpecial("kinvnc");
else
S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc));
@@ -6404,7 +6395,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (cv_kartdebugshrink.value && !modeattacking && !player->bot)
player->mo->destscale = (6*player->mo->destscale)/8;
player->kartstuff[k_growshrinktimer] = itemtime+(4*TICRATE); // 12 seconds
if (P_IsLocalPlayer(player) && cv_growmusic.value && cv_birdmusic.value )
if (P_IsLocalPlayer(player) && cv_growmusic.value == 1 && cv_birdmusic.value )
S_ChangeMusicSpecial("kgrow");
else
S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmg : sfx_kgrow));
+2 -2
View File
@@ -795,7 +795,7 @@ void P_RestoreMusic(player_t *player)
}
// Item - Grow
if (wantedmus == 2 && cv_growmusic.value)
if (wantedmus == 2 && cv_growmusic.value == 1)
{
S_ChangeMusicInternal("kgrow", true);
@@ -803,7 +803,7 @@ void P_RestoreMusic(player_t *player)
S_SetRestoreMusicFadeInCvar(&cv_growmusicfade);
}
// Item - Invincibility
else if (wantedmus == 1 && cv_supermusic.value)
else if (wantedmus == 1 && cv_supermusic.value == 1)
{
S_ChangeMusicInternal("kinvnc", true);