Game

class games.catastrophe.game.Game

Bases: joueur.base_game.BaseGame

The class representing the Game in the Catastrophe game.

Convert as many humans to as you can to survive in this post-apocalyptic wasteland.

property cat_energy_mult

The multiplier for the amount of energy regenerated when resting in a shelter with the cat overlord.

Type

float

property current_player

The player whose turn it is currently. That player can send commands. Other players cannot.

Type

games.catastrophe.player.Player

property current_turn

The current turn number, starting at 0 for the first player’s turn.

Type

int

property game_objects

A mapping of every game object’s ID to the actual game object. Primarily used by the server and client to easily refer to the game objects via ID.

Type

dict[str, games.catastrophe.game_object.GameObject]

get_game_object(id: str) → Optional[joueur.base_game_object.BaseGameObject]

gets the game object with the given id, or None

Returns

BaseGameObject in the game with the given id, or None if not found

get_tile_at(x: int, y: int) → Optional[games.catastrophe.tile.Tile]

Gets the Tile at a specified (x, y) position.

Parameters
  • x (int) – An integer between 0 and the map_width.

  • y (int) – An integer between 0 and the map_height.

Returns

The Tile at (x, y) or None if out of bounds.

Return type

games.catastrophe.tile.Tile or None

property harvest_cooldown

The amount of turns it takes for a Tile that was just harvested to grow food again.

Type

int

property jobs

All the Jobs that Units can have in the game.

Type

list[games.catastrophe.job.Job]

property lower_harvest_amount

The amount that the harvest rate is lowered each season.

Type

int

property map_height

The number of Tiles in the map along the y (vertical) axis.

Type

int

property map_width

The number of Tiles in the map along the x (horizontal) axis.

Type

int

property max_turns

The maximum number of turns before the game will automatically end.

Type

int

property monument_cost_mult

The multiplier for the cost of actions when performing them in range of a monument. Does not effect pickup cost.

Type

float

property monument_materials

The number of materials in a monument.

Type

int

property neutral_materials

The number of materials in a neutral Structure.

Type

int

property players

List of all the players in the game.

Type

list[games.catastrophe.player.Player]

property session

A unique identifier for the game instance that is being played.

Type

str

property shelter_materials

The number of materials in a shelter.

Type

int

property starting_food

The amount of food Players start with.

Type

int

property starving_energy_mult

The multiplier for the amount of energy regenerated when resting while starving.

Type

float

property structures

Every Structure in the game.

Type

list[games.catastrophe.structure.Structure]

property tiles

All the tiles in the map, stored in Row-major order. Use x + y * mapWidth to access the correct index.

Type

list[games.catastrophe.tile.Tile]

property time_added_per_turn

The amount of time (in nano-seconds) added after each player performs a turn.

Type

int

property turns_between_harvests

After a food tile is harvested, the number of turns before it can be harvested again.

Type

int

property turns_to_create_human

The number of turns between fresh humans being spawned on the road.

Type

int

property turns_to_lower_harvest

The number of turns before the harvest rate is lowered (length of each season basically).

Type

int

property units

Every Unit in the game.

Type

list[games.catastrophe.unit.Unit]

property wall_materials

The number of materials in a wall.

Type

int