mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add preset formations to different flights and waypoints. (#1948)
* Update pydcs version. * Add formation presets for various flight types.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import AttackGroup, WeaponType
|
||||
from dcs.task import AttackGroup, OptFormation, WeaponType
|
||||
|
||||
from game.theater import NavalControlPoint, TheaterGroundObject
|
||||
from game.transfers import MultiGroupTransport
|
||||
@@ -39,3 +39,5 @@ class BaiIngressBuilder(PydcsWaypointBuilder):
|
||||
task.params["altitudeEnabled"] = False
|
||||
task.params["groupAttack"] = True
|
||||
waypoint.tasks.append(task)
|
||||
|
||||
waypoint.tasks.append(OptFormation.trail_open())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import ControlledTask, OrbitAction
|
||||
from dcs.task import ControlledTask, OptFormation, OrbitAction
|
||||
|
||||
from gen.flights.flightplan import LoiterFlightPlan
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
@@ -26,3 +26,4 @@ class HoldPointBuilder(PydcsWaypointBuilder):
|
||||
int((push_time - self.elapsed_mission_time).total_seconds())
|
||||
)
|
||||
waypoint.add_task(loiter)
|
||||
waypoint.add_task(OptFormation.finger_four_close())
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
from typing import List, Type
|
||||
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import ControlledTask, EngageTargets, OptECMUsing, TargetType, Targets
|
||||
from dcs.task import (
|
||||
ControlledTask,
|
||||
EngageTargets,
|
||||
OptECMUsing,
|
||||
OptFormation,
|
||||
TargetType,
|
||||
Targets,
|
||||
)
|
||||
|
||||
from game.ato import FlightType
|
||||
from game.utils import nautical_miles
|
||||
@@ -19,6 +26,11 @@ class JoinPointBuilder(PydcsWaypointBuilder):
|
||||
],
|
||||
)
|
||||
|
||||
if self.flight.count < 4:
|
||||
waypoint.tasks.append(OptFormation.line_abreast_open())
|
||||
else:
|
||||
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]
|
||||
@@ -28,6 +40,11 @@ class JoinPointBuilder(PydcsWaypointBuilder):
|
||||
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfDetectedLockByRadar)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
|
||||
if self.flight.count < 4:
|
||||
waypoint.tasks.append(OptFormation.line_abreast_open())
|
||||
else:
|
||||
waypoint.tasks.append(OptFormation.spread_four_open())
|
||||
|
||||
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,
|
||||
@@ -37,6 +54,8 @@ class JoinPointBuilder(PydcsWaypointBuilder):
|
||||
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfOnlyLockByRadar)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
|
||||
waypoint.tasks.append(OptFormation.finger_four_open())
|
||||
|
||||
@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 BombingRunway
|
||||
from dcs.task import BombingRunway, OptFormation
|
||||
|
||||
from game.theater import Airfield
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
@@ -20,3 +20,4 @@ class OcaRunwayIngressBuilder(PydcsWaypointBuilder):
|
||||
waypoint.tasks.append(
|
||||
BombingRunway(airport_id=target.airport.id, group_attack=True)
|
||||
)
|
||||
waypoint.tasks.append(OptFormation.trail_open())
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import OptECMUsing
|
||||
from dcs.task import OptECMUsing, OptFormation
|
||||
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
|
||||
@@ -15,3 +15,5 @@ class SplitPointBuilder(PydcsWaypointBuilder):
|
||||
# Let the AI use ECM to defend themselves.
|
||||
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfOnlyLockByRadar)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
|
||||
waypoint.tasks.append(OptFormation.finger_four_close())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from dcs import Point
|
||||
from dcs.planes import B_17G, B_52H, Tu_22M3
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import Bombing, WeaponType
|
||||
from dcs.task import Bombing, OptFormation, WeaponType
|
||||
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
|
||||
@@ -13,6 +13,8 @@ class StrikeIngressBuilder(PydcsWaypointBuilder):
|
||||
else:
|
||||
self.add_strike_tasks(waypoint)
|
||||
|
||||
waypoint.tasks.append(OptFormation.trail_open())
|
||||
|
||||
def add_bombing_tasks(self, waypoint: MovingPoint) -> None:
|
||||
targets = self.waypoint.targets
|
||||
if not targets:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import EngageTargets, Targets
|
||||
from dcs.task import EngageTargets, OptFormation, Targets
|
||||
|
||||
from game.utils import nautical_miles
|
||||
from gen.flights.flightplan import SweepFlightPlan
|
||||
@@ -27,3 +27,8 @@ class SweepIngressBuilder(PydcsWaypointBuilder):
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
if self.flight.count < 4:
|
||||
waypoint.tasks.append(OptFormation.line_abreast_open())
|
||||
else:
|
||||
waypoint.tasks.append(OptFormation.spread_four_open())
|
||||
|
||||
Reference in New Issue
Block a user