mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
CAS engagement range
New option in Settings: CAS engagement range (nmi)
This commit is contained in:
@@ -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]:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user