diff --git a/game/event/airwar.py b/game/event/airwar.py index 0f804375..ed22f3af 100644 --- a/game/event/airwar.py +++ b/game/event/airwar.py @@ -8,7 +8,7 @@ if TYPE_CHECKING: class AirWarEvent(Event): - """An Event centered on the overall Air War""" + """Event handler for the air battle""" def __str__(self): - return "Frontline attack" + return "AirWar" diff --git a/game/event/event.py b/game/event/event.py index 6f933ace..4f9db729 100644 --- a/game/event/event.py +++ b/game/event/event.py @@ -38,7 +38,6 @@ class Event: location = None # type: Point from_cp = None # type: ControlPoint to_cp = None # type: ControlPoint - operation = Operation difficulty = 1 # type: int BONUS_BASE = 5 @@ -62,9 +61,9 @@ class Event: return int(math.log(self.to_cp.importance + 1, DIFFICULTY_LOG_BASE) * self.BONUS_BASE) def generate(self) -> UnitMap: - self.operation.prepare(self.game) - unit_map = self.operation.generate() - self.operation.current_mission.save( + Operation.prepare(self.game) + unit_map = Operation.generate() + Operation.current_mission.save( persistency.mission_path_for("liberation_nextturn.miz")) return unit_map diff --git a/game/game.py b/game/game.py index 242d8b0b..967d118b 100644 --- a/game/game.py +++ b/game/game.py @@ -193,7 +193,7 @@ class Game: if isinstance(event, Event): return event and event.attacker_name and event.attacker_name == self.player_name else: - raise RuntimeError(f"{event} was passed when an expected") + raise RuntimeError(f"{event} was passed when an Event type was expected") def on_load(self) -> None: LuaPluginManager.load_settings(self.settings) diff --git a/game/theater/conflicttheater.py b/game/theater/conflicttheater.py index ad8ea842..a889a366 100644 --- a/game/theater/conflicttheater.py +++ b/game/theater/conflicttheater.py @@ -485,6 +485,7 @@ class ConflictTheater: dist = cp.position.distance_to_point(control_point.position) if not closest_distance: closest_distance = dist + distances[cp.id] = dist if dist < closest_distance: distances[cp.id] = dist closest_cp_id = min(distances, key=distances.get) # type: ignore