mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Putting the ingress point directly on one end of the FLOT means that AI flights won't start searching and engaging targets until they reach that point. If the front line has advanced toward the flight's departure airfield, it might overfly targets on its way to the IP. Instead, place an IP for CAS the same way we place any other IP. The AI will fly to that and start searching from there. This also: * Removes the midpoint waypoint, since it didn't serve any real purpose * Names the FLOT boundary waypoints for what they actually are Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2231.
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
import logging
|
|
from typing import Type
|
|
|
|
from game.theater.theatergroundobject import (
|
|
EwrGroundObject,
|
|
SamGroundObject,
|
|
)
|
|
from .formationattack import (
|
|
FormationAttackBuilder,
|
|
FormationAttackFlightPlan,
|
|
FormationAttackLayout,
|
|
)
|
|
from .invalidobjectivelocation import InvalidObjectiveLocation
|
|
from ..flightwaypointtype import FlightWaypointType
|
|
|
|
|
|
class DeadFlightPlan(FormationAttackFlightPlan):
|
|
@staticmethod
|
|
def builder_type() -> Type[Builder]:
|
|
return Builder
|
|
|
|
|
|
class Builder(FormationAttackBuilder[DeadFlightPlan, FormationAttackLayout]):
|
|
def layout(self) -> FormationAttackLayout:
|
|
location = self.package.target
|
|
|
|
is_ewr = isinstance(location, EwrGroundObject)
|
|
is_sam = isinstance(location, SamGroundObject)
|
|
if not is_ewr and not is_sam:
|
|
logging.exception(
|
|
f"Invalid Objective Location for DEAD flight {self.flight=} at "
|
|
f"{location=}"
|
|
)
|
|
raise InvalidObjectiveLocation(self.flight.flight_type, location)
|
|
|
|
return self._build(FlightWaypointType.INGRESS_DEAD)
|
|
|
|
def build(self, dump_debug_info: bool = False) -> DeadFlightPlan:
|
|
return DeadFlightPlan(self.flight, self.layout())
|