From d14b964f1d6e3c503de2d6b377e503d1937dd93d Mon Sep 17 00:00:00 2001 From: MetalStormGhost <89945461+MetalStormGhost@users.noreply.github.com> Date: Wed, 21 Sep 2022 08:34:48 +0300 Subject: [PATCH] Add fidelity for SIDC status of TGOs. The new behavior is as follows for SAMs: No damaged units: fully capable (green) Damaged but still operational: present (no bar) Not fully destroyed but inoperable: damaged (yellow) Fully destroyed: destroyed (red) And for all other TGOs: Fully destroyed: destroyed (red) Any missing units: damaged (yellow) No missing units: present (no bar) Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2438. --- game/theater/theatergroundobject.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/game/theater/theatergroundobject.py b/game/theater/theatergroundobject.py index 8fe14ce0..6bfb7c2f 100644 --- a/game/theater/theatergroundobject.py +++ b/game/theater/theatergroundobject.py @@ -85,7 +85,12 @@ class TheaterGroundObject(MissionTarget, SidcDescribable, ABC): @property def sidc_status(self) -> Status: - return Status.PRESENT_DESTROYED if self.is_dead else Status.PRESENT + if self.is_dead: + return Status.PRESENT_DESTROYED + elif self.dead_units: + return Status.PRESENT_DAMAGED + else: + return Status.PRESENT @property def standard_identity(self) -> StandardIdentity: @@ -524,9 +529,13 @@ class SamGroundObject(IadsGroundObject): def sidc_status(self) -> Status: if self.is_dead: return Status.PRESENT_DESTROYED - if self.max_threat_range() > meters(0): - return Status.PRESENT - return Status.PRESENT_DAMAGED + elif self.dead_units: + if self.max_threat_range() > meters(0): + return Status.PRESENT + else: + return Status.PRESENT_DAMAGED + else: + return Status.PRESENT_FULLY_CAPABLE @property def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]: