Game

class games.saloon.game.Game

Bases: joueur.base_game.BaseGame

The class representing the Game in the Saloon game.

Use cowboys to have a good time and play some music on a Piano, while brawling with enemy Cowboys.

property bartender_cooldown

How many turns a Bartender will be busy for after throwing a Bottle.

Type

int

property bottles

All the beer Bottles currently flying across the saloon in the game.

Type

list[games.saloon.bottle.Bottle]

property brawler_damage

How much damage is applied to neighboring things bit by the Sharpshooter between turns.

Type

int

property cowboys

Every Cowboy in the game.

Type

list[games.saloon.cowboy.Cowboy]

property current_player

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

Type

games.saloon.player.Player

property current_turn

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

Type

int

property furnishings

Every furnishing in the game.

Type

list[games.saloon.furnishing.Furnishing]

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.saloon.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.saloon.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.saloon.tile.Tile or None

property jobs

All the jobs that Cowboys can be called in with.

Type

list[str]

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_cowboys_per_job

The maximum number of Cowboys a Player can bring into the saloon of each specific job.

Type

int

property max_turns

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

Type

int

property players

List of all the players in the game.

Type

list[games.saloon.player.Player]

property rowdiness_to_siesta

When a player’s rowdiness reaches or exceeds this number their Cowboys take a collective siesta.

Type

int

property session

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

Type

str

property sharpshooter_damage

How much damage is applied to things hit by Sharpshooters when they act.

Type

int

property siesta_length

How long siestas are for a player’s team.

Type

int

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.saloon.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_drunk

How many turns a Cowboy will be drunk for if a bottle breaks on it.

Type

int