1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00
vcmi/config/schemas/template.json

210 lines
5.4 KiB
JSON
Raw Normal View History

{
2023-05-19 20:14:01 +02:00
"type" : "object",
"$schema" : "http://json-schema.org/draft-04/schema",
"title" : "VCMI random map template format",
"description" : "Format used to define random map templates in VCMI",
"definitions" :
{
2023-05-19 20:14:01 +02:00
"zone" : {
"type" : "object",
"required" : ["type", "monsters", "size"],
2023-09-17 23:30:42 +02:00
"additionalProperties" : false,
2023-05-19 20:14:01 +02:00
"properties" : {
2023-09-17 23:30:42 +02:00
"type" : {
"type" : "string",
2024-11-23 13:19:25 +02:00
"enum" : ["playerStart", "cpuStart", "treasure", "junction", "sealed"]
2023-09-17 23:30:42 +02:00
},
"size" : { "type" : "number", "minimum" : 1 },
"owner" : {},
"playerTowns" : {"$ref" : "#/definitions/towns"},
"neutralTowns" : {"$ref" : "#/definitions/towns"},
"matchTerrainToTown" : { "type" : "boolean"},
"minesLikeZone" : { "type" : "number" },
"terrainTypeLikeZone" : { "type" : "number" },
"treasureLikeZone" : { "type" : "number" },
"customObjectsLikeZone" : { "type" : "number" },
2023-09-17 23:30:42 +02:00
"terrainTypes": {"$ref" : "#/definitions/stringArray"},
"bannedTerrains": {"$ref" : "#/definitions/stringArray"},
"townsAreSameType" : { "type" : "boolean"},
"allowedMonsters" : {"$ref" : "#/definitions/stringArray"},
"bannedMonsters" : {"$ref" : "#/definitions/stringArray"},
"allowedTowns" : {"$ref" : "#/definitions/stringArray"},
"bannedTowns" : {"$ref" : "#/definitions/stringArray"},
"monsters" : {
"type" : "string",
"enum" : ["weak", "normal", "strong", "none"]
},
2023-05-19 20:14:01 +02:00
"mines" : {"$ref" : "#/definitions/mines"},
"treasure" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"min" : {"type" : "number", "minimum" : 0},
"max" : {"type" : "number", "minimum" : 0},
"density" : {"type" : "number", "minimum" : 1}
2023-09-17 23:30:42 +02:00
},
"additionalProperties" : false
}
},
"customObjects" : {
2024-09-21 13:52:25 +02:00
"type" : "object",
"properties": {
"bannedCategories": {
"type": "array",
"items": {
"type": "string",
"enum": ["all", "dwelling", "creatureBank", "randomArtifact", "bonus", "resource", "resourceGenerator", "spellScroll", "pandorasBox", "questArtifact", "seerHut"]
}
},
"bannedObjects": {
"type": "array",
"items": {
"type": "string"
}
},
"commonObjects": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"rmg": {
"type": "object",
"properties": {
"value": {
"type": "integer"
},
"rarity": {
"type": "integer"
},
"zoneLimit": {
"type": "integer"
}
},
"required": ["value", "rarity"]
}
},
"required": ["id", "rmg"]
}
}
}
2023-09-17 23:30:42 +02:00
}
}
},
2023-09-17 23:30:42 +02:00
"towns" : {
"type" : "object",
"additionalProperties" : false,
2023-09-17 23:30:42 +02:00
"properties" : {
"towns" : { "type" : "number" },
"castles" : { "type" : "number" },
"townDensity" : { "type" : "number" },
"castleDensity" : { "type" : "number" }
}
},
"stringArray" : {
"type" : "array",
"items" : { "type" : "string" }
},
2023-09-17 23:30:42 +02:00
"mines" : {
"type" : "object",
"additionalProperties" : false,
"properties" : {
"gold" : { "type" : "number"},
"wood" : { "type" : "number"},
"ore" : { "type" : "number"},
"mercury" : { "type" : "number"},
"sulfur" : { "type" : "number"},
"crystal" : { "type" : "number"},
"gems" : { "type" : "number"}
}
},
2023-05-19 20:14:01 +02:00
"connection" :
2015-06-02 15:26:33 +02:00
{
2023-07-06 17:39:09 +02:00
"required" : ["a", "b"],
"additionalProperties" : true,
2023-05-19 20:14:01 +02:00
"properties" : {
"a" : {
2015-06-02 15:26:33 +02:00
"type" : "string"
},
2023-05-19 20:14:01 +02:00
"b" : {
2015-06-02 15:26:33 +02:00
"type" : "string"
},
2023-05-19 20:14:01 +02:00
"guard" :
2015-06-02 15:26:33 +02:00
{
2023-05-19 20:14:01 +02:00
"type" : "number",
2015-06-02 15:26:33 +02:00
"minimum" : 0
2023-07-06 17:39:09 +02:00
},
"type":
{
"type" : "string",
2024-07-29 20:36:23 +02:00
"enum" : ["wide", "fictive", "repulsive", "forcePortal"]
2015-06-02 15:26:33 +02:00
}
}
},
2023-05-19 20:14:01 +02:00
"waterContent" :
{
2023-05-19 20:14:01 +02:00
"enum" : ["none", "normal", "islands"],
"type" : "string"
2015-06-02 15:26:33 +02:00
}
},
2023-09-17 23:30:42 +02:00
"additionalProperties" : false,
2023-05-19 20:14:01 +02:00
"properties" :
{
2023-09-17 23:30:42 +02:00
"required" : ["zones", "connections", "minSize", "maxSize", "players"],
"players" : {
2023-09-18 14:36:35 +02:00
"description" : "Number of players that will be present on map (human or AI)",
2023-09-17 23:30:42 +02:00
"type": "string"
},
"humans" : {
2023-09-18 14:36:35 +02:00
"description" : "Optional, number of AI-only players",
2023-09-17 23:30:42 +02:00
"type": "string"
},
"minSize" : {
2023-09-18 14:36:35 +02:00
"description" : "Minimal size of the map, e.g. 'm+u' or '120x120x1",
2023-09-17 23:30:42 +02:00
"type": "string"
},
"maxSize" : {
2023-09-18 14:36:35 +02:00
"description" : "Maximal size of the map, e.g. 'm+u' or '120x120x1",
2023-09-17 23:30:42 +02:00
"type": "string"
},
"settings" : {
"description" : "List of changed game settings by template",
"type" : "object",
"$ref" : "gameSettings.json"
},
2023-09-18 14:36:35 +02:00
"name" : {
"description" : "Optional name - useful to have several template variations with same name",
2023-07-06 17:39:09 +02:00
"type": "string"
},
"description" : {
"description" : "Optional info about template, author or special rules",
"type": "string"
},
2023-05-19 20:14:01 +02:00
"zones" : {
2023-09-18 14:36:35 +02:00
"description" : "List of named zones",
2023-05-19 20:14:01 +02:00
"type" : "object",
2023-09-17 23:30:42 +02:00
"additionalProperties" : {"$ref" : "#/definitions/zone" }
},
2023-05-19 20:14:01 +02:00
"connections" : {
2023-09-18 14:36:35 +02:00
"description" : "List of connections between zones",
2023-05-19 20:14:01 +02:00
"type" : "array",
"items" : {"$ref" : "#/definitions/connection"}
},
2023-05-19 20:14:01 +02:00
"allowedWaterContent" : {
2023-09-18 14:36:35 +02:00
"description" : "Optional parameter allowing to prohibit some water modes. All modes are allowed if parameter is not specified",
2023-05-19 20:14:01 +02:00
"type" : "array",
"items" : {"$ref" : "#/definitions/waterContent"}
}
}
}