Add visual flicker in and out when faulting

This commit is contained in:
AJ Martinez 2023-02-03 02:23:52 -07:00
parent 30457f6b79
commit 101db619e6
4 changed files with 15 additions and 1 deletions

View file

@ -7802,6 +7802,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->tiregrease = 0;
player->sneakertimer = 0;
player->spindashboost = 0;
player->flashing = TICRATE/2;
}
if (player->stealingtimer == 0

View file

@ -9805,6 +9805,17 @@ void P_MobjThinker(mobj_t *mobj)
mobj->eflags |= MFE_PAUSED;
mobj->hitlag--;
if (mobj->type == MT_PLAYER && mobj->player->faulttimer > 0)
{
ClearFakePlayerSkin(mobj->player);
if (mobj->player->faulttimer & 1)
mobj->renderflags |= RF_DONTDRAW;
else
mobj->renderflags &= ~RF_DONTDRAW;
mobj->player->faulttimer--;
}
if (mobj->type == MT_DROPTARGET && mobj->reactiontime > 0 && mobj->hitlag == 2)
{
mobj->spritexscale = FRACUNIT;

View file

@ -1917,6 +1917,8 @@ static void K_HandleLapIncrement(player_t *player)
player->nocontrol = 69;
player->hyudorotimer = 69;
K_StripItems(player);
player->faulttimer = TICRATE/3;
ClearFakePlayerSkin(player);
}
if ((player->starpostnum == numstarposts) || (player->laps == 0))

View file

@ -501,7 +501,7 @@ void ClearFakePlayerSkin(player_t* player)
if ((flags & SF_IRONMAN) && !P_MobjWasRemoved(player->mo))
{
SetFakePlayerSkin(player, skinid);
if (player->spectator == false)
if (player->spectator == false && player->mo->hitlag == 0)
{
S_StartSound(player->mo, sfx_s3k9f);
K_SpawnMagicianParticles(player->mo, 5);