Battle: eliminate players killed by the Overtime Barrier

- Players killed this way become invisible and unable to
  move.
- Ends the match when one player is remaining.
This commit is contained in:
James R 2023-02-27 20:54:31 -08:00
parent f2c806185e
commit d56be63249
2 changed files with 25 additions and 10 deletions

View file

@ -92,6 +92,9 @@ void K_CheckBumpers(void)
UINT8 i; UINT8 i;
UINT8 numingame = 0; UINT8 numingame = 0;
UINT8 nobumpers = 0; UINT8 nobumpers = 0;
UINT8 eliminated = 0;
const boolean singleplayer = (battlecapsules || bossinfo.valid);
if (!(gametyperules & GTR_BUMPERS)) if (!(gametyperules & GTR_BUMPERS))
return; return;
@ -113,21 +116,28 @@ void K_CheckBumpers(void)
{ {
nobumpers++; nobumpers++;
} }
if (players[i].pflags & PF_ELIMINATED)
{
eliminated++;
}
} }
if (battlecapsules || bossinfo.valid) if (singleplayer
? nobumpers > 0 && nobumpers >= numingame
: eliminated >= numingame - 1)
{ {
if (nobumpers > 0 && nobumpers >= numingame) for (i = 0; i < MAXPLAYERS; i++)
{ {
for (i = 0; i < MAXPLAYERS; i++) if (!playeringame[i])
{ continue;
if (!playeringame[i]) if (players[i].spectator)
continue; continue;
if (players[i].spectator)
continue; if (singleplayer)
players[i].pflags |= PF_NOCONTEST; players[i].pflags |= PF_NOCONTEST;
P_DoPlayerExit(&players[i]);
} P_DoPlayerExit(&players[i]);
} }
return; return;
} }

View file

@ -2773,6 +2773,11 @@ static void P_DeathThink(player_t *player)
} }
} }
if ((player->pflags & PF_ELIMINATED) && (gametyperules & GTR_BUMPERS))
{
playerGone = true;
}
if (playerGone == false && player->deadtimer > TICRATE) if (playerGone == false && player->deadtimer > TICRATE)
{ {
player->playerstate = PST_REBORN; player->playerstate = PST_REBORN;