creature.json 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. {
  2. "type":"object",
  3. "$schema": "http://json-schema.org/draft-04/schema",
  4. "title" : "VCMI creature format",
  5. "description": "Json format for defining new creatures in VCMI",
  6. "required" : [ "faction" ],
  7. "anyOf" : [
  8. {
  9. "disabled" : { "enum" : [ true ] }
  10. },
  11. {
  12. "required" : [
  13. "name", "cost", "level", "fightValue", "aiValue",
  14. "attack", "defense", "hitPoints", "speed", "damage", "advMapAmount",
  15. "graphics", "sound"
  16. ]
  17. }
  18. ],
  19. "additionalProperties" : false,
  20. "properties":{
  21. "name": {
  22. "type":"object",
  23. "additionalProperties" : false,
  24. "description": "Translatable names for this creature",
  25. "required" : [ "singular", "plural" ],
  26. "properties":{
  27. "singular": {
  28. "type":"string",
  29. "description": "Singular version"
  30. },
  31. "plural": {
  32. "type":"string",
  33. "description": "Plural version"
  34. }
  35. }
  36. },
  37. "abilityText" : {
  38. "type" : "string",
  39. "description" : "Text version of creature abilities. Used only with original creature window"
  40. },
  41. "index" : {
  42. "type" : "number",
  43. "description" : "Private field to break things, do not use."
  44. },
  45. "extraNames" : {
  46. "type" : "array",
  47. "items" : { "type" : "string" },
  48. "description" : "Private field to break things, do not use."
  49. },
  50. "faction": {
  51. "type":"string",
  52. "description": "Faction this creature belongs to. Examples: castle, rampart"
  53. },
  54. "cost": {
  55. "type":"object",
  56. "additionalProperties" : false,
  57. "description": "Cost to recruit this creature",
  58. "properties":{
  59. "wood": { "type":"number"},
  60. "mercury": { "type":"number"},
  61. "ore": { "type":"number"},
  62. "sulfur": { "type":"number"},
  63. "crystal": { "type":"number"},
  64. "gems": { "type":"number"},
  65. "gold": { "type":"number"}
  66. }
  67. },
  68. "special": {
  69. "type":"boolean",
  70. "description": "Marks this object as special and not available by default"
  71. },
  72. "disabled": {
  73. "type":"boolean",
  74. "description": "Object is competely disabled and may not be even loaded in-game"
  75. },
  76. "level": { "type":"number"},
  77. "fightValue": {
  78. "type":"number",
  79. "description": " \"value\" of creature, used to determine for example army strength"
  80. },
  81. "aiValue": {
  82. "type":"number",
  83. "description": "Describes how valuable this creature is to AI. Usually similar to fightValue"
  84. },
  85. "growth": {
  86. "type":"number",
  87. "description": "Basic growth of this creature in town or in external dwellings"
  88. },
  89. "horde": {
  90. "type":"number",
  91. "description": "Bonus growth of this creature from built horde"
  92. },
  93. "attack": { "type":"number" },
  94. "defense": { "type":"number" },
  95. "hitPoints": { "type":"number" },
  96. "speed": { "type":"number" },
  97. "shots": { "type":"number" },
  98. "damage": {
  99. "type":"object",
  100. "additionalProperties" : false,
  101. "properties":{
  102. "max": { "type":"number" },
  103. "min": { "type":"number" }
  104. }
  105. },
  106. "spellPoints": {
  107. "type":"number",
  108. "description": "Spell points this creature has (usually equal to number of casts)"
  109. },
  110. "advMapAmount": {
  111. "type":"object",
  112. "additionalProperties" : false,
  113. "description" : "Initial size of random stacks on adventure map",
  114. "properties":{
  115. "min": { "type":"number" },
  116. "max": { "type":"number" }
  117. }
  118. },
  119. "upgrades": {
  120. "type":"array",
  121. "description": "List of creatures to which this one can be upgraded",
  122. "items": { "type":"string" }
  123. },
  124. "doubleWide": {
  125. "type":"boolean",
  126. "description": "If set, creature will be two tiles wide on battlefield"
  127. },
  128. "hasDoubleWeek": {
  129. "type":"boolean",
  130. "description": "creature may receive \"week of\" events"
  131. },
  132. "abilities": {
  133. "description": "Creature abilities described using Bonus system",
  134. "type":"object",
  135. "additionalProperties": {
  136. "$ref" : "vcmi:bonus"
  137. }
  138. },
  139. "stackExperience": {
  140. "type":"array",
  141. "description": "Stack experience, using bonus system",
  142. "items":{
  143. "type":"object",
  144. "additionalProperties" : false,
  145. "required" : [ "bonus", "values" ],
  146. "description": "0",
  147. "properties":{
  148. "bonus": {"$ref" : "vcmi:bonus" },
  149. "values": {
  150. "type":"array",
  151. "minItems" : 10,
  152. "maxItems" : 10,
  153. "description": "Strength of the bonus",
  154. "anyOf" : [
  155. { "items": { "type" : "number" } },
  156. { "items": { "type" : "boolean" } }
  157. ]
  158. }
  159. }
  160. }
  161. },
  162. "graphics": {
  163. "type":"object",
  164. "additionalProperties" : false,
  165. "description": "Describes how this creature looks like during battles",
  166. "required" : [
  167. "animationTime", "animation", "timeBetweenFidgets"
  168. ],
  169. "properties":{
  170. "animationTime": {
  171. "type":"object",
  172. "additionalProperties" : false,
  173. "required" : [ "attack", "flight", "walk", "idle" ],
  174. "description": "Length of several animations",
  175. "properties":{
  176. "attack": {
  177. "type":"number",
  178. "description": "attack"
  179. },
  180. "idle": {
  181. "type":"number",
  182. "description": "idle"
  183. },
  184. "flight": {
  185. "type":"number",
  186. "description": "flight"
  187. },
  188. "walk": {
  189. "type":"number",
  190. "description": "walk"
  191. }
  192. }
  193. },
  194. "iconLarge": {
  195. "type":"string",
  196. "description": "Large icon for this creature, used for example in town screen",
  197. "format" : "imageFile"
  198. },
  199. "iconSmall": {
  200. "type":"string",
  201. "description": "Small icon for this creature, used for example in exchange screen",
  202. "format" : "imageFile"
  203. },
  204. "map": {
  205. "type":"string",
  206. "description": ".def file with animation of this creature on adventure map",
  207. "format" : "defFile"
  208. },
  209. "animation": {
  210. "type":"string",
  211. "description": ".def file with animation of this creature in battles",
  212. "format" : "defFile"
  213. },
  214. "missile": {
  215. "type":"object",
  216. "additionalProperties" : false,
  217. "required" : [ "projectile", "frameAngles", "offset", "attackClimaxFrame" ],
  218. "description": "Missile description for archers",
  219. "properties":{
  220. "projectile": {
  221. "type":"string",
  222. "description": "Path to projectile animation",
  223. "format" : "defFile"
  224. },
  225. "frameAngles": {
  226. "type":"array",
  227. "description": "Angles of missile images, should go from 90 to -90",
  228. "minItems" : 1,
  229. "items": {
  230. "minimum" : -90,
  231. "maximum" : 90,
  232. "type":"number"
  233. }
  234. },
  235. "offset": {
  236. "type":"object",
  237. "additionalProperties" : false,
  238. "required" : [ "lowerX", "lowerY", "middleX", "middleY", "upperX", "upperY" ],
  239. "description": "Position where projectile image appears during shooting in specific direction",
  240. "properties":{
  241. "lowerX": { "type":"number" },
  242. "lowerY": { "type":"number" },
  243. "middleX": { "type":"number" },
  244. "middleY": { "type":"number" },
  245. "upperX": { "type":"number" },
  246. "upperY": { "type":"number" }
  247. }
  248. },
  249. "attackClimaxFrame": {
  250. "type":"number",
  251. "description": "Frame from attack animation during which creature deals damage"
  252. }
  253. }
  254. },
  255. "timeBetweenFidgets": {
  256. "type":"number",
  257. "description": "How often creature will play idling animation"
  258. },
  259. "troopCountLocationOffset": {
  260. "type":"number",
  261. "description": "Position of troop count label?"
  262. }
  263. }
  264. },
  265. "sound": {
  266. "type":"object",
  267. "additionalProperties" : false,
  268. "description": "Various sound files associated with this creature",
  269. "properties":{
  270. "attack": { "type":"string", "format" : "soundFile" },
  271. "defend": { "type":"string", "format" : "soundFile" },
  272. "killed": { "type":"string", "format" : "soundFile" },
  273. "startMoving": { "type":"string", "format" : "soundFile" },
  274. "endMoving": { "type":"string", "format" : "soundFile" },
  275. "move": { "type":"string", "format" : "soundFile" },
  276. "shoot": { "type":"string", "format" : "soundFile" },
  277. "wince": { "type":"string", "format" : "soundFile" }
  278. }
  279. }
  280. }
  281. }