From 8363a7e8fab7d5a11cff1e39a08caeb1b36ebd1a Mon Sep 17 00:00:00 2001 From: SnappyComebacks <74509817+SnappyComebacks@users.noreply.github.com> Date: Wed, 28 Dec 2022 14:19:33 -0700 Subject: [PATCH] Set units on the frontline to Hidden On MFD. (#2669) All groups (friendly and enemy) that are part of the front line are set to `Hidden On MFD`. This is a group level filter, and can not be applied on a per unit basis. --- changelog.md | 1 + game/missiongenerator/flotgenerator.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 9162ab72..0f074013 100644 --- a/changelog.md +++ b/changelog.md @@ -156,6 +156,7 @@ Saves from 6.x are not compatible with 7.0. * **[Squadrons]** Squadron-specific mission capability lists no longer restrict players from assigning missions outside the squadron's preferences. * **[New Game Wizard]** Squadrons can be directly replaced with a preset during air wing configuration rather than needing to remove and create a new squadron. * **[UI]** The orientation of objects like SAMs, EWRs, garrisons, and ships can now be manually adjusted. +* **[Mission Generation]** Units on the front line are now hidden on MFDs. ## Fixes diff --git a/game/missiongenerator/flotgenerator.py b/game/missiongenerator/flotgenerator.py index f95d74b2..0932b6b4 100644 --- a/game/missiongenerator/flotgenerator.py +++ b/game/missiongenerator/flotgenerator.py @@ -234,6 +234,7 @@ class FlotGenerator: ) vehicle = vg.units[0] GroundForcePainter(faction, vehicle).apply_livery() + vg.hidden_on_mfd = True return possible_infantry_units = set(faction.infantry_with_class(UnitClass.INFANTRY)) @@ -261,6 +262,7 @@ class FlotGenerator: ) vehicle = vg.units[0] GroundForcePainter(faction, vehicle).apply_livery() + vg.hidden_on_mfd = True for unit in units[1:]: position = infantry_position.random_point_within(55, 5) @@ -275,6 +277,7 @@ class FlotGenerator: ) vehicle = vg.units[0] GroundForcePainter(faction, vehicle).apply_livery() + vg.hidden_on_mfd = True def _earliest_tot_on_flot(self, player: bool) -> timedelta: tots = [ @@ -645,7 +648,7 @@ class FlotGenerator: ) -> List[VehicleGroup]: """ Return the nearest enemy group for the player group - @param group Group for which we should find the nearest ennemies + @param player_group Group for which we should find the nearest ennemies @param enemy_groups Potential enemy groups @param n number of nearby groups to take """ @@ -670,7 +673,7 @@ class FlotGenerator: ) -> Optional[VehicleGroup]: """ Search the enemy groups for a potential target suitable to armored assault - @param group Group for which we should find the nearest ennemy + @param player_group Group for which we should find the nearest ennemy @param enemy_groups Potential enemy groups """ min_distance = math.inf @@ -813,6 +816,7 @@ class FlotGenerator: group_size=count, heading=heading.degrees, ) + group.hidden_on_mfd = True self.unit_map.add_front_line_units(group, cp, unit_type)