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.
This commit is contained in:
MetalStormGhost 2022-09-21 08:34:48 +03:00 committed by Raffson
parent d6bd5184b6
commit d14b964f1d
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -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]: