bonusInstance.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. {
  2. "type" : "object",
  3. "$schema" : "http://json-schema.org/draft-04/schema",
  4. "title" : "VCMI bonus system format",
  5. "description" : "Subsection of several formats, used to add generic bonuses to objects",
  6. "required" : ["type"],
  7. "definitions" :
  8. {
  9. "nestedLimiter" : {
  10. "allOf" : [
  11. {
  12. "if" : {
  13. "type" : "string"
  14. },
  15. "then" : {
  16. "enum" : [ "allOf", "anyOf", "noneOf", "SHOOTER_ONLY", "DRAGON_NATURE", "IS_UNDEAD", "CREATURE_NATIVE_TERRAIN", "CREATURES_ONLY", "OPPOSITE_SIDE" ],
  17. "description" : "parameterless limiter or boolean operator at start of array"
  18. }
  19. },
  20. {
  21. "if" : {
  22. "type" : "object",
  23. "required" : [ "type" ],
  24. "properties" : {
  25. "type" : { "type" : "string", "const" : "CREATURE_TYPE_LIMITER" }
  26. }
  27. },
  28. "then" : {
  29. "additionalProperties" : false,
  30. "required" : [ "type", "creature" ],
  31. "properties" : {
  32. "type" : { "type" : "string", "const" : "CREATURE_TYPE_LIMITER" },
  33. "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
  34. "creature" : { "type" : "string" },
  35. "includeUpgrades" : { "type" : "boolean" }
  36. }
  37. }
  38. },
  39. {
  40. "if" : {
  41. "type" : "object",
  42. "required" : [ "type" ],
  43. "properties" : {
  44. "type" : { "type" : "string", "const" : "HAS_ANOTHER_BONUS_LIMITER" }
  45. }
  46. },
  47. "then" : {
  48. "additionalProperties" : false,
  49. "properties" : {
  50. "type" : { "type" : "string", "const" : "HAS_ANOTHER_BONUS_LIMITER" },
  51. "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
  52. "bonusType" : { "type" : "string" },
  53. "bonusSubtype" : { "type" : "string" },
  54. "bonusSourceType" : { "type" : "string" },
  55. "bonusSourceID" : { "type" : "string" }
  56. }
  57. }
  58. },
  59. {
  60. "if" : {
  61. "type" : "object",
  62. "properties" : {
  63. "type" : { "type" : "string", "const" : "CREATURE_ALIGNMENT_LIMITER" }
  64. }
  65. },
  66. "then" : {
  67. "additionalProperties" : false,
  68. "properties" : {
  69. "type" : { "type" : "string", "const" : "CREATURE_ALIGNMENT_LIMITER" },
  70. "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
  71. "alignment" : { "type" : "string", "enum" : [ "good", "evil", "neutral" ] }
  72. }
  73. }
  74. },
  75. {
  76. "if" : {
  77. "type" : "object",
  78. "required" : [ "type" ],
  79. "properties" : {
  80. "type" : { "type" : "string", "enum" : [ "CREATURE_FACTION_LIMITER", "FACTION_LIMITER" ] }
  81. }
  82. },
  83. "then" : {
  84. "additionalProperties" : false,
  85. "properties" : {
  86. "type" : { "type" : "string", "enum" : [ "CREATURE_FACTION_LIMITER", "FACTION_LIMITER" ] },
  87. "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
  88. "faction" : { "type" : "string" }
  89. }
  90. }
  91. },
  92. {
  93. "if" : {
  94. "type" : "object",
  95. "required" : [ "type" ],
  96. "properties" : {
  97. "type" : { "type" : "string", "const" : "CREATURE_LEVEL_LIMITER" }
  98. }
  99. },
  100. "then" : {
  101. "additionalProperties" : false,
  102. "properties" : {
  103. "type" : { "type" : "string", "const" : "CREATURE_LEVEL_LIMITER" },
  104. "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
  105. "minLevel" : { "type" : "number" },
  106. "maxlevel" : { "type" : "number" }
  107. }
  108. }
  109. },
  110. {
  111. "if" : {
  112. "type" : "object",
  113. "required" : [ "type" ],
  114. "properties" : {
  115. "type" : { "type" : "string", "enum" : [ "CREATURE_TERRAIN_LIMITER", "TERRAIN_LIMITER" ] }
  116. }
  117. },
  118. "then" : {
  119. "additionalProperties" : false,
  120. "properties" : {
  121. "type" : { "type" : "string", "enum" : [ "CREATURE_TERRAIN_LIMITER", "TERRAIN_LIMITER" ] },
  122. "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
  123. "terrain" : { "type" : "string" }
  124. }
  125. }
  126. },
  127. {
  128. "if" : {
  129. "type" : "object",
  130. "required" : [ "type" ],
  131. "properties" : {
  132. "type" : { "type" : "string", "const" : "UNIT_ON_HEXES" }
  133. }
  134. },
  135. "then" : {
  136. "additionalProperties" : false,
  137. "properties" : {
  138. "type" : { "type" : "string", "const" : "UNIT_ON_HEXES" },
  139. "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
  140. "hexes" : { "type" : "array", "items" : { "type" : "number" } }
  141. }
  142. }
  143. },
  144. {
  145. "if" : {
  146. "type" : "object",
  147. "required" : [ "type" ],
  148. "properties" : {
  149. "type" : { "type" : "string", "const" : "HAS_CHARGES_LIMITER" }
  150. }
  151. },
  152. "then" : {
  153. "additionalProperties" : false,
  154. "properties" : {
  155. "type" : { "type" : "string", "const" : "HAS_CHARGES_LIMITER" },
  156. "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
  157. "cost" : { "type" : "number" }
  158. }
  159. }
  160. },
  161. {
  162. "if" : {
  163. "type" : "array"
  164. },
  165. "then" : {
  166. "items" : {
  167. "$ref" : "#/definitions/nestedLimiter",
  168. "description" : "nested limiters optionally prefixed with boolean operator"
  169. }
  170. }
  171. }
  172. ]
  173. },
  174. "updater" :
  175. {
  176. "anyOf" : [
  177. {
  178. "type" : "string",
  179. "enum" : [ "TIMES_HERO_LEVEL", "TIMES_STACK_LEVEL", "DIVIDE_STACK_LEVEL", "BONUS_OWNER_UPDATER", "TIMES_STACK_SIZE", "TIMES_HERO_LEVEL_DIVIDE_STACK_LEVEL" ]
  180. },
  181. {
  182. "description" : "GROWS_WITH_LEVEL updater",
  183. "type" : "object",
  184. "required" : ["type", "valPer20", "stepSize"],
  185. "additionalProperties" : false,
  186. "properties" : {
  187. "type" : {
  188. "type" : "string",
  189. "const" : "GROWS_WITH_LEVEL"
  190. },
  191. "valPer20" : {
  192. "type" : "integer",
  193. "description" : "Bonus value for each 20 steps"
  194. },
  195. "stepSize" : {
  196. "type" : "integer",
  197. "minimum" : 1,
  198. "description" : "Size of each step, in levels"
  199. }
  200. }
  201. },
  202. {
  203. "description" : "TIMES_HERO_LEVEL updater",
  204. "type" : "object",
  205. "required" : ["type"],
  206. "additionalProperties" : false,
  207. "properties" : {
  208. "type" : {
  209. "type" : "string",
  210. "const" : "TIMES_HERO_LEVEL"
  211. },
  212. "stepSize" : {
  213. "type" : "integer",
  214. "minimum" : 1,
  215. "description" : "Size of each step, in levels"
  216. }
  217. }
  218. },
  219. {
  220. "description" : "TIMES_STACK_SIZE updater",
  221. "type" : "object",
  222. "required" : ["type"],
  223. "additionalProperties" : false,
  224. "properties" : {
  225. "type" : {
  226. "type" : "string",
  227. "const" : "TIMES_STACK_SIZE"
  228. },
  229. "stepSize" : {
  230. "type" : "integer",
  231. "minimum" : 1,
  232. "description" : "Size of each step, in levels"
  233. },
  234. "minimum" : {
  235. "type" : "integer",
  236. "description" : "Minimal bonus value"
  237. },
  238. "maximum" : {
  239. "type" : "integer",
  240. "description" : "Maximal bonus value"
  241. }
  242. }
  243. },
  244. {
  245. "description" : "TIMES_ARMY_SIZE updater",
  246. "type" : "object",
  247. "required" : ["type"],
  248. "additionalProperties" : false,
  249. "properties" : {
  250. "type" : {
  251. "type" : "string",
  252. "const" : "TIMES_ARMY_SIZE"
  253. },
  254. "stepSize" : {
  255. "type" : "integer",
  256. "minimum" : 1,
  257. "description" : "Size of each step, in levels"
  258. },
  259. "minimum" : {
  260. "type" : "integer",
  261. "description" : "Minimal bonus value"
  262. },
  263. "maximum" : {
  264. "type" : "integer",
  265. "description" : "Maximal bonus value"
  266. },
  267. "filteredLevel" : {
  268. "type" : "integer",
  269. "description" : "Level of units to count"
  270. },
  271. "filteredFaction" : {
  272. "type" : "string",
  273. "description" : "Faction of units to count"
  274. },
  275. "filteredCreature" : {
  276. "type" : "string",
  277. "description" : "Specific unit to count"
  278. }
  279. }
  280. }
  281. ]
  282. }
  283. },
  284. "additionalProperties" : false,
  285. "properties" : {
  286. "type" : {
  287. "type" : "string",
  288. "description" : "type"
  289. },
  290. "subtype" : {
  291. "type" : "string",
  292. "description" : "subtype"
  293. },
  294. "sourceID" : {
  295. "type" : "number",
  296. "description" : "sourceID"
  297. },
  298. "sourceType" : {
  299. "type" : "string",
  300. "enum" : [ "ARTIFACT", "ARTIFACT_INSTANCE", "OBJECT_TYPE", "OBJECT_INSTANCE", "CREATURE_ABILITY", "TERRAIN_NATIVE", "TERRAIN_OVERLAY", "SPELL_EFFECT", "TOWN_STRUCTURE", "HERO_BASE_SKILL", "SECONDARY_SKILL", "HERO_SPECIAL", "ARMY", "CAMPAIGN_BONUS", "STACK_EXPERIENCE", "COMMANDER", "GLOBAL", "OTHER" ],
  301. "description" : "sourceType"
  302. },
  303. "targetSourceType" : {
  304. "type" : "string",
  305. "enum" : [ "ARTIFACT", "ARTIFACT_INSTANCE", "OBJECT_TYPE", "OBJECT_INSTANCE", "CREATURE_ABILITY", "TERRAIN_NATIVE", "TERRAIN_OVERLAY", "SPELL_EFFECT", "TOWN_STRUCTURE", "HERO_BASE_SKILL", "SECONDARY_SKILL", "HERO_SPECIAL", "ARMY", "CAMPAIGN_BONUS", "STACK_EXPERIENCE", "COMMANDER", "GLOBAL", "OTHER" ],
  306. "description" : "targetSourceType"
  307. },
  308. "propagator" : {
  309. "description" : "propagator",
  310. "type" : "string",
  311. "enum" : [ "BATTLE_WIDE", "TOWN_AND_VISITOR", "PLAYER", "HERO", "TOWN", "ARMY", "TEAM", "GLOBAL_EFFECT" ]
  312. },
  313. "updater" : {
  314. "$ref" : "#/definitions/updater"
  315. },
  316. "propagationUpdater" : {
  317. "$ref" : "#/definitions/updater"
  318. },
  319. "limiters" : {
  320. "$ref" : "#/definitions/nestedLimiter",
  321. "description" : "limiter"
  322. },
  323. "effectRange" : {
  324. "type" : "string",
  325. "enum" : [ "NO_LIMIT", "ONLY_DISTANCE_FIGHT", "ONLY_MELEE_FIGHT" ],
  326. "description" : "effectRange"
  327. },
  328. "val" : {
  329. "type" : "number",
  330. "description" : "val"
  331. },
  332. "valueType" : {
  333. "type" : "string",
  334. "enum" : ["ADDITIVE_VALUE", "BASE_NUMBER", "PERCENT_TO_ALL", "PERCENT_TO_BASE", "PERCENT_TO_SOURCE", "PERCENT_TO_TARGET_TYPE", "INDEPENDENT_MAX", "INDEPENDENT_MIN" ],
  335. "description" : "valueType"
  336. },
  337. "addInfo" : {
  338. "anyOf" : [
  339. { "type" : "string" },
  340. { "type" : "number" },
  341. {
  342. "type" : "array",
  343. "items" : {
  344. "anyof" : [
  345. { "type" : "string" },
  346. { "type" : "number" }
  347. ]
  348. }
  349. }
  350. ],
  351. "description" : "addInfo"
  352. },
  353. "duration" : {
  354. "anyOf" : [
  355. {
  356. "type" : "string",
  357. "enum" : ["PERMANENT", "ONE_BATTLE", "ONE_DAY", "ONE_WEEK", "N_TURNS", "N_DAYS", "UNTIL_BEING_ATTACKED", "UNTIL_ATTACK", "STACK_GETS_TURN", "COMMANDER_KILLED", "UNTIL_OWN_ATTACK" ]
  358. },
  359. {
  360. "type" : "array",
  361. "items" : {
  362. "type" : "string",
  363. "enum" : ["PERMANENT", "ONE_BATTLE", "ONE_DAY", "ONE_WEEK", "N_TURNS", "N_DAYS", "UNTIL_BEING_ATTACKED", "UNTIL_ATTACK", "STACK_GETS_TURN", "COMMANDER_KILLED", "UNTIL_OWN_ATTACK" ]
  364. }
  365. }
  366. ],
  367. "description" : "duration"
  368. },
  369. "turns" : {
  370. "type" : "number",
  371. "description" : "turns"
  372. },
  373. "stacking" : {
  374. "type" : "string",
  375. "description" : "stacking"
  376. },
  377. "icon" : {
  378. "type" : "string",
  379. "description" : "Optional, custom icons to show in creature window",
  380. "format" : "imageFile"
  381. },
  382. "description" : {
  383. "anyOf" : [
  384. { "type" : "string" },
  385. { "type" : "number" }
  386. ],
  387. "description" : "description"
  388. },
  389. "hidden" : {
  390. "type" : "boolean",
  391. "description" : "Optional, hide bonus in creature window"
  392. }
  393. }
  394. }