Battle: replace bumper elimination win condition with points cap

- Points cap is 3 * player count. E.g. for 3 players, the
  cap is 9 points.
- Once a player gets enough points, they win!
This commit is contained in:
James R 2023-02-21 22:20:28 -08:00
parent 8ba2155d89
commit 87a6743c0f

View file

@ -91,8 +91,7 @@ void K_CheckBumpers(void)
{
UINT8 i;
UINT8 numingame = 0;
SINT8 winnernum = -1;
UINT32 winnerscoreadd = 0, maxroundscore = 0;
UINT32 toproundscore = 0;
UINT8 nobumpers = 0;
if (!(gametyperules & GTR_BUMPERS))
@ -110,23 +109,16 @@ void K_CheckBumpers(void)
return;
numingame++;
winnerscoreadd += players[i].roundscore;
if (players[i].roundscore > maxroundscore)
if (players[i].roundscore > toproundscore)
{
maxroundscore = players[i].roundscore;
toproundscore = players[i].roundscore;
}
if (players[i].bumpers <= 0) // if you don't have any bumpers, you're probably not a winner
{
nobumpers++;
continue;
}
else if (winnernum != -1) // TWO winners? that's dumb :V
return;
winnernum = i;
winnerscoreadd -= players[i].roundscore;
}
if (battlecapsules || bossinfo.valid)
@ -145,6 +137,13 @@ void K_CheckBumpers(void)
}
return;
}
else
{
if (toproundscore < (numingame * 3))
{
return;
}
}
if (numingame <= 1)
{
@ -158,14 +157,6 @@ void K_CheckBumpers(void)
return;
}
if (winnernum > -1 && playeringame[winnernum])
{
if ((players[winnernum].roundscore+winnerscoreadd) == maxroundscore)
winnerscoreadd++; // break ties if luigi wins by doing nothing
players[winnernum].roundscore += winnerscoreadd;
CONS_Printf(M_GetText("%s recieved %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s"));
}
for (i = 0; i < MAXPLAYERS; i++) // This can't go in the earlier loop because winning adds points
K_KartUpdatePosition(&players[i]);