diff --git a/config/schemas/artifact.json b/config/schemas/artifact.json index 691a05b88..bf0076111 100644 --- a/config/schemas/artifact.json +++ b/config/schemas/artifact.json @@ -1,10 +1,9 @@ { - "type":"object", - "$schema": "http://json-schema.org/draft-04/schema", + "type" : "object", + "$schema" : "http://json-schema.org/draft-04/schema", "title" : "VCMI artifact format", "description" : "Format used to define new artifacts in VCMI", - "required" : [ "class", "text", "type", "value" ], - + "required" : [ "type", "class", "value", "text" ], "definitions" : { "growingBonusList" : { "type" : "array", @@ -20,51 +19,53 @@ } } }, - "additionalProperties" : false, - "properties":{ - "bonuses": { - "type":"array", - "description": "Bonuses provided by this artifact using bonus system", - "items": { "$ref" : "bonus.json" } + "properties" : { + "warMachine" : + { + "type" : "string", + "description" : "Creature id to use on battle field. If set, this artifact is war machine" }, - "class": { - "type":"string", - "enum" : [ "SPECIAL", "TREASURE", "MINOR", "MAJOR", "RELIC" ], - "description": "Artifact class, treasure, minor, major or relic" - }, - "index" : { - "type" : "number", - "description" : "Private field to break things, do not use." - }, - "components": { - "type":"array", - "description": "Optional, list of components for combinational artifacts", - "items": { "type":"string" } - }, - "graphics": { - "type":"object", - "additionalProperties" : false, - "description": "Graphical files associated with the artifact", - "required" : [ "image", "map" ], - "properties":{ - "image": { - "type":"string", - "description": "Base image for this artifact, used for example in hero screen", - "format" : "imageFile" - }, - "large": { - "type":"string", - "description": "Large image, used for drag-and-drop and popup messages", - "format" : "imageFile" - }, - "map": { - "type":"string", - "description": ".def file for adventure map", - "format" : "defFile" - } + "type" : { + "type" : "array", + "description" : "Type of this artifact - creature, hero or commander", + "items" : { + "type" : "string", + "enum" : [ "HERO", "CREATURE", "COMMANDER" ] } }, + "slot" : { + "description" : "Slot to which this artifact can be put, if applicable", + "oneOf" : [ + { + "type" : "string" + }, + { + "type" : "array", + "minItems" : 1, + "additionalItems" : { "type" : "string" } + } + ] + }, + "class" : { + "type" : "string", + "enum" : [ "SPECIAL", "TREASURE", "MINOR", "MAJOR", "RELIC" ], + "description" : "Artifact class, treasure, minor, major or relic" + }, + "value" : { + "type" : "number", + "description" : "Cost of this artifact, in gold" + }, + "components" : { + "type" : "array", + "description" : "Optional, list of components for combinational artifacts", + "items" : { "type" : "string" } + }, + "bonuses" : { + "type" : "array", + "description" : "Bonuses provided by this artifact using bonus system", + "items" : { "$ref" : "bonus.json" } + }, "growing" : { "type" : "object", "additionalProperties" : false, @@ -73,56 +74,52 @@ "thresholdBonuses" : { "$ref" : "#/definitions/growingBonusList"} } }, - "slot": { - "description": "Slot to which this artifact can be put, if applicable", - "oneOf" : [ - { - "type":"string" - }, - { - "type" : "array", - "minItems" : 1, - "additionalItems" : { "type" : "string" } - } - ] - }, - "text": { - "type":"object", + "graphics" : { + "type" : "object", "additionalProperties" : false, - "description": "Texts associated with artifact", - "required" : [ "description", "event", "name" ], - "properties":{ - "description": { - "type":"string", - "description": "Long description of this artifact" + "description" : "Graphical files associated with the artifact", + "required" : [ "image", "map" ], + "properties" : { + "image" : { + "type" : "string", + "description" : "Base image for this artifact, used for example in hero screen", + "format" : "imageFile" }, - "event": { - "type":"string", - "description": "Text that visible on picking this artifact on map" + "large" : { + "type" : "string", + "description" : "Large image, used for drag-and-drop and popup messages", + "format" : "imageFile" }, - "name": { - "type":"string", - "description": "Name of the artifact" + "map" : { + "type" : "string", + "description" : ".def file for adventure map", + "format" : "defFile" } } }, - "type": { - "type":"array", - "description": "Type of this artifact - creature, hero or commander", - "items": { - "type":"string", - "enum" : [ "HERO", "CREATURE", "COMMANDER" ] + "text" : { + "type" : "object", + "additionalProperties" : false, + "description" : "Texts associated with artifact", + "required" : [ "description", "event", "name" ], + "properties" : { + "name" : { + "type" : "string", + "description" : "Name of the artifact" + }, + "description" : { + "type" : "string", + "description" : "Long description of this artifact" + }, + "event" : { + "type" : "string", + "description" : "Text that visible on picking this artifact on map" + } } }, - "value": { - "type":"number", - "description": "Cost of this artifact, in gold" - }, - "warMachine": - { - "type":"string", - "description": "Creature id to use on battle field. If set, this artifact is war machine" + "index" : { + "type" : "number", + "description" : "Private field to break things, do not use." } - } } diff --git a/config/schemas/battlefield.json b/config/schemas/battlefield.json index 7a1751b64..da9532931 100644 --- a/config/schemas/battlefield.json +++ b/config/schemas/battlefield.json @@ -1,35 +1,34 @@ { - "type":"object", - "$schema": "http://json-schema.org/draft-04/schema", + "type" : "object", + "$schema" : "http://json-schema.org/draft-04/schema", "title" : "VCMI battlefield format", "description" : "Format used to define new battlefields in VCMI", "required" : [ "graphics" ], "additionalProperties" : false, - "properties":{ - "bonuses": { - "type":"array", - "description": "Bonuses provided by this battleground using bonus system", - "items": { "$ref" : "bonus.json" } + "properties" : { + "name" : { + "type" : "string", + "description" : "Name of the battleground" }, - "name": { - "type":"string", - "description": "Name of the battleground" + "isSpecial" : { + "type" : "boolean", + "description" : "Shows if this battleground has own obstacles" }, "graphics": { "type":"string", "format" : "imageFile", "description": "BMP battleground resource" }, - "isSpecial": { - "type":"boolean", - "description": "Shows if this battleground has own obstacles" + "graphics" : { + "type" : "string", + "description" : "BMP battleground resource" }, - "impassableHexes": { - "type":"array", - "description": "Battle hexes always impassable for this type of battlefield (ship to ship for instance)", - "items": { - "type":"number" + "impassableHexes" : { + "type" : "array", + "description" : "Battle hexes always impassable for this type of battlefield (ship to ship for instance)", + "items" : { + "type" : "number" } } } diff --git a/config/schemas/bonus.json b/config/schemas/bonus.json index 4e297b568..22dcd6ef3 100644 --- a/config/schemas/bonus.json +++ b/config/schemas/bonus.json @@ -41,40 +41,28 @@ "additionalProperties" : false, "properties":{ - "addInfo": { + "type": { + "type":"string", + "description": "type" + }, + "subtype": { "anyOf" : [ { "type" : "string" }, - { "type" : "number" }, - { - "type" : "array", - "items" : { - "anyof" : [ - { "type" : "string" }, - { "type" : "number" } - ] - } - } + { "type" : "number" } ], - "description": "addInfo" + "description": "subtype" }, - "description": { + "sourceID": { + "type":"number", + "description": "sourceID" + }, + "sourceType": { "type":"string", - "description": "description" + "description": "sourceType" }, - "duration": { - "anyOf" : [ - { "type": "string"}, - { "type": "array", "items": {"type": "string"} } - ], - "description": "duration" - }, - "effectRange": { + "targetSourceType": { "type":"string", - "description": "effectRange" - }, - "limiters" : { - "$ref" : "#/definitions/nestedLimiter", - "description" : "limiter" + "description": "targetSourceType" }, "propagator": { "description": "propagator", @@ -139,36 +127,13 @@ } ] }, - "sourceID": { - "type":"number", - "description": "sourceID" + "limiters" : { + "$ref" : "#/definitions/nestedLimiter", + "description" : "limiter" }, - "sourceType": { + "effectRange": { "type":"string", - "description": "sourceType" - }, - "targetSourceType": { - "type":"string", - "description": "targetSourceType" - }, - "stacking" : { - "type" : "string", - "description" : "stacking" - }, - "subtype": { - "anyOf" : [ - { "type" : "string" }, - { "type" : "number" } - ], - "description": "subtype" - }, - "turns": { - "type":"number", - "description": "turns" - }, - "type": { - "type":"string", - "description": "type" + "description": "effectRange" }, "val": { "type":"number", @@ -177,6 +142,41 @@ "valueType": { "type":"string", "description": "valueType" + }, + "addInfo": { + "anyOf" : [ + { "type" : "string" }, + { "type" : "number" }, + { + "type" : "array", + "items" : { + "anyof" : [ + { "type" : "string" }, + { "type" : "number" } + ] + } + } + ], + "description": "addInfo" + }, + "duration": { + "anyOf" : [ + { "type": "string"}, + { "type": "array", "items": {"type": "string"} } + ], + "description": "duration" + }, + "turns": { + "type":"number", + "description": "turns" + }, + "stacking" : { + "type" : "string", + "description" : "stacking" + }, + "description": { + "type":"string", + "description": "description" } } } diff --git a/config/schemas/creature.json b/config/schemas/creature.json index f23bc333c..624043dc8 100644 --- a/config/schemas/creature.json +++ b/config/schemas/creature.json @@ -1,8 +1,8 @@ { - "type":"object", - "$schema": "http://json-schema.org/draft-04/schema", + "type" : "object", + "$schema" : "http://json-schema.org/draft-04/schema", "title" : "VCMI creature format", - "description": "Json format for defining new creatures in VCMI", + "description" : "Json format for defining new creatures in VCMI", "required" : [ "faction" ], "anyOf" : [ { @@ -10,35 +10,291 @@ }, { "required" : [ - "name", "cost", "level", "fightValue", "aiValue", - "attack", "defense", "hitPoints", "speed", "damage", "advMapAmount", - "graphics", "sound" + "name", "level", "cost", "speed", "hitPoints", "attack", "defense", "damage", + "fightValue", "aiValue", "advMapAmount", "graphics", "sound" ] } ], - "additionalProperties" : false, - "properties":{ - "name": { - "type":"object", + "properties" : { + "special" : { + "type" : "boolean", + "description" : "Marks this object as special and not available by default" + }, + "disabled" : { + "type" : "boolean", + "description" : "Object is competely disabled and may not be even loaded in-game" + }, + "name" : { + "type" : "object", "additionalProperties" : false, - "description": "Translatable names for this creature", + "description" : "Translatable names for this creature", "required" : [ "singular", "plural" ], - "properties":{ - "singular": { - "type":"string", - "description": "Singular version" + "properties" : { + "singular" : { + "type" : "string", + "description" : "Singular version" }, - "plural": { - "type":"string", - "description": "Plural version" + "plural" : { + "type" : "string", + "description" : "Plural version" } } }, + "faction" : { + "type" : "string", + "description" : "Faction this creature belongs to. Examples: castle, rampart" + }, + "level" : { "type" : "number"}, + "upgrades" : { + "type" : "array", + "description" : "List of creatures to which this one can be upgraded", + "items" : { "type" : "string" } + }, + "cost" : { + "type" : "object", + "additionalProperties" : false, + "description" : "Cost to recruit this creature", + "properties" : { + "gold" : { "type" : "number"}, + "wood" : { "type" : "number"}, + "ore" : { "type" : "number"}, + "mercury" : { "type" : "number"}, + "sulfur" : { "type" : "number"}, + "crystal" : { "type" : "number"}, + "gems" : { "type" : "number"}, + + } + }, + "speed" : { "type" : "number" }, + "hitPoints" : { "type" : "number" }, + "attack" : { "type" : "number" }, + "defense" : { "type" : "number" }, + "damage" : { + "type" : "object", + "additionalProperties" : false, + "properties" : { + "max" : { "type" : "number" }, + "min" : { "type" : "number" } + } + }, + "shots" : { "type" : "number" }, + "spellPoints" : { + "type" : "number", + "description" : "Spell points this creature has (usually equal to number of casts)" + }, + "doubleWide" : { + "type" : "boolean", + "description" : "If set, creature will be two tiles wide on battlefield" + }, + "fightValue" : { + "type" : "number", + "description" : " \"value\" of creature, used to determine for example army strength" + }, + "aiValue" : { + "type" : "number", + "description" : "Describes how valuable this creature is to AI. Usually similar to fightValue" + }, + "growth" : { + "type" : "number", + "description" : "Basic growth of this creature in town or in external dwellings" + }, + "horde" : { + "type" : "number", + "description" : "Bonus growth of this creature from built horde" + }, + "advMapAmount" : { + "type" : "object", + "additionalProperties" : false, + "description" : "Initial size of random stacks on adventure map", + "properties" : { + "min" : { "type" : "number" }, + "max" : { "type" : "number" } + } + }, + "hasDoubleWeek" : { + "type" : "boolean", + "description" : "creature may receive \"week of\" events" + }, + "abilities" : { + "description" : "Creature abilities described using Bonus system", + "type" : "object", + "additionalProperties" : { + "$ref" : "bonus.json" + } + }, "abilityText" : { "type" : "string", "description" : "Text version of creature abilities. Used only with original creature window" }, + "graphics" : { + "type" : "object", + "additionalProperties" : false, + "description" : "Describes how this creature looks like during battles", + "required" : [ + "animation", "animationTime", "timeBetweenFidgets" + ], + "properties" : { + "animation" : { + "type" : "string", + "description" : ".def file with animation of this creature in battles", + "format" : "defFile" + }, + "map" : { + "type" : "string", + "description" : ".def file with animation of this creature on adventure map", + "format" : "defFile" + }, + "iconLarge" : { + "type" : "string", + "description" : "Large icon for this creature, used for example in town screen", + "format" : "imageFile" + }, + "iconSmall" : { + "type" : "string", + "description" : "Small icon for this creature, used for example in exchange screen", + "format" : "imageFile" + }, + "animationTime" : { + "type" : "object", + "additionalProperties" : false, + "required" : [ "attack", "walk", "idle" ], + "description" : "Length of several animations", + "properties" : { + "attack" : { + "type" : "number", + "description" : "attack" + }, + "idle" : { + "type" : "number", + "description" : "idle" + }, + "walk" : { + "type" : "number", + "description" : "walk" + } + } + }, + "missile" : { + "type" : "object", + "additionalProperties" : false, + "required" : [ "frameAngles", "offset", "attackClimaxFrame" ], + "description" : "Missile description for archers", + "properties" : { + "projectile" : { + "type" : "string", + "description" : "Path to projectile animation", + "format" : "defFile" + }, + "ray" : { + "type" : "array", + "description" : "Colors of ray projectile animation", + "minItems" : 1, + "items" : { + "type" : "object", + "required" : [ "start", "end" ], + "properties" : { + "start" : { + "type" : "array", + "minItems" : 4, + "maxItems" : 4, + "items" : { + "minimum" : 0, + "maximum" : 255, + "type" : "number" + } + }, + "end" : { + "type" : "array", + "minItems" : 4, + "maxItems" : 4, + "items" : { + "minimum" : 0, + "maximum" : 255, + "type" : "number" + } + } + } + } + }, + "frameAngles" : { + "type" : "array", + "description" : "Angles of missile images, should go from 90 to -90", + "minItems" : 1, + "items" : { + "minimum" : -90, + "maximum" : 90, + "type" : "number" + } + }, + "offset" : { + "type" : "object", + "additionalProperties" : false, + "required" : [ "lowerX", "lowerY", "middleX", "middleY", "upperX", "upperY" ], + "description" : "Position where projectile image appears during shooting in specific direction", + "properties" : { + "lowerX" : { "type" : "number" }, + "lowerY" : { "type" : "number" }, + "middleX" : { "type" : "number" }, + "middleY" : { "type" : "number" }, + "upperX" : { "type" : "number" }, + "upperY" : { "type" : "number" } + } + }, + "attackClimaxFrame" : { + "type" : "number", + "description" : "Frame from attack animation during which creature deals damage" + } + } + }, + "timeBetweenFidgets" : { + "type" : "number", + "description" : "How often creature will play idling animation" + }, + "troopCountLocationOffset" : { + "type" : "number", + "description" : "Position of troop count label?" + } + } + }, + "sound" : { + "type" : "object", + "additionalProperties" : false, + "description" : "Various sound files associated with this creature", + "properties" : { + "attack" : { "type" : "string", "format" : "soundFile" }, + "defend" : { "type" : "string", "format" : "soundFile" }, + "killed" : { "type" : "string", "format" : "soundFile" }, + "startMoving" : { "type" : "string", "format" : "soundFile" }, + "endMoving" : { "type" : "string", "format" : "soundFile" }, + "move" : { "type" : "string", "format" : "soundFile" }, + "shoot" : { "type" : "string", "format" : "soundFile" }, + "wince" : { "type" : "string", "format" : "soundFile" } + } + }, + "stackExperience" : { + "type" : "array", + "description" : "Stack experience, using bonus system", + "items" : { + "type" : "object", + "additionalProperties" : false, + "required" : [ "bonus", "values" ], + "description" : "0", + "properties" : { + "bonus" : {"$ref" : "bonus.json" }, + "values" : { + "type" : "array", + "minItems" : 10, + "maxItems" : 10, + "description" : "Strength of the bonus", + "anyOf" : [ + { "items" : { "type" : "number" } }, + { "items" : { "type" : "boolean" } } + ] + } + } + } + }, "index" : { "type" : "number", "description" : "Private field to break things, do not use." @@ -47,265 +303,6 @@ "type" : "array", "items" : { "type" : "string" }, "description" : "Private field to break things, do not use." - }, - "faction": { - "type":"string", - "description": "Faction this creature belongs to. Examples: castle, rampart" - }, - "cost": { - "type":"object", - "additionalProperties" : false, - "description": "Cost to recruit this creature", - "properties":{ - "wood": { "type":"number"}, - "mercury": { "type":"number"}, - "ore": { "type":"number"}, - "sulfur": { "type":"number"}, - "crystal": { "type":"number"}, - "gems": { "type":"number"}, - "gold": { "type":"number"} - } - }, - "special": { - "type":"boolean", - "description": "Marks this object as special and not available by default" - }, - "disabled": { - "type":"boolean", - "description": "Object is competely disabled and may not be even loaded in-game" - }, - "level": { "type":"number"}, - "fightValue": { - "type":"number", - "description": " \"value\" of creature, used to determine for example army strength" - }, - "aiValue": { - "type":"number", - "description": "Describes how valuable this creature is to AI. Usually similar to fightValue" - }, - "growth": { - "type":"number", - "description": "Basic growth of this creature in town or in external dwellings" - }, - "horde": { - "type":"number", - "description": "Bonus growth of this creature from built horde" - }, - "attack": { "type":"number" }, - "defense": { "type":"number" }, - "hitPoints": { "type":"number" }, - "speed": { "type":"number" }, - "shots": { "type":"number" }, - - "damage": { - "type":"object", - "additionalProperties" : false, - "properties":{ - "max": { "type":"number" }, - "min": { "type":"number" } - } - }, - "spellPoints": { - "type":"number", - "description": "Spell points this creature has (usually equal to number of casts)" - }, - "advMapAmount": { - "type":"object", - "additionalProperties" : false, - "description" : "Initial size of random stacks on adventure map", - "properties":{ - "min": { "type":"number" }, - "max": { "type":"number" } - } - }, - "upgrades": { - "type":"array", - "description": "List of creatures to which this one can be upgraded", - "items": { "type":"string" } - }, - "doubleWide": { - "type":"boolean", - "description": "If set, creature will be two tiles wide on battlefield" - }, - "hasDoubleWeek": { - "type":"boolean", - "description": "creature may receive \"week of\" events" - }, - "abilities": { - "description": "Creature abilities described using Bonus system", - "type":"object", - "additionalProperties": { - "$ref" : "bonus.json" - } - }, - "stackExperience": { - "type":"array", - "description": "Stack experience, using bonus system", - "items":{ - "type":"object", - "additionalProperties" : false, - "required" : [ "bonus", "values" ], - "description": "0", - "properties":{ - "bonus": {"$ref" : "bonus.json" }, - "values": { - "type":"array", - "minItems" : 10, - "maxItems" : 10, - "description": "Strength of the bonus", - "anyOf" : [ - { "items": { "type" : "number" } }, - { "items": { "type" : "boolean" } } - ] - } - } - } - }, - "graphics": { - "type":"object", - "additionalProperties" : false, - "description": "Describes how this creature looks like during battles", - "required" : [ - "animationTime", "animation", "timeBetweenFidgets" - ], - "properties":{ - "animationTime": { - "type":"object", - "additionalProperties" : false, - "required" : [ "attack", "walk", "idle" ], - "description": "Length of several animations", - "properties":{ - "attack": { - "type":"number", - "description": "attack" - }, - "idle": { - "type":"number", - "description": "idle" - }, - "walk": { - "type":"number", - "description": "walk" - } - } - }, - "iconLarge": { - "type":"string", - "description": "Large icon for this creature, used for example in town screen", - "format" : "imageFile" - }, - "iconSmall": { - "type":"string", - "description": "Small icon for this creature, used for example in exchange screen", - "format" : "imageFile" - }, - - "map": { - "type":"string", - "description": ".def file with animation of this creature on adventure map", - "format" : "defFile" - }, - "animation": { - "type":"string", - "description": ".def file with animation of this creature in battles", - "format" : "defFile" - }, - "missile": { - "type":"object", - "additionalProperties" : false, - "required" : [ "frameAngles", "offset", "attackClimaxFrame" ], - "description": "Missile description for archers", - "properties":{ - "projectile": { - "type":"string", - "description": "Path to projectile animation", - "format" : "defFile" - }, - "ray": { - "type":"array", - "description": "Colors of ray projectile animation", - "minItems" : 1, - "items": { - "type":"object", - "required" : [ "start", "end" ], - "properties":{ - "start": { - "type":"array", - "minItems" : 4, - "maxItems" : 4, - "items": { - "minimum" : 0, - "maximum" : 255, - "type":"number" - } - }, - "end": { - "type":"array", - "minItems" : 4, - "maxItems" : 4, - "items": { - "minimum" : 0, - "maximum" : 255, - "type":"number" - } - } - } - } - }, - "frameAngles": { - "type":"array", - "description": "Angles of missile images, should go from 90 to -90", - "minItems" : 1, - "items": { - "minimum" : -90, - "maximum" : 90, - "type":"number" - } - }, - "offset": { - "type":"object", - "additionalProperties" : false, - "required" : [ "lowerX", "lowerY", "middleX", "middleY", "upperX", "upperY" ], - "description": "Position where projectile image appears during shooting in specific direction", - "properties":{ - "lowerX": { "type":"number" }, - "lowerY": { "type":"number" }, - "middleX": { "type":"number" }, - "middleY": { "type":"number" }, - "upperX": { "type":"number" }, - "upperY": { "type":"number" } - } - }, - "attackClimaxFrame": { - "type":"number", - "description": "Frame from attack animation during which creature deals damage" - } - } - }, - "timeBetweenFidgets": { - "type":"number", - "description": "How often creature will play idling animation" - }, - "troopCountLocationOffset": { - "type":"number", - "description": "Position of troop count label?" - } - } - }, - "sound": { - "type":"object", - "additionalProperties" : false, - "description": "Various sound files associated with this creature", - "properties":{ - "attack": { "type":"string", "format" : "soundFile" }, - "defend": { "type":"string", "format" : "soundFile" }, - "killed": { "type":"string", "format" : "soundFile" }, - "startMoving": { "type":"string", "format" : "soundFile" }, - "endMoving": { "type":"string", "format" : "soundFile" }, - "move": { "type":"string", "format" : "soundFile" }, - "shoot": { "type":"string", "format" : "soundFile" }, - "wince": { "type":"string", "format" : "soundFile" } - } } } } diff --git a/config/schemas/faction.json b/config/schemas/faction.json index 4f21c1652..82305e99b 100644 --- a/config/schemas/faction.json +++ b/config/schemas/faction.json @@ -31,7 +31,7 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI faction format", "description": "Json format for defining new faction (aka towns) in VCMI", - "required" : [ "name", "alignment", "creatureBackground", "nativeTerrain" ], + "required" : [ "name", "alignment", "nativeTerrain", "creatureBackground" ], "dependencies" : { "town" : [ "puzzleMap" ] }, @@ -42,15 +42,19 @@ "type" : "string", "description" : "Translatable name of town" }, - "index" : { - "type" : "number", - "description" : "Private field to break things, do not use." - }, "alignment": { "type":"string", "enum" : [ "good", "neutral", "evil" ], "description": "Town alignment, good, neutral or evil" }, + "nativeTerrain": { + "type":"string", + "description": "Native terrain for creatures. Creatures fighting on native terrain receive several bonuses" + }, + "preferUndergroundPlacement": { + "type":"boolean", + "description": "Random map generator places player/cpu-owned towns underground if true is specified and on the ground otherwise. Parameter is unused for maps without underground. False by default." + }, "creatureBackground": { "type":"object", "additionalProperties" : false, @@ -69,13 +73,163 @@ } } }, - "nativeTerrain": { - "type":"string", - "description": "Native terrain for creatures. Creatures fighting on native terrain receive several bonuses" - }, - "preferUndergroundPlacement": { - "type":"boolean", - "description": "Random map generator places player/cpu-owned towns underground if true is specified and on the ground otherwise. Parameter is unused for maps without underground. False by default." + "town": { + "type":"object", + "additionalProperties" : false, + "required" : [ + "mapObject", "buildingsIcons", "buildings", "creatures", "guildWindow", "names", + "hallBackground", "hallSlots", "horde", "mageGuild", "moatAbility", "defaultTavern", "tavernVideo", "guildBackground", "musicTheme", "siege", "structures", "townBackground", "warMachine" + ], + "description": "town", + "properties":{ + "creatures": { + "type":"array", + "minItems" : 7, + "maxItems" : 7, + "description" : "List of creatures available for recruitment on each level", + "items": { + "type":"array", + "items" : { "type" : "string" } + } + }, + "hallSlots": { + "type":"array", + "description": "Description of town hall", + "minItems" : 5, + "maxItems" : 5, + "items": { + "type":"array", + "minItems" : 1, + "maxItems" : 4, + "items" : { + "type" : "array", + "description" : "List of buildings available in one slot", + "items" : { "type" : "string" } + } + } + }, + "buildings": { + "type" : "object", + "additionalProperties" : { + "$ref" : "townBuilding.json" + } + }, + "mageGuild": { + "type":"number", + "description": "Maximal level of mage guild" + }, + "primaryResource": { + "type":"string", + "description": "Primary resource for this town. Produced by Silo and offered as starting bonus" + }, + "warMachine": { + "type":"string", + "description": "Identifier of war machine produced by blacksmith in town" + }, + "horde": { + "type":"array", + "maxItems" : 2, + "description": "Levels of creatures that have hordes in town", + "items": { "type":"number" } + }, + "moatAbility": { + "type":"string", + "description": "Identifier of ability to use as town moat during siege" + }, + "siege": { + "$ref" : "townSiege.json" + }, + "musicTheme": { + "type":"string", + "description": "Path to town music theme", + "format" : "musicFile" + }, + "tavernVideo" : { + "type" : "string", + "description" : "Video for tavern window", + "format" : "videoFile" + }, + "townBackground": { + "type":"string", + "description": "Background for town screen", + "format" : "imageFile" + }, + "guildWindow": { + "type":"string", + "description": "Image with small view on town from mage guild" + }, + "guildBackground": { + "type":"string", + "description": "Image with background of mage guild", + "format" : "imageFile" + }, + "hallBackground": { + "type":"string", + "description": "background image for town hall", + "format" : "imageFile" + }, + "buildingsIcons": { + "type" : "string", + "description": "Path to .def file with building icons", + "format" : "animationFile" + }, + "mapObject" : { + "properties" : { + "filters" : { + "type" : "object", + "additionalProperties" : { "type" : "array" } + } + } + }, + "structures": { + "type" : "object", + "additionalProperties" : { + "$ref" : "townStructure.json" + } + }, + "icons": { + "type":"object", + "additionalProperties" : false, + "description": "Town icons", + "required" : [ "fort", "village" ], + "properties":{ + "fort": { + "$ref" : "#/definitions/townIconPair", + "description": "Icons for town with built fort" + }, + "village": { + "$ref" : "#/definitions/townIconPair", + "description": "Icons for town without fort" + } + } + }, + "defaultTavern" : { + "type" : "number", + "description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field", + "minimum" : 0 + }, + "tavern" : { + "type" : "object", + "description" : "Hero classes available in tavern. Value indicates chance for hero of this class to appear", + "additionalProperties" : { + "type" : "number", + "minimum" : 0 + } + }, + "guildSpells" : { + "type" : "object", + "description" : "Spells available in mage guild. Value indicates chance for this spell to appear", + "additionalProperties" : { + "type" : "number" + } + }, + "names" : { + "type" : "array", + "description" : "Names for towns on adventure map", + "minItems" : 1, + "items" : { "type" : "string" } + } + } }, "puzzleMap": { "type":"object", @@ -104,164 +258,9 @@ } } }, - "town": { - "type":"object", - "additionalProperties" : false, - "required" : [ - "mapObject", "buildingsIcons", "buildings", "creatures", "guildWindow", "names", - "hallBackground", "hallSlots", "horde", "mageGuild", "moatAbility", "defaultTavern", "tavernVideo", "guildBackground", "musicTheme", "siege", "structures", "townBackground", "warMachine" - ], - "description": "town", - "properties":{ - "mapObject" : { - "properties" : { - "filters" : { - "type" : "object", - "additionalProperties" : { "type" : "array" } - } - } - }, - "guildSpells" : { - "type" : "object", - "description" : "Spells available in mage guild. Value indicates chance for this spell to appear", - "additionalProperties" : { - "type" : "number" - } - }, - "defaultTavern" : { - "type" : "number", - "description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field", - "minimum" : 0 - }, - "tavern" : { - "type" : "object", - "description" : "Hero classes available in tavern. Value indicates chance for hero of this class to appear", - "additionalProperties" : { - "type" : "number", - "minimum" : 0 - } - }, - "tavernVideo" : { - "type" : "string", - "description" : "Video for tavern window", - "format" : "videoFile" - }, - "names" : { - "type" : "array", - "description" : "Names for towns on adventure map", - "minItems" : 1, - "items" : { "type" : "string" } - }, - "buildingsIcons": { - "type" : "string", - "description": "Path to .def file with building icons", - "format" : "animationFile" - }, - "buildings": { - "type" : "object", - "additionalProperties" : { - "$ref" : "townBuilding.json" - } - }, - "creatures": { - "type":"array", - "minItems" : 7, - "maxItems" : 7, - "description" : "List of creatures available for recruitment on each level", - "items": { - "type":"array", - "items" : { "type" : "string" } - } - }, - "guildWindow": { - "type":"string", - "description": "Image with small view on town from mage guild" - }, - "guildBackground": { - "type":"string", - "description": "Image with background of mage guild", - "format" : "imageFile" - }, - - "hallBackground": { - "type":"string", - "description": "background image for town hall", - "format" : "imageFile" - }, - "hallSlots": { - "type":"array", - "description": "Description of town hall", - "minItems" : 5, - "maxItems" : 5, - "items": { - "type":"array", - "minItems" : 1, - "maxItems" : 4, - "items" : { - "type" : "array", - "description" : "List of buildings available in one slot", - "items" : { "type" : "string" } - } - } - }, - "horde": { - "type":"array", - "maxItems" : 2, - "description": "Levels of creatures that have hordes in town", - "items": { "type":"number" } - }, - "icons": { - "type":"object", - "additionalProperties" : false, - "description": "Town icons", - "required" : [ "fort", "village" ], - "properties":{ - "fort": { - "$ref" : "#/definitions/townIconPair", - "description": "Icons for town with built fort" - }, - "village": { - "$ref" : "#/definitions/townIconPair", - "description": "Icons for town without fort" - } - } - }, - "mageGuild": { - "type":"number", - "description": "Maximal level of mage guild" - }, - "moatAbility": { - "type":"string", - "description": "Identifier of ability to use as town moat during siege" - }, - "musicTheme": { - "type":"string", - "description": "Path to town music theme", - "format" : "musicFile" - }, - "siege": { - "$ref" : "townSiege.json" - }, - "structures": { - "type" : "object", - "additionalProperties" : { - "$ref" : "townStructure.json" - } - }, - "townBackground": { - "type":"string", - "description": "Background for town screen", - "format" : "imageFile" - }, - "primaryResource": { - "type":"string", - "description": "Primary resource for this town. Produced by Silo and offered as starting bonus" - }, - "warMachine": { - "type":"string", - "description": "Identifier of war machine produced by blacksmith in town" - } - } + "index" : { + "type" : "number", + "description" : "Private field to break things, do not use." } } } diff --git a/config/schemas/hero.json b/config/schemas/hero.json index 44a4a5368..f708b4e4a 100644 --- a/config/schemas/hero.json +++ b/config/schemas/hero.json @@ -3,7 +3,7 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI hero format", "description" : "Format used to define new heroes in VCMI", - "required": [ "army", "class", "skills", "texts" ], + "required": [ "class", "army", "skills", "texts" ], "oneOf" : [ { @@ -16,40 +16,9 @@ "additionalProperties" : false, "properties":{ - "army": { - "type":"array", - "description": "Initial hero army when recruited in tavern", - "minItems" : 1, - "maxItems" : 3, - "items": { - "type":"object", - "additionalProperties" : false, - "required" : [ "creature", "min", "max" ], - "properties":{ - "creature": { - "type":"string", - "description": "creature" - }, - "max": { - "type":"number", - "description": "max", - "minimum" : 1 - }, - "min": { - "type":"number", - "description": "min", - "minimum" : 1 - } - } - } - }, - "index" : { - "type" : "number", - "description" : "Private field to break things, do not use." - }, "special": { - "type":"boolean", - "description": "Marks this object as special and not available by default" + "type":"boolean", + "description": "Marks this object as special and not available by default" }, "class": { "type":"string", @@ -92,6 +61,33 @@ } } }, + "army": { + "type":"array", + "description": "Initial hero army when recruited in tavern", + "minItems" : 1, + "maxItems" : 3, + "items": { + "type":"object", + "additionalProperties" : false, + "required" : [ "creature", "min", "max" ], + "properties":{ + "creature": { + "type":"string", + "description": "creature" + }, + "max": { + "type":"number", + "description": "max", + "minimum" : 1 + }, + "min": { + "type":"number", + "description": "min", + "minimum" : 1 + } + } + } + }, "skills": { "type":"array", "description": "List of skills initially known by hero", @@ -142,30 +138,30 @@ "type":"object", "additionalProperties" : false, "description": "All translatable texts related to hero", - "required" : [ "biography", "name", "specialty" ], + "required" : [ "name", "biography", "specialty" ], "properties":{ - "biography": { - "type":"string", - "description": "Hero biography" - }, "name": { "type":"string", "description": "Hero name" }, + "biography": { + "type":"string", + "description": "Hero biography" + }, "specialty": { "type":"object", "additionalProperties" : false, "description": "Hero specialty information", - "required" : [ "description", "name", "tooltip" ], + "required" : [ "name", "description", "tooltip" ], "properties":{ - "description": { - "type":"string", - "description": "Description visible when hovering over specialty icon" - }, "name": { "type":"string", "description": "Name of the specialty" }, + "description": { + "type":"string", + "description": "Description visible when hovering over specialty icon" + }, "tooltip": { "type":"string", "description": "Tooltip visible on clicking icon." @@ -173,6 +169,10 @@ } } } + }, + "index" : { + "type" : "number", + "description" : "Private field to break things, do not use." } } } diff --git a/config/schemas/heroClass.json b/config/schemas/heroClass.json index d10731694..6067981cb 100644 --- a/config/schemas/heroClass.json +++ b/config/schemas/heroClass.json @@ -4,13 +4,30 @@ "title" : "VCMI hero class format", "description" : "Format used to define classes of heroes in VCMI", "required" : [ - "animation", "faction", "highLevelChance", "lowLevelChance", - "name", "primarySkills", "secondarySkills", "tavern", "defaultTavern", - "affinity", "commander", "mapObject" + "name", "faction", "affinity", "commander", "animation", "mapObject", + "primarySkills", "secondarySkills", "lowLevelChance", "highLevelChance", + "defaultTavern", "tavern" ], "additionalProperties" : false, "properties":{ + "name": { + "type":"string", + "description": "Translatable name of hero class" + }, + "faction": { + "type":"string", + "description": "Faction this hero class belongs to" + }, + "affinity" : { + "type" : "string", + "description" : "Affinity of hero class, might or magic", + "enum" : [ "might", "magic"] + }, + "commander": { + "type":"string", + "description": "Identifier of creature that is used as commander by heroes" + }, "animation": { "type":"object", "additionalProperties" : false, @@ -45,41 +62,6 @@ } } }, - "index" : { - "type" : "number", - "description" : "Private field to break things, do not use." - }, - "faction": { - "type":"string", - "description": "Faction this hero class belongs to" - }, - "affinity" : { - "type" : "string", - "description" : "Affinity of hero class, might or magic", - "enum" : [ "might", "magic"] - }, - "commander": { - "type":"string", - "description": "Identifier of creature that is used as commander by heroes" - }, - "highLevelChance": { - "type":"object", - "description": "Chance to get specific primary skill on level-up, applicable for levels starting from 10", - "additionalProperties":{ - "type":"number" - } - }, - "lowLevelChance": { - "type":"object", - "description": "Chance to get specific primary skill on level-up, applicable for levels less than 10", - "additionalProperties":{ - "type":"number" - } - }, - "name": { - "type":"string", - "description": "Translatable name of hero class" - }, "primarySkills": { "type":"object", "description": "Initial primary skills of heroes", @@ -94,12 +76,25 @@ "type":"number" } }, + "lowLevelChance": { + "type":"object", + "description": "Chance to get specific primary skill on level-up, applicable for levels less than 10", + "additionalProperties":{ + "type":"number" + } + }, + "highLevelChance": { + "type":"object", + "description": "Chance to get specific primary skill on level-up, applicable for levels starting from 10", + "additionalProperties":{ + "type":"number" + } + }, "defaultTavern" : { "type" : "number", "description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field", "minimum" : 0 }, - "tavern": { "type":"object", "description": "Chance for this hero to appear in tavern of this factions. Reversed version of field \"tavern\" from town format", @@ -107,6 +102,10 @@ "type":"number", "minimum" : 0 } + }, + "index" : { + "type" : "number", + "description" : "Private field to break things, do not use." } } } diff --git a/config/schemas/mapHeader.json b/config/schemas/mapHeader.json index 2ad23ce7e..13ebf62ea 100644 --- a/config/schemas/mapHeader.json +++ b/config/schemas/mapHeader.json @@ -3,42 +3,36 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI map header format", "description" : "Part of map in json format, defines core settings of the map", - "required": [ "defeatIconIndex", "defeatString", "victoryIconIndex", "victoryString" ], + "required": [ "victoryIconIndex", "victoryString", "defeatIconIndex", "defeatString" ], "additionalProperties" : false, "properties":{ - "defeatIconIndex": { - "type":"number" - }, - "defeatString": { - "type":"string" - }, "victoryIconIndex": { "type":"number" }, "victoryString": { "type":"string" }, + "defeatIconIndex": { + "type":"number" + }, + "defeatString": { + "type":"string" + }, "triggeredEvents" : { "type" : "object", - "additionalProperties" : { "type" : "object", - "additionalProperties" : "false", - + "additionalProperties" : false, "properties" : { "required" : [ "condition", "message", "effect" ], - "condition" : { "type" : "array" }, - "description" : { "type" : "string" }, "message" : { "type" : "string" }, "effect" : { "type" : "object", "additionalProperties" : false, - "required" : [ "type", "messageToSend" ], - "properties" : { "type" : { "type" : "string" }, "messageToSend" : { "type" : "string" } diff --git a/config/schemas/mod.json b/config/schemas/mod.json index ce1113aaf..04ab76ec6 100644 --- a/config/schemas/mod.json +++ b/config/schemas/mod.json @@ -3,7 +3,7 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI mod file format", "description" : "Format used to define main mod file (mod.json) in VCMI", - "required" : [ "name", "description", "version", "author", "contact", "modType" ], + "required" : [ "name", "description", "modType", "version", "author", "contact" ], "definitions" : { "localizable" : { "type":"object", @@ -22,6 +22,14 @@ "type":"string", "description": "Author of the mod. Can be nickname, real name or name of team" }, + "changelog" : { + "type":"object", + "description": "List of changes/new features in each version", + "additionalProperties" : { + "type" : "array", + "items" : { "type":"string" } + } + }, "skipValidation" : { "type":"boolean", "description": "If set to true, vcmi will skip validation of current translation json files" @@ -30,14 +38,6 @@ "type":"array", "description": "List of files with translations for this language", "items": { "type":"string", "format" : "textFile" } - }, - "changelog" : { - "type":"object", - "description": "List of changes/new features in each version", - "additionalProperties" : { - "type" : "array", - "items" : { "type":"string" } - } } } } @@ -53,52 +53,38 @@ "type":"string", "description": "More lengthy description of mod. No hard limit" }, - "modType" : { "type":"string", "enum" : [ "Translation", "Town", "Test", "Templates", "Spells", "Music", "Sounds", "Skills", "Other", "Objects", "Mechanics", "Interface", "Heroes", "Graphical", "Expansion", "Creatures", "Artifacts", "AI" ], "description": "Type of mod, e.g. Town, Artifacts, Graphical." }, - - "version" : { - "type":"string", - "description": "Current mod version, up to 3 numbers, dot-separated. Format: A.B.C" - }, - "author" : { "type":"string", "description": "Author of the mod. Can be nickname, real name or name of team" }, - - "licenseName" : { - "type":"string", - "description": "Name of the license, recommended is Creative Commons Attribution-ShareAlike" - }, - - "licenseURL" : { - "type":"string", - "description": "Url to license text, e.g. http://creativecommons.org/licenses/by-sa/4.0/deed" - }, - "contact" : { "type":"string", "description": "Home page of mod or link to forum thread" }, - - "language" : { + "licenseName" : { "type":"string", - "description": "Base language of the mod, before applying localizations. By default vcmi assumes English", - "enum" : [ "chinese", "english", "korean", "german", "polish", "russian", "spanish", "ukrainian" ], + "description": "Name of the license, recommended is Creative Commons Attribution-ShareAlike" }, - "depends": { - "type":"array", - "description": "List of mods that are required to run this one", - "items": { "type":"string" } + "licenseURL" : { + "type":"string", + "description": "Url to license text, e.g. http://creativecommons.org/licenses/by-sa/4.0/deed" }, - "conflicts": { - "type":"array", - "description": "List of mods that can't be enabled in the same time as this one", - "items": { "type":"string" } + "version" : { + "type":"string", + "description": "Current mod version, up to 3 numbers, dot-separated. Format: A.B.C" + }, + "changelog" : { + "type":"object", + "description": "List of changes/new features in each version", + "additionalProperties" : { + "type" : "array", + "items" : { "type":"string" } + } }, "compatibility" : { "type":"object", @@ -117,11 +103,58 @@ } } }, - + "depends": { + "type":"array", + "description": "List of mods that are required to run this one", + "items": { "type":"string" } + }, + "conflicts": { + "type":"array", + "description": "List of mods that can't be enabled in the same time as this one", + "items": { "type":"string" } + }, "keepDisabled" : { "type":"boolean", "description": "If set to true, mod will not be enabled automatically on install" }, + "settings" : { + "type":"object", + "description": "List of changed game settings by mod", + "additionalProperties" : { + "type" : "object", + "properties" : { + "type" : "object" + } + } + }, + "filesystem": { + "type":"object", + "description": "Optional, description on how files are organized in your mod. In most cases you do not need to use this field", + "additionalProperties":{ + "type":"array", + "description" : "list of data sources attached to this mount point", + "items": { + "type":"object", + "additionalProperties" : false, + "properties":{ + "path": { + "type":"string", + "description": "Path to data source" + }, + "type": { + "type" : "string", + "enum" : [ "dir", "lod", "snd", "vid", "map", "zip" ], + "description" : "Type of data source" + } + } + } + } + }, + "language" : { + "type":"string", + "description": "Base language of the mod, before applying localizations. By default vcmi assumes English", + "enum" : [ "chinese", "english", "korean", "german", "polish", "russian", "spanish", "ukrainian" ] + }, "chinese" : { "$ref" : "#/definitions/localizable" }, @@ -151,22 +184,6 @@ "description": "List of files with translations for this language", "items": { "type":"string", "format" : "textFile" } }, - "artifacts": { - "type":"array", - "description": "List of configuration files for artifacts", - "items": { "type":"string", "format" : "textFile" } - }, - "bonuses":{ - "type":"array", - "description": "List of configuration files for bonuses", - "items": { "type":"string", "format" : "textFile" } - - }, - "creatures": { - "type":"array", - "description": "List of configuration files for creatures", - "items": { "type":"string", "format" : "textFile" } - }, "factions": { "type":"array", "description": "List of configuration files for towns/factions", @@ -182,14 +199,19 @@ "description": "List of configuration files for heroes", "items": { "type":"string", "format" : "textFile" } }, - "objects": { + "skills": { "type":"array", - "description": "List of configuration files for objects", + "description": "List of configuration files for skills", "items": { "type":"string", "format" : "textFile" } }, - "scripts": { + "creatures": { "type":"array", - "description": "List of configuration files for scripts", + "description": "List of configuration files for creatures", + "items": { "type":"string", "format" : "textFile" } + }, + "artifacts": { + "type":"array", + "description": "List of configuration files for artifacts", "items": { "type":"string", "format" : "textFile" } }, "spells": { @@ -197,26 +219,14 @@ "description": "List of configuration files for spells", "items": { "type":"string", "format" : "textFile" } }, - "skills": { + "objects": { "type":"array", - "description": "List of configuration files for skills", + "description": "List of configuration files for objects", "items": { "type":"string", "format" : "textFile" } }, - "templates":{ + "bonuses":{ "type":"array", - "description": "List of configuration files for RMG templates", - "items": { "type":"string", "format" : "textFile" } - - }, - "battlefields":{ - "type":"array", - "description": "List of configuration files for battlefields", - "items": { "type":"string", "format" : "textFile" } - - }, - "obstacles":{ - "type":"array", - "description": "List of configuration files for obstacles", + "description": "List of configuration files for bonuses", "items": { "type":"string", "format" : "textFile" } }, "terrains":{ @@ -234,49 +244,25 @@ "description": "List of configuration files for rivers", "items": { "type":"string", "format" : "textFile" } }, - - "changelog" : { - "type":"object", - "description": "List of changes/new features in each version", - "additionalProperties" : { - "type" : "array", - "items" : { "type":"string" } - } + "battlefields":{ + "type":"array", + "description": "List of configuration files for battlefields", + "items": { "type":"string", "format" : "textFile" } }, - - "settings" : { - "type":"object", - "description": "List of changed game settings by mod", - "additionalProperties" : { - "type" : "object", - "properties" : { - "type" : "object" - } - } + "obstacles":{ + "type":"array", + "description": "List of configuration files for obstacles", + "items": { "type":"string", "format" : "textFile" } }, - - "filesystem": { - "type":"object", - "description": "Optional, description on how files are organized in your mod. In most cases you do not need to use this field", - "additionalProperties":{ - "type":"array", - "description" : "list of data sources attached to this mount point", - "items": { - "type":"object", - "additionalProperties" : false, - "properties":{ - "path": { - "type":"string", - "description": "Path to data source" - }, - "type": { - "type" : "string", - "enum" : [ "dir", "lod", "snd", "vid", "map", "zip" ], - "description" : "Type of data source" - } - } - } - } + "templates":{ + "type":"array", + "description": "List of configuration files for RMG templates", + "items": { "type":"string", "format" : "textFile" } + }, + "scripts": { + "type":"array", + "description": "List of configuration files for scripts", + "items": { "type":"string", "format" : "textFile" } } } } diff --git a/config/schemas/object.json b/config/schemas/object.json index ad357ab7c..0dd296449 100644 --- a/config/schemas/object.json +++ b/config/schemas/object.json @@ -3,10 +3,13 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI map object format", "description" : "Description of map object class", - "required": [ "handler", "name" ], + "required": [ "name", "handler" ], "additionalProperties" : false, "properties":{ + "name": { + "type":"string" + }, "index": { "type":"number" }, @@ -19,9 +22,6 @@ "base": { "type" : "object" }, - "name": { - "type":"string" - }, "types": { "type":"object", "additionalProperties": { diff --git a/config/schemas/objectTemplate.json b/config/schemas/objectTemplate.json index 140697978..fab06653f 100644 --- a/config/schemas/objectTemplate.json +++ b/config/schemas/objectTemplate.json @@ -24,16 +24,10 @@ "maxItems" : 3, "items": { "type": "string", - "maxLength" : 3, - "minLength" : 3 + "minLength" : 3, + "maxLength" : 3 } }, - - "allowedTerrains" : { - "type":"array", - "items": { "type": "string" }, - "description": "List of terrain on which this object can be placed" - }, "mask" : { "type":"array", "items": { "type": "string" }, @@ -42,6 +36,11 @@ "zIndex" : { "type":"number", "description": "Defines order in which objects on same tile will be blit." + }, + "allowedTerrains" : { + "type":"array", + "items": { "type": "string" }, + "description": "List of terrain on which this object can be placed" } } } diff --git a/config/schemas/objectType.json b/config/schemas/objectType.json index 3bcf49fc3..195dc54de 100644 --- a/config/schemas/objectType.json +++ b/config/schemas/objectType.json @@ -13,6 +13,15 @@ "aiValue": { "type":"number" }, + "base": { + "type" : "object" + }, + "templates": { + "type":"object", + "additionalProperties": { + "$ref" : "objectTemplate.json" + } + }, "sounds": { "type":"object", "additionalProperties" : false, @@ -43,16 +52,6 @@ } } } - }, - - "base": { - "type" : "object" - }, - "templates": { - "type":"object", - "additionalProperties": { - "$ref" : "objectTemplate.json" - } } } } diff --git a/config/schemas/obstacle.json b/config/schemas/obstacle.json index 66b204cc9..7ed9546ff 100644 --- a/config/schemas/obstacle.json +++ b/config/schemas/obstacle.json @@ -17,6 +17,10 @@ "description": "Obstacles can be placed on specified specified battlefields", "items": { "type" : "string" } }, + "absolute": { + "type": "boolean", + "description": "Should be used absolute or relative coordinates for obstacle. There is possible only one absolute obstacle" + }, "width": { "type": "number", "description": "Width ob obstacle" @@ -41,10 +45,6 @@ "unknown": { "type": "number", "description": "Unknown field" - }, - "absolute": { - "type": "boolean", - "description": "Should be used absolute or relative coordinates for obstacle. There is possible only one absolute obstacle" } } } diff --git a/config/schemas/river.json b/config/schemas/river.json index 51eb1031f..ad162b35d 100644 --- a/config/schemas/river.json +++ b/config/schemas/river.json @@ -3,25 +3,20 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI river format", "description" : "Format used to define new rivers in VCMI", - "required" : [ "text", "shortIdentifier", "tilesFilename", "delta" ], + "required" : [ "shortIdentifier", "text", "tilesFilename", "delta" ], "additionalProperties" : false, "properties":{ - "index" : + "shortIdentifier": { - "type": "number", - "description": "Internal, do not use" + "type": "string", + "description": "Two-letters unique indentifier for this road. Used in map format" }, "text": { "type": "string", "description": "Human-readable name of the river" }, - "shortIdentifier": - { - "type": "string", - "description": "Two-letters unique indentifier for this road. Used in map format" - }, "tilesFilename": { "type": "string", @@ -32,6 +27,11 @@ { "type": "string", "description": "Name of file with river delta graphics" + }, + "index" : + { + "type": "number", + "description": "Internal, do not use" } } } diff --git a/config/schemas/road.json b/config/schemas/road.json index 8e684c251..673a3f644 100644 --- a/config/schemas/road.json +++ b/config/schemas/road.json @@ -3,25 +3,20 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI road format", "description" : "Format used to define new roads in VCMI", - "required" : [ "text", "shortIdentifier", "tilesFilename", "moveCost" ], + "required" : [ "shortIdentifier", "text", "tilesFilename", "moveCost" ], "additionalProperties" : false, "properties":{ - "index" : + "shortIdentifier": { - "type": "number", - "description": "Internal, do not use" + "type": "string", + "description": "Two-letters unique indentifier for this road. Used in map format" }, "text": { "type": "string", "description": "Human-readable name of the road" }, - "shortIdentifier": - { - "type": "string", - "description": "Two-letters unique indentifier for this road. Used in map format" - }, "tilesFilename": { "type": "string", @@ -32,6 +27,11 @@ { "type": "number", "description": "How many movement points needed to move hero" + }, + "index" : + { + "type": "number", + "description": "Internal, do not use" } } } diff --git a/config/schemas/script.json b/config/schemas/script.json index 371c1372b..148e7e147 100644 --- a/config/schemas/script.json +++ b/config/schemas/script.json @@ -1,13 +1,9 @@ { "type" : "object", "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "VCMI script format", "description" : "Format used to configure script environment", - - "required" : ["source"], - "properties" : { "source" : { "type": "string", diff --git a/config/schemas/skill.json b/config/schemas/skill.json index 031195eb5..dbe1542e3 100644 --- a/config/schemas/skill.json +++ b/config/schemas/skill.json @@ -1,18 +1,18 @@ { - "type" : "object", "$schema" : "http://json-schema.org/draft-04/schema", - "title" : "VCMI skill format", "description" : "Format used to replace bonuses provided by secondary skills in VCMI", - "definitions" : { - "skillBonus" : { "type" : "object", "description" : "Set of bonuses provided by skill at given level", "required" : ["description", "effects"], "properties" : { + "description" : { + "type" : "string", + "description" : "localizable description" + }, "images" : { "type" : "object", "description" : "skill icons of varying size", @@ -34,10 +34,6 @@ } } }, - "description" : { - "type" : "string", - "description" : "localizable description" - }, "effects" : { "type" : "object", "additionalProperties" : { @@ -46,20 +42,17 @@ } } } - }, - "required" : ["name", "basic", "advanced", "expert"], - "properties" : { - "index" : { - "type": "number", - "description": "numeric id of skill, required for existing skills" - }, "name" : { "type": "string", "description": "localizable skill name" }, + "index" : { + "type": "number", + "description": "numeric id of skill, required for existing skills" + }, "obligatoryMajor":{ "type": "boolean", "description": "This skill is major obligatory (like H3 Wisdom)" diff --git a/config/schemas/spell.json b/config/schemas/spell.json index 89d51aec7..e2d9c8531 100644 --- a/config/schemas/spell.json +++ b/config/schemas/spell.json @@ -1,12 +1,8 @@ { - "type":"object", "$schema": "http://json-schema.org/draft-04/schema", - "title" : "VCMI spell format", "description" : "Format used to define new spells in VCMI", - - "definitions" : { "animationQueue":{ "type": "array", @@ -44,8 +40,8 @@ "items":{ "type": "object", "properties":{ - "minimumAngle": {"type":"number", "minimum" : 0}, - "defName": {"type":"string", "format": "defFile"} + "defName": {"type":"string", "format": "defFile"}, + "minimumAngle": {"type":"number", "minimum" : 0} }, "additionalProperties" : false } @@ -60,7 +56,7 @@ }, "levelInfo":{ "type": "object", - "required":["range","description","cost","power","aiValue","range"], + "required":["range", "description", "cost", "power", "aiValue"], "additionalProperties" : false, "properties":{ @@ -75,14 +71,13 @@ "power":{ "type": "number" }, - "aiValue":{ - "type": "number" - }, - "range":{ "type": "string", "description": "spell range description in SRSL" }, + "aiValue":{ + "type": "number" + }, "effects":{ "type": "object", "description": "Timed effects (updated by prolongation)", @@ -125,46 +120,37 @@ } } }, - "texts":{ "type": "object", - - "additionalProperties" : false } }, - "required" : ["type", "name", "school", "level", "power","gainChance","flags","levels"], "additionalProperties" : false, - "properties": { "index":{ "type": "number", "description": "numeric id of spell required only for original spells, prohibited for new spells" }, + "name":{ + "type": "string", + "description": "Localizable name" + }, "type":{ "type": "string", "enum": ["adventure", "combat", "ability"], "description":"Spell type" }, - "name":{ - "type": "string", - "description": "Localizable name" - - }, "school":{ "type": "object", "description": "Spell schools", "additionalProperties": false, - "properties":{ - "air":{"type": "boolean"}, "fire":{"type": "boolean"}, "earth":{"type": "boolean"}, "water":{"type": "boolean"} } - }, "level":{ "type": "number", @@ -172,18 +158,15 @@ "minimum" : 0, "maximum" : 5 }, - "power":{ "type": "number", "description": "Base power" }, - "defaultGainChance":{ "type": "number", "description": "Gain chance by default for all factions" }, - "gainChance":{ "type": "object", "description": "Chance in % to gain for faction. NOTE: this field is merged with faction config", @@ -261,40 +244,37 @@ "additionalProperties" : true }, "animation":{"$ref": "#/definitions/animation"}, - "graphics":{ - "type": "object", - "additionalProperties" : false, - "properties":{ - "iconImmune":{ - "type": "string", - "description": "Resourse path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)", - "format" : "imageFile" - }, - "iconScenarioBonus":{ - "type": "string", - "description": "Resourse path of icon for scenario bonus" , - "format" : "imageFile" - }, - "iconEffect":{ - "type": "string", - "description": "Resourse path of icon for spell effects during battle" , - "format" : "imageFile" - }, - "iconBook":{ - "type": "string", - "description":"Resourse path of icon for spellbook" , - "format" : "imageFile" - }, - "iconScroll":{ - "type": "string", - "description": "Resourse path of icon for spell scrolls", - "format": "imageFile" - } - } - + "type": "object", + "additionalProperties" : false, + "properties":{ + "iconBook":{ + "type": "string", + "description":"Resourse path of icon for spellbook" , + "format" : "imageFile" + }, + "iconScroll":{ + "type": "string", + "description": "Resourse path of icon for spell scrolls", + "format": "imageFile" + }, + "iconEffect":{ + "type": "string", + "description": "Resourse path of icon for spell effects during battle" , + "format" : "imageFile" + }, + "iconImmune":{ + "type": "string", + "description": "Resourse path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)", + "format" : "imageFile" + }, + "iconScenarioBonus":{ + "type": "string", + "description": "Resourse path of icon for scenario bonus" , + "format" : "imageFile" + } + } }, - "sounds":{ "type": "object", "additionalProperties" : false, @@ -305,12 +285,10 @@ } } }, - "levels":{ "type": "object", "additionalProperties" : false, "required" : ["none", "basic", "advanced", "expert"], - "properties":{ "base":{ "type": "object", diff --git a/config/schemas/template.json b/config/schemas/template.json index 6b6081bba..988d4f511 100644 --- a/config/schemas/template.json +++ b/config/schemas/template.json @@ -1,12 +1,8 @@ { - "type":"object", "$schema": "", - "title" : "VCMI random map template format", "description" : "Format used to define random map templates in VCMI", - - "definitions" : { "zone":{ @@ -35,14 +31,14 @@ } }, "type" :{ - "enum": ["playerStart", "cpuStart", "treasure", "junction"], + "type":"string", "additionalProperties" : false, - "type":"string" + "enum": ["playerStart", "cpuStart", "treasure", "junction"] }, "size":{ "type": "number", "minimum": 1, - "additionalProperties" : false, + "additionalProperties" : false }, "connection": { @@ -68,9 +64,10 @@ "type": "string" } }, - "properties": { + "required" : ["zones", "connections"], + "additionalProperties" : false, "zones":{ "type": "object", "additionalProperties":{"$ref" : "#/definitions/zone" } @@ -82,8 +79,6 @@ "allowedWaterContent": { "type": "array", "items": {"$ref" : "#/definitions/waterContent"} - }, - "required" : ["zones", "connections"], - "additionalProperties" : false + } } } diff --git a/config/schemas/terrain.json b/config/schemas/terrain.json index 0af7e327e..9ded5ea89 100644 --- a/config/schemas/terrain.json +++ b/config/schemas/terrain.json @@ -4,24 +4,58 @@ "title" : "VCMI terrain format", "description" : "Format used to define new terrains in VCMI", "required" : [ "text", "moveCost", "minimapUnblocked", "minimapBlocked", "music", "tiles", "type", "horseSound", "horseSoundPenalty", "shortIdentifier", "battleFields" ], - "additionalProperties" : false, "properties":{ - "index" : - { - "type": "number", - "description": "Internal, do not use" - }, "text": { "type": "string", "description": "Human-readable name of this terrain" }, + "shortIdentifier": + { + "type": "string", + "description": "Two-letters unique indentifier for this terrain. Used for map format" + }, + "type": + { + "type": "array", + "description": "Type of this terrain. Can be land, water, subterranean or rock", + "items": + { + "enum": ["LAND", "WATER", "SUB", "ROCK", "SURFACE"], + "type": "string" + } + }, "moveCost": { "type": "number", "description": "How many movement points needed to move hero" }, + "tiles": + { + "type": "string", + "description": "Name of file with graphicks", + "format": "defFile" + }, + "rockTerrain": + { + "type": "string", + "description": "The name of rock type terrain which will be used as borders in the underground" + }, + "river": + { + "type": "string", + "description": "River type which should be used for that terrain" + }, + "battleFields": + { + "type": "array", + "description": "array of battleFields for this terrain", + "items": + { + "type": "string" + } + }, "minimapUnblocked": { "type": "array", @@ -50,58 +84,6 @@ "description": "Music filename to play on this terrain on adventure map", "format": "musicFile" }, - "tiles": - { - "type": "string", - "description": "Name of file with graphicks", - "format": "defFile" - }, - "type": - { - "type": "array", - "description": "Type of this terrain. Can be land, water, subterranean or rock", - "items": - { - "enum": ["LAND", "WATER", "SUB", "ROCK", "SURFACE"], - "type": "string" - } - }, - "rockTerrain": - { - "type": "string", - "description": "The name of rock type terrain which will be used as borders in the underground" - }, - "river": - { - "type": "string", - "description": "River type which should be used for that terrain" - }, - "horseSound": - { - "type": "string", - "description": "Hero movement sound for this terrain, version for moving on tiles with road", - "format": "soundFile" - }, - "horseSoundPenalty": - { - "type": "string", - "description": "Hero movement sound for this terrain, version for moving on tiles without road", - "format": "soundFile" - }, - "shortIdentifier": - { - "type": "string", - "description": "Two-letters unique indentifier for this terrain. Used for map format" - }, - "battleFields": - { - "type": "array", - "description": "array of battleFields for this terrain", - "items": - { - "type": "string" - } - }, "sounds": { "type": "object", @@ -121,6 +103,18 @@ } } }, + "horseSound": + { + "type": "string", + "description": "Hero movement sound for this terrain, version for moving on tiles with road", + "format": "soundFile" + }, + "horseSoundPenalty": + { + "type": "string", + "description": "Hero movement sound for this terrain, version for moving on tiles without road", + "format": "soundFile" + }, "prohibitTransitions": { "type": "array", @@ -139,6 +133,11 @@ { "type": "string", "description": "Can be normal, dirt, water, rock" + }, + "index" : + { + "type": "number", + "description": "Internal, do not use" } } } diff --git a/config/schemas/townBuilding.json b/config/schemas/townBuilding.json index 4ad0a1aa5..e80cf848b 100644 --- a/config/schemas/townBuilding.json +++ b/config/schemas/townBuilding.json @@ -4,7 +4,6 @@ "$schema": "http://json-schema.org/draft-04/schema", "title" : "VCMI town building format", "description" : "Format used to define town buildings in VCMI", - "definitions" : { "buildingRequirement" : { @@ -22,34 +21,11 @@ } } }, - "properties":{ "id": { "type":"number", "description" : "Numeric identifier of this building" }, - "type": { - "type":"string", - "description" : "Subtype for some special buildings" - }, - "height": { - "type":"string", - "enum" : [ "skyship", "high", "average", "low"], - "description" : "Height for lookout towers and some grails" - }, - "mode": { - "type":"string", - "enum" : [ "normal", "auto", "special", "grail" ], - "description" : "Mode in which this building will be built" - }, - "requires": { - "$ref" : "#/definitions/buildingRequirement", - "description" : "List of town buildings that must be built before this one" - }, - "upgrades": { - "description" : "If this building is upgrade, identifier of base building", - "type":"string" - }, "name" : { "description" : "Name of this building", "type" : "string" @@ -58,18 +34,40 @@ "description" : "Full decsription of this building", "type" : "string" }, + "type": { + "type":"string", + "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" : "If this building is upgrade, identifier of base building", + "type":"string" + }, "cost": { "type":"object", "additionalProperties" : false, "description": "Cost to build this building", "properties":{ + "gold": { "type":"number"}, "wood": { "type":"number"}, - "mercury": { "type":"number"}, "ore": { "type":"number"}, + "mercury": { "type":"number"}, "sulfur": { "type":"number"}, "crystal": { "type":"number"}, - "gems": { "type":"number"}, - "gold": { "type":"number"} + "gems": { "type":"number"} } }, "produce": { @@ -77,13 +75,13 @@ "additionalProperties" : false, "description": "Resources this building produce each day", "properties":{ + "gold": { "type":"number"}, "wood": { "type":"number"}, - "mercury": { "type":"number"}, "ore": { "type":"number"}, + "mercury": { "type":"number"}, "sulfur": { "type":"number"}, "crystal": { "type":"number"}, - "gems": { "type":"number"}, - "gold": { "type":"number"} + "gems": { "type":"number"} } }, "overrides": { diff --git a/config/schemas/townSiege.json b/config/schemas/townSiege.json index 67284689e..b7a7894c0 100644 --- a/config/schemas/townSiege.json +++ b/config/schemas/townSiege.json @@ -5,11 +5,9 @@ "title" : "VCMI siege screen format", "description" : "Format used to define town siege screen in VCMI", "required" : [ - "gate", "imagePrefix", "moat", "shooter", - "towerIconLarge", "towerIconSmall", - "static", "towers", "walls" + "shooter", "towerIconLarge", "towerIconSmall", "imagePrefix", + "static", "towers", "walls", "gate", "moat" ], - "definitions" : { "point" : { @@ -26,6 +24,10 @@ "additionalProperties" : false, "required" : [ "battlement", "creature", "tower" ], "properties":{ + "tower": { + "description" : "Location of main segment of tower", + "$ref" : "#/definitions/point" + }, "battlement": { "description" : "Location of battlement, part of tower that covers shooter", "$ref" : "#/definitions/point" @@ -33,16 +35,81 @@ "creature": { "description" : "Location of shooter in tower", "$ref" : "#/definitions/point" - }, - "tower": { - "description" : "Location of main segment of tower", - "$ref" : "#/definitions/point" } } } }, - "properties":{ + "shooter": { + "type":"string", + "description" : "Identifier of creature that will be used as tower shooter" + }, + "towerIconSmall": { + "type":"string", + "description": "Small icon for tower, used in battle queue", + "format" : "imageFile" + }, + "towerIconLarge": { + "type":"string", + "description": "Large icon for tower, used in battle queue", + "format" : "imageFile" + }, + "imagePrefix": { + "type":"string", + "description" : "Prefix to all images related to siege screen" + }, + "static": { + "type":"object", + "additionalProperties" : false, + "description" : "Static sections of walls", + "properties":{ + "background": { + "description" : "Very top section of the wall located above hero", + "$ref" : "#/definitions/point" + }, + "top": { + "description" : "Top section located between destructible sections", + "$ref" : "#/definitions/point" + }, + "bottom": { + "description" : "Bottom section located between destructible sections", + "$ref" : "#/definitions/point" + } + } + }, + "towers": { + "type":"object", + "additionalProperties" : false, + "description" : "Decription of towers", + "properties":{ + "top": { "$ref" : "#/definitions/tower", "description" : "Top tower" }, + "keep": { "$ref" : "#/definitions/tower", "description" : "Central keep" }, + "bottom": { "$ref" : "#/definitions/tower", "description" : "Bottom tower" } + } + }, + "walls": { + "type":"object", + "additionalProperties" : false, + "description" : "Destructible sections of the walls", + "properties":{ + "upper": { + "description" : "Topmost section located near top tower", + "$ref" : "#/definitions/point" + }, + "upperMid": { + "description" : "Second from top section located near gates", + "$ref" : "#/definitions/point" + }, + "bottomMid": { + "description" : "Second from bottom section located near gates", + "$ref" : "#/definitions/point" + }, + "bottom": { + "description" : "Bottommost section located near bottom tower", + "$ref" : "#/definitions/point" + } + } + }, "gate": { "type":"object", "additionalProperties" : false, @@ -58,10 +125,6 @@ } } }, - "imagePrefix": { - "type":"string", - "description" : "Prefix to all images related to siege screen" - }, "moat": { "type":"object", "additionalProperties" : false, @@ -76,72 +139,6 @@ "$ref" : "#/definitions/point" } } - }, - "shooter": { - "type":"string", - "description" : "Identifier of creature that will be used as tower shooter" - }, - "towerIconSmall": { - "type":"string", - "description": "Small icon for tower, used in battle queue", - "format" : "imageFile" - }, - "towerIconLarge": { - "type":"string", - "description": "Large icon for tower, used in battle queue", - "format" : "imageFile" - }, - "static": { - "type":"object", - "additionalProperties" : false, - "description" : "Static sections of walls", - "properties":{ - "background": { - "description" : "Very top section of the wall located above hero", - "$ref" : "#/definitions/point" - }, - "bottom": { - "description" : "Bottom section located between destructible sections", - "$ref" : "#/definitions/point" - }, - "top": { - "description" : "Top section located between destructible sections", - "$ref" : "#/definitions/point" - } - } - }, - "towers": { - "type":"object", - "additionalProperties" : false, - "description" : "Decription of towers", - "properties":{ - "bottom": { "$ref" : "#/definitions/tower", "description" : "Bottom tower" }, - "keep": { "$ref" : "#/definitions/tower", "description" : "Central keep" }, - "top": { "$ref" : "#/definitions/tower", "description" : "Top tower" } - } - }, - "walls": { - "type":"object", - "additionalProperties" : false, - "description" : "Destructible sections of the walls", - "properties":{ - "bottomMid": { - "description" : "Second from bottom section located near gates", - "$ref" : "#/definitions/point" - }, - "bottom": { - "description" : "Bottommost section located near bottom tower", - "$ref" : "#/definitions/point" - }, - "upperMid": { - "description" : "Second from top section located near gates", - "$ref" : "#/definitions/point" - }, - "upper": { - "description" : "Topmost section located near top tower", - "$ref" : "#/definitions/point" - } - } } } } diff --git a/config/schemas/townStructure.json b/config/schemas/townStructure.json index 2f4c14e9a..dd7c82379 100644 --- a/config/schemas/townStructure.json +++ b/config/schemas/townStructure.json @@ -6,6 +6,14 @@ "required": [ "animation", "x", "y"], "additionalProperties" : false, "properties":{ + "builds": { + "type" : "string", + "description" : "" + }, + "hidden": { + "type":"boolean", + "description" : "If upgrade, this building will replace parent animation but will not alter its behaviour" + }, "animation": { "type":"string", "description" : "Main animation file for this building", @@ -21,14 +29,6 @@ "description" : "Golden border around building, displayed when building is selected", "format" : "imageFile" }, - "builds": { - "type" : "string", - "description" : "" - }, - "hidden": { - "type":"boolean", - "description" : "If upgrade, this building will replace parent animation but will not alter its behaviour" - }, "x": { "type":"number", "description" : "Position on screen"