mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add ECM behavior to not Air to Air flights (#1879)
* If a plane has a jammer, and it is not an air to air flight it will jam between join and split.
This commit is contained in:
parent
641c21627e
commit
a013d27d17
@ -9,6 +9,7 @@ Saves from 5.x are not compatible with 6.0.
|
||||
* **[Mission Generation]** Added an option to fast-forward mission generation until the point of first contact (WIP).
|
||||
* **[Mission Generation]** Add Option to enforce the Easy Communication setting for the mission
|
||||
* **[Flight Planning]** Added the ability to plan tankers for recovery on package flights. AI does not plan.
|
||||
* **[Flight Planning]** Air to Ground flights now have ECM enabled on lock at the join point, and SEAD/DEAD also have ECM enabled on detection and lock at ingress.
|
||||
* **[Modding]** Add F-104 mod support
|
||||
* **[UI]** Added options to the loadout editor for setting properties such as HMD choice.
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import AttackGroup, WeaponType
|
||||
from dcs.task import AttackGroup, OptECMUsing, WeaponType
|
||||
|
||||
from game.theater import TheaterGroundObject
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
@ -32,3 +32,7 @@ class DeadIngressBuilder(PydcsWaypointBuilder):
|
||||
task.params["altitudeEnabled"] = False
|
||||
task.params["groupAttack"] = True
|
||||
waypoint.tasks.append(task)
|
||||
|
||||
# Preemptively use ECM to better avoid getting swatted.
|
||||
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfDetectedLockByRadar)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from typing import List, Type
|
||||
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import ControlledTask, EngageTargets, TargetType, Targets
|
||||
from dcs.task import ControlledTask, EngageTargets, OptECMUsing, TargetType, Targets
|
||||
|
||||
from game.ato import FlightType
|
||||
from game.utils import nautical_miles
|
||||
@ -18,11 +18,25 @@ class JoinPointBuilder(PydcsWaypointBuilder):
|
||||
Targets.All.Air.Planes.MultiroleFighters,
|
||||
],
|
||||
)
|
||||
|
||||
elif self.flight.flight_type == FlightType.SEAD_ESCORT:
|
||||
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)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
|
||||
elif not self.flight.flight_type.is_air_to_air:
|
||||
# Capture any non A/A type to avoid issues with SPJs that use the primary radar such as the F/A-18C.
|
||||
# You can bully them with STT to not be able to fire radar guided missiles at you,
|
||||
# so best choice is to not let them perform jamming for now.
|
||||
|
||||
# Let the AI use ECM to defend themselves.
|
||||
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfOnlyLockByRadar)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
|
||||
@staticmethod
|
||||
def configure_escort_tasks(
|
||||
waypoint: MovingPoint, target_types: List[Type[TargetType]]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import AttackGroup, WeaponType
|
||||
from dcs.task import AttackGroup, OptECMUsing, WeaponType
|
||||
|
||||
from game.theater import TheaterGroundObject
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
@ -32,3 +32,7 @@ class SeadIngressBuilder(PydcsWaypointBuilder):
|
||||
task.params["altitudeEnabled"] = False
|
||||
task.params["groupAttack"] = True
|
||||
waypoint.tasks.append(task)
|
||||
|
||||
# Preemptively use ECM to better avoid getting swatted.
|
||||
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfDetectedLockByRadar)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
|
||||
17
game/missiongenerator/aircraft/waypoints/splitpoint.py
Normal file
17
game/missiongenerator/aircraft/waypoints/splitpoint.py
Normal file
@ -0,0 +1,17 @@
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import OptECMUsing
|
||||
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
|
||||
|
||||
class SplitPointBuilder(PydcsWaypointBuilder):
|
||||
def add_tasks(self, waypoint: MovingPoint) -> None:
|
||||
|
||||
if not self.flight.flight_type.is_air_to_air:
|
||||
# Capture any non A/A type to avoid issues with SPJs that use the primary radar such as the F/A-18C.
|
||||
# You can bully them with STT to not be able to fire radar guided missiles at you,
|
||||
# so best choice is to not let them perform jamming for now.
|
||||
|
||||
# Let the AI use ECM to defend themselves.
|
||||
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfOnlyLockByRadar)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
@ -27,6 +27,7 @@ from .deadingress import DeadIngressBuilder
|
||||
from .default import DefaultWaypointBuilder
|
||||
from .holdpoint import HoldPointBuilder
|
||||
from .joinpoint import JoinPointBuilder
|
||||
from .splitpoint import SplitPointBuilder
|
||||
from .landingpoint import LandingPointBuilder
|
||||
from .ocaaircraftingress import OcaAircraftIngressBuilder
|
||||
from .ocarunwayingress import OcaRunwayIngressBuilder
|
||||
@ -127,6 +128,7 @@ class WaypointGenerator:
|
||||
FlightWaypointType.INGRESS_STRIKE: StrikeIngressBuilder,
|
||||
FlightWaypointType.INGRESS_SWEEP: SweepIngressBuilder,
|
||||
FlightWaypointType.JOIN: JoinPointBuilder,
|
||||
FlightWaypointType.SPLIT: SplitPointBuilder,
|
||||
FlightWaypointType.LANDING_POINT: LandingPointBuilder,
|
||||
FlightWaypointType.LOITER: HoldPointBuilder,
|
||||
FlightWaypointType.PATROL: RaceTrackEndBuilder,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user