mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add BAI planning against supply routes.
This currently is only supported for player flights. I have no idea how to create an AI flight plan that won't just get them killed. AI-only BAI missions against supply routes will warn the player on mission creation.
This commit is contained in:
@@ -349,6 +349,63 @@ class WaypointBuilder:
|
||||
self.race_track_end(end, altitude),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def convoy_search_start(
|
||||
control_point: ControlPoint, altitude: Distance
|
||||
) -> FlightWaypoint:
|
||||
"""Creates a convoy search start waypoint.
|
||||
|
||||
Args:
|
||||
control_point: Control point for the beginning of the search.
|
||||
altitude: Altitude of the racetrack.
|
||||
"""
|
||||
waypoint = FlightWaypoint(
|
||||
FlightWaypointType.INGRESS_BAI,
|
||||
control_point.position.x,
|
||||
control_point.position.y,
|
||||
altitude,
|
||||
)
|
||||
waypoint.name = control_point.name
|
||||
waypoint.description = "Beginning of convoy search area"
|
||||
waypoint.pretty_name = "Search start"
|
||||
return waypoint
|
||||
|
||||
@staticmethod
|
||||
def convoy_search_end(
|
||||
control_point: ControlPoint, altitude: Distance
|
||||
) -> FlightWaypoint:
|
||||
"""Creates a convoy search start waypoint.
|
||||
|
||||
Args:
|
||||
control_point: Control point for the beginning of the search.
|
||||
altitude: Altitude of the racetrack.
|
||||
"""
|
||||
waypoint = FlightWaypoint(
|
||||
FlightWaypointType.EGRESS,
|
||||
control_point.position.x,
|
||||
control_point.position.y,
|
||||
altitude,
|
||||
)
|
||||
waypoint.name = control_point.name
|
||||
waypoint.description = "End of convoy search area"
|
||||
waypoint.pretty_name = "Search end"
|
||||
return waypoint
|
||||
|
||||
def convoy_search(
|
||||
self, start: ControlPoint, end: ControlPoint, altitude: Distance
|
||||
) -> Tuple[FlightWaypoint, FlightWaypoint]:
|
||||
"""Creates two waypoint for a convoy search path.
|
||||
|
||||
Args:
|
||||
start: The beginning convoy search waypoint.
|
||||
end: The ending convoy search waypoint.
|
||||
altitude: The convoy search altitude.
|
||||
"""
|
||||
return (
|
||||
self.convoy_search_start(start, altitude),
|
||||
self.convoy_search_end(end, altitude),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def orbit(start: Point, altitude: Distance) -> FlightWaypoint:
|
||||
"""Creates an circular orbit point.
|
||||
|
||||
Reference in New Issue
Block a user