1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/config/schemas/townBuilding.json
Ivan Savenko 36c1ed670f Support for configurable town fortifications
Removed most of hardcoded checks for fort level or for presence of fort/
citadel/castle buildings.

It is now possible to define which parts of town fortifications are
provided by town buildings

Configuration for H3-like fortifications is provided in
buildingsLibrary.json and will be used automatically by mods as long as
mods have buidings named "fort", "citadel" and "castle".

Alternatively, mods can separately define:
- hitpoints of walls (shared value for all sections)
- hitpoints of central, upper and lower towers (separate values)
- presence of moat
- shooters for each tower (separate values)
2024-08-28 19:42:14 +00:00

131 lines
5.0 KiB
JSON

{
"type" : "object",
"additionalProperties" : false,
"$schema" : "http://json-schema.org/draft-04/schema",
"title" : "VCMI town building format",
"description" : "Format used to define town buildings in VCMI",
"definitions" :
{
"buildingRequirement" : {
"type" : "array",
"items" : [
{
"description" : "First item that indicates type of following expression",
"type" : "string"
}
],
"additionalItems" :
{
"description" : "Following items that contain expression elements",
"$ref" : "#/definitions/buildingRequirement"
}
}
},
"properties" : {
"id" : {
"type" : "number",
"description" : "Numeric identifier of this building"
},
"name" : {
"description" : "Localizable name of this building",
"type" : "string"
},
"description" : {
"description" : "Localizable description of this building",
"type" : "string"
},
"type" : {
"type" : "string",
"enum" : [ "mysticPond", "castleGate", "portalOfSummoning", "library", "escapeTunnel", "treasury", "bank" ],
"description" : "Subtype for some special buildings"
},
"mode" : {
"type" : "string",
"enum" : [ "normal", "auto", "special", "grail" ],
"description" : "Mode in which this building will be built"
},
"height" : {
"type" : "string",
"enum" : [ "skyship", "high", "average", "low"],
"description" : "Height for lookout towers and some grails"
},
"requires" : {
"$ref" : "#/definitions/buildingRequirement",
"description" : "List of town buildings that must be built before this one"
},
"upgrades" : {
"description" : "Optional, indicates that this building upgrades another base building",
"type" : "string"
},
"upgradeReplacesBonuses" : {
"description" : "If set to true, this building will replace all bonuses from base building, leaving only bonuses defined by this building",
"type" : "boolean"
},
"configuration" : {
"description" : "Optional, configuration of building that can be activated by visiting hero",
"$ref" : "rewardable.json"
},
"firtufications" : {
"type" : "object",
"additionalProperties" : false,
"description" : "Fortifications provided by this buildings, if any",
"properties" : {
"citadelShooter" : { "type" : "string", "description" : "Creature ID of shooter located in central keep (citadel). Used only if citadel is present." },
"upperTowerShooter" : { "type" : "string", "description" : "Creature ID of shooter located in upper tower. Used only if upper tower is present." },
"lowerTowerShooter" : { "type" : "string", "description" : "Creature ID of shooter located in lower tower. Used only if lower tower is present." },
"wallsHealth" : { "type" : "number", "description" : "Maximum health of destructible walls. Walls are only present if their health is above zero" },
"citadelHealth" : { "type" : "number", "description" : "Maximum health of central tower or 0 if not present. Requires walls presence." },
"upperTowerHealth" : { "type" : "number", "description" : "Maximum health of upper tower or 0 if not present. Requires walls presence." },
"lowerTowerHealth" : { "type" : "number", "description" : "Maximum health of lower tower or 0 if not present. Requires walls presence." },
"hasMoat" : { "type" : "boolean","description" : "If set to true, moat will be placed in front of the walls. Requires walls presence." }
}
},
"cost" : {
"type" : "object",
"additionalProperties" : false,
"description" : "Resources needed to build building",
"properties" : {
"gold" : { "type" : "number"},
"wood" : { "type" : "number"},
"ore" : { "type" : "number"},
"mercury" : { "type" : "number"},
"sulfur" : { "type" : "number"},
"crystal" : { "type" : "number"},
"gems" : { "type" : "number"}
}
},
"produce" : {
"type" : "object",
"additionalProperties" : false,
"description" : "Resources produced each day by this building",
"properties" : {
"gold" : { "type" : "number"},
"wood" : { "type" : "number"},
"ore" : { "type" : "number"},
"mercury" : { "type" : "number"},
"sulfur" : { "type" : "number"},
"crystal" : { "type" : "number"},
"gems" : { "type" : "number"}
}
},
"warMachine" : {
"type" : "string",
"description" : "Artifact ID of a war machine that can be purchased in this building, if any"
},
"bonuses" : {
"type" : "array",
"description" : "Bonuses that are provided by this building in any town where this building has been built. Only affects town itself (including siege), to propagate effect to player or team please use bonus propagators",
"items" : { "$ref" : "bonus.json" }
},
"marketModes" : {
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "resource-resource", "resource-player", "creature-resource", "resource-artifact", "artifact-resource", "artifact-experience", "creature-experience", "creature-undead", "resource-skill"],
},
"description" : "List of modes available in this market"
}
}
}