mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'unstuck-tripwire' into 'master'
Reduce hitlag, then respawn when trapped in tripwire See merge request KartKrew/Kart!1805
This commit is contained in:
commit
ee03dae01e
4 changed files with 22 additions and 0 deletions
|
|
@ -967,6 +967,8 @@ struct player_t
|
||||||
|
|
||||||
UINT8 preventfailsafe; // Set when taking damage to prevent cheesing eggboxes
|
UINT8 preventfailsafe; // Set when taking damage to prevent cheesing eggboxes
|
||||||
|
|
||||||
|
UINT8 tripwireUnstuck;
|
||||||
|
|
||||||
UINT8 handtimer;
|
UINT8 handtimer;
|
||||||
angle_t besthanddirection;
|
angle_t besthanddirection;
|
||||||
|
|
||||||
|
|
|
||||||
12
src/k_kart.c
12
src/k_kart.c
|
|
@ -4643,6 +4643,7 @@ void K_ApplyTripWire(player_t *player, tripwirestate_t state)
|
||||||
if (player->hyudorotimer <= 0)
|
if (player->hyudorotimer <= 0)
|
||||||
{
|
{
|
||||||
K_AddHitLag(player->mo, 10, false);
|
K_AddHitLag(player->mo, 10, false);
|
||||||
|
player->mo->hitlag -= min(player->mo->hitlag, player->tripwireUnstuck/4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == TRIPSTATE_PASSED && player->spinouttimer &&
|
if (state == TRIPSTATE_PASSED && player->spinouttimer &&
|
||||||
|
|
@ -4650,6 +4651,8 @@ void K_ApplyTripWire(player_t *player, tripwirestate_t state)
|
||||||
{
|
{
|
||||||
K_TumblePlayer(player, NULL, NULL);
|
K_TumblePlayer(player, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player->tripwireUnstuck += 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 K_ExplodePlayer(player_t *player, mobj_t *inflictor, mobj_t *source) // A bit of a hack, we just throw the player up higher here and extend their spinout timer
|
INT32 K_ExplodePlayer(player_t *player, mobj_t *inflictor, mobj_t *source) // A bit of a hack, we just throw the player up higher here and extend their spinout timer
|
||||||
|
|
@ -8624,6 +8627,15 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
if (player->preventfailsafe)
|
if (player->preventfailsafe)
|
||||||
player->preventfailsafe--;
|
player->preventfailsafe--;
|
||||||
|
|
||||||
|
if (player->tripwireUnstuck > 150)
|
||||||
|
{
|
||||||
|
player->tripwireUnstuck = 0;
|
||||||
|
K_DoIngameRespawn(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player->tripwireUnstuck && !player->mo->hitlag)
|
||||||
|
player->tripwireUnstuck--;
|
||||||
|
|
||||||
if ((player->respawn.state == RESPAWNST_NONE) && player->growshrinktimer != 0)
|
if ((player->respawn.state == RESPAWNST_NONE) && player->growshrinktimer != 0)
|
||||||
{
|
{
|
||||||
if (player->growshrinktimer > 0 && onground == true)
|
if (player->growshrinktimer > 0 && onground == true)
|
||||||
|
|
|
||||||
|
|
@ -353,6 +353,8 @@ static int player_get(lua_State *L)
|
||||||
lua_pushinteger(L, plr->oldGuard);
|
lua_pushinteger(L, plr->oldGuard);
|
||||||
else if (fastcmp(field,"preventfailsafe"))
|
else if (fastcmp(field,"preventfailsafe"))
|
||||||
lua_pushinteger(L, plr->preventfailsafe);
|
lua_pushinteger(L, plr->preventfailsafe);
|
||||||
|
else if (fastcmp(field,"tripwireUnstuck"))
|
||||||
|
lua_pushinteger(L, plr->tripwireUnstuck);
|
||||||
/*
|
/*
|
||||||
else if (fastcmp(field,"itemroulette"))
|
else if (fastcmp(field,"itemroulette"))
|
||||||
lua_pushinteger(L, plr->itemroulette);
|
lua_pushinteger(L, plr->itemroulette);
|
||||||
|
|
@ -871,6 +873,8 @@ static int player_set(lua_State *L)
|
||||||
plr->oldGuard = luaL_checkinteger(L, 3);
|
plr->oldGuard = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"preventfailsafe"))
|
else if (fastcmp(field,"preventfailsafe"))
|
||||||
plr->preventfailsafe = luaL_checkinteger(L, 3);
|
plr->preventfailsafe = luaL_checkinteger(L, 3);
|
||||||
|
else if (fastcmp(field,"tripwireUnstuck"))
|
||||||
|
plr->tripwireUnstuck = luaL_checkinteger(L, 3);
|
||||||
/*
|
/*
|
||||||
else if (fastcmp(field,"itemroulette"))
|
else if (fastcmp(field,"itemroulette"))
|
||||||
plr->itemroulette = luaL_checkinteger(L, 3);
|
plr->itemroulette = luaL_checkinteger(L, 3);
|
||||||
|
|
|
||||||
|
|
@ -579,6 +579,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
||||||
|
|
||||||
WRITEUINT8(save->p, players[i].preventfailsafe);
|
WRITEUINT8(save->p, players[i].preventfailsafe);
|
||||||
|
|
||||||
|
WRITEUINT8(save->p, players[i].tripwireUnstuck);
|
||||||
|
|
||||||
WRITEUINT8(save->p, players[i].handtimer);
|
WRITEUINT8(save->p, players[i].handtimer);
|
||||||
WRITEANGLE(save->p, players[i].besthanddirection);
|
WRITEANGLE(save->p, players[i].besthanddirection);
|
||||||
|
|
||||||
|
|
@ -1148,6 +1150,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
||||||
|
|
||||||
players[i].preventfailsafe = READUINT8(save->p);
|
players[i].preventfailsafe = READUINT8(save->p);
|
||||||
|
|
||||||
|
players[i].tripwireUnstuck = READUINT8(save->p);
|
||||||
|
|
||||||
players[i].handtimer = READUINT8(save->p);
|
players[i].handtimer = READUINT8(save->p);
|
||||||
players[i].besthanddirection = READANGLE(save->p);
|
players[i].besthanddirection = READANGLE(save->p);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue