SnappyComebacks bf034e18eb
Add preset formations to different flights and waypoints. (#1948)
* Update pydcs version.
* Add formation presets for various flight types.
2022-01-16 14:49:17 -07:00

24 lines
732 B
Python

import logging
from dcs.point import MovingPoint
from dcs.task import BombingRunway, OptFormation
from game.theater import Airfield
from .pydcswaypointbuilder import PydcsWaypointBuilder
class OcaRunwayIngressBuilder(PydcsWaypointBuilder):
def add_tasks(self, waypoint: MovingPoint) -> None:
target = self.package.target
if not isinstance(target, Airfield):
logging.error(
"Unexpected target type for runway bombing mission: %s",
target.__class__.__name__,
)
return
waypoint.tasks.append(
BombingRunway(airport_id=target.airport.id, group_attack=True)
)
waypoint.tasks.append(OptFormation.trail_open())