-
Notifications
You must be signed in to change notification settings - Fork 0
Start -- Create a game.
{
"nickname": "Rulio"
}
The result should be something like this.
{
"id": "PbDHs",
"nickname": "Rulio",
"score": 0,
"vp": 0,
"rounds": 0,
"rolled": [
{ "color": "red", "face": "shot" },
{ "color": "green", "face": "runner" },
{ "color": "yellow", "face": "brain" }
],
"brains": ["yellow"],
"shots": ["red"],
"runners": ["green"]
}
The last three fields are arrays of the dice's colors.
-
score
is the number of accumulated brains. -
vp
is the number of victory points, earned each time the score reaches 13. -
rounds
is the number of times the player is shotgunned (three shots), or eats 13 (or more) brains.
When the score reaches 13 or more, the player earns a VP and starts a new round with the score reset to zero.
When the player gets three shots, a new round starts with the score intact.
Play -- Update the game state.
{
"id": "PbDHs",
"nickname": "Rulio",
"action": "roll",
"vp": 0,
"rounds": 0,
"score": 0,
"brains": ["yellow"],
"shots": ["red"],
"runners": ["green"]
}
The server only cares about the three first fields.
The nickname can be updated.
The action, if any, can be either roll
or stop
. If no action is provided the server returns 400 Bad Request
{
"id": "PbDHs",
"nickname": "Rulio",
"vp": 0,
"rounds": 0,
"score": 0,
"rolled": [
{ "color": "yellow", "face": "shot" },
{ "color": "green", "face": "brain" },
{ "color": "yellow", "face": "brain" }
],
"brains": ["yellow", "green", "yellow"],
"shots": ["red", "yellow"],
"runners": ["green"]
}
This is the response in case the specified action was roll
. If the specified action was stop
, the rolled
would be ommited.
Just retrieve the state of the game.
{
"id": "PbDHs",
"nickname": "Rulio",
"vp": 0,
"score": 0,
"rounds": 0,
"rolled": [
{ "color": "yellow", "face": "shot" },
{ "color": "green", "face": "brain" },
{ "color": "yellow", "face": "brain" }
],
"brains": ["yellow", "green", "yellow"],
"shots": ["red", "yellow"],
"runners": ["green"]
}
Get the global ranking.
The player with more vp
(victory points) to rounds
ratio is always first.
[
{
"position": 1,
"nickname": "Rulio",
"vp": 23,
"rounds": 35
},
{
"position": 2,
"nickname": "Emilio",
"vp": 23,
"rounds": 40
},
{
"position": 3,
"nickname": "Emilio",
"vp": 4,
"rounds": 8
},
]