Always plan & plan more BARCAP for carriers

This commit is contained in:
Raffson 2024-12-24 00:38:29 +01:00
parent f1dc431d2f
commit 75c29dd907
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 9 additions and 2 deletions

View File

@ -15,6 +15,7 @@ from game.theater import (
MissionTarget,
OffMapSpawn,
ParkingType,
NavalControlPoint,
)
from game.theater.theatergroundobject import (
BuildingGroundObject,
@ -147,6 +148,9 @@ class ObjectiveFinder:
if isinstance(cp, OffMapSpawn):
# Off-map spawn locations don't need protection.
continue
if isinstance(cp, NavalControlPoint):
yield cp # always consider CVN/LHA as vulnerable
continue
airfields_in_proximity = self.closest_airfields_to(cp)
airbase_threat_range = self.game.settings.airbase_threat_range
if (

View File

@ -180,13 +180,16 @@ class TheaterState(WorldState["TheaterState"]):
}
vulnerable_control_points = [
cp for cp, bp in battle_postitions.items() if not bp.blocking_capture
cp
for cp, bp in battle_postitions.items()
if not bp.blocking_capture or cp.is_fleet
]
return TheaterState(
context=context,
barcaps_needed={
cp: barcap_rounds for cp in finder.vulnerable_control_points()
cp: 2 * barcap_rounds if cp.is_fleet else barcap_rounds
for cp in finder.vulnerable_control_points()
},
active_front_lines=list(finder.front_lines()),
front_line_stances={f: None for f in finder.front_lines()},