mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user