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
Esempio n. 2
0
 def apply_effects(self, state: TheaterState) -> None:
     state.eliminate_ship(self.target)
Esempio n. 3
0
 def enemy_has_ammo_dumps(self, state: TheaterState) -> bool:
     return bool(state.ammo_dumps_at(self.enemy_cp(state)))
Esempio n. 4
0
 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))
Esempio n. 5
0
 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)]
Esempio n. 7
0
 def apply_effects(self, state: TheaterState) -> None:
     state.eliminate_garrison(self.target)
Esempio n. 8
0
 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)