Require all bases to be captured to win/lose

This commit is contained in:
Raffson 2023-04-10 14:10:46 +02:00
parent 8973100f95
commit 7eb652b970
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -351,16 +351,10 @@ class Game:
persistency.autosave(self)
def check_win_loss(self) -> TurnState:
player_airbases = {
cp for cp in self.theater.player_points() if cp.runway_is_operational()
}
if not player_airbases:
if not self.theater.player_points():
return TurnState.LOSS
enemy_airbases = {
cp for cp in self.theater.enemy_points() if cp.runway_is_operational()
}
if not enemy_airbases:
if not self.theater.enemy_points():
return TurnState.WIN
return TurnState.CONTINUE