mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
* Auto-ato AWACS & Tankers settings Split off the **Automatic AWACS package planning** and **Automatic Theater tanker package planning** settings from **Automatic package planning behavior** so players can choose to have AWACS and theater tankers auto-planned, while managing everything else themselves. * Drop logic to child-classes * Enable AWACS auto-planning by default * Switch order of preconditions --------- Co-authored-by: Raffson <Raffson@users.noreply.github.com>
33 lines
1021 B
Python
33 lines
1021 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from game.ato.flighttype import FlightType
|
|
from game.commander.tasks.packageplanningtask import PackagePlanningTask
|
|
from game.commander.theaterstate import TheaterState
|
|
from game.theater import MissionTarget
|
|
|
|
|
|
@dataclass
|
|
class PlanAewc(PackagePlanningTask[MissionTarget]):
|
|
def preconditions_met(self, state: TheaterState) -> bool:
|
|
if (
|
|
state.context.coalition.player
|
|
and not state.context.settings.auto_ato_behavior_awacs
|
|
):
|
|
return False
|
|
if not super().preconditions_met(state):
|
|
return False
|
|
return self.target in state.aewc_targets
|
|
|
|
def apply_effects(self, state: TheaterState) -> None:
|
|
state.aewc_targets.remove(self.target)
|
|
|
|
def propose_flights(self) -> None:
|
|
self.propose_flight(FlightType.AEWC, 1)
|
|
|
|
@property
|
|
def asap(self) -> bool:
|
|
# Supports all the early CAP flights, so should be in the air ASAP.
|
|
return True
|