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:
@@ -6,6 +6,8 @@ from collections import defaultdict
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Dict, Iterator, List, Optional
|
||||
|
||||
from dcs import Point
|
||||
from game.theater import FlightType, MissionTarget
|
||||
from game.theater.controlpoint import ControlPoint
|
||||
|
||||
|
||||
@@ -97,3 +99,25 @@ class SupplyRoute:
|
||||
current = previous
|
||||
path.reverse()
|
||||
return path
|
||||
|
||||
|
||||
class SupplyRouteLink(MissionTarget):
|
||||
def __init__(self, a: ControlPoint, b: ControlPoint) -> None:
|
||||
self.control_point_a = a
|
||||
self.control_point_b = b
|
||||
super().__init__(
|
||||
f"Supply route between {a} and {b}",
|
||||
Point((a.position.x + b.position.x) / 2, (a.position.y + b.position.y) / 2),
|
||||
)
|
||||
|
||||
def mission_types(self, for_player: bool) -> Iterator[FlightType]:
|
||||
yield from [
|
||||
FlightType.BAI,
|
||||
# TODO: Escort
|
||||
# TODO: SEAD
|
||||
# TODO: Recon
|
||||
# TODO: TARCAP
|
||||
]
|
||||
|
||||
def is_friendly(self, to_player: bool) -> bool:
|
||||
return self.control_point_a.captured
|
||||
|
||||
Reference in New Issue
Block a user