neon-sprawl/content/schemas/quest-objective-def.schema....

60 lines
1.9 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://neon-sprawl.local/schemas/quest-objective-def.json",
"title": "QuestObjectiveDef",
"description": "Single objective row on a QuestStepDef (content/quests/*_quests.json). Kinds cover gather, craft, encounter, and inventory checks for E7.M1 prototype Slice 1.",
"type": "object",
"additionalProperties": false,
"required": ["id", "kind"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$",
"description": "Immutable objective key for progress tracking and HTTP projection."
},
"kind": {
"type": "string",
"enum": ["gather_item", "craft_recipe", "encounter_complete", "inventory_has_item"],
"description": "Objective completion predicate evaluated server-side on success hooks."
},
"itemId": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$",
"description": "Frozen item catalog id (gather_item, inventory_has_item)."
},
"quantity": {
"type": "integer",
"minimum": 1,
"description": "Required count for gather_item, craft_recipe, or inventory_has_item."
},
"recipeId": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$",
"description": "Frozen recipe catalog id (craft_recipe)."
},
"encounterId": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$",
"description": "Frozen encounter catalog id (encounter_complete)."
}
},
"oneOf": [
{
"properties": { "kind": { "const": "gather_item" } },
"required": ["itemId", "quantity"]
},
{
"properties": { "kind": { "const": "craft_recipe" } },
"required": ["recipeId", "quantity"]
},
{
"properties": { "kind": { "const": "encounter_complete" } },
"required": ["encounterId"]
},
{
"properties": { "kind": { "const": "inventory_has_item" } },
"required": ["itemId", "quantity"]
}
]
}