mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Delay ring burst after damage
This commit is contained in:
parent
8e62117596
commit
c6897688d0
6 changed files with 24 additions and 10 deletions
|
|
@ -668,6 +668,7 @@ struct player_t
|
|||
UINT16 superring; // You were awarded rings, and have this many of them left to spawn on yourself.
|
||||
UINT8 nextringaward; // When should we spawn our next superring ring?
|
||||
UINT16 ringvolume; // When consuming lots of rings, lower the sound a little.
|
||||
UINT16 ringburst; // Queued number of rings to lose after hitlag ends
|
||||
|
||||
UINT8 curshield; // see kartshields_t
|
||||
UINT8 bubblecool; // Bubble Shield use cooldown
|
||||
|
|
|
|||
|
|
@ -361,6 +361,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->nextringaward);
|
||||
else if (fastcmp(field,"ringvolume"))
|
||||
lua_pushinteger(L, plr->ringvolume);
|
||||
else if (fastcmp(field,"ringburst"))
|
||||
lua_pushinteger(L, plr->ringburst);
|
||||
else if (fastcmp(field,"curshield"))
|
||||
lua_pushinteger(L, plr->curshield);
|
||||
else if (fastcmp(field,"bubblecool"))
|
||||
|
|
@ -775,6 +777,8 @@ static int player_set(lua_State *L)
|
|||
plr->nextringaward = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"ringvolume"))
|
||||
plr->ringvolume = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"ringburst"))
|
||||
plr->ringburst = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"curshield"))
|
||||
plr->curshield = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"bubblecool"))
|
||||
|
|
|
|||
|
|
@ -2752,8 +2752,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
if (type != DMG_STING)
|
||||
player->flashing = K_GetKartFlashing(player);
|
||||
|
||||
//P_PlayRinglossSound(target);
|
||||
P_PlayerRingBurst(player, ringburst);
|
||||
player->ringburst += ringburst;
|
||||
|
||||
K_PopPlayerShield(player);
|
||||
player->instashield = 15;
|
||||
|
|
|
|||
|
|
@ -10031,6 +10031,14 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
|
||||
if (mobj->player != NULL && mobj->hitlag == 0 && (mobj->eflags & MFE_DAMAGEHITLAG))
|
||||
{
|
||||
if (mobj->player->ringburst > 0)
|
||||
{
|
||||
// Delayed ring loss
|
||||
P_PlayRinglossSound(mobj);
|
||||
P_PlayerRingBurst(mobj->player, mobj->player->ringburst);
|
||||
mobj->player->ringburst = 0;
|
||||
}
|
||||
|
||||
K_HandleDirectionalInfluence(mobj->player);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -468,6 +468,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT16(save->p, players[i].superring);
|
||||
WRITEUINT8(save->p, players[i].nextringaward);
|
||||
WRITEUINT8(save->p, players[i].ringvolume);
|
||||
WRITEUINT16(save->p, players[i].ringburst);
|
||||
|
||||
WRITEUINT8(save->p, players[i].curshield);
|
||||
WRITEUINT8(save->p, players[i].bubblecool);
|
||||
|
|
@ -946,6 +947,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].superring = READUINT16(save->p);
|
||||
players[i].nextringaward = READUINT8(save->p);
|
||||
players[i].ringvolume = READUINT8(save->p);
|
||||
players[i].ringburst = READUINT16(save->p);
|
||||
|
||||
players[i].curshield = READUINT8(save->p);
|
||||
players[i].bubblecool = READUINT8(save->p);
|
||||
|
|
|
|||
16
src/sounds.c
16
src/sounds.c
|
|
@ -1211,14 +1211,14 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"rank", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Rank slam
|
||||
|
||||
// Damage sounds
|
||||
{"dmga1", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmga2", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmga3", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmga4", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmgb1", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmgb2", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmgb3", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmgb4", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmga1", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmga2", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmga3", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmga4", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmgb1", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmgb2", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmgb3", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
{"dmgb4", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"},
|
||||
|
||||
// SRB2Kart - Engine sounds
|
||||
// Engine class A
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue