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:
Dan Albert
2021-04-19 23:09:39 -07:00
parent 2b06d8a096
commit 3f16c0378a
5 changed files with 238 additions and 2 deletions

View File

@@ -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