faction.json 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. {
  2. "definitions" : {
  3. "townIcon" :
  4. {
  5. "type" : "object",
  6. "additionalProperties" : false,
  7. "required" : [ "small", "large" ],
  8. "properties" : {
  9. "small" : { "type" : "string", "format" : "imageFile" },
  10. "large" : { "type" : "string", "format" : "imageFile" }
  11. }
  12. },
  13. "townIconPair" : {
  14. "type" : "object",
  15. "additionalProperties" : false,
  16. "required" : [ "normal", "built" ],
  17. "properties" : {
  18. "built" : {
  19. "$ref" : "#/definitions/townIcon",
  20. "description" : "Icon used after player build something in town"
  21. },
  22. "normal" : {
  23. "$ref" : "#/definitions/townIcon",
  24. "description" : "Icon used normally"
  25. }
  26. }
  27. }
  28. },
  29. "type" : "object",
  30. "$schema" : "http://json-schema.org/draft-04/schema",
  31. "title" : "VCMI faction format",
  32. "description" : "Json format for defining new faction (aka towns) in VCMI",
  33. "required" : [ "name", "boat", "alignment", "nativeTerrain", "creatureBackground" ],
  34. "dependencies" : {
  35. "town" : [ "puzzleMap" ]
  36. },
  37. "additionalProperties" : false,
  38. "properties" : {
  39. "name" : {
  40. "type" : "string",
  41. "description" : "Localizable faction name, e.g. Rampart"
  42. },
  43. "description" : {
  44. "type" : "string",
  45. "description" : "Description about the faction"
  46. },
  47. "alignment" : {
  48. "type" : "string",
  49. "enum" : [ "good", "neutral", "evil" ],
  50. "description" : "Faction alignment, good, neutral or evil"
  51. },
  52. "nativeTerrain" : {
  53. "type" : "string",
  54. "description" : "Native terrain for creatures. Creatures fighting on native terrain receive several bonuses"
  55. },
  56. "boat" : {
  57. "type" : "string",
  58. "description" : "Identifier of boat type that is produced by shipyard and used by heroes in water taverns or prisons"
  59. },
  60. "preferUndergroundPlacement" : {
  61. "type" : "boolean",
  62. "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."
  63. },
  64. "special" : {
  65. "type" : "boolean",
  66. "description" : "If true, faction is disabled from starting pick and in random map generation"
  67. },
  68. "creatureBackground" : {
  69. "type" : "object",
  70. "additionalProperties" : false,
  71. "required" : [ "120px", "130px" ],
  72. "description" : "Backgrounds for creature info card",
  73. "properties" : {
  74. "120px" : {
  75. "type" : "string",
  76. "description" : "Version that is 120 pixels in height",
  77. "format" : "imageFile"
  78. },
  79. "130px" : {
  80. "type" : "string",
  81. "description" : "Version that is 130 pixels in height",
  82. "format" : "imageFile"
  83. }
  84. }
  85. },
  86. "town" : {
  87. "type" : "object",
  88. "additionalProperties" : false,
  89. "required" : [
  90. "mapObject", "buildingsIcons", "buildings", "creatures", "guildWindow", "names",
  91. "hallBackground", "hallSlots", "horde", "mageGuild", "moatAbility", "defaultTavern", "tavernVideo", "guildBackground", "musicTheme", "siege", "structures", "townBackground"
  92. ],
  93. "description" : "town",
  94. "properties" : {
  95. "creatures" : {
  96. "type" : "array",
  97. "minItems" : 7,
  98. "maxItems" : 8,
  99. "description" : "List of creatures available for recruitment on each level",
  100. "items" : {
  101. "type" : "array",
  102. "items" : { "type" : "string" }
  103. }
  104. },
  105. "hallSlots" : {
  106. "type" : "array",
  107. "description" : "Description of town hall",
  108. "minItems" : 5,
  109. "maxItems" : 5,
  110. "items" : {
  111. "type" : "array",
  112. "minItems" : 1,
  113. "maxItems" : 4,
  114. "items" : {
  115. "type" : "array",
  116. "description" : "List of buildings available in one slot",
  117. "items" : { "type" : "string" }
  118. }
  119. }
  120. },
  121. "buildings" : {
  122. "type" : "object",
  123. "additionalProperties" : {
  124. "$ref" : "townBuilding.json"
  125. }
  126. },
  127. "mageGuild" : {
  128. "type" : "number",
  129. "description" : "Maximal level of mage guild"
  130. },
  131. "primaryResource" : {
  132. "type" : "string",
  133. "description" : "Primary resource for this town. Produced by Silo and offered as starting bonus"
  134. },
  135. "horde" : {
  136. "type" : "array",
  137. "maxItems" : 2,
  138. "description" : "Levels of creatures that have hordes in town",
  139. "items" : { "type" : "number" }
  140. },
  141. "moatAbility" : {
  142. "type" : "string",
  143. "description" : "Identifier of ability to use as town moat during siege"
  144. },
  145. "siege" : {
  146. "$ref" : "townSiege.json"
  147. },
  148. "musicTheme" : {
  149. "type" : "array",
  150. "description" : "Path to town music themes",
  151. "minItems" : 1,
  152. "items" : {
  153. "type" : "string",
  154. "format" : "musicFile"
  155. }
  156. },
  157. "tavernVideo" : {
  158. "type" : "string",
  159. "description" : "Video for tavern window",
  160. "format" : "videoFile"
  161. },
  162. "townBackground" : {
  163. "type" : "string",
  164. "description" : "Background for town screen",
  165. "format" : "imageFile"
  166. },
  167. "guildWindow" : {
  168. "anyOf" : [
  169. {
  170. "type" : "array",
  171. "description" : "Image with small view on town from mage guild (each array element for different mage guild level; if one element only this will be always selected)",
  172. "minItems" : 1,
  173. "items" : {
  174. "type" : "string",
  175. "format" : "imageFile"
  176. }
  177. },
  178. {
  179. "type" : "string",
  180. "description" : "Image with small view on town from mage guild",
  181. "format" : "imageFile"
  182. }
  183. ]
  184. },
  185. "guildBackground" : {
  186. "anyOf" : [
  187. {
  188. "type" : "array",
  189. "description" : "Image with background of mage guild (each array element for different mage guild level; if one element only this will be always selected)",
  190. "minItems" : 1,
  191. "items" : {
  192. "type" : "string",
  193. "format" : "imageFile"
  194. }
  195. },
  196. {
  197. "type" : "string",
  198. "description" : "Image with background of mage guild",
  199. "format" : "imageFile"
  200. }
  201. ]
  202. },
  203. "guildWindowPosition" : {
  204. "type" : "object",
  205. "additionalProperties" : false,
  206. "properties" : {
  207. "x" : { "type" : "number", "description" : "X coordinate on screen" },
  208. "y" : { "type" : "number", "description" : "Y coordinate on screen" }
  209. }
  210. },
  211. "guildSpellPositions" : {
  212. "type" : "array",
  213. "description" : "Positions of spells in mage guild",
  214. "items" : {
  215. "type" : "array",
  216. "items" : {
  217. "type" : "object",
  218. "additionalProperties" : false,
  219. "properties" : {
  220. "x" : { "type" : "number", "description" : "X coordinate on screen" },
  221. "y" : { "type" : "number", "description" : "Y coordinate on screen" }
  222. }
  223. }
  224. }
  225. },
  226. "hallBackground" : {
  227. "type" : "string",
  228. "description" : "background image for town hall",
  229. "format" : "imageFile"
  230. },
  231. "buildingsIcons" : {
  232. "type" : "string",
  233. "description" : "Path to building icons for town hall",
  234. "format" : "animationFile"
  235. },
  236. "mapObject" : {
  237. "properties" : {
  238. "filters" : {
  239. "type" : "object",
  240. "additionalProperties" : { "type" : "array" }
  241. }
  242. }
  243. },
  244. "structures" : {
  245. "type" : "object",
  246. "additionalProperties" : {
  247. "$ref" : "townStructure.json"
  248. }
  249. },
  250. "icons" : {
  251. "type" : "object",
  252. "additionalProperties" : false,
  253. "description" : "Town icons",
  254. "required" : [ "fort", "village" ],
  255. "properties" : {
  256. "fort" : {
  257. "$ref" : "#/definitions/townIconPair",
  258. "description" : "Icons for town with built fort"
  259. },
  260. "village" : {
  261. "$ref" : "#/definitions/townIconPair",
  262. "description" : "Icons for town without fort"
  263. }
  264. }
  265. },
  266. "defaultTavern" : {
  267. "type" : "number",
  268. "description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field",
  269. "minimum" : 0
  270. },
  271. "tavern" : {
  272. "type" : "object",
  273. "description" : "Hero classes available in tavern. Value indicates chance for hero of this class to appear",
  274. "additionalProperties" : {
  275. "type" : "number",
  276. "minimum" : 0
  277. }
  278. },
  279. "guildSpells" : {
  280. "type" : "object",
  281. "description" : "Spells available in mage guild. Value indicates chance for this spell to appear",
  282. "additionalProperties" : {
  283. "type" : "number"
  284. }
  285. },
  286. "names" : {
  287. "type" : "array",
  288. "description" : "Names for towns on adventure map",
  289. "minItems" : 1,
  290. "items" : { "type" : "string" }
  291. }
  292. }
  293. },
  294. "puzzleMap" : {
  295. "type" : "object",
  296. "additionalProperties" : false,
  297. "required" : [ "prefix", "pieces" ],
  298. "description" : "Puzzle map from obelisks for this town. Must contain 48 pieces",
  299. "properties" : {
  300. "pieces" : {
  301. "type" : "array",
  302. "description" : "Lits of pieces definitions",
  303. "minItems" : 48,
  304. "maxItems" : 48,
  305. "items" : {
  306. "type" : "object",
  307. "additionalProperties" : false,
  308. "properties" : {
  309. "index" : { "type" : "number", "description" : "Order in which images will be opened" },
  310. "x" : { "type" : "number", "description" : "X coordinate on screen" },
  311. "y" : { "type" : "number", "description" : "Y coordinate on screen" }
  312. }
  313. }
  314. },
  315. "prefix" : {
  316. "type" : "string",
  317. "description" : "Prefix for image names, e.g. \"PUZCAS\" for name \"PUZCAS12.png\""
  318. }
  319. }
  320. },
  321. "index" : {
  322. "type" : "number",
  323. "description" : "Private field to break things, do not use."
  324. }
  325. }
  326. }