Games#

general#

This section provides an overview of the game mechanics, including how to start a game, manage quests, and handle player interactions.

games#

Important

Currently only only one game is available with the name “Fast and hungry, task hunt”. But there are plans to add more games in the future and the merge of game The great base-off from a past tournament.

Name

Status

Description

Fast and hungry, task hunt

In progress

Complete all tasks and survive. The game ends as soon as one player has completed all tasks.

The great base-off

In progress

Survive for a year and earn points for upgrading your base.

Mixed martial starves

Idea

game status workflow#

flowchart TD A([start]) -->|automatic| CREATED CREATED --> |manuelly| RUNNING CREATED --> |manuelly| PAUSED CREATED --> |automatic| FAILURE FAILURE --> |automatic| Z RUNNING --> |manuelly| PAUSED PAUSED --> |manuelly| RUNNING PAUSED --> |manuelly| STOPPED STOPPED --> |automatic| FINISHED FINISHED --> Z([end])

functions#

This file contains all logic for creating a game and managing the game state.

class src.game.GameStats[source]#

Class to store the game statistics and values to process the workflow.

async process_league_stats(config)[source]#

Function to process the league statistics and calculate the number of participants and the maximum hours played by a player.

Parameters:

config (Configuration) – App configuration

async rank_calculation_possible()[source]#

Function to check if the rank calculation is possible.

Returns:

True if the rank calculation is possible, False otherwise

Return type:

bool

class src.game.GameConfig(name, game_emojis)[source]#

General GameConfig class to store the configuration for a game.

async src.game.failed_game(config, game)[source]#

Helper function to stop a game in case that a wrong input has been givin in selection menu and set the game status to FAILURE.

Parameters:
  • config (Configuration) – App configuration

  • game (Game) – Game object for change status

Return type:

None

async src.game.create_quests(config, player, game, tasks)[source]#

Function to get the quests for a player based on the playing hours.

Parameters:
  • config (Configuration) – App configuration

  • player (Player) – Player object to get quests for

Return type:

None

async src.game.generate_league_table(config)[source]#

Function to generate the league table for the players based ranks.

Parameters:

config (Configuration) – App configuration

Return type:

None

async src.game.show_league_table(interaction, config)[source]#

Function to show the league table in the Discord channel.

Parameters:
  • interaction (Interaction) – Interaction object to respond to the command

  • config (Configuration) – App configuration

Return type:

None

async src.game.get_player_rank(config, player, prepr_game_stats)[source]#

Function calculate the rank of a player based on the playing hours and league position. The rank is calculated based on the formula PLAYER_RANK_G1

Parameters:
  • config (Configuration) – App configuration

  • player (Player) – Player to calculate the rank

  • prepr_game_stats (GameStats) – Complete game statistics

Returns:

Rank fore the player based on formula

Return type:

int