mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Make sweep flights actually sweep flights.
DCS group task doesn't alter behavior, but it does alter which tasks are available to the group.
This commit is contained in:
parent
14dd8e43a4
commit
9f2409bb9e
@ -47,6 +47,7 @@ from dcs.task import (
|
|||||||
EPLRS,
|
EPLRS,
|
||||||
EngageTargets,
|
EngageTargets,
|
||||||
EngageTargetsInZone,
|
EngageTargetsInZone,
|
||||||
|
FighterSweep,
|
||||||
GroundAttack,
|
GroundAttack,
|
||||||
OptROE,
|
OptROE,
|
||||||
OptRTBOnBingoFuel,
|
OptRTBOnBingoFuel,
|
||||||
@ -57,7 +58,8 @@ from dcs.task import (
|
|||||||
SEAD,
|
SEAD,
|
||||||
StartCommand,
|
StartCommand,
|
||||||
Targets,
|
Targets,
|
||||||
Task, WeaponType,
|
Task,
|
||||||
|
WeaponType,
|
||||||
)
|
)
|
||||||
from dcs.terrain.terrain import Airport
|
from dcs.terrain.terrain import Airport
|
||||||
from dcs.translation import String
|
from dcs.translation import String
|
||||||
@ -1047,6 +1049,19 @@ class AircraftConflictGenerator:
|
|||||||
|
|
||||||
self.configure_behavior(group, rtb_winchester=ammo_type)
|
self.configure_behavior(group, rtb_winchester=ammo_type)
|
||||||
|
|
||||||
|
def configure_sweep(self, group: FlyingGroup, package: Package,
|
||||||
|
flight: Flight,
|
||||||
|
dynamic_runways: Dict[str, RunwayData]) -> None:
|
||||||
|
group.task = FighterSweep.name
|
||||||
|
self._setup_group(group, FighterSweep, package, flight, dynamic_runways)
|
||||||
|
|
||||||
|
if flight.unit_type not in GUNFIGHTERS:
|
||||||
|
ammo_type = OptRTBOnOutOfAmmo.Values.AAM
|
||||||
|
else:
|
||||||
|
ammo_type = OptRTBOnOutOfAmmo.Values.Cannon
|
||||||
|
|
||||||
|
self.configure_behavior(group, rtb_winchester=ammo_type)
|
||||||
|
|
||||||
def configure_cas(self, group: FlyingGroup, package: Package,
|
def configure_cas(self, group: FlyingGroup, package: Package,
|
||||||
flight: Flight,
|
flight: Flight,
|
||||||
dynamic_runways: Dict[str, RunwayData]) -> None:
|
dynamic_runways: Dict[str, RunwayData]) -> None:
|
||||||
@ -1127,17 +1142,19 @@ class AircraftConflictGenerator:
|
|||||||
dynamic_runways: Dict[str, RunwayData]) -> None:
|
dynamic_runways: Dict[str, RunwayData]) -> None:
|
||||||
flight_type = flight.flight_type
|
flight_type = flight.flight_type
|
||||||
if flight_type in [FlightType.BARCAP, FlightType.TARCAP,
|
if flight_type in [FlightType.BARCAP, FlightType.TARCAP,
|
||||||
FlightType.INTERCEPTION, FlightType.SWEEP]:
|
FlightType.INTERCEPTION]:
|
||||||
self.configure_cap(group, package, flight, dynamic_runways)
|
self.configure_cap(group, package, flight, dynamic_runways)
|
||||||
|
elif flight_type == FlightType.SWEEP:
|
||||||
|
self.configure_sweep(group, package, flight, dynamic_runways)
|
||||||
elif flight_type in [FlightType.CAS, FlightType.BAI]:
|
elif flight_type in [FlightType.CAS, FlightType.BAI]:
|
||||||
self.configure_cas(group, package, flight, dynamic_runways)
|
self.configure_cas(group, package, flight, dynamic_runways)
|
||||||
elif flight_type in [FlightType.DEAD, ]:
|
elif flight_type == FlightType.DEAD:
|
||||||
self.configure_dead(group, package, flight, dynamic_runways)
|
self.configure_dead(group, package, flight, dynamic_runways)
|
||||||
elif flight_type in [FlightType.SEAD, ]:
|
elif flight_type == FlightType.SEAD:
|
||||||
self.configure_sead(group, package, flight, dynamic_runways)
|
self.configure_sead(group, package, flight, dynamic_runways)
|
||||||
elif flight_type in [FlightType.STRIKE]:
|
elif flight_type == FlightType.STRIKE:
|
||||||
self.configure_strike(group, package, flight, dynamic_runways)
|
self.configure_strike(group, package, flight, dynamic_runways)
|
||||||
elif flight_type in [FlightType.ANTISHIP]:
|
elif flight_type == FlightType.ANTISHIP:
|
||||||
self.configure_anti_ship(group, package, flight, dynamic_runways)
|
self.configure_anti_ship(group, package, flight, dynamic_runways)
|
||||||
elif flight_type == FlightType.ESCORT:
|
elif flight_type == FlightType.ESCORT:
|
||||||
self.configure_escort(group, package, flight, dynamic_runways)
|
self.configure_escort(group, package, flight, dynamic_runways)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user