2
0
Эх сурвалжийг харах

Merge pull request #2171 from krs0/feature/schema_updates

Rearranging Schemas
Ivan Savenko 2 жил өмнө
parent
commit
eff6551f80

+ 78 - 81
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,50 +19,52 @@
 			}
 		}
 	},
-
 	"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"
+		},
+		"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",
+		"class" : {
+			"type" : "string",
 			"enum" : [ "SPECIAL", "TREASURE", "MINOR", "MAJOR", "RELIC" ],
-			"description": "Artifact class, treasure, minor, major or relic"
+			"description" : "Artifact class, treasure, minor, major or relic"
 		},
-		"index" : {
+		"value" : {
 			"type" : "number",
-			"description" : "Private field to break things, do not use."
+			"description" : "Cost of this artifact, in gold"
 		},
-		"components": {
-			"type":"array",
-			"description": "Optional, list of components for combinational artifacts",
-			"items": { "type":"string" }
+		"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"
-				}
-			}
+		"bonuses" : {
+			"type" : "array",
+			"description" : "Bonuses provided by this artifact using bonus system",
+			"items" : { "$ref" : "bonus.json" }
 		},
 		"growing" : {
 			"type" : "object",
@@ -73,56 +74,52 @@
 				"thresholdBonuses" : { "$ref" : "#/definitions/growingBonusList"}
 			}
 		},
-		"slot": {
-			"description": "Slot to which this artifact can be put, if applicable",
-			"oneOf" : [
-				{
-					"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"
 				},
-				{
-					"type" : "array",
-					"minItems" : 1,
-					"additionalItems" : { "type" : "string" }
+				"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"
 				}
-			]
+			}
 		},
-		"text": {
-			"type":"object",
+		"text" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Texts associated with artifact",
+			"description" : "Texts associated with artifact",
 			"required" : [ "description", "event", "name" ],
-			"properties":{
-				"description": {
-					"type":"string",
-					"description": "Long description of this artifact"
+			"properties" : {
+				"name" : {
+					"type" : "string",
+					"description" : "Name of the artifact"
 				},
-				"event": {
-					"type":"string",
-					"description": "Text that visible on picking this artifact on map"
+				"description" : {
+					"type" : "string",
+					"description" : "Long description of this artifact"
 				},
-				"name": {
-					"type":"string",
-					"description": "Name of the artifact"
+				"event" : {
+					"type" : "string",
+					"description" : "Text that visible on picking this artifact on map"
 				}
 			}
 		},
-		"type": {
-			"type":"array",
-			"description": "Type of this artifact - creature, hero or commander",
-			"items": {
-				"type":"string",
-				"enum" : [ "HERO", "CREATURE", "COMMANDER" ]
-			}
-		},
-		"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."
 		}
-
 	}
 }

+ 19 - 20
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":{
+	"properties" : {
+		"name" : {
+			"type" : "string",
+			"description" : "Name of the battleground"
+		},
+		"isSpecial" : {
+			"type" : "boolean",
+			"description" : "Shows if this battleground has own obstacles"
+		},
 		"bonuses": {
 			"type":"array",
 			"description": "Bonuses provided by this battleground using bonus system",
 			"items": { "$ref" : "bonus.json" }
 		},
-		"name": {
-			"type":"string",
-			"description": "Name of the battleground"
-		},
-		"graphics": {
-			"type":"string",
+		"graphics" : {
+			"type" : "string",
 			"format" : "imageFile",
-			"description": "BMP battleground resource"
+			"description" : "BMP battleground resource"
 		},
-		"isSpecial": {
-			"type":"boolean",
-			"description": "Shows if this battleground has own obstacles"
-		},
-		"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"
 			}
 		}
 	}

+ 66 - 68
config/schemas/bonus.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 bonus system format",
 	"description" : "Subsection of several formats, used to add generic bonuses to objects",
-	"required": ["type"],
-
+	"required" : ["type"],
 	"definitions" :
 	{
 		"nestedLimiter" : {
@@ -38,55 +37,42 @@
 			]
 		}
 	},
-
 	"additionalProperties" : false,
-	"properties":{
-		"addInfo": {
+	"properties" : {
+		"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": {
-			"type":"string",
-			"description": "description"
+		"sourceID" : {
+			"type" : "number",
+			"description" : "sourceID"
 		},
-		"duration": {
-                        "anyOf" : [
-                                { "type": "string"},
-                                { "type": "array", "items": {"type": "string"} }
-                        ],
-			"description": "duration"
-		},
-		"effectRange": {
-			"type":"string",
-			"description": "effectRange"
+		"sourceType" : {
+			"type" : "string",
+			"description" : "sourceType"
 		},
-		"limiters" : {
-			"$ref" : "#/definitions/nestedLimiter",
-			"description" : "limiter"
+		"targetSourceType" : {
+			"type" : "string",
+			"description" : "targetSourceType"
 		},
-		"propagator": {
-			"description": "propagator",
+		"propagator" : {
+			"description" : "propagator",
 			"anyOf" : [
 				{
 					"type" : "string"
 				},
 				{
-					"type":"array",
-					"items": {
-							"type":"string",
-							"description": "0"
+					"type" : "array",
+					"items" : {
+							"type" : "string",
+							"description" : "0"
 					}
 				}
 			]
@@ -106,7 +92,7 @@
 							"type" : "string",
 							"description" : "type"
 						},
-						"parameters": {
+						"parameters" : {
 							"type" : "array",
 							"description" : "parameters",
 							"additionalItems" : true
@@ -130,7 +116,7 @@
 							"type" : "string",
 							"description" : "type"
 						},
-						"parameters": {
+						"parameters" : {
 							"type" : "array",
 							"description" : "parameters",
 							"additionalItems" : true
@@ -139,44 +125,56 @@
 				}
 			]
 		},
-		"sourceID": {
-			"type":"number",
-			"description": "sourceID"
+		"limiters" : {
+			"$ref" : "#/definitions/nestedLimiter",
+			"description" : "limiter"
 		},
-		"sourceType": {
-			"type":"string",
-			"description": "sourceType"
+		"effectRange" : {
+			"type" : "string",
+			"description" : "effectRange"
 		},
-		"targetSourceType": {
-			"type":"string",
-			"description": "targetSourceType"
+		"val" : {
+			"type" : "number",
+			"description" : "val"
 		},
-		"stacking" : {
+		"valueType" : {
 			"type" : "string",
-			"description" : "stacking"
+			"description" : "valueType"
 		},
-		"subtype": {
+		"addInfo" : {
 			"anyOf" : [
 				{ "type" : "string" },
-				{ "type" : "number" }
+				{ "type" : "number" },
+				{
+					"type" : "array",
+					"items" : {
+						"anyof" : [
+							{ "type" : "string" },
+							{ "type" : "number" }
+						]
+					}
+				}
 			],
-			"description": "subtype"
+			"description" : "addInfo"
 		},
-		"turns": {
-			"type":"number",
-			"description": "turns"
+		"duration" : {
+                        "anyOf" : [
+                                { "type" : "string"},
+                                { "type" : "array", "items" : {"type" : "string"} }
+                        ],
+			"description" : "duration"
 		},
-		"type": {
-			"type":"string",
-			"description": "type"
+		"turns" : {
+			"type" : "number",
+			"description" : "turns"
 		},
-		"val": {
-			"type":"number",
-			"description": "val"
+		"stacking" : {
+			"type" : "string",
+			"description" : "stacking"
 		},
-		"valueType": {
-			"type":"string",
-			"description": "valueType"
+		"description" : {
+			"type" : "string",
+			"description" : "description"
 		}
 	}
 }

+ 213 - 217
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,302 +10,298 @@
 		},
 		{
 			"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"
 				}
 			}
 		},
-		"abilityText" : {
+		"faction" : {
 			"type" : "string",
-			"description" : "Text version of creature abilities. Used only with original creature window"
+			"description" : "Faction this creature belongs to. Examples: castle, rampart"
 		},
-		"index" : {
-			"type" : "number",
-			"description" : "Private field to break things, do not use."
-		},
-		"extraNames" : {
+		"level" : { "type" : "number"},
+		"upgrades" : {
 			"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"
+			"description" : "List of creatures to which this one can be upgraded",
+			"items" : { "type" : "string" }
 		},
-		"cost": {
-			"type":"object",
+		"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"}
+			"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"}
 			}
 		},
-		"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"
+		"speed" :     { "type" : "number" },
+		"hitPoints" : { "type" : "number" },
+		"attack" :    { "type" : "number" },
+		"defense" :   { "type" : "number" },
+		"damage" : {
+			"type" : "object",
+			"additionalProperties" : false,
+			"properties" : {
+				"max" : { "type" : "number" },
+				"min" : { "type" : "number" }
+			}
 		},
-		"level": { "type":"number"},
-		"fightValue": {
-			"type":"number",
-			"description": " \"value\" of creature, used to determine for example army strength"
+		"shots" :     { "type" : "number" },
+		"spellPoints" : {
+			"type" : "number",
+			"description" : "Spell points this creature has (usually equal to number of casts)"
 		},
-		"aiValue": {
-			"type":"number",
-			"description": "Describes how valuable this creature is to AI. Usually similar to fightValue"
+		"doubleWide" : {
+			"type" : "boolean",
+			"description" : "If set, creature will be two tiles wide on battlefield"
 		},
-		"growth": {
-			"type":"number",
-			"description": "Basic growth of this creature in town or in external dwellings"
+		"fightValue" : {
+			"type" : "number",
+			"description" : " \"value\" of creature, used to determine for example army strength"
 		},
-		"horde": {
-			"type":"number",
-			"description": "Bonus growth of this creature from built horde"
+		"aiValue" : {
+			"type" : "number",
+			"description" : "Describes how valuable this creature is to AI. Usually similar to fightValue"
 		},
-		"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" }
-			}
+		"growth" : {
+			"type" : "number",
+			"description" : "Basic growth of this creature in town or in external dwellings"
 		},
-		"spellPoints": {
-			"type":"number",
-			"description": "Spell points this creature has (usually equal to number of casts)"
+		"horde" : {
+			"type" : "number",
+			"description" : "Bonus growth of this creature from built horde"
 		},
-		"advMapAmount": {
-			"type":"object",
+		"advMapAmount" : {
+			"type" : "object",
 			"additionalProperties" : false,
 			"description" : "Initial size of random stacks on adventure map",
-			"properties":{
-				"min": { "type":"number" },
-				"max": { "type":"number" }
+			"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"
 		},
-		"hasDoubleWeek": {
-			"type":"boolean",
-			"description": "creature may receive \"week of\" events"
-		},
-		"abilities": {
-			"description": "Creature abilities described using Bonus system",
-			"type":"object",
-			"additionalProperties": {
+		"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" } }
-						]
-					}
-				}
-			}
+		"abilityText" : {
+			"type" : "string",
+			"description" : "Text version of creature abilities. Used only with original creature window"
 		},
-		"graphics": {
-			"type":"object",
+		"graphics" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Describes how this creature looks like during battles",
+			"description" : "Describes how this creature looks like during battles",
 			"required" : [
-				"animationTime", "animation", "timeBetweenFidgets"
+				"animation", "animationTime", "timeBetweenFidgets"
 			],
-			"properties":{
-				"animationTime": {
-					"type":"object",
+			"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"
+					"description" : "Length of several animations",
+					"properties" : {
+						"attack" : {
+							"type" : "number",
+							"description" : "attack"
 						},
-						"idle": {
-							"type":"number",
-							"description": "idle"
+						"idle" : {
+							"type" : "number",
+							"description" : "idle"
 						},
-						"walk": {
-							"type":"number",
-							"description": "walk"
+						"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",
+				"missile" : {
+					"type" : "object",
 					"additionalProperties" : false,
 					"required" : [ "frameAngles", "offset", "attackClimaxFrame" ],
-					"description": "Missile description for archers",
-					"properties":{
-						"projectile": {
-							"type":"string",
-							"description": "Path to projectile animation",
+					"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",
+						"ray" : {
+							"type" : "array",
+							"description" : "Colors of ray projectile animation",
 							"minItems" : 1,
-							"items": {
-								"type":"object",
+							"items" : {
+								"type" : "object",
 								"required" : [ "start", "end" ],
-								"properties":{
-									"start":  {
-										"type":"array",
+								"properties" : {
+									"start" :  {
+										"type" : "array",
 										"minItems" : 4,
 										"maxItems" : 4,
-										"items": {
+										"items" : {
 											"minimum" : 0,
 											"maximum" : 255,
-											"type":"number"
+											"type" : "number"
 										}
 									 },
-									"end":  {
-										"type":"array",
+									"end" :  {
+										"type" : "array",
 										"minItems" : 4,
 										"maxItems" : 4,
-										"items": {
+										"items" : {
 											"minimum" : 0,
 											"maximum" : 255,
-											"type":"number"
+											"type" : "number"
 										}
 									}
 								}
 							}
 						},
-						"frameAngles": {
-							"type":"array",
-							"description": "Angles of missile images, should go from 90 to -90",
+						"frameAngles" : {
+							"type" : "array",
+							"description" : "Angles of missile images, should go from 90 to -90",
 							"minItems" : 1,
-							"items": {
+							"items" : {
 								"minimum" : -90,
 								"maximum" :  90,
-								"type":"number"
+								"type" : "number"
 							}
 						},
-						"offset": {
-							"type":"object",
+						"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" }
+							"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"
+						"attackClimaxFrame" : {
+							"type" : "number",
+							"description" : "Frame from attack animation during which creature deals damage"
 						}
 					}
 				},
-				"timeBetweenFidgets": {
-					"type":"number",
-					"description": "How often creature will play idling animation"
+				"timeBetweenFidgets" : {
+					"type" : "number",
+					"description" : "How often creature will play idling animation"
 				},
-				"troopCountLocationOffset": {
-					"type":"number",
-					"description": "Position of troop count label?"
+				"troopCountLocationOffset" : {
+					"type" : "number",
+					"description" : "Position of troop count label?"
 				}
 			}
 		},
-		"sound": {
-			"type":"object",
+		"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" }
+			"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."
+		},
+		"extraNames" : {
+			"type" : "array",
+			"items" : { "type" : "string" },
+			"description" : "Private field to break things, do not use."
 		}
 	}
 }

+ 172 - 175
config/schemas/faction.json

@@ -11,257 +11,254 @@
 			}
 		},
 		"townIconPair" : {
-			"type":"object",
+			"type" : "object",
 			"additionalProperties" : false,
 			"required" : [ "normal", "built" ],
-			"properties": {
-				"built": {
+			"properties" : {
+				"built" : {
 					"$ref" : "#/definitions/townIcon",
-					"description": "Icon used after player build something in town"
+					"description" : "Icon used after player build something in town"
 				},
-				"normal": {
+				"normal" : {
 					"$ref" : "#/definitions/townIcon",
-					"description": "Icon used normally"
+					"description" : "Icon used normally"
 				}
 			}
 		}
 	},
-
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$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" ],
+	"description" : "Json format for defining new faction (aka towns) in VCMI",
+	"required" : [ "name", "alignment", "nativeTerrain", "creatureBackground" ],
 	"dependencies" : {
 		"town" : [ "puzzleMap" ]
 	},
-	
 	"additionalProperties" : false,
-	"properties":{
+	"properties" : {
 		"name" : {
 			"type" : "string",
 			"description" : "Translatable name of town"
 		},
-		"index" : {
-			"type" : "number",
-			"description" : "Private field to break things, do not use."
-		},
-		"alignment": {
-			"type":"string",
+		"alignment" : {
+			"type" : "string",
 			"enum" : [ "good", "neutral", "evil" ],
-			"description": "Town alignment, good, neutral or evil"
+			"description" : "Town alignment, good, neutral or evil"
+		},
+		"nativeTerrain" : {
+			"type" : "string",
+			"description" : "Native terrain for creatures. Creatures fighting on native terrain receive several bonuses"
 		},
-		"creatureBackground": {
-			"type":"object",
+		"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,
 			"required" : [ "120px", "130px" ],
-			"description": "Backgrounds for creature info card",
-			"properties":{
-				"120px": {
-					"type":"string",
-					"description": "Version that is 120 pixels in height",
+			"description" : "Backgrounds for creature info card",
+			"properties" : {
+				"120px" : {
+					"type" : "string",
+					"description" : "Version that is 120 pixels in height",
 					"format" : "imageFile"
 				},
-				"130px": {
-					"type":"string",
-					"description": "Version that is 130 pixels in height",
+				"130px" : {
+					"type" : "string",
+					"description" : "Version that is 130 pixels in height",
 					"format" : "imageFile"
 				}
 			}
 		},
-		"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."
-		},
-		"puzzleMap": {
-			"type":"object",
-			"additionalProperties" : false,
-			"required" : [ "prefix", "pieces" ],
-			"description": "Puzzle map from obelisks for this town. Must contain 48 pieces",
-			"properties":{
-				"pieces": {
-					"type":"array",
-					"description": "Lits of pieces definitions",
-					"minItems" : 48,
-					"maxItems" : 48,
-					"items": {
-						"type":"object",
-						"additionalProperties" : false,
-						"properties":{
-							"index": { "type":"number", "description" : "Order in which images will be opened" },
-							"x":     { "type":"number", "description" : "X coordinate on screen" },
-							"y":     { "type":"number", "description" : "X coordinate on screen" }
-						}
-					}
-				},
-				"prefix": {
-					"type":"string",
-					"description": "Prefix for image names, e.g. \"PUZCAS\" for name \"PUZCAS12.png\""
-				}
-			}
-		},
-		"town": {
-			"type":"object",
+		"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" }
+			"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" }
 						}
 					}
 				},
-				"guildSpells" : {
+				"buildings" : {
 					"type" : "object",
-					"description" : "Spells available in mage guild. Value indicates chance for this spell to appear",
 					"additionalProperties" : {
-						"type" : "number"
+						"$ref" : "townBuilding.json"
 					}
-				},				
-				"defaultTavern" : {
+				},
+				"mageGuild" : {
 					"type" : "number",
-					"description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field",
-					"minimum" : 0
+					"description" : "Maximal level of mage guild"
 				},
-				"tavern" : {
-					"type" : "object",
-					"description" : "Hero classes available in tavern. Value indicates chance for hero of this class to appear",
-					"additionalProperties" : {
-						"type" : "number",
-						"minimum" : 0
-					}
+				"primaryResource" : {
+					"type" : "string",
+					"description" : "Primary resource for this town. Produced by Silo and offered as starting bonus"
 				},
-				"tavernVideo" : {
+				"warMachine" : {
 					"type" : "string",
-					"description" : "Video for tavern window",
-					"format" : "videoFile"
+					"description" : "Identifier of war machine produced by blacksmith in town"
 				},
-				"names" : {
+				"horde" : {
 					"type" : "array",
-					"description" : "Names for towns on adventure map",
-					"minItems" : 1,
-					"items" : { "type" : "string" }
+					"maxItems" : 2,
+					"description" : "Levels of creatures that have hordes in town",
+					"items" : { "type" : "number" }
 				},
-				"buildingsIcons": {
+				"moatAbility" : {
 					"type" : "string",
-					"description": "Path to .def file with building icons",
-					"format" : "animationFile"
+					"description" : "Identifier of ability to use as town moat during siege"
 				},
-				"buildings": {
-					"type" : "object",
-					"additionalProperties" : {
-						"$ref" : "townBuilding.json"
-					}
+				"siege" : {
+					"$ref" : "townSiege.json"
 				},
-				"creatures": {
-					"type":"array",
-					"minItems" : 7,
-					"maxItems" : 7,
-					"description" : "List of creatures available for recruitment on each level",
-					"items": {
-						"type":"array",
-						"items" : { "type" : "string" }
-					}
+				"musicTheme" : {
+					"type" : "string",
+					"description" : "Path to town music theme",
+					"format" : "musicFile"
 				},
-				"guildWindow": {
-					"type":"string",
-					"description": "Image with small view on town from mage guild"
+				"tavernVideo" : {
+					"type" : "string",
+					"description" : "Video for tavern window",
+					"format" : "videoFile"
 				},
-				"guildBackground": {
-					"type":"string",
-					"description": "Image with background of mage guild",
+				"townBackground" : {
+					"type" : "string",
+					"description" : "Background for town screen",
 					"format" : "imageFile"
 				},
-
-				"hallBackground": {
-					"type":"string",
-					"description": "background image for town hall",
+				"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"
 				},
-				"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" }
+				"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" }
 						}
 					}
 				},
-				"horde": {
-					"type":"array",
-					"maxItems" : 2,
-					"description": "Levels of creatures that have hordes in town",
-					"items": { "type":"number" }
+				"structures" : {
+					"type" : "object",
+					"additionalProperties" : {
+						"$ref" : "townStructure.json"
+					}
 				},
-				"icons": {
-					"type":"object",
+				"icons" : {
+					"type" : "object",
 					"additionalProperties" : false,
-					"description": "Town icons",
+					"description" : "Town icons",
 					"required" : [ "fort", "village" ],
-					"properties":{
-						"fort": {
+					"properties" : {
+						"fort" : {
 							"$ref" : "#/definitions/townIconPair",
-							"description": "Icons for town with built fort"
+							"description" : "Icons for town with built fort"
 						},
-						"village": {
+						"village" : {
 							"$ref" : "#/definitions/townIconPair",
-							"description": "Icons for town without fort"
+							"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"
+				"defaultTavern" : {
+					"type" : "number",
+					"description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field",
+					"minimum" : 0
 				},
-				"structures": {
+				"tavern" : {
 					"type" : "object",
+					"description" : "Hero classes available in tavern. Value indicates chance for hero of this class to appear",
 					"additionalProperties" : {
-						"$ref" : "townStructure.json"
+						"type" : "number",
+						"minimum" : 0
 					}
 				},
-				"townBackground": {
-					"type":"string",
-					"description": "Background for town screen",
-					"format" : "imageFile"
+				"guildSpells" : {
+					"type" : "object",
+					"description" : "Spells available in mage guild. Value indicates chance for this spell to appear",
+					"additionalProperties" : {
+						"type" : "number"
+					}
 				},
-				"primaryResource": {
-					"type":"string",
-					"description": "Primary resource for this town. Produced by Silo and offered as starting bonus"
+				"names" : {
+					"type" : "array",
+					"description" : "Names for towns on adventure map",
+					"minItems" : 1,
+					"items" : { "type" : "string" }
+				}
+			}
+		},
+		"puzzleMap" : {
+			"type" : "object",
+			"additionalProperties" : false,
+			"required" : [ "prefix", "pieces" ],
+			"description" : "Puzzle map from obelisks for this town. Must contain 48 pieces",
+			"properties" : {
+				"pieces" : {
+					"type" : "array",
+					"description" : "Lits of pieces definitions",
+					"minItems" : 48,
+					"maxItems" : 48,
+					"items" : {
+						"type" : "object",
+						"additionalProperties" : false,
+						"properties" : {
+							"index" : { "type" : "number", "description" : "Order in which images will be opened" },
+							"x" :     { "type" : "number", "description" : "X coordinate on screen" },
+							"y" :     { "type" : "number", "description" : "X coordinate on screen" }
+						}
+					}
 				},
-				"warMachine": {
-					"type":"string",
-					"description": "Identifier of war machine produced by blacksmith in town"
+				"prefix" : {
+					"type" : "string",
+					"description" : "Prefix for image names, e.g. \"PUZCAS\" for name \"PUZCAS12.png\""
 				}
 			}
+		},
+		"index" : {
+			"type" : "number",
+			"description" : "Private field to break things, do not use."
 		}
 	}
 }

+ 107 - 109
config/schemas/hero.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 hero format",
 	"description" : "Format used to define new heroes in VCMI",
-	"required": [ "army", "class", "skills", "texts" ],
-	
+	"required" : [ "class", "army", "skills", "texts" ],
 	"oneOf" : [
 		{
 			"required" : [ "images" ]
@@ -13,109 +12,104 @@
 			"required" : [ "index" ]
 		}
 	],
-
 	"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."
+	"properties" : {
+		"special" : {
+			"type" : "boolean",
+			"description" : "Marks this object as special and not available by default"
 		},
-		"special": {
-				"type":"boolean",
-				"description": "Marks this object as special and not available by default"
+		"class" : {
+			"type" : "string",
+			"description" : "Hero class, e.g. knight or battleMage"
 		},
-		"class": {
-			"type":"string",
-			"description": "Hero class, e.g. knight or battleMage"
+		"female" : {
+			"type" : "boolean",
+			"description" : "This hero is female (changeable via editor)"
 		},
-		"female": {
-			"type":"boolean",
-			"description": "This hero is female (changeable via editor)"
-		},
-		"battleImage": {
-			"type":"string",
-			"description": "Custom def used on battle",
+		"battleImage" : {
+			"type" : "string",
+			"description" : "Custom def used on battle",
 			"format" : "defFile"
 		},
-		"images": {
-			"type":"object",
+		"images" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "images",
-			"required": [ "large", "small", "specialtyLarge", "specialtySmall" ],
-			"properties":{
-				"large": {
-					"type":"string",
-					"description": "Large version of portrait for use in hero screen",
+			"description" : "images",
+			"required" : [ "large", "small", "specialtyLarge", "specialtySmall" ],
+			"properties" : {
+				"large" : {
+					"type" : "string",
+					"description" : "Large version of portrait for use in hero screen",
 					"format" : "imageFile"
 				},
-				"small": {
-					"type":"string",
-					"description": "Small version of portrait for use on adventure map",
+				"small" : {
+					"type" : "string",
+					"description" : "Small version of portrait for use on adventure map",
 					"format" : "imageFile"
 				},
-				"specialtyLarge": {
-					"type":"string",
-					"description": "Large image of hero specilty, used in hero screen",
+				"specialtyLarge" : {
+					"type" : "string",
+					"description" : "Large image of hero specilty, used in hero screen",
 					"format" : "imageFile"
 				},
-				"specialtySmall": {
-					"type":"string",
-					"description": "Small image of hero specialty for use in exchange screen",
+				"specialtySmall" : {
+					"type" : "string",
+					"description" : "Small image of hero specialty for use in exchange screen",
 					"format" : "imageFile"
 				}
 			}
 		},
-		"skills": {
-			"type":"array",
-			"description": "List of skills initially known by hero",
+		"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",
 			"maxItems" : 8,
-			"items": {
-				"type":"object",
+			"items" : {
+				"type" : "object",
 				"additionalProperties" : false,
 				"required" : [ "level", "skill" ],
-				"properties":{
-					"level": {
-						"type":"string",
-						"description": "level",
+				"properties" : {
+					"level" : {
+						"type" : "string",
+						"description" : "level",
 						"enum" : [ "basic", "advanced", "expert" ]
 					},
-					"skill": {
-						"type":"string",
-						"description": "skill"
+					"skill" : {
+						"type" : "string",
+						"description" : "skill"
 					}
 				}
 			}
 		},
-		"specialty": {
+		"specialty" : {
 			"type" : "object",
-			"description": "Description of hero specialty using bonus system",
+			"description" : "Description of hero specialty using bonus system",
 			"additionalProperties" : false,
 			"properties" : { 
 				"base" : {
@@ -133,46 +127,50 @@
 				}
 			}
 		},
-		"spellbook": {
-			"type":"array",
-			"description": "List of starting spells, if available. This entry (even empty) will also grant spellbook",
-			"items": { "type":"string" }
+		"spellbook" : {
+			"type" : "array",
+			"description" : "List of starting spells, if available. This entry (even empty) will also grant spellbook",
+			"items" : { "type" : "string" }
 		},
-		"texts": {
-			"type":"object",
+		"texts" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "All translatable texts related to hero",
-			"required" : [ "biography", "name", "specialty" ],
-			"properties":{
-				"biography": {
-					"type":"string",
-					"description": "Hero biography"
+			"description" : "All translatable texts related to hero",
+			"required" : [ "name", "biography", "specialty" ],
+			"properties" : {
+				"name" : {
+					"type" : "string",
+					"description" : "Hero name"
 				},
-				"name": {
-					"type":"string",
-					"description": "Hero name"
+				"biography" : {
+					"type" : "string",
+					"description" : "Hero biography"
 				},
-				"specialty": {
-					"type":"object",
+				"specialty" : {
+					"type" : "object",
 					"additionalProperties" : false,
-					"description": "Hero specialty information",
-					"required" : [ "description", "name", "tooltip" ],
-					"properties":{
-						"description": {
-							"type":"string",
-							"description": "Description visible when hovering over specialty icon"
+					"description" : "Hero specialty information",
+					"required" : [ "name", "description", "tooltip" ],
+					"properties" : {
+						"name" : {
+							"type" : "string",
+							"description" : "Name of the specialty"
 						},
-						"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."
+						"tooltip" : {
+							"type" : "string",
+							"description" : "Tooltip visible on clicking icon."
 						}
 					}
 				}
 			}
+		},
+		"index" : {
+			"type" : "number",
+			"description" : "Private field to break things, do not use."
 		}
 	}
 }

+ 68 - 70
config/schemas/heroClass.json

@@ -1,36 +1,52 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"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":{
-		"animation": {
-			"type":"object",
+	"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,
-			"description": "Files related to hero animation",
-			"required": [ "battle" ],
-			"properties":{
-				"battle": {
-					"type":"object",
+			"description" : "Files related to hero animation",
+			"required" : [ "battle" ],
+			"properties" : {
+				"battle" : {
+					"type" : "object",
 					"additionalProperties" : false,
-					"description": "Hero animations for battle",
-					"required": [ "female", "male" ],
-					"properties":{
-						"female": {
-							"type":"string",
-							"description": "Female version",
+					"description" : "Hero animations for battle",
+					"required" : [ "female", "male" ],
+					"properties" : {
+						"female" : {
+							"type" : "string",
+							"description" : "Female version",
 							"format" : "defFile"
 						},
-						"male": {
-							"type":"string",
-							"description": "Male version",
+						"male" : {
+							"type" : "string",
+							"description" : "Male version",
 							"format" : "defFile"
 						}
 					}
@@ -45,53 +61,32 @@
 				}
 			}
 		},
-		"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"
+		"primarySkills" : {
+			"type" : "object",
+			"description" : "Initial primary skills of heroes",
+			"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"
+		"secondarySkills" : {
+			"type" : "object",
+			"description" : "Chance to get specific secondary skill on level-up. All missing skills are considered to be banned",
+			"additionalProperties" : {
+				"type" : "number"
 			}
 		},
-		"name": {
-			"type":"string",
-			"description": "Translatable name of hero class"
-		},
-		"primarySkills": {
-			"type":"object",
-			"description": "Initial primary skills of heroes",
-			"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"
 			}
 		},
-		"secondarySkills": {
-			"type":"object",
-			"description": "Chance to get specific secondary skill on level-up. All missing skills are considered to be banned",
-			"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" : {
@@ -99,14 +94,17 @@
 			"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",
-			"additionalProperties":{
-				"type":"number",
+		"tavern" : {
+			"type" : "object",
+			"description" : "Chance for this hero to appear in tavern of this factions. Reversed version of field \"tavern\" from town format",
+			"additionalProperties" : {
+				"type" : "number",
 				"minimum" : 0
 			}
+		},
+		"index" : {
+			"type" : "number",
+			"description" : "Private field to break things, do not use."
 		}
 	}
 }

+ 13 - 20
config/schemas/mapHeader.json

@@ -1,44 +1,37 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$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"
+	"properties" : {
+		"victoryIconIndex" : {
+			"type" : "number"
 		},
-		"defeatString": {
-			"type":"string"
+		"victoryString" : {
+			"type" : "string"
 		},
-		"victoryIconIndex": {
-			"type":"number"
+		"defeatIconIndex" : {
+			"type" : "number"
 		},
-		"victoryString": {
-			"type":"string"
+		"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" }

+ 190 - 204
config/schemas/mod.json

@@ -1,108 +1,94 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$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",
+			"type" : "object",
 			"additionalProperties" : false,
 			"required" : [ "name", "description" ],
-			"properties":{
-				"name": {
-					"type":"string",
-					"description": "Short name of your mod. No more than 2-3 words"
+			"properties" : {
+				"name" : {
+					"type" : "string",
+					"description" : "Short name of your mod. No more than 2-3 words"
 				},
-				"description": {
-					"type":"string",
-					"description": "More lengthy description of mod. No hard limit"
+				"description" : {
+					"type" : "string",
+					"description" : "More lengthy description of mod. No hard limit"
 				},
 				"author" : {
-					"type":"string",
-					"description": "Author of the mod. Can be nickname, real name or name of team"
-				},
-				"skipValidation" : {
-					"type":"boolean",
-					"description": "If set to true, vcmi will skip validation of current translation json files"
-				},
-				"translations":{
-					"type":"array",
-					"description": "List of files with translations for this language",
-					"items": { "type":"string", "format" : "textFile" }
+					"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",
+					"type" : "object",
+					"description" : "List of changes/new features in each version",
 					"additionalProperties" : {
 						"type" : "array",
-						"items" : { "type":"string" }
+						"items" : { "type" : "string" }
 					}
+				},
+				"skipValidation" : {
+					"type" : "boolean",
+					"description" : "If set to true, vcmi will skip validation of current translation json files"
+				},
+				"translations" : {
+					"type" : "array",
+					"description" : "List of files with translations for this language",
+					"items" : { "type" : "string", "format" : "textFile" }
 				}
 			}
 		}
 	},
 	
 	"additionalProperties" : false,
-	"properties":{
-		"name": {
-			"type":"string",
-			"description": "Short name of your mod. No more than 2-3 words"
+	"properties" : {
+		"name" : {
+			"type" : "string",
+			"description" : "Short name of your mod. No more than 2-3 words"
 		},
-		"description": {
-			"type":"string",
-			"description": "More lengthy description of mod. No hard limit"
+		"description" : {
+			"type" : "string",
+			"description" : "More lengthy description of mod. No hard limit"
 		},
-
 		"modType" : {
-			"type":"string",
+			"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"
+			"description" : "Type of mod, e.g. Town, Artifacts, Graphical."
 		},
-
 		"author" : {
-			"type":"string",
-			"description": "Author of the mod. Can be nickname, real name or name of team"
+			"type" : "string",
+			"description" : "Author of the mod. Can be nickname, real name or name of team"
+		},
+		"contact" : {
+			"type" : "string",
+			"description" : "Home page of mod or link to forum thread"
 		},
-
 		"licenseName" : {
-			"type":"string",
-			"description": "Name of the license, recommended is Creative Commons Attribution-ShareAlike"
+			"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" : {
-			"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" ],
+			"type" : "string",
+			"description" : "Url to license text, e.g. http://creativecommons.org/licenses/by-sa/4.0/deed"
 		},
-		"depends": {
-			"type":"array",
-			"description": "List of mods that are required to run this one",
-			"items": { "type":"string" }
+		"version" : {
+			"type" : "string",
+			"description" : "Current mod version, up to 3 numbers, dot-separated. Format: A.B.C"
 		},
-		"conflicts": {
-			"type":"array",
-			"description": "List of mods that can't be enabled in the same time as this one",
-			"items": { "type":"string" }
+		"changelog" : {
+			"type" : "object",
+			"description" : "List of changes/new features in each version",
+			"additionalProperties" : {
+				"type" : "array",
+				"items" : { "type" : "string" }
+			}
 		},
 		"compatibility" : {
-			"type":"object",
-			"description": "Supported versions of vcmi engine",
+			"type" : "object",
+			"description" : "Supported versions of vcmi engine",
 			"additionalProperties" : false,
 			"properties" : {
 				"min" : {
@@ -117,10 +103,57 @@
 				}
 			}
 		},
-
+		"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"
+			"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"
@@ -146,137 +179,90 @@
 		"ukrainian" : {
 			"$ref" : "#/definitions/localizable"
 		},
-		"translations":{
-			"type":"array",
-			"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",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"heroClasses": {
-			"type":"array",
-			"description": "List of configuration files for hero classes",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"heroes": {
-			"type":"array",
-			"description": "List of configuration files for heroes",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"objects": {
-			"type":"array",
-			"description": "List of configuration files for objects",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"scripts": {
-			"type":"array",
-			"description": "List of configuration files for scripts",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"spells": {
-			"type":"array",
-			"description": "List of configuration files for spells",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"skills": {
-			"type":"array",
-			"description": "List of configuration files for skills",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"templates":{
-			"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",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"terrains":{
-			"type":"array",
-			"description": "List of configuration files for terrains",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"roads":{
-			"type":"array",
-			"description": "List of configuration files for roads",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"rivers":{
-			"type":"array",
-			"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" }
-			}
-		},
-		
-		"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"
-						}
-					}
-				}
-			}
+		"translations" : {
+			"type" : "array",
+			"description" : "List of files with translations for this language",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"factions" : {
+			"type" : "array",
+			"description" : "List of configuration files for towns/factions",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"heroClasses" : {
+			"type" : "array",
+			"description" : "List of configuration files for hero classes",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"heroes" : {
+			"type" : "array",
+			"description" : "List of configuration files for heroes",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"skills" : {
+			"type" : "array",
+			"description" : "List of configuration files for skills",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"creatures" : {
+			"type" : "array",
+			"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" : {
+			"type" : "array",
+			"description" : "List of configuration files for spells",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"objects" : {
+			"type" : "array",
+			"description" : "List of configuration files for objects",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"bonuses" : {
+			"type" : "array",
+			"description" : "List of configuration files for bonuses",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"terrains" : {
+			"type" : "array",
+			"description" : "List of configuration files for terrains",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"roads" : {
+			"type" : "array",
+			"description" : "List of configuration files for roads",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"rivers" : {
+			"type" : "array",
+			"description" : "List of configuration files for rivers",
+			"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",
+			"items" : { "type" : "string", "format" : "textFile" }
+		},
+		"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" }
 		}
 	}
 }

+ 16 - 16
config/schemas/object.json

@@ -1,30 +1,30 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$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":{
-		"index": {
-			"type":"number"
+	"properties" : {
+		"name" : {
+			"type" : "string"
+		},
+		"index" : {
+			"type" : "number"
 		},
 		"lastReservedIndex" : {
-			"type":"number"
+			"type" : "number"
 		},
-		"handler": {
-			"type":"string"
+		"handler" : {
+			"type" : "string"
 		},
-		"base": {
+		"base" : {
 			"type" : "object"
 		},
-		"name": {
-			"type":"string"
-		},
-		"types": {
-			"type":"object",
-			"additionalProperties": {
+		"types" : {
+			"type" : "object",
+			"additionalProperties" : {
 				"$ref" : "objectType.json"
 			}
 		}

+ 25 - 27
config/schemas/objectTemplate.json

@@ -1,47 +1,45 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI map object template format",
 	"description" : "Description of map object tempate that describes appearence of object instance",
-	"required": [ "animation", "mask" ],
-
+	"required" : [ "animation", "mask" ],
 	"additionalProperties" : false,
-	"properties":{
-		"animation": {
+	"properties" : {
+		"animation" : {
 			"type" : "string",
-			"description": "Path to def file with animation of this object",
+			"description" : "Path to def file with animation of this object",
 			"format" : "defFile"
 		},
-		"editorAnimation":{
+		"editorAnimation" : {
 			"type" : "string",
-			"description": "Optional path to def file with animation of this object to use in map editor",
+			"description" : "Optional path to def file with animation of this object to use in map editor",
 			"format" : "defFile"			
 		},
-		"visitableFrom": {
-			"type":"array",
-			"description": "Directions from which this object is visible",
+		"visitableFrom" : {
+			"type" : "array",
+			"description" : "Directions from which this object is visible",
 			"minItems" : 3,
 			"maxItems" : 3,
-			"items": {
-				"type": "string",
-				"maxLength" : 3,
-				"minLength" : 3
+			"items" : {
+				"type" : "string",
+				"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" },
-			"description": "Object mask that describes on which tiles object is visible/blocked/activatable"
+			"type" : "array",
+			"items" : { "type" : "string" },
+			"description" : "Object mask that describes on which tiles object is visible/blocked/activatable"
 		},
 		"zIndex" :  {
-			"type":"number",
-			"description": "Defines order in which objects on same tile will be blit."
+			"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"
 		}
 	}
 }

+ 35 - 37
config/schemas/objectType.json

@@ -1,58 +1,56 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI map object type format",
 	"description" : "Description of map object type, used only as sub-schema of object",
-	"required": [ ],
+	"required" : [ ],
 	"additionalProperties" : true, // may have type-dependant properties
-
-	"properties":{
-		"index": {
-			"type":"number"
+	"properties" : {
+		"index" : {
+			"type" : "number"
 		},
-		"aiValue": {
-			"type":"number"
+		"aiValue" : {
+			"type" : "number"
 		},
-		"sounds": {
-			"type":"object",
+		"base" : {
+			"type" : "object"
+		},
+		"templates" : {
+			"type" : "object",
+			"additionalProperties" : {
+				"$ref" : "objectTemplate.json"
+			}
+		},
+		"sounds" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Sounds used by this object",
+			"description" : "Sounds used by this object",
 			"properties" : {
-				"ambient": {
-					"type":"array",
-					"description": "Background sound of an object",
-					"items": {
-						"type": "string",
+				"ambient" : {
+					"type" : "array",
+					"description" : "Background sound of an object",
+					"items" : {
+						"type" : "string",
 						"format" : "soundFile"
 					}
 				},
-				"visit": {
-					"type":"array",
-					"description": "Sound that played on object visit",
-					"items": {
-						"type": "string",
+				"visit" : {
+					"type" : "array",
+					"description" : "Sound that played on object visit",
+					"items" : {
+						"type" : "string",
 						"format" : "soundFile"
 					}
 				},
-				"removal": {
-					"type":"array",
-					"description": "Sound that played on object removal",
-					"items": {
-						"type": "string",
+				"removal" : {
+					"type" : "array",
+					"description" : "Sound that played on object removal",
+					"items" : {
+						"type" : "string",
 						"format" : "soundFile"
 					}
 				}
 			}
-		},
-
-		"base": {
-			"type" : "object"
-		},
-		"templates": {
-			"type":"object",
-			"additionalProperties": {
-				"$ref" : "objectTemplate.json"
-			}
 		}
 	}
 }

+ 31 - 32
config/schemas/obstacle.json

@@ -1,50 +1,49 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI obstacle format",
 	"description" : "Format used to define new obstacles in VCMI",
 	"required" : [ "animation" ],
-
 	"additionalProperties" : false,
-	"properties":{
-		"allowedTerrains": {
-			"type": "array",
-			"description": "Obstacles can be place on specified terrains only",
-			"items": { "type" : "string" }
+	"properties" : {
+		"allowedTerrains" : {
+			"type" : "array",
+			"description" : "Obstacles can be place on specified terrains only",
+			"items" : { "type" : "string" }
 		},
-		"specialBattlefields": {
-			"type": "array",
-			"description": "Obstacles can be placed on specified specified battlefields",
-			"items": { "type" : "string" }
+		"specialBattlefields" : {
+			"type" : "array",
+			"description" : "Obstacles can be placed on specified specified battlefields",
+			"items" : { "type" : "string" }
 		},
-		"width": {
-			"type": "number",
-			"description": "Width ob obstacle"
+		"absolute" : {
+			"type" : "boolean",
+			"description" : "Should be used absolute or relative coordinates for obstacle. There is possible only one absolute obstacle"
 		},
-		"height": {
-			"type": "number",
-			"description": "height if obstacle"
+		"width" : {
+			"type" : "number",
+			"description" : "Width ob obstacle"
 		},
-		"blockedTiles": {
-			"type": "array",
-			"description": "Blocked hexes - absolute or relative hex id",
-			"items": { "type" : "number" }
+		"height" : {
+			"type" : "number",
+			"description" : "height if obstacle"
 		},
-		"animation": {
-			"type": "string",
-			"description": "Image resource",
+		"blockedTiles" : {
+			"type" : "array",
+			"description" : "Blocked hexes - absolute or relative hex id",
+			"items" : { "type" : "number" }
+		},
+		"animation" : {
+			"type" : "string",
+			"description" : "Image resource",
 			"anyOf" : [
 				{ "format" : "defFile" },
 				{ "format" : "imageFile" }
 			]
 		},
-		"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"
+		"unknown" : {
+			"type" : "number",
+			"description" : "Unknown field"
 		}
 	}
 }

+ 20 - 21
config/schemas/river.json

@@ -1,37 +1,36 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$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" : 
+	"properties" : {
+		"shortIdentifier" :
 		{
-			"type": "number",
-			"description": "Internal, do not use"
+			"type" : "string",
+			"description" : "Two-letters unique indentifier for this road. Used in map format"
 		},
-		"text":
+		"text" :
 		{
-			"type": "string",
-			"description": "Human-readable name of the river"
+			"type" : "string",
+			"description" : "Human-readable name of the river"
 		},
-		"shortIdentifier":
+		"tilesFilename" :
 		{
-			"type": "string",
-			"description": "Two-letters unique indentifier for this road. Used in map format"
+			"type" : "string",
+			"description" : "Name of file with river graphics",
+			"format" : "defFile"
 		},
-		"tilesFilename":
+		"delta" :
 		{
-			"type": "string",
-			"description": "Name of file with river graphics",
-			"format": "defFile"
+			"type" : "string",
+			"description" : "Name of file with river delta graphics"
 		},
-		"delta":
+		"index" : 
 		{
-			"type": "string",
-			"description": "Name of file with river delta graphics"
+			"type" : "number",
+			"description" : "Internal, do not use"
 		}
 	}
 }

+ 20 - 21
config/schemas/road.json

@@ -1,37 +1,36 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$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" : 
+	"properties" : {
+		"shortIdentifier" :
 		{
-			"type": "number",
-			"description": "Internal, do not use"
+			"type" : "string",
+			"description" : "Two-letters unique indentifier for this road. Used in map format"
 		},
-		"text":
+		"text" :
 		{
-			"type": "string",
-			"description": "Human-readable name of the road"
+			"type" : "string",
+			"description" : "Human-readable name of the road"
 		},
-		"shortIdentifier":
+		"tilesFilename" :
 		{
-			"type": "string",
-			"description": "Two-letters unique indentifier for this road. Used in map format"
+			"type" : "string",
+			"description" : "Name of file with road graphics",
+			"format" : "defFile"
 		},
-		"tilesFilename":
+		"moveCost" :
 		{
-			"type": "string",
-			"description": "Name of file with road graphics",
-			"format": "defFile"
+			"type" : "number",
+			"description" : "How many movement points needed to move hero"
 		},
-		"moveCost":
+		"index" : 
 		{
-			"type": "number",
-			"description": "How many movement points needed to move hero"
+			"type" : "number",
+			"description" : "Internal, do not use"
 		}
 	}
 }

+ 6 - 10
config/schemas/script.json

@@ -1,22 +1,18 @@
 {
 	"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",
-			"description": "Full VFS path to script source (extension required)"
+			"type" : "string",
+			"description" : "Full VFS path to script source (extension required)"
 		},
-		"implements" :{
-			"type": "string",
-			"enum": ["ANYTHING", "BATTLE_EFFECT"],
-			"description": ""
+		"implements" : {
+			"type" : "string",
+			"enum" : ["ANYTHING", "BATTLE_EFFECT"],
+			"description" : ""
 		}
 	}
 }

+ 41 - 41
config/schemas/settings.json

@@ -2,7 +2,7 @@
 // Any new settings should be added in this file for correct serialization and initialization
 {
 	"type" : "object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"required" : [ "general", "video", "adventure", "pathfinder", "battle", "server", "logging", "launcher", "gameTweaks" ],
 	"definitions" : {
 		"logLevelEnum" : {
@@ -11,11 +11,11 @@
 		}
 	},
 	"additionalProperties" : false,
-	"properties":
+	"properties" :
 	{
 		"general" : {
 			"type" : "object",
-			"default": {},
+			"default" : {},
 			"additionalProperties" : false,
 			"required" : [
 				"playerName",
@@ -35,7 +35,7 @@
 			],
 			"properties" : {
 				"playerName" : {
-					"type":"string",
+					"type" : "string",
 					"default" : "Player"
 				},
 				"music" : {
@@ -59,21 +59,21 @@
 					"default" : false
 				},
 				"lastMap" : {
-					"type":"string",
+					"type" : "string",
 					"default" : "Maps/Arrogance"
 				},
 				"language" : {
-					"type":"string",
+					"type" : "string",
 					"enum" : [ "english", "chinese", "german", "polish", "russian", "spanish", "ukrainian" ],
 					"default" : "english"
 				},
 				"gameDataLanguage" : {
-					"type":"string",
+					"type" : "string",
 					"enum" : [ "auto", "english", "chinese", "german", "korean", "polish", "russian", "spanish", "ukrainian", "other_cp1250", "other_cp1251", "other_cp1252" ],
 					"default" : "auto"
 				},
 				"lastSave" : {
-					"type":"string",
+					"type" : "string",
 					"default" : "NEWGAME"
 				},
 				"lastSettingsTab" : {
@@ -81,7 +81,7 @@
 					"default" : 0
 				},
 				"lastCampaign" : {
-					"type":"string",
+					"type" : "string",
 					"default" : ""
 				},
 				"saveFrequency" : {
@@ -109,7 +109,7 @@
 		"video" : {
 			"type" : "object",
 			"additionalProperties" : false,
-			"default": {},
+			"default" : {},
 			"required" : [ 
 				"resolution", 
 				"bitsPerPixel", 
@@ -133,15 +133,15 @@
 						"height" : { "type" : "number" },
 						"scaling" : { "type" : "number" }
 					},
-					"default": {"width" : 800, "height": 600, "scaling" : 100 }
+					"default" : {"width" : 800, "height" : 600, "scaling" : 100 }
 				},
 				"bitsPerPixel" : {
 					"type" : "number",
 					"default" : 32
 				},
-				"fullscreen": {
-					"type": "boolean",
-					"default": false
+				"fullscreen" : {
+					"type" : "boolean",
+					"default" : false
 				},
 				"realFullscreen" : {
 					"type" : "boolean",
@@ -160,7 +160,7 @@
 					"type" : "boolean",
 					"default" : true
 				},
-				"driver":{
+				"driver" : {
 					"type" : "string",
 					"default" : "opengl",
 					"description" : "preferred graphics backend driver name for SDL2"
@@ -182,7 +182,7 @@
 		"adventure" : {
 			"type" : "object",
 			"additionalProperties" : false,
-			"default": {},
+			"default" : {},
 			"required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "alwaysSkipCombat" ],
 			"properties" : {
 				"heroMoveTime" : {
@@ -222,13 +222,13 @@
 		"pathfinder" : {
 			"type" : "object",
 			"additionalProperties" : false,
-			"default": {},
+			"default" : {},
 			"required" : [ "teleports", "layers", "oneTurnSpecialLayersLimit", "originalMovementRules", "lightweightFlyingMode" ],
 			"properties" : {
 				"layers" : {
 					"type" : "object",
 					"additionalProperties" : false,
-					"default": {},
+					"default" : {},
 					"required" : [ "sailing", "waterWalking", "flying" ],
 					"properties" : {
 						"sailing" : {
@@ -248,7 +248,7 @@
 				"teleports" : {
 					"type" : "object",
 					"additionalProperties" : false,
-					"default": {},
+					"default" : {},
 					"required" : [ "twoWay", "oneWay", "oneWayRandom", "whirlpool", "castleGate" ],
 					"properties" : {
 						"twoWay" : {
@@ -290,7 +290,7 @@
 		"battle" : {
 			"type" : "object",
 			"additionalProperties" : false,
-			"default": {},
+			"default" : {},
 			"required" : [ "speedFactor", "mouseShadow", "cellBorders", "stackRange", "movementHighlightOnHover", "showQueue", "queueSize", "touchscreenMode" ],
 			"properties" : {
 				"speedFactor" : {
@@ -298,7 +298,7 @@
 					"default" : 2
 				},
 				"mouseShadow" : {
-					"type":"boolean",
+					"type" : "boolean",
 					"default" : true
 				},
 				"cellBorders" : {
@@ -331,11 +331,11 @@
 		"server" : {
 			"type" : "object",
 			"additionalProperties" : false,
-			"default": {},
+			"default" : {},
 			"required" : [ "server", "port", "localInformation", "playerAI", "friendlyAI","neutralAI", "enemyAI", "reconnect", "uuid", "names" ],
 			"properties" : {
 				"server" : {
-					"type":"string",
+					"type" : "string",
 					"default" : "127.0.0.1"
 				},
 				"port" : {
@@ -373,7 +373,7 @@
 				"names" : {
 					"type" : "array",
 					"default" : [],
-					"items":
+					"items" :
 					{
 						"type" : "string",
 						"default" : ""
@@ -457,7 +457,7 @@
 		},
 		"launcher" : {
 			"type" : "object",
-			"default": {},
+			"default" : {},
 			"additionalProperties" : false,
 			"required" : [ "setupCompleted", "repositoryURL", "enableInstalledMods", "extraResolutionsModPath", "autoCheckRepositories", "updateOnStartup", "updateConfigUrl", "lobbyUrl", "lobbyPort", "lobbyUsername", "connectionTimeout" ],
 			"properties" : {
@@ -517,10 +517,10 @@
 			}
 		},
 		"gameTweaks" : {
-			"type": "object",
-			"default": {},
-			"additionalProperties": false,
-			"required": [
+			"type" : "object",
+			"default" : {},
+			"additionalProperties" : false,
+			"required" : [
 				"showGrid",
 				"forceMovementInfo",
 				"numericCreaturesQuantities",
@@ -529,18 +529,18 @@
 				"infoBarPick",
 				"skipBattleIntroMusic"
 			],
-			"properties": {
-				"showGrid": {
-					"type": "boolean",
-					"default": false
-				},
-				"forceMovementInfo": {
-					"type": "boolean",
-					"default": false
-				},
-				"numericCreaturesQuantities": {
-					"type": "boolean",
-					"default": false
+			"properties" : {
+				"showGrid" : {
+					"type" : "boolean",
+					"default" : false
+				},
+				"forceMovementInfo" : {
+					"type" : "boolean",
+					"default" : false
+				},
+				"numericCreaturesQuantities" : {
+					"type" : "boolean",
+					"default" : false
 				},
 				"availableCreaturesAsDwellingLabel" : {
 					"type" : "boolean",

+ 16 - 23
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,27 +42,24 @@
 				}
 			}
 		}
-		
 	},
-
 	"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"
+			"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)"
+		"obligatoryMajor" : {
+			"type" : "boolean",
+			"description" : "This skill is major obligatory (like H3 Wisdom)"
 		},
-		"obligatoryMinor":{
-			"type": "boolean",
-			"description": "This skill is minor obligatory (like H3 Magic school)"
+		"obligatoryMinor" : {
+			"type" : "boolean",
+			"description" : "This skill is minor obligatory (like H3 Magic school)"
 		},
 		"gainChance" : {
 			"description" : "Chance for the skill to be offered on level-up (heroClass may override)",

+ 194 - 216
config/schemas/spell.json

@@ -1,332 +1,310 @@
 {
-
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
-
+	"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",
-			"items":{
-				"anyOf":[
+		"animationQueue" : {
+			"type" : "array",
+			"items" : {
+				"anyOf" :[
 					{
 						//dummy animation, pause, Value - frame count
-						"type": "number"
+						"type" : "number"
 					},
 					{
 						//assumed verticalPosition: top
-						"type": "string",
-						"format": "defFile"
+						"type" : "string",
+						"format" : "defFile"
 					},
 					{
-						"type": "object",
-						"properties":{
-							"verticalPosition": {"type":"string", "enum":["top","bottom"]},
-							"defName": {"type":"string", "format": "defFile"}
+						"type" : "object",
+						"properties" : {
+							"verticalPosition" : {"type" : "string", "enum" :["top","bottom"]},
+							"defName" : {"type" : "string", "format" : "defFile"}
 						},
 						"additionalProperties" : false
 					}
 				]
 			}
 		},
-		"animation":{
-			"type": "object",
+		"animation" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"properties":{
-				"affect":{"$ref" : "#/definitions/animationQueue"},
-				"hit":{"$ref" : "#/definitions/animationQueue"},
-				"cast":{"$ref" : "#/definitions/animationQueue"},
-				"projectile":{
-					"type":"array",
-					"items":{
-						"type": "object",
-						"properties":{
-							"minimumAngle": {"type":"number", "minimum" : 0},
-							"defName": {"type":"string", "format": "defFile"}
+			"properties" : {
+				"affect" : {"$ref" : "#/definitions/animationQueue"},
+				"hit" : {"$ref" : "#/definitions/animationQueue"},
+				"cast" : {"$ref" : "#/definitions/animationQueue"},
+				"projectile" : {
+					"type" : "array",
+					"items" : {
+						"type" : "object",
+						"properties" : {
+							"defName" : {"type" : "string", "format" : "defFile"},
+							"minimumAngle" : {"type" : "number", "minimum" : 0}
 						},
 						"additionalProperties" : false
 					}
 				}
 			}
 		},
-		"flags" :{
+		"flags" : {
 			"type" : "object",
 			"additionalProperties" : {
-			"type":"boolean"
+			"type" : "boolean"
 			}
 		},
-		"levelInfo":{
-			"type": "object",
-			"required":["range","description","cost","power","aiValue","range"],
+		"levelInfo" : {
+			"type" : "object",
+			"required" :["range", "description", "cost", "power", "aiValue"],
 
 			"additionalProperties" : false,
-			"properties":{
-				"description":{
-					"type": "string",
-					"description": "Localizable description. Use {xxx} for formatting"
+			"properties" : {
+				"description" : {
+					"type" : "string",
+					"description" : "Localizable description. Use {xxx} for formatting"
 				},
-				"cost":{
-					"type": "number",
-					"description":"Cost in mana points"
+				"cost" : {
+					"type" : "number",
+					"description" : "Cost in mana points"
 				},
-				"power":{
-					"type": "number"
+				"power" : {
+					"type" : "number"
 				},
-				"aiValue":{
-					"type": "number"
+				"range" : {
+					"type" : "string",
+					"description" : "spell range description in SRSL"
 				},
-
-				"range":{
-					"type": "string",
-					"description": "spell range description in SRSL"
+				"aiValue" : {
+					"type" : "number"
 				},
-				"effects":{
-					"type": "object",
-					"description": "Timed effects (updated by prolongation)",
+				"effects" : {
+					"type" : "object",
+					"description" : "Timed effects (updated by prolongation)",
 					"additionalProperties" : {
 						"$ref" : "bonus.json"
 					}
 				},
-				"cumulativeEffects":{
-					"type": "object",
-					"description": "Timed effects (updated by unique bonus)",
+				"cumulativeEffects" : {
+					"type" : "object",
+					"description" : "Timed effects (updated by unique bonus)",
 					"additionalProperties" : {
 						"$ref" : "bonus.json"
 					}
 				},
-				"battleEffects":{
-					"type": "object",
+				"battleEffects" : {
+					"type" : "object",
 					"additionalProperties" : {
-						"type": "object"
+						"type" : "object"
 					}
 				},
-				"targetModifier":{
-					"type": "object",
-					"additionalProperties": false,
-					"properties":{
-						"smart":{
-							"type": "boolean",
-							"description": "true: friendly/hostile based on positiveness; false: all targets"
+				"targetModifier" : {
+					"type" : "object",
+					"additionalProperties" : false,
+					"properties" : {
+						"smart" : {
+							"type" : "boolean",
+							"description" : "true: friendly/hostile based on positiveness; false: all targets"
 						},
-						"clearTarget":
+						"clearTarget" :
 						{
-							"type": "boolean",
-							"description": "LOCATION target only. Target hex/tile must be clear"
+							"type" : "boolean",
+							"description" : "LOCATION target only. Target hex/tile must be clear"
 						},
-						"clearAffected":
+						"clearAffected" :
 						{
-							"type": "boolean",
-							"description": "LOCATION target only. All affected hexes/tile must be clear"
+							"type" : "boolean",
+							"description" : "LOCATION target only. All affected hexes/tile must be clear"
 						}
 					}
 				}
 			}
 		},
-
-		"texts":{
-			"type": "object",
-
-
+		"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"
+	"properties" : {
+		"index" : {
+				"type" : "number",
+				"description" : "numeric id of spell required only for original spells, prohibited for new spells"
 		},
-		"type":{
-				"type": "string",
-				"enum": ["adventure", "combat", "ability"],
-				"description":"Spell type"
+		"name" : {
+			"type" : "string",
+			"description" : "Localizable name"
 		},
-		"name":{
-				"type": "string",
-				"description": "Localizable name"
-
+		"type" : {
+				"type" : "string",
+				"enum" : ["adventure", "combat", "ability"],
+				"description" : "Spell type"
 		},
-		"school":{
-				"type": "object",
-				"description": "Spell schools",
-				"additionalProperties": false,
-
-				"properties":{
-
-						"air":{"type": "boolean"},
-						"fire":{"type": "boolean"},
-						"earth":{"type": "boolean"},
-						"water":{"type": "boolean"}
+		"school" : {
+				"type" : "object",
+				"description" : "Spell schools",
+				"additionalProperties" : false,
+				"properties" : {
+						"air" : {"type" : "boolean"},
+						"fire" : {"type" : "boolean"},
+						"earth" : {"type" : "boolean"},
+						"water" : {"type" : "boolean"}
 				}
-
 		},
-		"level":{
-				"type": "number",
-				"description": "Spell level",
+		"level" : {
+				"type" : "number",
+				"description" : "Spell level",
 				"minimum" : 0,
 				"maximum" : 5
 		},
-
-		"power":{
-				"type": "number",
-				"description": "Base power"
+		"power" : {
+				"type" : "number",
+				"description" : "Base power"
 		},
-
-		"defaultGainChance":{
-				"type": "number",
-				"description": "Gain chance by default for all factions"
+		"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",
+		"gainChance" : {
+				"type" : "object",
+				"description" : "Chance in % to gain for faction. NOTE: this field is merged with faction config",
 				"additionalProperties" : {
-					"type": "number",
+					"type" : "number",
 					"minimum" : 0
 				}
 		},
-		"targetType":{
-				  "type": "string",
-				  "description": "NO_TARGET - instant cast no aiming, default; CREATURE - target is unit; OBSTACLE - target is OBSTACLE; LOCATION - target is location",
-				  "enum": ["NO_TARGET","CREATURE","OBSTACLE","LOCATION"]
+		"targetType" : {
+				  "type" : "string",
+				  "description" : "NO_TARGET - instant cast no aiming, default; CREATURE - target is unit; OBSTACLE - target is OBSTACLE; LOCATION - target is location",
+				  "enum" : ["NO_TARGET","CREATURE","OBSTACLE","LOCATION"]
 		},
-		"counters":{
+		"counters" : {
 				 "$ref" : "#/definitions/flags",
-				 "description": "Flags structure ids of countering spells"
+				 "description" : "Flags structure ids of countering spells"
 		},
-		"flags":{
-				"type": "object",
-				"description": "Various flags",
+		"flags" : {
+				"type" : "object",
+				"description" : "Various flags",
 				"additionalProperties" : false,
-				"properties":{
-						"indifferent": {
-								"type":"boolean",
-								"description": "Spell is indifferent for target"
+				"properties" : {
+						"indifferent" : {
+								"type" : "boolean",
+								"description" : "Spell is indifferent for target"
 						},
-						"negative": {
-								"type":"boolean",
-								"description": "Spell is negative for target"
+						"negative" : {
+								"type" : "boolean",
+								"description" : "Spell is negative for target"
 						},
-						"positive": {
-								"type":"boolean",
-								"description": "Spell is positive for target"
+						"positive" : {
+								"type" : "boolean",
+								"description" : "Spell is positive for target"
 						},
-						"damage": {
-								"type":"boolean",
-								"description": "Spell does damage (direct or indirect)"
+						"damage" : {
+								"type" : "boolean",
+								"description" : "Spell does damage (direct or indirect)"
 						},
-						"offensive": {
-								"type":"boolean",
-								"description": "Spell does direct damage (implicitly sets damage and negative)"
+						"offensive" : {
+								"type" : "boolean",
+								"description" : "Spell does direct damage (implicitly sets damage and negative)"
 						},
-						"rising":{
-								"type":"boolean",
-								"description": "Rising spell (implicitly sets positive)"
+						"rising" : {
+								"type" : "boolean",
+								"description" : "Rising spell (implicitly sets positive)"
 						},
-						"special":{
-								"type": "boolean",
-								"description": "Special spell. Can be given only by BonusType::SPELL"
+						"special" : {
+								"type" : "boolean",
+								"description" : "Special spell. Can be given only by BonusType::SPELL"
 						},
-						"nonMagical":{
-							"type": "boolean",
-							"description": "Non-magical ability. Usually used by some creatures. Should not be affected by sorcery and generic magic resistance. School resistances apply. Examples: dendroid bind, efreet fire shield."
+						"nonMagical" : {
+							"type" : "boolean",
+							"description" : "Non-magical ability. Usually used by some creatures. Should not be affected by sorcery and generic magic resistance. School resistances apply. Examples: dendroid bind, efreet fire shield."
 					}
 				}
 		},
-		"immunity":{
+		"immunity" : {
 				"$ref" : "#/definitions/flags",
-				 "description": "flags structure of bonus names, any one of these bonus grants immunity"
+				 "description" : "flags structure of bonus names, any one of these bonus grants immunity"
 		},
-		"absoluteImmunity":{
+		"absoluteImmunity" : {
 				 "$ref" : "#/definitions/flags",
-				 "description": "flags structure of bonus names. Any one of these bonus grants immunity, can't be negated"
+				 "description" : "flags structure of bonus names. Any one of these bonus grants immunity, can't be negated"
 		},
-		"limit":{
+		"limit" : {
 				 "$ref" : "#/definitions/flags",
-				 "description": "flags structure of bonus names, presence of all bonuses required to be affected by."
+				 "description" : "flags structure of bonus names, presence of all bonuses required to be affected by."
 		},
-		"absoluteLimit":{
+		"absoluteLimit" : {
 				 "$ref" : "#/definitions/flags",
-				 "description": "flags structure of bonus names, presence of all bonuses required to be affected by, can't be negated."
+				 "description" : "flags structure of bonus names, presence of all bonuses required to be affected by, can't be negated."
 		},
-		"targetCondition":{
-			"type": "object",
+		"targetCondition" : {
+			"type" : "object",
 			"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"
-						 }
-				 }
-
+		"animation" : {"$ref" : "#/definitions/animation"},
+		"graphics" : {
+			"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",
+		"sounds" : {
+			 "type" : "object",
 			 "additionalProperties" : false,
-			 "properties":{
-					 "cast":{
-						  "type": "string",
-						  "description": "Resourse path of cast sound"
+			 "properties" : {
+					 "cast" : {
+						  "type" : "string",
+						  "description" : "Resourse path of cast sound"
 					 }
 			 }
 		},
-
-		"levels":{
-			 "type": "object",
+		"levels" : {
+			 "type" : "object",
 			 "additionalProperties" : false,
 			 "required" : ["none", "basic", "advanced", "expert"],
-
-			 "properties":{
-				"base":{
-					"type": "object",
-					"description": "will be merged with all levels",
-					"additionalProperties": true
+			 "properties" : {
+				"base" : {
+					"type" : "object",
+					"description" : "will be merged with all levels",
+					"additionalProperties" : true
 				},
-				"none":{
+				"none" : {
 					"$ref" : "#/definitions/levelInfo"
 				},
-				"basic":{
+				"basic" : {
 					"$ref" : "#/definitions/levelInfo"
 				},
-				"advanced":{
+				"advanced" : {
 					"$ref" : "#/definitions/levelInfo"
 				},
-				"expert":{
+				"expert" : {
 					"$ref" : "#/definitions/levelInfo"
 				}
 			}

+ 50 - 55
config/schemas/template.json

@@ -1,89 +1,84 @@
 {
-
-	"type":"object",
-	"$schema": "",
-
+	"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" :
 	{
-		"zone":{
-			"type": "object",
+		"zone" : {
+			"type" : "object",
 			"required" : ["type", "monsters", "size"],
-			"properties":{
-				"type":{"$ref" : "#/definitions/type"},
-				"size":{"$ref" : "#/definitions/size"},			
-				"playerTowns":{"$ref" : "#/definitions/playerTowns"},				
-				"neuralTowns":{"$ref" : "#/definitions/neuralTowns"},
-				"townsAreSameType":{"$ref" : "#/definitions/townsAreSameType"},
-				"monsters":{"$ref" : "#/definitions/monsters"},
-				"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}
+			"properties" : {
+				"type" : {"$ref" : "#/definitions/type"},
+				"size" : {"$ref" : "#/definitions/size"},			
+				"playerTowns" : {"$ref" : "#/definitions/playerTowns"},				
+				"neuralTowns" : {"$ref" : "#/definitions/neuralTowns"},
+				"townsAreSameType" : {"$ref" : "#/definitions/townsAreSameType"},
+				"monsters" : {"$ref" : "#/definitions/monsters"},
+				"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}
 						},					
 						"additionalProperties" : false						
 					}
 				}				
 			}		
 		},
-		"type" :{
-			"enum": ["playerStart", "cpuStart", "treasure", "junction"],
+		"type" : {
+			"type" : "string",
 			"additionalProperties" : false,
-			"type":"string"
+			"enum" : ["playerStart", "cpuStart", "treasure", "junction"]
 		},
-		"size":{
-			"type": "number",
-			"minimum": 1,
-			"additionalProperties" : false,
+		"size" : {
+			"type" : "number",
+			"minimum" : 1,
+			"additionalProperties" : false
 		},
-		"connection":
+		"connection" :
 		{
-			"required": ["a", "b", "guard"],
-			"properties":{
-				"a":{
+			"required" : ["a", "b", "guard"],
+			"properties" : {
+				"a" : {
 					"type" : "string"
 				},
-				"b":{
+				"b" : {
 					"type" : "string"
 				},
-				"guard":
+				"guard" :
 				{
-					"type": "number",
+					"type" : "number",
 					"minimum" : 0
 				}
 			}
 		},
-		"waterContent":
+		"waterContent" :
 		{
-			"enum": ["none", "normal", "islands"],
+			"enum" : ["none", "normal", "islands"],
 			"additionalProperties" : false,
-			"type": "string"
+			"type" : "string"
 		}
 	},
-
-	"properties":
+	"properties" :
 	{
-		"zones":{
-			"type": "object",
-			"additionalProperties":{"$ref" : "#/definitions/zone"	}						
-		},
-		"connections":{
-			"type": "array",
-			"items":{"$ref" : "#/definitions/connection"}	
+		"required" : ["zones", "connections"],
+		"additionalProperties" : false,
+		"zones" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "#/definitions/zone"	}						
 		},
-		"allowedWaterContent": {
-			"type": "array",
-			"items": {"$ref" : "#/definitions/waterContent"}
+		"connections" : {
+			"type" : "array",
+			"items" : {"$ref" : "#/definitions/connection"}	
 		},
-		"required" : ["zones", "connections"],
-		"additionalProperties" : false
+		"allowedWaterContent" : {
+			"type" : "array",
+			"items" : {"$ref" : "#/definitions/waterContent"}
+		}
 	}
 }

+ 94 - 95
config/schemas/terrain.json

@@ -1,144 +1,143 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"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":
+	"properties" : {
+		"text" :
 		{
-			"type": "string",
-			"description": "Human-readable name of this terrain"
+			"type" : "string",
+			"description" : "Human-readable name of this terrain"
 		},
-		"moveCost":
+		"shortIdentifier" :
 		{
-			"type": "number",
-			"description": "How many movement points needed to move hero"
-		},
-		"minimapUnblocked":
-		{
-			"type": "array",
-			"description": "Color of terrain on minimap without unpassable objects",
-			"minItems": 3,
-			"maxItems": 3,
-			"items":
-			{
-				"type": "number"
-			}
+			"type" : "string",
+			"description" : "Two-letters unique indentifier for this terrain. Used for map format"
 		},
-		"minimapBlocked":
+		"type" :
 		{
-			"type": "array",
-			"description": "Color of terrain on minimap with unpassable objects",
-			"minItems": 3,
-			"maxItems": 3,
-			"items":
+			"type" : "array",
+			"description" : "Type of this terrain. Can be land, water, subterranean or rock",
+			"items" :
 			{
-				"type": "number"
+				"enum" : ["LAND", "WATER", "SUB", "ROCK", "SURFACE"],
+				"type" : "string"
 			}
 		},
-		"music":
+		"moveCost" :
 		{
-			"type": "string",
-			"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"
-			}
+			"type" : "number",
+			"description" : "How many movement points needed to move hero"
 		},
-		"rockTerrain":
+		"tiles" :
 		{
-			"type": "string",
-			"description": "The name of rock type terrain which will be used as borders in the underground"
+			"type" : "string",
+			"description" : "Name of file with graphicks",
+			"format" : "defFile"
 		},
-		"river":
+		"rockTerrain" :
 		{
-			"type": "string",
-			"description": "River type which should be used for that terrain"
+			"type" : "string",
+			"description" : "The name of rock type terrain which will be used as borders in the underground"
 		},
-		"horseSound":
+		"river" :
 		{
-			"type": "string",
-			"description": "Hero movement sound for this terrain, version for moving on tiles with road",
-			"format": "soundFile"
+			"type" : "string",
+			"description" : "River type which should be used for that terrain"
 		},
-		"horseSoundPenalty":
+		"battleFields" :
 		{
-			"type": "string",
-			"description": "Hero movement sound for this terrain, version for moving on tiles without road",
-			"format": "soundFile"
+			"type" : "array",
+			"description" : "array of battleFields for this terrain",
+			"items" :
+			{
+				"type" : "string"
+			}
 		},
-		"shortIdentifier":
+		"minimapUnblocked" :
 		{
-			"type": "string",
-			"description": "Two-letters unique indentifier for this terrain. Used for map format"
+			"type" : "array",
+			"description" : "Color of terrain on minimap without unpassable objects",
+			"minItems" : 3,
+			"maxItems" : 3,
+			"items" :
+			{
+				"type" : "number"
+			}
 		},
-		"battleFields":
+		"minimapBlocked" :
 		{
-			"type": "array",
-			"description": "array of battleFields for this terrain",
-			"items":
+			"type" : "array",
+			"description" : "Color of terrain on minimap with unpassable objects",
+			"minItems" : 3,
+			"maxItems" : 3,
+			"items" :
 			{
-				"type": "string"
+				"type" : "number"
 			}
 		},
-		"sounds":
+		"music" :
 		{
-			"type": "object",
-			"description": "list of sounds for this terrain",
+			"type" : "string",
+			"description" : "Music filename to play on this terrain on adventure map",
+			"format" : "musicFile"
+		},
+		"sounds" :
+		{
+			"type" : "object",
+			"description" : "list of sounds for this terrain",
 			"additionalProperties" : false,
-			"properties":
+			"properties" :
 			{
 				"ambient" : 
 				{
-					"type": "array",
-					"description": "list of ambient sounds for this terrain",
-					"items":
+					"type" : "array",
+					"description" : "list of ambient sounds for this terrain",
+					"items" :
 					{
-						"type": "string",
-						"format": "soundFile"
+						"type" : "string",
+						"format" : "soundFile"
 					}
 				}
 			}
 		},
-		"prohibitTransitions":
+		"horseSound" :
 		{
-			"type": "array",
-			"description": "array or terrain names, which is prohibited to make transition from/to",
-			"items":
+			"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",
+			"description" : "array or terrain names, which is prohibited to make transition from/to",
+			"items" :
 			{
-				"type": "string"
+				"type" : "string"
 			}
 		},
-		"transitionRequired":
+		"transitionRequired" :
 		{
-			"type": "boolean",
-			"description": "If sand/dirt transition required from/to other terrains"
+			"type" : "boolean",
+			"description" : "If sand/dirt transition required from/to other terrains"
 		},
-		"terrainViewPatterns":
+		"terrainViewPatterns" :
+		{
+			"type" : "string",
+			"description" : "Can be normal, dirt, water, rock"
+		},
+		"index" :
 		{
-			"type": "string",
-			"description": "Can be normal, dirt, water, rock"
+			"type" : "number",
+			"description" : "Internal, do not use"
 		}
 	}
 }

+ 55 - 57
config/schemas/townBuilding.json

@@ -1,10 +1,9 @@
 {
-	"type":"object",
+	"type" : "object",
 	"additionalProperties" : false,
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"$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,71 +21,70 @@
 			}
 		} 
 	},
-
-	"properties":{
-		"id": {
-			"type":"number",
+	"properties" : {
+		"id" : {
+			"type" : "number",
 			"description" : "Numeric identifier of this building"
 		},
-		"type": {
-			"type":"string",
-			"description" : "Subtype for some special buildings"
+		"name" : {
+			"description" : "Name of this building",
+			"type" : "string"
 		},
-		"height": {
-			"type":"string",
-			"enum" : [ "skyship", "high", "average", "low"],
-			"description" : "Height for lookout towers and some grails"
+		"description" : {
+			"description" : "Full decsription of this building",
+			"type" : "string"
 		},
-		"mode": {
-			"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"
 		},
-		"requires": {
+		"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": {
+		"upgrades" : {
 			"description" : "If this building is upgrade, identifier of base building",
-			"type":"string"
-		},
-		"name" : {
-			"description" : "Name of this building",
 			"type" : "string"
 		},
-		"description" : {
-			"description" : "Full decsription of this building",
-			"type" : "string"
-		},
-		"cost": {
-			"type":"object",
+		"cost" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Cost to build this building",
-			"properties":{
-				"wood":    { "type":"number"},
-				"mercury": { "type":"number"},
-				"ore":     { "type":"number"},
-				"sulfur":  { "type":"number"},
-				"crystal": { "type":"number"},
-				"gems":    { "type":"number"},
-				"gold":    { "type":"number"}
+			"description" : "Cost to build this 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",
+		"produce" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Resources this building produce each day",
-			"properties":{
-				"wood":    { "type":"number"},
-				"mercury": { "type":"number"},
-				"ore":     { "type":"number"},
-				"sulfur":  { "type":"number"},
-				"crystal": { "type":"number"},
-				"gems":    { "type":"number"},
-				"gold":    { "type":"number"}
+			"description" : "Resources this building produce each day",
+			"properties" : {
+				"gold" :    { "type" : "number"},
+				"wood" :    { "type" : "number"},
+				"ore" :     { "type" : "number"},
+				"mercury" : { "type" : "number"},
+				"sulfur" :  { "type" : "number"},
+				"crystal" : { "type" : "number"},
+				"gems" :    { "type" : "number"}
 			}
 		},
-		"overrides": {
+		"overrides" : {
 			"type" : "array",
 			"items" : [
 				{
@@ -95,15 +93,15 @@
 				}
 			]
 		},
-		"bonuses": {
-			"type":"array",
-			"description": "Bonuses, provided by this special building on build using bonus system",
-			"items": { "$ref" : "bonus.json" }
+		"bonuses" : {
+			"type" : "array",
+			"description" : "Bonuses, provided by this special building on build using bonus system",
+			"items" : { "$ref" : "bonus.json" }
 		},
-		"onVisitBonuses": {
-			"type":"array",
-			"description": "Bonuses, provided by this special building on hero visit and applied to the visiting hero",
-			"items": { "$ref" : "bonus.json" }
+		"onVisitBonuses" : {
+			"type" : "array",
+			"description" : "Bonuses, provided by this special building on hero visit and applied to the visiting hero",
+			"items" : { "$ref" : "bonus.json" }
 		}
 	}
 }

+ 81 - 84
config/schemas/townSiege.json

@@ -1,144 +1,141 @@
 {
-	"type":"object",
+	"type" : "object",
 	"additionalProperties" : false,
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"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" : {
 			"type" : "object",
 			"additionalProperties" : false,
 			"required" : [ "x", "y" ],
-			"properties":{
-				"x": { "type":"number" },
-				"y": { "type":"number" }
+			"properties" : {
+				"x" : { "type" : "number" },
+				"y" : { "type" : "number" }
 			}
 		},
 		"tower" : {
 			"type" : "object",
 			"additionalProperties" : false,
 			"required" : [ "battlement", "creature", "tower" ],
-			"properties":{
-				"battlement": {
-					"description" : "Location of battlement, part of tower that covers shooter",
+			"properties" : {
+				"tower" : {
+					"description" : "Location of main segment of tower",
 					"$ref" : "#/definitions/point"
 				},
-				"creature": {
-					"description" : "Location of shooter in tower",
+				"battlement" : {
+					"description" : "Location of battlement, part of tower that covers shooter",
 					"$ref" : "#/definitions/point"
 				},
-				"tower": {
-					"description" : "Location of main segment of tower",
+				"creature" : {
+					"description" : "Location of shooter in tower",
 					"$ref" : "#/definitions/point"
 				}
 			}
 		}
 	},
-
-	"properties":{
-		"gate": {
-			"type":"object",
-			"additionalProperties" : false,
-			"description" : "Town gates",
-			"properties":{
-				"arch": {
-					"description" : "Static, top part of gates",
-					"$ref" : "#/definitions/point"
-				},
-				"gate": {
-					"description" : "Main section of gates",
-					"$ref" : "#/definitions/point"
-				}
-			}
-		},
-		"imagePrefix": {
-			"type":"string",
-			"description" : "Prefix to all images related to siege screen"
-		},
-		"moat": {
-			"type":"object",
-			"additionalProperties" : false,
-			"description" : "Castle moat description",
-			"properties":{
-				"bank": {
-					"description" : "Small section with bank of the moat",
-					"$ref" : "#/definitions/point"
-				},
-				"moat": {
-					"description" : "Main section of the moat",
-					"$ref" : "#/definitions/point"
-				}
-			}
-		},
-		"shooter": {
-			"type":"string",
+	"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",
+		"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",
+		"towerIconLarge" : {
+			"type" : "string",
+			"description" : "Large icon for tower, used in battle queue",
 			"format" : "imageFile"
 		},
-		"static": {
-			"type":"object",
+		"imagePrefix" : {
+			"type" : "string",
+			"description" : "Prefix to all images related to siege screen"
+		},
+		"static" : {
+			"type" : "object",
 			"additionalProperties" : false,
 			"description" : "Static sections of walls",
-			"properties":{
-				"background": {
+			"properties" : {
+				"background" : {
 					"description" : "Very top section of the wall located above hero",
 					"$ref" : "#/definitions/point"
 				},
-				"bottom": {
-					"description" : "Bottom section located between destructible sections",
+				"top" : {
+					"description" : "Top section located between destructible sections",
 					"$ref" : "#/definitions/point"
 				},
-				"top": {
-					"description" : "Top section located between destructible sections",
+				"bottom" : {
+					"description" : "Bottom section located between destructible sections",
 					"$ref" : "#/definitions/point"
 				}
 			}
 		},
-		"towers": {
-			"type":"object",
+		"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" }
+			"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",
+		"walls" : {
+			"type" : "object",
 			"additionalProperties" : false,
 			"description" : "Destructible sections of the walls",
-			"properties":{
-				"bottomMid": {
+			"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": {
+				"bottom" : {
 					"description" : "Bottommost section located near bottom tower",
 					"$ref" : "#/definitions/point"
+				}
+			}
+		},
+		"gate" : {
+			"type" : "object",
+			"additionalProperties" : false,
+			"description" : "Town gates",
+			"properties" : {
+				"arch" : {
+					"description" : "Static, top part of gates",
+					"$ref" : "#/definitions/point"
 				},
-				"upperMid": {
-					"description" : "Second from top section located near gates",
+				"gate" : {
+					"description" : "Main section of gates",
+					"$ref" : "#/definitions/point"
+				}
+			}
+		},
+		"moat" : {
+			"type" : "object",
+			"additionalProperties" : false,
+			"description" : "Castle moat description",
+			"properties" : {
+				"bank" : {
+					"description" : "Small section with bank of the moat",
 					"$ref" : "#/definitions/point"
 				},
-				"upper": {
-					"description" : "Topmost section located near top tower",
+				"moat" : {
+					"description" : "Main section of the moat",
 					"$ref" : "#/definitions/point"
 				}
 			}

+ 24 - 24
config/schemas/townStructure.json

@@ -1,44 +1,44 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI town structures format",
 	"description" : "Format used to define structures visible on town screen in VCMI",
-	"required": [ "animation", "x", "y"],
+	"required" : [ "animation", "x", "y"],
 	"additionalProperties" : false,
-	"properties":{
-		"animation": {
-			"type":"string",
+	"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",
 			"format" : "animationFile"
 		},
-		"area": {
-			"type":"string",
+		"area" : {
+			"type" : "string",
 			"description" : "Area that indicate when building is selected. Must be 8-bit image",
 			"format" : "imageFile"
 		},
-		"border": {
-			"type":"string",
+		"border" : {
+			"type" : "string",
 			"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",
+		"x" : {
+			"type" : "number",
 			"description" : "Position on screen"
 		},
-		"y": {
-			"type":"number",
+		"y" : {
+			"type" : "number",
 			"description" : "Position on screen"
 		},
-		"z": {
-			"type":"number",
+		"z" : {
+			"type" : "number",
 			"description" : "Position on screen. Buildings with higher value will be drawn on top of other buildings"
 		}
 	}