mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-01 12:43:33 +00:00
Beam fault cleanup, make non-circuit death faults respawn at wp behind finish
This commit is contained in:
parent
dfdfef3355
commit
de268b744b
5 changed files with 37 additions and 6 deletions
|
|
@ -107,7 +107,7 @@ typedef enum
|
|||
PF_SHRINKME = 1<<28, // "Shrink me" cheat preference
|
||||
PF_SHRINKACTIVE = 1<<29, // "Shrink me" cheat is in effect. (Can't be disabled mid-race)
|
||||
|
||||
PF_VOID = 1<<30
|
||||
PF_VOID = 1<<30, // Removed from reality! When leaving hitlag, reenable visibility+collision and kill speed.
|
||||
|
||||
// up to 1<<31 is free
|
||||
} pflags_t;
|
||||
|
|
|
|||
14
src/k_kart.c
14
src/k_kart.c
|
|
@ -7803,8 +7803,22 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
player->sneakertimer = 0;
|
||||
player->spindashboost = 0;
|
||||
player->flashing = TICRATE/2;
|
||||
player->ringboost = 0;
|
||||
player->driftboost = player->strongdriftboost = 0;
|
||||
player->gateBoost = 0;
|
||||
}
|
||||
|
||||
if (player->pflags & PF_FAULT && player->nocontrol) // Hold player on respawn platform, no fair skipping long POSITION areas
|
||||
{
|
||||
if (rainbowstartavailable && ((leveltime <= starttime) || (leveltime - starttime < 10*TICRATE)))
|
||||
{
|
||||
player->nocontrol = 50;
|
||||
player->mo->renderflags |= RF_DONTDRAW;
|
||||
player->mo->flags |= MF_NOCLIPTHING;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (player->stealingtimer == 0
|
||||
&& player->rocketsneakertimer)
|
||||
player->rocketsneakertimer--;
|
||||
|
|
|
|||
|
|
@ -119,6 +119,8 @@ void K_DoFault(player_t *player)
|
|||
S_StartSound(player->mo, sfx_s3k83);
|
||||
player->karthud[khud_fault] = 1;
|
||||
player->pflags |= PF_FAULT;
|
||||
player->mo->renderflags |= RF_DONTDRAW;
|
||||
player->mo->flags |= MF_NOCLIPTHING;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +149,12 @@ void K_DoIngameRespawn(player_t *player)
|
|||
|
||||
// FAULT
|
||||
if (leveltime < starttime)
|
||||
{
|
||||
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_SECTIONRACE))
|
||||
player->respawn.wp = K_GetFinishLineWaypoint()->prevwaypoints[0];
|
||||
K_DoFault(player);
|
||||
}
|
||||
|
||||
|
||||
player->ringboost = 0;
|
||||
player->driftboost = player->strongdriftboost = 0;
|
||||
|
|
@ -163,7 +170,7 @@ void K_DoIngameRespawn(player_t *player)
|
|||
player->respawn.pointz += K_RespawnOffset(player, player->respawn.flip);
|
||||
player->respawn.manual = false; // one respawn only!
|
||||
}
|
||||
else if (player->respawn.wp != NULL && leveltime >= starttime)
|
||||
else if (player->respawn.wp != NULL)
|
||||
{
|
||||
const UINT32 dist = RESPAWN_DIST + (player->airtime * 48);
|
||||
player->respawn.distanceleft = (dist * mapobjectscale) / FRACUNIT;
|
||||
|
|
@ -272,7 +279,7 @@ void K_DoIngameRespawn(player_t *player)
|
|||
player->respawn.init = true;
|
||||
|
||||
player->respawn.airtimer = player->airtime;
|
||||
player->respawn.truedeath = false;
|
||||
player->respawn.truedeath = player->pflags & PF_FAULT;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
|
|
@ -612,6 +619,9 @@ static void K_DropDashWait(player_t *player)
|
|||
if (player->nocontrol == 0)
|
||||
player->respawn.timer--;
|
||||
|
||||
if (player->pflags & PF_FAULT)
|
||||
return;
|
||||
|
||||
if (leveltime % 8 == 0)
|
||||
{
|
||||
const UINT8 ns = 8;
|
||||
|
|
|
|||
|
|
@ -1910,16 +1910,19 @@ static void K_HandleLapIncrement(player_t *player)
|
|||
if (leveltime < starttime && !(gametyperules & GTR_ROLLINGSTART))
|
||||
{
|
||||
// freeze 'em until fault penalty is over
|
||||
player->mo->hitlag = starttime - leveltime + 50;
|
||||
player->mo->hitlag = starttime - leveltime + TICRATE*3;
|
||||
player->pflags = PF_VOID;
|
||||
player->mo->renderflags |= RF_DONTDRAW;
|
||||
player->mo->flags |= MF_NOCLIPTHING;
|
||||
player->nocontrol = 69;
|
||||
player->hyudorotimer = 69;
|
||||
player->nocontrol = UINT16_MAX;
|
||||
player->hyudorotimer = UINT16_MAX;
|
||||
player->speed = 0;
|
||||
K_StripItems(player);
|
||||
player->faulttimer = TICRATE/3;
|
||||
ClearFakePlayerSkin(player);
|
||||
S_StartSound(player->mo, sfx_s3k8a);
|
||||
P_MoveOrigin(player->mo, player->mo->old_x, player->mo->old_y, player->mo->z);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((player->starpostnum == numstarposts) || (player->laps == 0))
|
||||
|
|
|
|||
|
|
@ -4207,7 +4207,11 @@ void P_PlayerThink(player_t *player)
|
|||
if (player->nocontrol && player->nocontrol < UINT16_MAX)
|
||||
{
|
||||
if (!(--player->nocontrol))
|
||||
{
|
||||
player->pflags &= ~PF_FAULT;
|
||||
player->mo->renderflags &= ~RF_DONTDRAW;
|
||||
player->mo->flags &= ~MF_NOCLIPTHING;
|
||||
}
|
||||
}
|
||||
else
|
||||
player->nocontrol = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue