magicciv/public/resources/items/items.schema.json
2026-04-07 17:52:04 -07:00

143 lines
5.5 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "items_item",
"title": "Item",
"description": "A craftable or lootable item that can be equipped on a unit squad. Inherits from base.",
"allOf": [
{ "$ref": "../base.schema.json" },
{
"type": "object",
"required": ["category", "tier", "charge_mode", "source"],
"properties": {
"category": {
"type": "string",
"enum": ["weapon", "armor", "consumable", "tool"],
"description": "Top-level item category. Mirrors keys in item_categories.json."
},
"tier": {
"type": "integer",
"minimum": 1,
"maximum": 10,
"description": "Universal T1-T10 tier. Drives the dominant balance dimension and the producer-building tier requirement."
},
"charge_mode": {
"type": "string",
"enum": ["permanent", "combat", "use"],
"description": "permanent = persists until unit death; combat = consumed once per battle then refreshed; use = consumed when spent."
},
"charges": {
"type": "integer",
"minimum": 1,
"description": "Number of charges for combat or use modes. Omit for permanent."
},
"source": {
"type": "string",
"enum": ["crafted", "apex_relic"],
"description": "crafted = produced via a building production queue (Track A). apex_relic = unique drop from a named apex creature (Track B)."
},
"stats": {
"type": "array",
"description": "At most three stat lines. Hard cap, not a soft suggestion. Each entry is a single bonus or modifier the unit gains while equipped.",
"maxItems": 3,
"items": {
"type": "object",
"required": ["key", "value"],
"properties": {
"key": {
"type": "string",
"description": "Bonus key consumed by unit.gd._get_item_stat() (e.g., melee_bonus, armor_bonus, str_bonus, morale_bonus, movement_bonus)."
},
"value": { "type": "number" },
"condition": {
"type": "string",
"description": "Optional condition string (e.g., 'vs_unarmored', 'in_cold_terrain'). Free text consumed by combat resolver."
},
"label": {
"type": "string",
"description": "Display label for the unit panel."
}
}
}
},
"production": {
"type": "object",
"description": "Crafting metadata. Required when source=crafted.",
"required": ["building", "hammer_cost"],
"properties": {
"building": {
"type": "string",
"description": "Producer building ID. The item slots into this building's per-building production queue."
},
"secondary_building": {
"type": "string",
"description": "Optional co-requisite building that must also be present in the same city. Used to express crafting interactions without a recipe sub-game."
},
"hammer_cost": {
"type": "integer",
"minimum": 1,
"description": "Production cost charged against the producing building's hammer throughput."
},
"materials": {
"type": "array",
"description": "Stockpile materials consumed when production starts.",
"items": {
"type": "object",
"required": ["resource", "amount"],
"properties": {
"resource": {
"type": "string",
"description": "Stockpile resource ID (deposit ID like 'iron_ore' or fauna part like 'direwolf_hide')."
},
"amount": { "type": "integer", "minimum": 1 }
}
}
},
"requires_tech": {
"type": "string",
"description": "Tech ID prerequisite. Same gating model as units."
}
}
},
"apex_drop": {
"type": "object",
"description": "Apex relic metadata. Required when source=apex_relic.",
"required": ["drops_from"],
"properties": {
"drops_from": {
"type": "string",
"description": "Fauna species ID of the named apex creature that drops this relic."
},
"drop_chance": {
"type": "number",
"minimum": 0,
"maximum": 1,
"default": 1.0,
"description": "Probability of drop on kill. Default 1.0 = guaranteed."
}
}
},
"equip_restriction": {
"type": "object",
"description": "Optional restriction on which unit squads may equip this item.",
"properties": {
"unit_tags": {
"type": "array",
"items": { "type": "string" },
"description": "Squad must carry at least one of these tags to equip."
},
"min_tier": {
"type": "integer",
"minimum": 1,
"maximum": 10,
"description": "Squad must be at least this tier to equip."
}
}
},
"sprite": {
"type": "string",
"description": "Sprite path (resolved through ThemeAssets)."
}
}
}
]
}