Use old Ring Sting noise

This commit is contained in:
AJ Martinez 2024-03-05 16:00:00 -07:00
parent 3af24b8606
commit a280ccb7de
6 changed files with 20 additions and 3 deletions

View file

@ -993,6 +993,7 @@ struct player_t
boolean markedfordeath;
boolean dotrickfx;
boolean stingfx;
UINT8 bumperinflate;
UINT8 ringboxdelay; // Delay until Ring Box auto-activates

View file

@ -4820,9 +4820,7 @@ void K_DebtStingPlayer(player_t *player, mobj_t *source)
player->wipeoutslow = min(length-1, wipeoutslowtime+1);
player->ringvisualwarning = TICRATE*2;
if (P_IsDisplayPlayer(player))
S_StartSoundAtVolume(NULL, sfx_sting0, 170);
player->stingfx = true;
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
}
@ -8979,6 +8977,12 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->dotrickfx = false;
}
if (player->stingfx && !player->mo->hitlag)
{
S_StartSound(player->mo, sfx_s226l);
player->stingfx = false;
}
// Don't screw up chain ring pickup/usage with instawhip charge.
// If the button stays held, delay charge a bit.
if (player->instaWhipChargeLockout)

View file

@ -267,6 +267,8 @@ static int player_get(lua_State *L)
lua_pushboolean(L, plr->ringvisualwarning);
else if (fastcmp(field,"dotrickfx"))
lua_pushboolean(L, plr->dotrickfx);
else if (fastcmp(field,"stingfx"))
lua_pushboolean(L, plr->stingfx);
else if (fastcmp(field,"bumperinflate"))
lua_pushboolean(L, plr->bumperinflate);
else if (fastcmp(field,"ringboxdelay"))
@ -811,6 +813,8 @@ static int player_set(lua_State *L)
plr->markedfordeath = luaL_checkboolean(L, 3);
else if (fastcmp(field,"dotrickfx"))
plr->dotrickfx = luaL_checkboolean(L, 3);
else if (fastcmp(field,"stingfx"))
plr->stingfx = luaL_checkboolean(L, 3);
else if (fastcmp(field,"bumperinflate"))
plr->bumperinflate = luaL_checkboolean(L, 3);
else if (fastcmp(field,"ringboxdelay"))

View file

@ -604,6 +604,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT8(save->p, players[i].markedfordeath);
WRITEUINT8(save->p, players[i].dotrickfx);
WRITEUINT8(save->p, players[i].stingfx);
WRITEUINT8(save->p, players[i].bumperinflate);
WRITEUINT8(save->p, players[i].ringboxdelay);
@ -1191,6 +1192,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].markedfordeath = READUINT8(save->p);
players[i].dotrickfx = READUINT8(save->p);
players[i].stingfx = READUINT8(save->p);
players[i].bumperinflate = READUINT8(save->p);
players[i].ringboxdelay = READUINT8(save->p);

View file

@ -1523,6 +1523,9 @@ sfxinfo_t S_sfx[NUMSFX] =
// SMS
{"sting0", false, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Ring loss
// Patching up base sounds
{"s226l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // s2 spikes LOUD
// SRB2kart - Skin sounds
{"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR, ""},
{"klose", false, 64, 96, -1, NULL, 0, SKSKLOSE, -1, LUMPERROR, ""},

View file

@ -1599,6 +1599,9 @@ typedef enum
// SMS
sfx_sting0,
// Patch-up
sfx_s226l,
// And LASTLY, Kart's skin sounds.
sfx_kwin,
sfx_klose,