mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-16 01:31:26 +00:00
If the game would normally end in a bomb kill, then always switch their places
This commit is contained in:
parent
d3913a72df
commit
e271c2de5d
2 changed files with 20 additions and 2 deletions
|
@ -4490,7 +4490,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|
||||
void K_CalculateBattleWanted(void)
|
||||
{
|
||||
UINT8 numingame = 0, numwanted = 0;
|
||||
UINT8 numingame = 0, numplaying = 0, numwanted = 0;
|
||||
SINT8 bestbumperplayer = -1, bestbumper = -1;
|
||||
SINT8 camppos[MAXPLAYERS]; // who is the biggest camper
|
||||
UINT8 ties = 0, nextcamppos = 0;
|
||||
|
@ -4519,6 +4519,8 @@ void K_CalculateBattleWanted(void)
|
|||
if (players[i].exiting) // We're done, don't calculate.
|
||||
return;
|
||||
|
||||
numplaying++;
|
||||
|
||||
if (players[i].kartstuff[k_bumper] <= 0) // Not alive, so don't do anything else
|
||||
continue;
|
||||
|
||||
|
@ -4554,7 +4556,7 @@ void K_CalculateBattleWanted(void)
|
|||
camppos[position] = i;
|
||||
}
|
||||
|
||||
if (numingame <= 2)
|
||||
if (numplaying <= 2 || (numingame <= 2 && bestbumper == 1)) // In 1v1s then there's no need for WANTED. In bigger netgames, don't show anyone as WANTED when they're equally matched.
|
||||
numwanted = 0;
|
||||
else
|
||||
numwanted = min(4, 1 + ((numingame-2) / 4));
|
||||
|
|
|
@ -516,6 +516,22 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
boom->color = SKINCOLOR_RED;
|
||||
S_StartSound(boom, special->info->attacksound);
|
||||
|
||||
if (player->kartstuff[k_bumper] == 1) // If you have only one bumper left, and see if it's a 1v1
|
||||
{
|
||||
INT32 numingame = 0;
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator || players[i].kartstuff[k_bumper] <= 0)
|
||||
continue;
|
||||
numingame++;
|
||||
}
|
||||
|
||||
if (numingame <= 2) // If so, then an extra karma point so they are 100% certain to switch places; it's annoying to end matches with a bomb kill
|
||||
special->target->player->kartstuff[k_comebackpoints]++;
|
||||
}
|
||||
|
||||
special->target->player->kartstuff[k_comebackpoints] += 2 * (K_IsPlayerWanted(player) ? 2 : 1);
|
||||
if (netgame && cv_hazardlog.value)
|
||||
CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[special->target->player-players], player_names[player-players]);
|
||||
|
|
Loading…
Reference in a new issue