mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
fix numerous UI elements using is_ownfor
This commit is contained in:
@@ -38,7 +38,7 @@ class IBuilder(ABC, Generic[FlightPlanT, LayoutT]):
|
||||
self._generate_package_waypoints_if_needed(dump_debug_info)
|
||||
self._flight_plan = self.build(dump_debug_info)
|
||||
except NavMeshError as ex:
|
||||
color = "blue" if self.flight.squadron.player else "red"
|
||||
color = "blue" if self.flight.squadron.player.is_blue else "red"
|
||||
raise PlanningError(
|
||||
f"Could not plan {color} {self.flight.flight_type.value} from "
|
||||
f"{self.flight.departure} to {self.package.target}"
|
||||
|
||||
@@ -27,7 +27,7 @@ class FrontLineStanceTask(TheaterCommanderTask, ABC):
|
||||
@staticmethod
|
||||
def management_allowed(state: TheaterState) -> bool:
|
||||
return (
|
||||
not state.context.coalition.player
|
||||
not state.context.coalition.player.is_blue
|
||||
or state.context.settings.automate_front_line_stance
|
||||
)
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
||||
|
||||
def preconditions_met(self, state: TheaterState) -> bool:
|
||||
if (
|
||||
state.context.coalition.player
|
||||
state.context.coalition.player.is_blue
|
||||
and state.context.settings.auto_ato_behavior is AutoAtoBehavior.Disabled
|
||||
):
|
||||
return False
|
||||
@@ -102,7 +102,7 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
||||
return 1
|
||||
|
||||
def fulfill_mission(self, state: TheaterState) -> bool:
|
||||
color = "blue" if state.context.coalition.player else "red"
|
||||
color = "blue" if state.context.coalition.player.is_blue else "red"
|
||||
self.propose_flights()
|
||||
fulfiller = PackageFulfiller(
|
||||
state.context.coalition,
|
||||
@@ -214,7 +214,7 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
||||
settings = state.context.coalition.game.settings
|
||||
margin = 100 - (
|
||||
settings.ownfor_autoplanner_aggressiveness
|
||||
if state.context.coalition.player
|
||||
if state.context.coalition.player.is_blue
|
||||
else settings.opfor_autoplanner_aggressiveness
|
||||
)
|
||||
threat_range = iads_threat.max_threat_range() * (margin / 100)
|
||||
|
||||
@@ -12,7 +12,7 @@ from game.theater import MissionTarget
|
||||
class PlanAewc(PackagePlanningTask[MissionTarget]):
|
||||
def preconditions_met(self, state: TheaterState) -> bool:
|
||||
if (
|
||||
state.context.coalition.player
|
||||
state.context.coalition.player.is_blue
|
||||
and not state.context.settings.auto_ato_behavior_awacs
|
||||
):
|
||||
return False
|
||||
|
||||
@@ -14,7 +14,7 @@ MARGIN = 4 # assume 4 aircraft can land without refueling
|
||||
class PlanRecovery(PackagePlanningTask[ControlPoint]):
|
||||
def preconditions_met(self, state: TheaterState) -> bool:
|
||||
if (
|
||||
state.context.coalition.player
|
||||
state.context.coalition.player.is_blue
|
||||
and not state.context.settings.auto_ato_behavior_tankers
|
||||
):
|
||||
return False
|
||||
|
||||
@@ -12,7 +12,7 @@ from game.theater import MissionTarget
|
||||
class PlanRefueling(PackagePlanningTask[MissionTarget]):
|
||||
def preconditions_met(self, state: TheaterState) -> bool:
|
||||
if (
|
||||
state.context.coalition.player
|
||||
state.context.coalition.player.is_blue
|
||||
and not state.context.settings.auto_ato_behavior_tankers
|
||||
):
|
||||
return False
|
||||
|
||||
@@ -866,7 +866,7 @@ class HelipadGenerator:
|
||||
|
||||
if self.game.position_culled(helipad):
|
||||
cull_farp_statics = True
|
||||
if self.cp.coalition.player:
|
||||
if self.cp.coalition.player.is_blue:
|
||||
for package in self.cp.coalition.ato.packages:
|
||||
for flight in package.flights:
|
||||
if flight.squadron.location == self.cp:
|
||||
@@ -998,7 +998,7 @@ class GroundSpawnRoadbaseGenerator:
|
||||
cull_farp_statics = True
|
||||
elif self.game.position_culled(ground_spawn[0]):
|
||||
cull_farp_statics = True
|
||||
if self.cp.coalition.player:
|
||||
if self.cp.coalition.player.is_blue:
|
||||
for package in self.cp.coalition.ato.packages:
|
||||
for flight in package.flights:
|
||||
if flight.squadron.location == self.cp:
|
||||
@@ -1277,7 +1277,7 @@ class GroundSpawnGenerator:
|
||||
cull_farp_statics = True
|
||||
elif self.game.position_culled(vtol_pad[0]):
|
||||
cull_farp_statics = True
|
||||
if self.cp.coalition.player:
|
||||
if self.cp.coalition.player.is_blue:
|
||||
for package in self.cp.coalition.ato.packages:
|
||||
for flight in package.flights:
|
||||
if flight.squadron.location == self.cp:
|
||||
|
||||
Reference in New Issue
Block a user