Add player pilot invulnerability option.

https://github.com/dcs-liberation/dcs_liberation/issues/276
This commit is contained in:
Dan Albert
2021-05-27 01:40:23 -07:00
parent 82ce688a0d
commit 28f20d47d3
3 changed files with 29 additions and 4 deletions

View File

@@ -120,10 +120,13 @@ class Event:
self.game.red_ato, debriefing.air_losses, for_player=False
)
@staticmethod
def commit_air_losses(debriefing: Debriefing) -> None:
def commit_air_losses(self, debriefing: Debriefing) -> None:
for loss in debriefing.air_losses.losses:
loss.pilot.alive = False
if (
not loss.pilot.player
or not self.game.settings.invulnerable_player_pilots
):
loss.pilot.alive = False
aircraft = loss.flight.unit_type
cp = loss.flight.departure
available = cp.base.total_units_of_type(aircraft)

View File

@@ -36,6 +36,7 @@ class Settings:
restrict_weapons_by_date: bool = False
disable_legacy_aewc: bool = False
generate_dark_kneeboard: bool = False
invulnerable_player_pilots: bool = True
# Performance oriented
perf_red_alert_state: bool = True