Don't scrub missions with unplannable escort types

The check for whether or not the escort is actually needed happens later, and thus the mission can still be scrubbed if it's too dangerous. However, missions should not be scrubbed when a particular escort type is unplannable, yet not needed. Only if the primary flight type is not plannable should the mission immediately be scrubbed
This commit is contained in:
Raffson
2023-09-23 16:51:26 +02:00
parent 167d048232
commit 389037e6bf
7 changed files with 19 additions and 14 deletions

View File

@@ -1,9 +1,9 @@
from __future__ import annotations
from dataclasses import dataclass
from random import randint
from game.ato.flighttype import FlightType
from game.commander.missionproposals import EscortType
from game.commander.tasks.packageplanningtask import PackagePlanningTask
from game.commander.theaterstate import TheaterState
from game.transfers import CargoShip
@@ -24,4 +24,4 @@ class PlanAntiShipping(PackagePlanningTask[CargoShip]):
def propose_flights(self) -> None:
size = self.get_flight_size()
self.propose_flight(FlightType.ANTISHIP, size)
self.propose_common_escorts()
self.propose_flight(FlightType.ESCORT, 2, EscortType.AirToAir)

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
from dataclasses import dataclass
from game.ato.flighttype import FlightType
from game.commander.missionproposals import EscortType
from game.commander.tasks.packageplanningtask import PackagePlanningTask
from game.commander.theaterstate import TheaterState
from game.theater import FrontLine
@@ -31,5 +32,5 @@ class PlanCas(PackagePlanningTask[FrontLine]):
def propose_flights(self) -> None:
size = self.get_flight_size()
self.propose_flight(FlightType.CAS, size)
self.propose_flight(FlightType.TARCAP, 2)
self.propose_flight(FlightType.SEAD_SWEEP, 2)
self.propose_flight(FlightType.TARCAP, 2, EscortType.AirToAir)
self.propose_flight(FlightType.SEAD_SWEEP, 2, EscortType.Sead)

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
from dataclasses import dataclass
from game.ato.flighttype import FlightType
from game.commander.missionproposals import EscortType
from game.commander.tasks.packageplanningtask import PackagePlanningTask
from game.commander.theaterstate import TheaterState
from game.theater.theatergroundobject import IadsGroundObject
@@ -39,8 +40,8 @@ class PlanDead(PackagePlanningTask[IadsGroundObject]):
# also threatened by SAMs. We don't want to include a SEAD escort if the
# package is *only* threatened by the target though. Could be improved, but
# needs a decent refactor to the escort planning to do so.
if self.target.has_live_radar_sam:
self.propose_flight(FlightType.SEAD, 2)
self.propose_common_escorts()
if self.target.has_live_radar_sam:
self.propose_flight(FlightType.SEAD, 2, EscortType.Sead)
if self.target.control_point.coalition.game.settings.autoplan_tankers_for_dead:
self.propose_flight(FlightType.REFUELING, 1)
self.propose_flight(FlightType.REFUELING, 1, EscortType.Refuel)

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
from dataclasses import dataclass
from game.ato.flighttype import FlightType
from game.commander.missionproposals import EscortType
from game.commander.tasks.packageplanningtask import PackagePlanningTask
from game.commander.theaterstate import TheaterState
from game.theater import ControlPoint
@@ -30,4 +31,4 @@ class PlanOcaStrike(PackagePlanningTask[ControlPoint]):
self.propose_flight(FlightType.OCA_AIRCRAFT, 2)
self.propose_common_escorts()
if self.target.coalition.game.settings.autoplan_tankers_for_oca:
self.propose_flight(FlightType.REFUELING, 1)
self.propose_flight(FlightType.REFUELING, 1, EscortType.Refuel)

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
from dataclasses import dataclass
from game.ato.flighttype import FlightType
from game.commander.missionproposals import EscortType
from game.commander.tasks.packageplanningtask import PackagePlanningTask
from game.commander.theaterstate import TheaterState
from game.theater.theatergroundobject import TheaterGroundObject
@@ -25,4 +26,4 @@ class PlanStrike(PackagePlanningTask[TheaterGroundObject]):
self.propose_flight(FlightType.STRIKE, min(4, (tgt_count // 2) + tgt_count % 2))
self.propose_common_escorts()
if self.target.coalition.game.settings.autoplan_tankers_for_strike:
self.propose_flight(FlightType.REFUELING, 1)
self.propose_flight(FlightType.REFUELING, 1, EscortType.Refuel)