mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add triggered waypoint switch to strike escorts
This commit is contained in:
parent
66290fe1ce
commit
5f10154000
@ -19,7 +19,9 @@ from dcs.task import (
|
||||
OptRestrictJettison,
|
||||
Refueling,
|
||||
RunwayAttack,
|
||||
Transport, SEAD,
|
||||
Transport,
|
||||
SEAD,
|
||||
SwitchWaypoint,
|
||||
)
|
||||
from dcs.unitgroup import FlyingGroup
|
||||
|
||||
@ -267,6 +269,8 @@ class AircraftBehavior:
|
||||
# Search Then Engage task, which we have to use instead of the Escort
|
||||
# task for the reasons explained in JoinPointBuilder.
|
||||
group.task = Escort.name
|
||||
if flight.package.primary_task == FlightType.STRIKE:
|
||||
group.add_trigger_action(SwitchWaypoint(None, 5))
|
||||
self.configure_behavior(
|
||||
flight, group, roe=OptROE.Values.OpenFire, restrict_jettison=True
|
||||
)
|
||||
@ -276,6 +280,8 @@ class AircraftBehavior:
|
||||
# available aircraft, and F-14s are not able to be SEAD despite having TALDs.
|
||||
# https://forums.eagle.ru/topic/272112-cannot-assign-f-14-to-sead/
|
||||
group.task = SEAD.name
|
||||
if flight.package.primary_task == FlightType.STRIKE:
|
||||
group.add_trigger_action(SwitchWaypoint(None, 5))
|
||||
self.configure_behavior(
|
||||
flight,
|
||||
group,
|
||||
|
||||
@ -5,9 +5,12 @@ from datetime import datetime
|
||||
from functools import cached_property
|
||||
from typing import Any, Dict, List, TYPE_CHECKING
|
||||
|
||||
from dcs.action import AITaskPush
|
||||
from dcs.condition import FlagIsTrue
|
||||
from dcs.country import Country
|
||||
from dcs.mission import Mission
|
||||
from dcs.terrain.terrain import NoParkingSlotError
|
||||
from dcs.triggers import TriggerOnce, Event
|
||||
from dcs.unitgroup import FlyingGroup, StaticGroup
|
||||
|
||||
from game.ato.airtaaskingorder import AirTaskingOrder
|
||||
@ -111,6 +114,13 @@ class AircraftGenerator:
|
||||
flight, country, dynamic_runways
|
||||
)
|
||||
self.unit_map.add_aircraft(group, flight)
|
||||
if package.primary_task == FlightType.STRIKE:
|
||||
splittrigger = TriggerOnce(Event.NoEvent, f"Split-{id(package)}")
|
||||
splittrigger.add_condition(FlagIsTrue(flag=f"split-{id(package)}"))
|
||||
for flight in package.flights:
|
||||
if flight is not package.primary_flight:
|
||||
splittrigger.add_action(AITaskPush(flight.group_id, 1))
|
||||
self.mission.triggerrules.triggers.append(splittrigger)
|
||||
|
||||
def spawn_unused_aircraft(
|
||||
self, player_country: Country, enemy_country: Country
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user