RemoveCoins
Referee: take coins out of a member's purse, the inverse of GrantCoins.
Full documentation: RemoveCoins. Wire type: remove_coins.
Legal session modes: battle, encounter, exploring, game_over, town, victory
JSON Schema
{
"$defs": {
"Coins": {
"description": "A fixed pile of coins, like generated treasure, the contents of a chest, or a pile dropped on the floor.\n\nFrozen, unlike the `CoinPurse` a character carries.\n`generate_treasure` returns its coins in this\nform, and a dungeon feature contains its coins this way until someone picks them up. To\ngive the coins to a character, add each denomination to their purse.",
"properties": {
"pp": {
"default": 0,
"minimum": 0,
"title": "Pp",
"type": "integer",
"description": "Platinum pieces, worth 5 gp each."
},
"gp": {
"default": 0,
"minimum": 0,
"title": "Gp",
"type": "integer",
"description": "Gold pieces."
},
"ep": {
"default": 0,
"minimum": 0,
"title": "Ep",
"type": "integer",
"description": "Electrum pieces, worth half a gold piece each."
},
"sp": {
"default": 0,
"minimum": 0,
"title": "Sp",
"type": "integer",
"description": "Silver pieces, ten to the gold piece."
},
"cp": {
"default": 0,
"minimum": 0,
"title": "Cp",
"type": "integer",
"description": "Copper pieces, a hundred to the gold piece."
}
},
"title": "Coins",
"type": "object"
}
},
"description": "Referee: take coins out of a member's purse, the inverse of `GrantCoins`.\n\nUse it to charge a price or a toll. The session takes exactly the coins you name. It\ndoesn't make change between denominations, so a member who has gold but no silver can't\npay a toll in silver. Convert the price to coins the member has before you send the\ncommand. This command is legal in every mode, `game_over` and `victory` included. It makes no draws\nand takes no time.\n\nModes:\n `town`, `exploring`, `encounter`, `battle`, `game_over`, `victory`\n\nRejections:\n - `session.command.unknown_member` - `character_id` matches no party member.\n - `items.coins.insufficient` - the purse has fewer coins of some denomination than\n `coins` asks for.\n\nEvents:\n `ItemsRemovedEvent` with the coins' value.",
"properties": {
"command_type": {
"const": "remove_coins",
"default": "remove_coins",
"title": "Command Type",
"type": "string",
"description": "The name that identifies the command class in serialized data. Each command class fixes\nit to a distinct snake_case string, like `\"move_party\"` or `\"open_door\"`, and constructing\nthe class sets it, so you never pass it yourself.\n`parse_command` and the\n`AnyCommand` union use it to rebuild the right class\nfrom a serialized mapping. A class's value never changes between releases."
},
"source": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Source",
"description": "Who or what issued the command on whose behalf: an authored trigger or quest id, or the\nname of one of your game's systems. The engine never reads it, so a command with a\n`source` does exactly what the same command without one does. The session logs and\nreplays it with the command, so the log alone shows why something happened. Leave it\n`None` when there's nothing to record. An empty string fails validation when the command\nis constructed."
},
"character_id": {
"title": "Character Id",
"type": "string",
"description": "The member whose purse pays, by\n`MemberView.id`. A command you issue yourself has a\nmember id here, and the session refuses any other value with `session.command.unknown_member`.\nA consequence or a reward in an adventure document has a party selector instead,\n`\"@party\"` for every living member or `\"@first\"` for the first living member, because the\nsession assigns member ids when it starts. The trigger and quest interpreter replaces the selector\nwith member ids before it issues the command."
},
"coins": {
"$ref": "#/$defs/Coins",
"description": "The coins to take, by denomination. The purse must have at least this many coins of each\ndenomination."
}
},
"required": [
"character_id",
"coins"
],
"title": "RemoveCoins",
"type": "object"
}