game.core.events.game_event
core/events/game_event.py
Defines a GameEvent interface and concrete events for weather conditions and union strikes.
Includes a helper to generate random events.
Functions
Generate a list of random game events. |
Classes
Abstract base class for game events. |
|
Represents a union strike event. |
|
|
Weather related game event affecting fuel consumption. |
|
Types for different weather conditions. |
- class game.core.events.game_event.GameEvent
Bases:
ABC
Abstract base class for game events.
- _abc_impl = <_abc._abc_data object>
- abstract description() str
A short description of the event.
- abstract trigger(game)
Trigger the event’s effect in the game.
- class game.core.events.game_event.UnionStrikeEvent
Bases:
GameEvent
Represents a union strike event. [WIP]
- _abc_impl = <_abc._abc_data object>
- description() str
A short description of the event.
- trigger(game)
Trigger the event’s effect in the game.
- class game.core.events.game_event.WeatherEvent(weather_type: WeatherType)
Bases:
GameEvent
Weather related game event affecting fuel consumption.
- _abc_impl = <_abc._abc_data object>
- _weather_data = {WeatherType.CLEAR: {'effect': 'Normal fuel consumption.', 'fuel_modifier': 0.0, 'icon': '☀️', 'messages': ['Sky clear, smooth flying ahead!', 'Sun shining, perfect conditions for the flight.']}, WeatherType.RAIN: {'effect': '+5% fuel consumed.', 'fuel_modifier': 0.05, 'icon': '🌧️', 'messages': ['Rainy skies ahead, runways may be slippery.', 'Wet conditions expected, maintain caution!']}, WeatherType.SNOW: {'effect': '+7.5% fuel consumed.', 'fuel_modifier': 0.075, 'icon': '❄️', 'messages': ['Snow is falling, watch out for those icy runways!', 'Snowy conditions, heavy traffic at the airport expected.']}, WeatherType.STORM: {'effect': '+10% fuel consumed.', 'fuel_modifier': 0.1, 'icon': '⛈️', 'messages': ['Storm ahead, fasten your seatbelt!', 'Turbulence alert, incoming storm!']}, WeatherType.TAILWIND: {'effect': '-5% fuel consumed due to tailwind.', 'fuel_modifier': -0.05, 'icon': '💨', 'messages': ['Winds at your back, smooth and quick flight ahead.', 'Enjoy the speed boost from the tailwind!']}}
- description() str
Return a radio message and update message for a specific weather type.
- trigger(game)
Apply fuel consumption and save the event message in the game.