Enabled SEAD Escort missions to be tasked on Naval targets and OCA/Aircraft missions on FARPs. When SEAD Escorts are tasked on Naval groups, they will also target ships.

This commit is contained in:
MetalStormGhost 2022-09-04 14:40:18 +03:00 committed by Raffson
parent 2ea74d7435
commit 07de598aec
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
3 changed files with 22 additions and 5 deletions

View File

@ -11,6 +11,7 @@ from dcs.task import (
)
from game.ato import FlightType
from game.theater import NavalControlPoint
from game.utils import nautical_miles
from .pydcswaypointbuilder import PydcsWaypointBuilder
@ -32,9 +33,18 @@ class JoinPointBuilder(PydcsWaypointBuilder):
waypoint.tasks.append(OptFormation.spread_four_open())
elif self.flight.flight_type == FlightType.SEAD_ESCORT:
self.configure_escort_tasks(
waypoint, [Targets.All.GroundUnits.AirDefence.AAA.SAMRelated]
)
if isinstance(self.flight.package.target, NavalControlPoint):
self.configure_escort_tasks(
waypoint,
[
Targets.All.Naval,
Targets.All.GroundUnits.AirDefence.AAA.SAMRelated,
],
)
else:
self.configure_escort_tasks(
waypoint, [Targets.All.GroundUnits.AirDefence.AAA.SAMRelated]
)
# Let the AI use ECM to preemptively defend themselves.
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfDetectedLockByRadar)

View File

@ -1176,7 +1176,10 @@ class NavalControlPoint(ControlPoint, ABC):
# TODO: Inter-ship logistics?
]
else:
yield FlightType.ANTISHIP
yield from [
FlightType.ANTISHIP,
FlightType.SEAD_ESCORT,
]
yield from super().mission_types(for_player)
@property
@ -1424,6 +1427,7 @@ class Fob(ControlPoint):
if not self.is_friendly(for_player):
yield FlightType.STRIKE
yield FlightType.AIR_ASSAULT
yield FlightType.OCA_AIRCRAFT
yield from super().mission_types(for_player)

View File

@ -350,7 +350,10 @@ class NavalGroundObject(TheaterGroundObject, ABC):
from game.ato import FlightType
if not self.is_friendly(for_player):
yield FlightType.ANTISHIP
yield from [
FlightType.ANTISHIP,
FlightType.SEAD_ESCORT,
]
yield from super().mission_types(for_player)
@property