mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 23:59:18 +08:00
Merge pull request #273 from ritiek/elimination-games-fix
Set winner when player leaves elimination mid-game
This commit is contained in:
commit
9ffee1c52d
@ -1,3 +1,5 @@
|
|||||||
|
- Declare opponent team as the winner if a player with their final turn leaves an elimination game.
|
||||||
|
|
||||||
### 1.6.0 (20357)
|
### 1.6.0 (20357)
|
||||||
- Revamped netcode significantly. We still don't have client-prediction, but things should (hopefully) feel much lower latency now.
|
- Revamped netcode significantly. We still don't have client-prediction, but things should (hopefully) feel much lower latency now.
|
||||||
- Added network debug graphs accessible by hitting F8.
|
- Added network debug graphs accessible by hitting F8.
|
||||||
|
|||||||
@ -23,3 +23,6 @@
|
|||||||
|
|
||||||
### Daniil Rakhov
|
### Daniil Rakhov
|
||||||
- Plugin api additions
|
- Plugin api additions
|
||||||
|
|
||||||
|
### Ritiek Malhotra
|
||||||
|
- Just <3 BombSquad
|
||||||
|
|||||||
@ -483,6 +483,13 @@ class EliminationGame(ba.TeamGameActivity[Player, Team]):
|
|||||||
# list then.
|
# list then.
|
||||||
ba.timer(0, self._update_icons)
|
ba.timer(0, self._update_icons)
|
||||||
|
|
||||||
|
# If the player to leave was the last in spawn order and had
|
||||||
|
# their final turn currently in-progress, mark the survival time
|
||||||
|
# for their team.
|
||||||
|
if self._get_total_team_lives(player.team) == 0:
|
||||||
|
assert self._start_time is not None
|
||||||
|
player.team.survival_seconds = int(ba.time() - self._start_time)
|
||||||
|
|
||||||
def _get_total_team_lives(self, team: Team) -> int:
|
def _get_total_team_lives(self, team: Team) -> int:
|
||||||
return sum(player.lives for player in team.players)
|
return sum(player.lives for player in team.players)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user