Add anti-ship missions.

The only practical difference between this and BAI is that the target is
floating, so this mostly shares its implementation with BAI.

Fixes https://github.com/Khopa/dcs_liberation/issues/350
This commit is contained in:
Dan Albert
2020-11-16 23:29:19 -08:00
parent 9f2409bb9e
commit 082e8c062c
4 changed files with 42 additions and 8 deletions

View File

@@ -255,9 +255,7 @@ class ControlPoint(MissionTarget):
]
else:
if self.is_fleet:
yield from [
# TODO: FlightType.ANTISHIP
]
yield FlightType.ANTISHIP
else:
yield from [
# TODO: FlightType.STRIKE

View File

@@ -156,7 +156,15 @@ class BuildingGroundObject(TheaterGroundObject):
return f"{self.category}|{self.group_id}|{self.object_id}"
class GenericCarrierGroundObject(TheaterGroundObject):
class NavalGroundObject(TheaterGroundObject):
def mission_types(self, for_player: bool) -> Iterator[FlightType]:
from gen.flights.flight import FlightType
if not self.is_friendly(for_player):
yield FlightType.ANTISHIP
yield from super().mission_types(for_player)
class GenericCarrierGroundObject(NavalGroundObject):
pass
@@ -284,7 +292,7 @@ class EwrGroundObject(BaseDefenseGroundObject):
return f"{self.faction_color}|{super().group_name}"
class ShipGroundObject(TheaterGroundObject):
class ShipGroundObject(NavalGroundObject):
def __init__(self, name: str, group_id: int, position: Point,
control_point: ControlPoint) -> None:
super().__init__(