mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Briefly lock out TRIPWIRE_BLASTER after failing a tripwire
This commit is contained in:
parent
ffb0596581
commit
9b5bd70cae
4 changed files with 21 additions and 1 deletions
|
|
@ -661,6 +661,8 @@ struct player_t
|
|||
|
||||
UINT8 eggmanTransferDelay;
|
||||
|
||||
UINT8 tripwireReboundDelay; // When failing Tripwire, brieftly lock out speed-based tripwire pass (anti-cheese)
|
||||
|
||||
mobj_t *stumbleIndicator;
|
||||
|
||||
#ifdef HWRENDER
|
||||
|
|
|
|||
12
src/k_kart.c
12
src/k_kart.c
|
|
@ -2683,7 +2683,7 @@ tripwirepass_t K_TripwirePassConditions(player_t *player)
|
|||
|
||||
if (
|
||||
player->flamedash ||
|
||||
player->speed > 2 * K_GetKartSpeed(player, false, false)
|
||||
(player->speed > 2 * K_GetKartSpeed(player, false, false) && player->tripwireReboundDelay == 0)
|
||||
)
|
||||
return TRIPWIRE_BOOST;
|
||||
|
||||
|
|
@ -4078,10 +4078,17 @@ void K_TumbleInterrupt(player_t *player)
|
|||
|
||||
void K_ApplyTripWire(player_t *player, tripwirestate_t state)
|
||||
{
|
||||
// We are either softlocked or wildly misbehaving. Stop that!
|
||||
if (state == TRIPSTATE_BLOCKED && player->tripwireReboundDelay && (player->speed > 5 * K_GetKartSpeed(player, false, false)))
|
||||
K_TumblePlayer(player, NULL, NULL);
|
||||
|
||||
if (state == TRIPSTATE_PASSED)
|
||||
S_StartSound(player->mo, sfx_ssa015);
|
||||
else if (state == TRIPSTATE_BLOCKED)
|
||||
{
|
||||
S_StartSound(player->mo, sfx_kc40);
|
||||
player->tripwireReboundDelay = 60;
|
||||
}
|
||||
|
||||
player->tripwireState = state;
|
||||
K_AddHitLag(player->mo, 10, false);
|
||||
|
|
@ -7713,6 +7720,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->eggmanTransferDelay)
|
||||
player->eggmanTransferDelay--;
|
||||
|
||||
if (player->tripwireReboundDelay)
|
||||
player->tripwireReboundDelay--;
|
||||
|
||||
if (player->ringdelay)
|
||||
player->ringdelay--;
|
||||
|
||||
|
|
|
|||
|
|
@ -306,6 +306,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->tripwirePass);
|
||||
else if (fastcmp(field,"tripwireLeniency"))
|
||||
lua_pushinteger(L, plr->tripwireLeniency);
|
||||
else if (fastcmp(field,"tripwireReboundDelay"))
|
||||
lua_pushinteger(L, plr->tripwireReboundDelay);
|
||||
/*
|
||||
else if (fastcmp(field,"itemroulette"))
|
||||
lua_pushinteger(L, plr->itemroulette);
|
||||
|
|
@ -684,6 +686,8 @@ static int player_set(lua_State *L)
|
|||
plr->tripwirePass = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"tripwireLeniency"))
|
||||
plr->tripwireLeniency = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"tripwireReboundDelay"))
|
||||
plr->tripwireReboundDelay = luaL_checkinteger(L, 3);
|
||||
/*
|
||||
else if (fastcmp(field,"itemroulette"))
|
||||
plr->itemroulette = luaL_checkinteger(L, 3);
|
||||
|
|
|
|||
|
|
@ -395,6 +395,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
|
||||
WRITEUINT8(save->p, players[i].eggmanTransferDelay);
|
||||
|
||||
WRITEUINT8(save->p, players[i].tripwireReboundDelay);
|
||||
|
||||
// respawnvars_t
|
||||
WRITEUINT8(save->p, players[i].respawn.state);
|
||||
WRITEUINT32(save->p, K_GetWaypointHeapIndex(players[i].respawn.wp));
|
||||
|
|
@ -750,6 +752,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
|
||||
players[i].eggmanTransferDelay = READUINT8(save->p);
|
||||
|
||||
players[i].tripwireReboundDelay = READUINT8(save->p);
|
||||
|
||||
// respawnvars_t
|
||||
players[i].respawn.state = READUINT8(save->p);
|
||||
players[i].respawn.wp = (waypoint_t *)(size_t)READUINT32(save->p);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue