diff --git a/game/data/doctrine.py b/game/data/doctrine.py index ba063d12f..cfa95cbbc 100644 --- a/game/data/doctrine.py +++ b/game/data/doctrine.py @@ -117,8 +117,6 @@ def from_dict(data: dict[str, Any]) -> Cap: @dataclass(frozen=True) class Tactics: - #: Aircraft use countermeasures (chaff, flares) - use_countermeasures: bool #: Air-to-air missile attack range options air_to_air_missile_attack_range: Optional[OptAAMissileAttackRange.Values] @@ -129,7 +127,6 @@ class Tactics: @staticmethod def from_dict(data: dict[str, Any]) -> Tactics: return Tactics( - use_countermeasures=data.get("use_countermeasures", True), air_to_air_missile_attack_range=None, air_defence_evades_anti_radiation_missiles=data.get( "air_defence_evades_anti_radiation_missiles", False diff --git a/game/factions/faction.py b/game/factions/faction.py index 49a44dc35..95baeb237 100644 --- a/game/factions/faction.py +++ b/game/factions/faction.py @@ -123,6 +123,9 @@ class Faction: #: weapons groups to their introduction years. weapons_introduction_year_overrides: Dict[str, int] = field(default_factory=dict) + #: Set to True if the faction has access to countermeasures (chaff and flares). + countermeasures_available: bool = True + def has_access_to_dcs_type(self, unit_type: Type[DcsUnitType]) -> bool: # Vehicle and Ship Units if any(unit_type == u.dcs_unit_type for u in self.accessible_units): @@ -271,6 +274,8 @@ def from_dict(cls: Type[Faction], json: Dict[str, Any]) -> Faction: "weapons_introduction_year_overrides", {} ) + faction.countermeasures_available = json.get("countermeasures_available", True) + return faction @property diff --git a/resources/doctrines/coldwar.yaml b/resources/doctrines/coldwar.yaml index 4f072a9e5..aa0f6b6a6 100644 --- a/resources/doctrines/coldwar.yaml +++ b/resources/doctrines/coldwar.yaml @@ -32,6 +32,5 @@ helicopter: rendezvous_altitude_ft_agl: 1500 air_assault_nav_altitude_ft_agl: 1500 tactics: - use_countermeasures: true air_defence_evades_anti_radiation_missiles: false air_to_air_missile_attack_range: ~ diff --git a/resources/doctrines/modern.yaml b/resources/doctrines/modern.yaml index aca5233c0..0772601fa 100644 --- a/resources/doctrines/modern.yaml +++ b/resources/doctrines/modern.yaml @@ -32,6 +32,5 @@ helicopter: rendezvous_altitude_ft_agl: 1500 air_assault_nav_altitude_ft_agl: 1500 tactics: - use_countermeasures: true air_defence_evades_anti_radiation_missiles: false air_to_air_missile_attack_range: ~ \ No newline at end of file diff --git a/resources/doctrines/ww2.yaml b/resources/doctrines/ww2.yaml index de1450643..a6075e617 100644 --- a/resources/doctrines/ww2.yaml +++ b/resources/doctrines/ww2.yaml @@ -31,6 +31,5 @@ helicopter: rendezvous_altitude_ft_agl: 1500 air_assault_nav_altitude_ft_agl: 1500 tactics: - use_countermeasures: true air_defence_evades_anti_radiation_missiles: false air_to_air_missile_attack_range: ~ \ No newline at end of file