From be31a97c7148af86d7d681793964f9f951d627b5 Mon Sep 17 00:00:00 2001 From: MetalStormGhost Date: Tue, 4 Jul 2023 21:55:28 +0300 Subject: [PATCH] Added new option in settings: SEAD Sweep engagement range (nmi). Renamed SEAD Sweep threat buffer distance (nmi) to SEAD Escort/Sweep threat buffer distance (nmi) since it also applies to SEAD Escort flights. --- changelog.md | 3 +- game/ato/flightplans/waypointbuilder.py | 2 +- .../aircraft/waypoints/seadsweepingress.py | 6 +++- game/settings/settings.py | 30 ++++++++++++------- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/changelog.md b/changelog.md index 97e6f171..205da693 100644 --- a/changelog.md +++ b/changelog.md @@ -11,8 +11,9 @@ * **[Options]** Added a separate Doctrine page in settings with the following new options: * Minimum number of aircraft for autoplanner to plan OCA packages against * Airbase threat range (nmi) - * TARCAP threat buffer distance (nmi) * SEAD Sweep threat buffer distance (nmi) + * SEAD Escort/Sweep threat buffer distance (nmi) + * TARCAP threat buffer distance (nmi) * AEW&C threat buffer distance (nmi) * Theater tanker threat buffer distance (nmi) * **[Options]** Improved the option to configure OPFOR autoplanner aggressiveness. The AI might now take even more risks and plan missions against defended targets. diff --git a/game/ato/flightplans/waypointbuilder.py b/game/ato/flightplans/waypointbuilder.py index aa7a217e..cd126161 100644 --- a/game/ato/flightplans/waypointbuilder.py +++ b/game/ato/flightplans/waypointbuilder.py @@ -459,7 +459,7 @@ class WaypointBuilder: ingress = self.flight.package.waypoints.ingress ingress2tgt_dist = ingress.distance_to_point(target.position) threat_range = nautical_miles( - self.flight.coalition.game.settings.sead_sweep_threat_buffer_min_distance + self.flight.coalition.game.settings.sead_threat_buffer_min_distance ).meters if target.strike_targets: threat_range = ( diff --git a/game/missiongenerator/aircraft/waypoints/seadsweepingress.py b/game/missiongenerator/aircraft/waypoints/seadsweepingress.py index a1eccc1e..35d126db 100644 --- a/game/missiongenerator/aircraft/waypoints/seadsweepingress.py +++ b/game/missiongenerator/aircraft/waypoints/seadsweepingress.py @@ -20,7 +20,11 @@ class SeadSweepIngressBuilder(PydcsWaypointBuilder): ControlledTask( EngageTargets( # TODO: From doctrine. - max_distance=int(nautical_miles(30).meters), + max_distance=int( + nautical_miles( + self.flight.coalition.game.settings.sead_sweep_engagement_range_distance + ).meters + ), targets=[Targets.All.GroundUnits.AirDefence.AAA.SAMRelated], ) ) diff --git a/game/settings/settings.py b/game/settings/settings.py index 58b1dd38..1ca5724b 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -267,6 +267,25 @@ class Settings: "lower threat range generally means less BARCAPs are planned." ), ) + sead_sweep_engagement_range_distance: int = bounded_int_option( + "SEAD Sweep threat buffer distance (nmi)", + page=CAMPAIGN_DOCTRINE_PAGE, + section=DOCTRINE_DISTANCES_SECTION, + default=30, + min=0, + max=100, + ) + sead_threat_buffer_min_distance: int = bounded_int_option( + "SEAD Escort/Sweep threat buffer distance (nmi)", + page=CAMPAIGN_DOCTRINE_PAGE, + section=DOCTRINE_DISTANCES_SECTION, + default=5, + min=0, + max=100, + detail=( + "How close to known threats will the SEAD Escort / SEAD Sweep engagement zone extend." + ), + ) tarcap_threat_buffer_min_distance: int = bounded_int_option( "TARCAP threat buffer distance (nmi)", page=CAMPAIGN_DOCTRINE_PAGE, @@ -276,17 +295,6 @@ class Settings: max=100, detail=("How close to known threats will the TARCAP racetrack extend."), ) - sead_sweep_threat_buffer_min_distance: int = bounded_int_option( - "SEAD Sweep threat buffer distance (nmi)", - page=CAMPAIGN_DOCTRINE_PAGE, - section=DOCTRINE_DISTANCES_SECTION, - default=5, - min=0, - max=100, - detail=( - "How close to known threats will the SEAD Sweep engagement zone extend." - ), - ) aewc_threat_buffer_min_distance: int = bounded_int_option( "AEW&C threat buffer distance (nmi)", page=CAMPAIGN_DOCTRINE_PAGE,