diff --git a/src/d_player.h b/src/d_player.h index ab30fc934..a915ab22e 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -993,6 +993,7 @@ struct player_t boolean markedfordeath; boolean dotrickfx; + boolean stingfx; UINT8 bumperinflate; UINT8 ringboxdelay; // Delay until Ring Box auto-activates diff --git a/src/k_kart.c b/src/k_kart.c index a9db55a03..38146d30b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index b323b3ca8..81031d7b9 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -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")) diff --git a/src/p_saveg.c b/src/p_saveg.c index dbbc95339..5c36f7a4d 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -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); diff --git a/src/sounds.c b/src/sounds.c index 527e6b2ad..537b382dc 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -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, ""}, diff --git a/src/sounds.h b/src/sounds.h index 0aef7e7bc..e48b39f88 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1599,6 +1599,9 @@ typedef enum // SMS sfx_sting0, + // Patch-up + sfx_s226l, + // And LASTLY, Kart's skin sounds. sfx_kwin, sfx_klose,