mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Final failsafe, for when Ring Shooter fails
This commit is contained in:
parent
10f8bb5a3f
commit
97d58b7d29
5 changed files with 28 additions and 0 deletions
|
|
@ -939,6 +939,8 @@ struct player_t
|
|||
|
||||
UINT16 infinitether; // Generic infinitether time, used for infinitether leniency.
|
||||
|
||||
UINT8 finalfailsafe; // When you can't Ringshooter, force respawn as a last ditch effort!
|
||||
|
||||
UINT8 lastsafelap;
|
||||
|
||||
mobj_t *stumbleIndicator;
|
||||
|
|
|
|||
14
src/k_kart.c
14
src/k_kart.c
|
|
@ -8616,6 +8616,20 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
K_RemoveGrowShrink(player);
|
||||
}
|
||||
|
||||
if (player->respawn.state == RESPAWNST_NONE && (player->cmd.buttons & BT_RESPAWN) == BT_RESPAWN)
|
||||
{
|
||||
player->finalfailsafe++; // Decremented by ringshooter to "freeze" this timer
|
||||
if (player->finalfailsafe >= 4*TICRATE)
|
||||
{
|
||||
K_DoIngameRespawn(player);
|
||||
player->finalfailsafe = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player->finalfailsafe = 0;
|
||||
}
|
||||
|
||||
if (player->superring)
|
||||
{
|
||||
player->nextringaward++;
|
||||
|
|
|
|||
|
|
@ -341,6 +341,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->trickcharge);
|
||||
else if (fastcmp(field,"infinitether"))
|
||||
lua_pushinteger(L, plr->infinitether);
|
||||
else if (fastcmp(field,"finalfailsafe"))
|
||||
lua_pushinteger(L, plr->finalfailsafe);
|
||||
else if (fastcmp(field,"lastsafelap"))
|
||||
lua_pushinteger(L, plr->lastsafelap);
|
||||
else if (fastcmp(field,"instaWhipCharge"))
|
||||
|
|
@ -841,6 +843,8 @@ static int player_set(lua_State *L)
|
|||
plr->trickcharge = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"infinitether"))
|
||||
plr->infinitether = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"finalfailsafe"))
|
||||
plr->finalfailsafe = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"lastsafelap"))
|
||||
plr->lastsafelap = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"instaWhipCharge"))
|
||||
|
|
|
|||
|
|
@ -688,6 +688,10 @@ void Obj_RingShooterInput(player_t *player)
|
|||
if (AllowRingShooter(player) == true
|
||||
&& (player->cmd.buttons & BT_RESPAWN) == BT_RESPAWN)
|
||||
{
|
||||
// "Freeze" final-failsafe timer if we're eligible to ringshooter, but don't reset it.
|
||||
if (player->finalfailsafe)
|
||||
player->finalfailsafe--;
|
||||
|
||||
if (P_MobjWasRemoved(base) == true)
|
||||
{
|
||||
SpawnRingShooter(player);
|
||||
|
|
|
|||
|
|
@ -567,6 +567,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
|
||||
WRITEUINT16(save->p, players[i].infinitether);
|
||||
|
||||
WRITEUINT8(save->p, players[i].finalfailsafe);
|
||||
|
||||
WRITEUINT8(save->p, players[i].lastsafelap);
|
||||
|
||||
WRITEMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||
|
|
@ -1126,6 +1128,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
|
||||
players[i].infinitether = READUINT16(save->p);
|
||||
|
||||
players[i].finalfailsafe = READUINT8(save->p);
|
||||
|
||||
players[i].lastsafelap = READUINT8(save->p);
|
||||
|
||||
READMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue