CompleteQuest
Referee: complete an active quest, and the adventure when the quest concludes it.
Full documentation: CompleteQuest. Wire type: complete_quest.
Legal session modes: battle, encounter, exploring, game_over, town, victory
JSON Schema
{
"description": "Referee: complete an active quest, and the adventure when the quest concludes it.\n\nThe quest must be active, and that's the only check. The session doesn't check the\nquest's objectives or its completion rule, because ruling a quest done is the\nreferee's call. The trigger and quest interpreter checks the rule before it issues this\ncommand. The command accepts only the quest ids the adventure defines, as\n`ActivateQuest` describes, and the `ActivateQuest`\nexample shows a quest from start to finish.\n\nThis command grants no rewards. Whoever completes the quest issues the quest's rewards\nafterwards as separate commands, so a completion you send yourself grants nothing\nunless you send the rewards too, and every reward granted is in the log. When the\nquest's author wrote a `completion` text in its narrative, the completion adds that text\nto the journal, and the events include it. No\n`JournalEntryAddedEvent` follows.\n\nCompleting a quest whose spec sets `concludes_adventure` ends the adventure. The session\ncloses any open encounter and battle, and switches to `victory`. No other command enters\n`victory`. When the session has already ended, in `game_over` or `victory`, the quest\nstill completes and its text still goes in the journal, but the mode doesn't change and\nthe session emits no `AdventureCompletedEvent`. This command is legal in every mode,\n`game_over` and `victory` included.\n\nModes:\n `town`, `exploring`, `encounter`, `battle`, `game_over`, `victory`\n\nRejections:\n - `session.command.unknown_quest` - `quest_id` matches no quest of the\n adventure.\n - `session.command.quest_state` - the quest is inactive or already\n completed. The rejection includes the quest id and its current state.\n\nEvents:\n `QuestCompletedEvent` with the\n quest id, the quest's name, and the completion text. An\n `AdventureCompletedEvent`\n with the same text follows when the quest concludes the adventure and the\n session hadn't already ended.",
"properties": {
"command_type": {
"const": "complete_quest",
"default": "complete_quest",
"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."
},
"quest_id": {
"minLength": 1,
"title": "Quest Id",
"type": "string",
"description": "Which quest to complete, by\n`QuestSpec.id`. It has to be active, and that's the only\ncheck: whoever issues the command decides whether the objectives are done."
}
},
"required": [
"quest_id"
],
"title": "CompleteQuest",
"type": "object"
}