Files
magic-factorio/data/recipe-book.schema.json

145 lines
5.4 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://mana-foundry.local/schema/recipe-book.schema.json",
"title": "Mana Foundry Recipe Book",
"type": "object",
"required": ["schemaVersion", "metadata", "stages", "biomes", "machines", "items", "recipes"],
"properties": {
"schemaVersion": { "type": "integer", "const": 1 },
"metadata": {
"type": "object",
"required": ["title", "revision"],
"properties": {
"title": { "type": "string", "minLength": 1 },
"revision": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"updatedAt": { "type": "string" }
},
"additionalProperties": false
},
"stages": {
"type": "array",
"items": { "$ref": "#/$defs/stage" }
},
"biomes": {
"type": "array",
"items": { "$ref": "#/$defs/biome" }
},
"machines": {
"type": "array",
"items": { "$ref": "#/$defs/machine" }
},
"items": {
"type": "array",
"items": { "$ref": "#/$defs/item" }
},
"recipes": {
"type": "array",
"items": { "$ref": "#/$defs/recipe" }
}
},
"additionalProperties": false,
"$defs": {
"id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
"stage": {
"type": "object",
"required": ["id", "name", "order", "color"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"name": { "type": "string", "minLength": 1 },
"order": { "type": "integer", "minimum": 0 },
"color": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" }
},
"additionalProperties": false
},
"biome": {
"type": "object",
"required": ["id", "name", "color", "law"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"name": { "type": "string", "minLength": 1 },
"color": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
"law": { "type": "string" }
},
"additionalProperties": false
},
"machine": {
"type": "object",
"required": ["id", "name", "stage", "biome", "baseSpeed", "description"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"name": { "type": "string", "minLength": 1 },
"stage": { "$ref": "#/$defs/id" },
"biome": { "$ref": "#/$defs/id" },
"baseSpeed": { "type": "number", "exclusiveMinimum": 0 },
"description": { "type": "string" },
"tags": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }
},
"additionalProperties": false
},
"item": {
"type": "object",
"required": ["id", "name", "category", "stage", "biome", "mass", "stackSize", "isRaw", "tags", "notes"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"name": { "type": "string", "minLength": 1 },
"category": { "type": "string", "minLength": 1 },
"stage": { "$ref": "#/$defs/id" },
"biome": { "$ref": "#/$defs/id" },
"mass": { "type": "number", "exclusiveMinimum": 0 },
"stackSize": { "type": "integer", "minimum": 1 },
"isRaw": { "type": "boolean" },
"tags": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
"notes": { "type": "string" }
},
"additionalProperties": false
},
"ingredient": {
"type": "object",
"required": ["itemId", "amount", "mode"],
"properties": {
"itemId": { "$ref": "#/$defs/id" },
"amount": { "type": "number", "exclusiveMinimum": 0 },
"mode": { "enum": ["consumed", "catalyst", "fluid", "state"] }
},
"additionalProperties": false
},
"product": {
"type": "object",
"required": ["itemId", "amount"],
"properties": {
"itemId": { "$ref": "#/$defs/id" },
"amount": { "type": "number", "minimum": 0 },
"min": { "type": "number", "minimum": 0 },
"max": { "type": "number", "minimum": 0 },
"chance": { "type": "number", "minimum": 0, "maximum": 1 },
"weight": { "type": "number", "minimum": 0, "maximum": 100 }
},
"additionalProperties": false
},
"recipe": {
"type": "object",
"required": ["id", "name", "stage", "biome", "machineId", "kind", "duration", "unlockedBy", "inputs", "outputs", "manaPerSecond", "entropy", "conditions", "tags", "notes", "enabled"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"name": { "type": "string", "minLength": 1 },
"stage": { "$ref": "#/$defs/id" },
"biome": { "$ref": "#/$defs/id" },
"machineId": { "$ref": "#/$defs/id" },
"kind": { "enum": ["craft", "inscription", "growth", "decay", "state", "separation", "ritual", "result_bag", "recovery"] },
"duration": { "type": "number", "exclusiveMinimum": 0 },
"unlockedBy": { "type": "string" },
"inputs": { "type": "array", "items": { "$ref": "#/$defs/ingredient" } },
"outputs": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/product" } },
"manaPerSecond": { "type": "number", "minimum": 0 },
"entropy": { "type": "number", "minimum": 0 },
"conditions": { "type": "array", "items": { "type": "string" } },
"tags": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
"notes": { "type": "string" },
"enabled": { "type": "boolean" }
},
"additionalProperties": false
}
}
}