... | ... | @@ -84,10 +84,18 @@ expected return. All functions are called if implemented by the bot. The follow |
|
|
* onMessage - callback when a player issues a free form chat message (probably shouldn't use this...)
|
|
|
* onGameComplete - reveal the spies at the end of the game
|
|
|
|
|
|
## Accessible Variables
|
|
|
In the bot object, the following variables are accessible:
|
|
|
self.game: The shared game state object
|
|
|
self.spy: A boolean saying if you are a spy or not
|
|
|
self.name: The name of this bot class
|
|
|
self.index: The index of this bot (player number in game)
|
|
|
|
|
|
|
|
|
# Game State
|
|
|
At all points in the game, the players have access to a shared state, ```self.game``` which holds useful information about the game state.
|
|
|
|
|
|
* phase - the current phase of the game
|
|
|
* phase - the current phase of the game (preparing / selection / voting / mission / announcing)
|
|
|
* turn - the mission number (1 to 5)
|
|
|
* tries - the current attempt number (1 to 5)
|
|
|
* wins - the current number of resistance wins (0 to 3)
|
... | ... | |