mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
This alters the DEAD task planning to be the *least* preferred task, but prevents other tasks from being planned unless they are excepted to be clear of air defenses first. Even so, missions are a guaranteed success so those other missions will still get SEAD escorts if there's potential for a SAM in the area. This means that air defenses that are not protecting a more useful target (like a convoy, armor column, building, etc) will no longer be considered by the mission planner. This isn't *quite* right since we currently only check the target area for air defenses rather than the entire flight plan, so there's a chance that we ignore IADS that have threatened ingress points (though that's mostly solved by the flight plan layout). This also is still slightly limited because it's not checking for aircraft availability at this stage yet, so we may aggressively plan missions that we should be skipping unless we can guarantee that the DEAD mission was planned. However, that's not new behavior.
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from game.commander.tasks.packageplanningtask import PackagePlanningTask
|
|
from game.commander.theaterstate import TheaterState
|
|
from game.data.doctrine import Doctrine
|
|
from game.theater import ControlPoint
|
|
from gen.flights.flight import FlightType
|
|
|
|
|
|
@dataclass
|
|
class PlanOcaStrike(PackagePlanningTask[ControlPoint]):
|
|
aircraft_cold_start: bool
|
|
|
|
def preconditions_met(self, state: TheaterState) -> bool:
|
|
if self.target not in state.oca_targets:
|
|
return False
|
|
return self.target_area_preconditions_met(state)
|
|
|
|
def apply_effects(self, state: TheaterState) -> None:
|
|
state.oca_targets.remove(self.target)
|
|
|
|
def propose_flights(self, doctrine: Doctrine) -> None:
|
|
self.propose_flight(FlightType.OCA_RUNWAY, 2, doctrine.mission_ranges.offensive)
|
|
if self.aircraft_cold_start:
|
|
self.propose_flight(
|
|
FlightType.OCA_AIRCRAFT, 2, doctrine.mission_ranges.offensive
|
|
)
|
|
self.propose_common_escorts(doctrine)
|