CAS engagement range

New option in Settings: CAS engagement range (nmi)
This commit is contained in:
MetalStormGhost
2023-08-01 19:12:41 +03:00
committed by Raffson
parent a5104dd9ec
commit c51fa5c1df
4 changed files with 19 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ from datetime import timedelta
from typing import TYPE_CHECKING, Type
from game.theater import FrontLine
from game.utils import Distance, Speed, kph, meters
from game.utils import Distance, Speed, kph, meters, nautical_miles
from .ibuilder import IBuilder
from .invalidobjectivelocation import InvalidObjectiveLocation
from .patrolling import PatrollingFlightPlan, PatrollingLayout
@@ -53,8 +53,9 @@ class CasFlightPlan(PatrollingFlightPlan[CasLayout], UiZoneDisplay):
@property
def engagement_distance(self) -> Distance:
max_length = self.flight.coalition.game.settings.max_frontline_width * 1000
return meters(max_length) / 2
return nautical_miles(
self.flight.coalition.game.settings.cas_engagement_range_distance
)
@property
def combat_speed_waypoints(self) -> set[FlightWaypoint]:

View File

@@ -26,7 +26,11 @@ class CasIngressBuilder(PydcsWaypointBuilder):
logging.error("No CAS waypoint found. Falling back to search and engage")
waypoint.add_task(
EngageTargets(
max_distance=int(nautical_miles(10).meters),
max_distance=int(
nautical_miles(
self.flight.coalition.game.settings.cas_engagement_range_distance
).meters
),
targets=[
Targets.All.GroundUnits.GroundVehicles,
Targets.All.GroundUnits.AirDefence.AAA,

View File

@@ -267,6 +267,14 @@ class Settings:
"lower threat range generally means less BARCAPs are planned."
),
)
cas_engagement_range_distance: int = bounded_int_option(
"CAS engagement range (nmi)",
page=CAMPAIGN_DOCTRINE_PAGE,
section=DOCTRINE_DISTANCES_SECTION,
default=10,
min=0,
max=100,
)
sead_sweep_engagement_range_distance: int = bounded_int_option(
"SEAD Sweep engagement range (nmi)",
page=CAMPAIGN_DOCTRINE_PAGE,