fix numerous UI elements using is_ownfor

This commit is contained in:
Eclipse/Druss99
2025-10-14 21:42:40 -04:00
committed by Raffson
parent 624f2a00fd
commit 3d788e3ae8
12 changed files with 33 additions and 21 deletions

View File

@@ -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
)

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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