def plan_missions(self, tracer: MultiEventTracer) -> None: state = TheaterState.from_game(self.game, self.player, tracer) while True: result = self.plan(state) if result is None: # Planned all viable tasks this turn. return for task in result.tasks: task.execute(self.game.coalition_for(self.player)) state = result.end_state
def apply_effects(self, state: TheaterState) -> None: state.eliminate_ship(self.target)
def enemy_has_ammo_dumps(self, state: TheaterState) -> bool: return bool(state.ammo_dumps_at(self.enemy_cp(state)))
def unit_cap(self, state: TheaterState, player: bool) -> int: cp = self.front_line.control_point_friendly_to(player) ammo_depots = list(state.ammo_dumps_at(cp)) return cp.front_line_capacity_with(len(ammo_depots))
def apply_effects(self, state: TheaterState) -> None: state.eliminate_air_defense(self.target)
def each_valid_method( self, state: TheaterState) -> Iterator[Method[TheaterState]]: for ammo_dump in state.ammo_dumps_at(self.control_point): yield [PlanStrike(ammo_dump)]
def apply_effects(self, state: TheaterState) -> None: state.eliminate_garrison(self.target)
def preconditions_met(self, state: TheaterState) -> bool: if not state.has_garrison(self.target): return False if not self.target_area_preconditions_met(state): return False return super().preconditions_met(state)