diff --git a/game/ato/flightplans/ocaaircraft.py b/game/ato/flightplans/ocaaircraft.py index 5b8ba6da..652f3d3a 100644 --- a/game/ato/flightplans/ocaaircraft.py +++ b/game/ato/flightplans/ocaaircraft.py @@ -3,7 +3,7 @@ from __future__ import annotations import logging from typing import Type -from game.theater import Airfield +from game.theater import Airfield, Fob from .formationattack import ( FormationAttackBuilder, FormationAttackFlightPlan, @@ -23,7 +23,7 @@ class Builder(FormationAttackBuilder[OcaAircraftFlightPlan, FormationAttackLayou def layout(self) -> FormationAttackLayout: location = self.package.target - if not isinstance(location, Airfield): + if not isinstance(location, Airfield) and not isinstance(location, Fob): logging.exception( f"Invalid Objective Location for OCA/Aircraft flight " f"{self.flight=} at {location=}." diff --git a/game/commander/tasks/primitive/oca.py b/game/commander/tasks/primitive/oca.py index 34767073..0fdcc547 100644 --- a/game/commander/tasks/primitive/oca.py +++ b/game/commander/tasks/primitive/oca.py @@ -1,7 +1,6 @@ from __future__ import annotations from dataclasses import dataclass -from random import randint from game.ato.flighttype import FlightType from game.commander.tasks.packageplanningtask import PackagePlanningTask @@ -25,7 +24,8 @@ class PlanOcaStrike(PackagePlanningTask[ControlPoint]): def propose_flights(self) -> None: size = self.get_flight_size() - self.propose_flight(FlightType.OCA_RUNWAY, size) + if self.target.cptype == self.target.cptype.AIRBASE: + self.propose_flight(FlightType.OCA_RUNWAY, size) if self.aircraft_cold_start: self.propose_flight(FlightType.OCA_AIRCRAFT, 2) self.propose_common_escorts() diff --git a/game/theater/controlpoint.py b/game/theater/controlpoint.py index 27a434f9..3ee1b3cc 100644 --- a/game/theater/controlpoint.py +++ b/game/theater/controlpoint.py @@ -1558,6 +1558,8 @@ class Fob(ControlPoint, RadioFrequencyContainer, CTLD): if not self.is_friendly(for_player): yield FlightType.STRIKE yield FlightType.AIR_ASSAULT + if self.total_aircraft_parking(ParkingType(True, True, True)): + yield FlightType.OCA_AIRCRAFT else: yield FlightType.AEWC