1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
vcmi/config/schemas/template.json

159 lines
4.2 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",
"enum" : ["playerStart", "cpuStart", "treasure", "junction"]
},
"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" },
"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
}
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",
"enum" : ["wide", "fictive", "repulsive"]
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"
},
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"}
}
}
}