Battle: win by having enough points when you kill a player

This commit is contained in:
James R 2023-06-29 23:32:17 -07:00
parent e6ba45e558
commit 1184e6d674
2 changed files with 11 additions and 1 deletions

View file

@ -3791,6 +3791,7 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN
{
UINT8 points = 1;
boolean trapItem = false;
boolean finishOff = (victim->mo->health > 0) && (victim->mo->health <= damage);
if (!(gametyperules & GTR_POINTLIMIT))
{
@ -3825,7 +3826,7 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN
}
else if (gametyperules & GTR_BUMPERS)
{
if ((victim->mo->health > 0) && (victim->mo->health <= damage))
if (finishOff)
{
// +2 points for finishing off a player
points = 2;
@ -3835,6 +3836,11 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN
P_AddPlayerScore(player, points);
K_SpawnBattlePoints(player, victim, points);
if ((gametyperules & GTR_BUMPERS) && finishOff && g_pointlimit <= player->roundscore)
{
P_DoAllPlayersExit(0, false);
}
}
void K_SpinPlayer(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 type)

View file

@ -901,6 +901,10 @@ void P_CheckPointLimit(void)
if (battleprisons)
return;
// This will be handled by P_KillPlayer
if (gametyperules & GTR_BUMPERS)
return;
// pointlimit is nonzero, check if it's been reached by this player
if (G_GametypeHasTeams())
{