mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +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.
35 lines
1.4 KiB
Python
35 lines
1.4 KiB
Python
from collections import Iterator
|
|
from dataclasses import dataclass
|
|
|
|
from game.commander.tasks.compound.aewcsupport import PlanAewcSupport
|
|
from game.commander.tasks.compound.attackairinfrastructure import (
|
|
AttackAirInfrastructure,
|
|
)
|
|
from game.commander.tasks.compound.attackbuildings import AttackBuildings
|
|
from game.commander.tasks.compound.attackgarrisons import AttackGarrisons
|
|
from game.commander.tasks.compound.degradeiads import DegradeIads
|
|
from game.commander.tasks.compound.frontlinedefense import FrontLineDefense
|
|
from game.commander.tasks.compound.interdictreinforcements import (
|
|
InterdictReinforcements,
|
|
)
|
|
from game.commander.tasks.compound.protectairspace import ProtectAirSpace
|
|
from game.commander.tasks.compound.refuelingsupport import PlanRefuelingSupport
|
|
from game.commander.theaterstate import TheaterState
|
|
from game.htn import CompoundTask, Method
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class PlanNextAction(CompoundTask[TheaterState]):
|
|
aircraft_cold_start: bool
|
|
|
|
def each_valid_method(self, state: TheaterState) -> Iterator[Method[TheaterState]]:
|
|
yield [PlanAewcSupport()]
|
|
yield [PlanRefuelingSupport()]
|
|
yield [ProtectAirSpace()]
|
|
yield [FrontLineDefense()]
|
|
yield [InterdictReinforcements()]
|
|
yield [AttackGarrisons()]
|
|
yield [AttackAirInfrastructure(self.aircraft_cold_start)]
|
|
yield [AttackBuildings()]
|
|
yield [DegradeIads()]
|