diff --git a/game/factions/faction.py b/game/factions/faction.py index b0caf4bb..45071530 100644 --- a/game/factions/faction.py +++ b/game/factions/faction.py @@ -108,6 +108,15 @@ class Faction: # List of default livery overrides liveries_overrides: Dict[UnitType, List[str]] = field(default_factory=dict) + #: Set to True if the faction should force the "Unrestricted satnav" option + #: for the mission. This option enables GPS for capable aircraft regardless + #: of the time period or operator. For example, the CJTF "countries" don't + #: appear to have GPS capability, so they need this. + #: + #: Note that this option cannot be set per-side. If either faction needs it, + #: both will use it. + unrestricted_satnav: bool = False + @classmethod def from_json(cls: Type[Faction], json: Dict[str, Any]) -> Faction: @@ -194,6 +203,8 @@ class Faction: if k is not None: faction.liveries_overrides[k] = [s.lower() for s in v] + faction.unrestricted_satnav = json.get("unrestricted_satnav", False) + return faction @property diff --git a/gen/forcedoptionsgen.py b/gen/forcedoptionsgen.py index 65e213b5..bccf981a 100644 --- a/gen/forcedoptionsgen.py +++ b/gen/forcedoptionsgen.py @@ -36,10 +36,14 @@ class ForcedOptionsGenerator: elif self.game.settings.labels == "Off": self.mission.forced_options.labels = int(Labels.Off) + def _set_unrestricted_satnav(self) -> None: + blue = self.game.player_faction + red = self.game.enemy_faction + if blue.unrestricted_satnav or red.unrestricted_satnav: + self.mission.forced_options.unrestricted_satnav = True + def generate(self): self._set_options_view() self._set_external_views() self._set_labels() - - - \ No newline at end of file + self._set_unrestricted_satnav() diff --git a/resources/factions/bluefor_modern.json b/resources/factions/bluefor_modern.json index 49e2e1cf..eb913019 100644 --- a/resources/factions/bluefor_modern.json +++ b/resources/factions/bluefor_modern.json @@ -96,5 +96,6 @@ "ArleighBurkeGroupGenerator" ], "has_jtac": true, - "jtac_unit": "MQ_9_Reaper" + "jtac_unit": "MQ_9_Reaper", + "unrestricted_satnav": true }