mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Require all bases to be captured to win/lose
This commit is contained in:
parent
8973100f95
commit
7eb652b970
10
game/game.py
10
game/game.py
@ -351,16 +351,10 @@ class Game:
|
|||||||
persistency.autosave(self)
|
persistency.autosave(self)
|
||||||
|
|
||||||
def check_win_loss(self) -> TurnState:
|
def check_win_loss(self) -> TurnState:
|
||||||
player_airbases = {
|
if not self.theater.player_points():
|
||||||
cp for cp in self.theater.player_points() if cp.runway_is_operational()
|
|
||||||
}
|
|
||||||
if not player_airbases:
|
|
||||||
return TurnState.LOSS
|
return TurnState.LOSS
|
||||||
|
|
||||||
enemy_airbases = {
|
if not self.theater.enemy_points():
|
||||||
cp for cp in self.theater.enemy_points() if cp.runway_is_operational()
|
|
||||||
}
|
|
||||||
if not enemy_airbases:
|
|
||||||
return TurnState.WIN
|
return TurnState.WIN
|
||||||
|
|
||||||
return TurnState.CONTINUE
|
return TurnState.CONTINUE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user