@v12-engine/engine 0.1.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (951) hide show
  1. package/dist/abilities/amounts.d.ts +28 -0
  2. package/dist/abilities/amounts.js +74 -0
  3. package/dist/abilities/amounts.js.map +1 -0
  4. package/dist/abilities/buffs.d.ts +106 -6
  5. package/dist/abilities/buffs.js +443 -0
  6. package/dist/abilities/buffs.js.map +1 -0
  7. package/dist/abilities/castTold.d.ts +2 -0
  8. package/dist/abilities/castTold.js +66 -0
  9. package/dist/abilities/castTold.js.map +1 -0
  10. package/dist/abilities/chance.d.ts +38 -0
  11. package/dist/abilities/chance.js +77 -0
  12. package/dist/abilities/chance.js.map +1 -0
  13. package/dist/abilities/charges.d.ts +18 -0
  14. package/dist/abilities/charges.js +101 -0
  15. package/dist/abilities/charges.js.map +1 -0
  16. package/dist/abilities/control.d.ts +28 -0
  17. package/dist/abilities/control.js +113 -0
  18. package/dist/abilities/control.js.map +1 -0
  19. package/dist/abilities/dispel.js +51 -0
  20. package/dist/abilities/dispel.js.map +1 -0
  21. package/dist/abilities/effectFields.d.ts +1 -1
  22. package/dist/abilities/effectFields.js +676 -0
  23. package/dist/abilities/effectFields.js.map +1 -0
  24. package/dist/abilities/effectIndex.d.ts +27 -0
  25. package/dist/abilities/effectIndex.js +64 -0
  26. package/dist/abilities/effectIndex.js.map +1 -0
  27. package/dist/abilities/effects/buff.d.ts +9 -3
  28. package/dist/abilities/effects/buff.js +84 -0
  29. package/dist/abilities/effects/buff.js.map +1 -0
  30. package/dist/abilities/effects/conditions.d.ts +2 -0
  31. package/dist/abilities/effects/conditions.js +41 -0
  32. package/dist/abilities/effects/conditions.js.map +1 -0
  33. package/dist/abilities/effects/core.js +54 -0
  34. package/dist/abilities/effects/core.js.map +1 -0
  35. package/dist/abilities/effects/damage.d.ts +1 -1
  36. package/dist/abilities/effects/damage.js +43 -0
  37. package/dist/abilities/effects/damage.js.map +1 -0
  38. package/dist/abilities/effects/heal.d.ts +2 -2
  39. package/dist/abilities/effects/heal.js +51 -0
  40. package/dist/abilities/effects/heal.js.map +1 -0
  41. package/dist/abilities/effects/missile.d.ts +13 -1
  42. package/dist/abilities/effects/missile.js +104 -0
  43. package/dist/abilities/effects/missile.js.map +1 -0
  44. package/dist/abilities/effects/morph.d.ts +5 -0
  45. package/dist/abilities/effects/morph.js +43 -0
  46. package/dist/abilities/effects/morph.js.map +1 -0
  47. package/dist/abilities/effects/moves.d.ts +16 -4
  48. package/dist/abilities/effects/moves.js +212 -0
  49. package/dist/abilities/effects/moves.js.map +1 -0
  50. package/dist/abilities/effects/passives.d.ts +19 -9
  51. package/dist/abilities/effects/passives.js +131 -0
  52. package/dist/abilities/effects/passives.js.map +1 -0
  53. package/dist/abilities/effects/proxy.d.ts +5 -0
  54. package/dist/abilities/effects/proxy.js +60 -0
  55. package/dist/abilities/effects/proxy.js.map +1 -0
  56. package/dist/abilities/effects/sight.d.ts +2 -2
  57. package/dist/abilities/effects/sight.js +39 -0
  58. package/dist/abilities/effects/sight.js.map +1 -0
  59. package/dist/abilities/effects/spawn.d.ts +5 -2
  60. package/dist/abilities/effects/spawn.js +40 -0
  61. package/dist/abilities/effects/spawn.js.map +1 -0
  62. package/dist/abilities/effects/timed.d.ts +2 -2
  63. package/dist/abilities/effects/timed.js +96 -0
  64. package/dist/abilities/effects/timed.js.map +1 -0
  65. package/dist/abilities/effects/trade.d.ts +1 -1
  66. package/dist/abilities/effects/trade.js +25 -0
  67. package/dist/abilities/effects/trade.js.map +1 -0
  68. package/dist/abilities/effects.d.ts +97 -23
  69. package/dist/abilities/effects.js +860 -0
  70. package/dist/abilities/effects.js.map +1 -0
  71. package/dist/abilities/land.d.ts +38 -4
  72. package/dist/abilities/land.js +189 -0
  73. package/dist/abilities/land.js.map +1 -0
  74. package/dist/abilities/recast.d.ts +45 -0
  75. package/dist/abilities/recast.js +118 -0
  76. package/dist/abilities/recast.js.map +1 -0
  77. package/dist/abilities/scaled.js +40 -0
  78. package/dist/abilities/scaled.js.map +1 -0
  79. package/dist/abilities/screen.d.ts +6 -0
  80. package/dist/abilities/screen.js +83 -0
  81. package/dist/abilities/screen.js.map +1 -0
  82. package/dist/abilities/shapes.d.ts +66 -0
  83. package/dist/abilities/shapes.js +122 -0
  84. package/dist/abilities/shapes.js.map +1 -0
  85. package/dist/abilities/text.d.ts +14 -2
  86. package/dist/abilities/text.js +204 -0
  87. package/dist/abilities/text.js.map +1 -0
  88. package/dist/abilities/triggers.d.ts +98 -0
  89. package/dist/abilities/triggers.js +351 -0
  90. package/dist/abilities/triggers.js.map +1 -0
  91. package/dist/abilityChanges.d.ts +131 -0
  92. package/dist/abilityChanges.js +345 -0
  93. package/dist/abilityChanges.js.map +1 -0
  94. package/dist/ai/area.d.ts +4 -1
  95. package/dist/ai/brain.d.ts +4 -1
  96. package/dist/ai/brain.js +844 -0
  97. package/dist/ai/brain.js.map +1 -0
  98. package/dist/ai/budget.js +74 -0
  99. package/dist/ai/budget.js.map +1 -0
  100. package/dist/ai/checks.d.ts +9 -1
  101. package/dist/ai/checks.js +242 -0
  102. package/dist/ai/checks.js.map +1 -0
  103. package/dist/ai/computer.d.ts +11 -4
  104. package/dist/ai/computer.js +251 -0
  105. package/dist/ai/computer.js.map +1 -0
  106. package/dist/ai/defence.d.ts +4 -0
  107. package/dist/ai/defence.js +430 -0
  108. package/dist/ai/defence.js.map +1 -0
  109. package/dist/ai/define.d.ts +3 -2
  110. package/dist/ai/define.js +31 -0
  111. package/dist/ai/define.js.map +1 -0
  112. package/dist/ai/economy.d.ts +10 -7
  113. package/dist/ai/economy.js +780 -0
  114. package/dist/ai/economy.js.map +1 -0
  115. package/dist/ai/geometry.js +38 -0
  116. package/dist/ai/geometry.js.map +1 -0
  117. package/dist/ai/goals.d.ts +1 -0
  118. package/dist/ai/goals.js +560 -0
  119. package/dist/ai/goals.js.map +1 -0
  120. package/dist/ai/knowledge.d.ts +72 -7
  121. package/dist/ai/knowledge.js +804 -0
  122. package/dist/ai/knowledge.js.map +1 -0
  123. package/dist/ai/lanes.d.ts +10 -2
  124. package/dist/ai/lanes.js +715 -0
  125. package/dist/ai/lanes.js.map +1 -0
  126. package/dist/ai/melee/build.js +264 -0
  127. package/dist/ai/melee/build.js.map +1 -0
  128. package/dist/ai/melee/goals.d.ts +7 -0
  129. package/dist/ai/melee/goals.js +720 -0
  130. package/dist/ai/melee/goals.js.map +1 -0
  131. package/dist/ai/melee/heroes.js +68 -0
  132. package/dist/ai/melee/heroes.js.map +1 -0
  133. package/dist/ai/melee/index.d.ts +1 -1
  134. package/dist/ai/melee/index.js +51 -0
  135. package/dist/ai/melee/index.js.map +1 -0
  136. package/dist/ai/melee/production.js +29 -0
  137. package/dist/ai/melee/production.js.map +1 -0
  138. package/dist/ai/melee/surrender.js +64 -0
  139. package/dist/ai/melee/surrender.js.map +1 -0
  140. package/dist/ai/micro.d.ts +9 -0
  141. package/dist/ai/micro.js +1316 -0
  142. package/dist/ai/micro.js.map +1 -0
  143. package/dist/ai/mission.d.ts +9 -2
  144. package/dist/ai/mission.js +538 -0
  145. package/dist/ai/mission.js.map +1 -0
  146. package/dist/ai/missionRules.d.ts +1 -1
  147. package/dist/ai/missionRules.js +26 -0
  148. package/dist/ai/missionRules.js.map +1 -0
  149. package/dist/ai/module.d.ts +6 -2
  150. package/dist/ai/module.js +37 -0
  151. package/dist/ai/module.js.map +1 -0
  152. package/dist/ai/options.d.ts +3 -3
  153. package/dist/ai/plans/build.d.ts +20 -1
  154. package/dist/ai/plans/build.js +608 -0
  155. package/dist/ai/plans/build.js.map +1 -0
  156. package/dist/ai/plans/placement.d.ts +4 -1
  157. package/dist/ai/plans/placement.js +295 -0
  158. package/dist/ai/plans/placement.js.map +1 -0
  159. package/dist/ai/plans/plans.d.ts +9 -0
  160. package/dist/ai/plans/plans.js +110 -0
  161. package/dist/ai/plans/plans.js.map +1 -0
  162. package/dist/ai/plans/production.d.ts +14 -2
  163. package/dist/ai/plans/production.js +434 -0
  164. package/dist/ai/plans/production.js.map +1 -0
  165. package/dist/ai/plans/purse.d.ts +6 -3
  166. package/dist/ai/plans/purse.js +139 -0
  167. package/dist/ai/plans/purse.js.map +1 -0
  168. package/dist/ai/plans/tech.d.ts +6 -0
  169. package/dist/ai/plans/tech.js +122 -0
  170. package/dist/ai/plans/tech.js.map +1 -0
  171. package/dist/ai/profiles.d.ts +4 -4
  172. package/dist/{profiles-B3NS9jwk.js → ai/profiles.js} +3 -98
  173. package/dist/ai/profiles.js.map +1 -0
  174. package/dist/ai/reach.js +54 -0
  175. package/dist/ai/reach.js.map +1 -0
  176. package/dist/ai/report.d.ts +8 -0
  177. package/dist/ai/report.js +87 -0
  178. package/dist/ai/report.js.map +1 -0
  179. package/dist/ai/roles.d.ts +4 -0
  180. package/dist/ai/roles.js +207 -0
  181. package/dist/ai/roles.js.map +1 -0
  182. package/dist/ai/rules.d.ts +8 -2
  183. package/dist/ai/rules.js +416 -0
  184. package/dist/ai/rules.js.map +1 -0
  185. package/dist/ai/scouting.d.ts +6 -0
  186. package/dist/ai/scouting.js +324 -0
  187. package/dist/ai/scouting.js.map +1 -0
  188. package/dist/ai/settings.js +99 -0
  189. package/dist/ai/settings.js.map +1 -0
  190. package/dist/ai/squads.d.ts +21 -2
  191. package/dist/ai/squads.js +916 -0
  192. package/dist/ai/squads.js.map +1 -0
  193. package/dist/ai/strength.js +320 -0
  194. package/dist/ai/strength.js.map +1 -0
  195. package/dist/ai/task.d.ts +3 -1
  196. package/dist/ai/task.js +17 -0
  197. package/dist/ai/task.js.map +1 -0
  198. package/dist/ai/tasks/attack.js +24 -0
  199. package/dist/ai/tasks/attack.js.map +1 -0
  200. package/dist/ai/tasks/capture.d.ts +3 -3
  201. package/dist/ai/tasks/capture.js +37 -0
  202. package/dist/ai/tasks/capture.js.map +1 -0
  203. package/dist/ai/tasks/creep.js +29 -0
  204. package/dist/ai/tasks/creep.js.map +1 -0
  205. package/dist/ai/tasks/defend.js +61 -0
  206. package/dist/ai/tasks/defend.js.map +1 -0
  207. package/dist/ai/tasks/drop.js +81 -0
  208. package/dist/ai/tasks/drop.js.map +1 -0
  209. package/dist/ai/tasks/escort.js +59 -0
  210. package/dist/ai/tasks/escort.js.map +1 -0
  211. package/dist/ai/tasks/gather.js +48 -0
  212. package/dist/ai/tasks/gather.js.map +1 -0
  213. package/dist/ai/tasks/harass.js +39 -0
  214. package/dist/ai/tasks/harass.js.map +1 -0
  215. package/dist/ai/tasks/hold.js +32 -0
  216. package/dist/ai/tasks/hold.js.map +1 -0
  217. package/dist/ai/tasks/index.js +34 -0
  218. package/dist/ai/tasks/index.js.map +1 -0
  219. package/dist/ai/tasks/move.js +26 -0
  220. package/dist/ai/tasks/move.js.map +1 -0
  221. package/dist/ai/tasks/patrol.js +59 -0
  222. package/dist/ai/tasks/patrol.js.map +1 -0
  223. package/dist/ai/tasks/retreat.js +28 -0
  224. package/dist/ai/tasks/retreat.js.map +1 -0
  225. package/dist/ai/tasks/scout.js +73 -0
  226. package/dist/ai/tasks/scout.js.map +1 -0
  227. package/dist/ai/tasks/shared.d.ts +1 -1
  228. package/dist/ai/tasks/shared.js +137 -0
  229. package/dist/ai/tasks/shared.js.map +1 -0
  230. package/dist/ai/team.d.ts +18 -1
  231. package/dist/ai/team.js +492 -0
  232. package/dist/ai/team.js.map +1 -0
  233. package/dist/ai/threat.d.ts +6 -0
  234. package/dist/ai/threat.js +206 -0
  235. package/dist/ai/threat.js.map +1 -0
  236. package/dist/ai/view.d.ts +21 -7
  237. package/dist/ai/view.js +677 -0
  238. package/dist/ai/view.js.map +1 -0
  239. package/dist/ai/waves.d.ts +6 -0
  240. package/dist/ai/waves.js +410 -0
  241. package/dist/ai/waves.js.map +1 -0
  242. package/dist/ai.js +54 -6239
  243. package/dist/aiTesting.d.ts +6 -3
  244. package/dist/aiTesting.js +229 -0
  245. package/dist/aiTesting.js.map +1 -0
  246. package/dist/areas.d.ts +4 -1
  247. package/dist/areas.js +295 -0
  248. package/dist/areas.js.map +1 -0
  249. package/dist/attacks.d.ts +3 -3
  250. package/dist/attacks.js +127 -0
  251. package/dist/attacks.js.map +1 -0
  252. package/dist/burning.d.ts +267 -0
  253. package/dist/burning.js +795 -0
  254. package/dist/burning.js.map +1 -0
  255. package/dist/bytes.js +21 -0
  256. package/dist/bytes.js.map +1 -0
  257. package/dist/callings.d.ts +71 -0
  258. package/dist/callings.js +157 -0
  259. package/dist/callings.js.map +1 -0
  260. package/dist/cameraOrders.d.ts +78 -0
  261. package/dist/cameraOrders.js +114 -0
  262. package/dist/cameraOrders.js.map +1 -0
  263. package/dist/camps.d.ts +70 -4
  264. package/dist/camps.js +501 -0
  265. package/dist/camps.js.map +1 -0
  266. package/dist/capture.d.ts +15 -3
  267. package/dist/capture.js +304 -0
  268. package/dist/capture.js.map +1 -0
  269. package/dist/cellLayers.d.ts +78 -13
  270. package/dist/cellLayers.js +275 -0
  271. package/dist/cellLayers.js.map +1 -0
  272. package/dist/cellPatches.d.ts +24 -0
  273. package/dist/cellPatches.js +73 -0
  274. package/dist/cellPatches.js.map +1 -0
  275. package/dist/cinematics.d.ts +10 -5
  276. package/dist/cinematics.js +161 -0
  277. package/dist/cinematics.js.map +1 -0
  278. package/dist/clock.d.ts +2 -2
  279. package/dist/clock.js +78 -0
  280. package/dist/clock.js.map +1 -0
  281. package/dist/commands.d.ts +36 -4
  282. package/dist/commands.js +636 -0
  283. package/dist/commands.js.map +1 -0
  284. package/dist/components.d.ts +31 -10
  285. package/dist/components.js +74 -0
  286. package/dist/components.js.map +1 -0
  287. package/dist/computers.d.ts +4 -4
  288. package/dist/computers.js +194 -0
  289. package/dist/computers.js.map +1 -0
  290. package/dist/concealment.d.ts +25 -2
  291. package/dist/concealment.js +409 -0
  292. package/dist/concealment.js.map +1 -0
  293. package/dist/coreComponents.js +130 -0
  294. package/dist/coreComponents.js.map +1 -0
  295. package/dist/createGame.d.ts +306 -0
  296. package/dist/createGame.js +405 -0
  297. package/dist/createGame.js.map +1 -0
  298. package/dist/dashing.d.ts +18 -2
  299. package/dist/dashing.js +41 -0
  300. package/dist/dashing.js.map +1 -0
  301. package/dist/debug.d.ts +8 -0
  302. package/dist/debug.js +5 -3
  303. package/dist/debug2.js +76 -0
  304. package/dist/debug2.js.map +1 -0
  305. package/dist/debugCommands.d.ts +6 -6
  306. package/dist/debugCommands.js +537 -0
  307. package/dist/debugCommands.js.map +1 -0
  308. package/dist/debugging.d.ts +1 -0
  309. package/dist/defaultSets.d.ts +183 -0
  310. package/dist/defaultSets.js +216 -0
  311. package/dist/defaultSets.js.map +1 -0
  312. package/dist/definitions.d.ts +6 -0
  313. package/dist/definitions.js +78 -0
  314. package/dist/definitions.js.map +1 -0
  315. package/dist/defs.d.ts +1895 -165
  316. package/dist/defs.js +380 -0
  317. package/dist/defs.js.map +1 -0
  318. package/dist/denying.d.ts +4 -4
  319. package/dist/denying.js +106 -0
  320. package/dist/denying.js.map +1 -0
  321. package/dist/destructibles.d.ts +2 -2
  322. package/dist/destructibles.js +36 -0
  323. package/dist/destructibles.js.map +1 -0
  324. package/dist/determinism.d.ts +4 -4
  325. package/dist/determinism.js +247 -0
  326. package/dist/determinism.js.map +1 -0
  327. package/dist/dialog.d.ts +17 -2
  328. package/dist/dialog.js +108 -0
  329. package/dist/dialog.js.map +1 -0
  330. package/dist/effectRefs.js +28 -0
  331. package/dist/effectRefs.js.map +1 -0
  332. package/dist/effects.d.ts +27 -11
  333. package/dist/effects.js +110 -0
  334. package/dist/effects.js.map +1 -0
  335. package/dist/endings.d.ts +1 -1
  336. package/dist/endings.js +78 -0
  337. package/dist/endings.js.map +1 -0
  338. package/dist/engagement.d.ts +40 -6
  339. package/dist/engagement.js +530 -0
  340. package/dist/engagement.js.map +1 -0
  341. package/dist/engineEvents.d.ts +72 -9
  342. package/dist/engineEvents.js +520 -0
  343. package/dist/engineEvents.js.map +1 -0
  344. package/dist/entity.d.ts +275 -26
  345. package/dist/entity.js +441 -0
  346. package/dist/entity.js.map +1 -0
  347. package/dist/entityIndex.d.ts +10 -3
  348. package/dist/entityIndex.js +149 -0
  349. package/dist/entityIndex.js.map +1 -0
  350. package/dist/errors.d.ts +6 -2
  351. package/dist/errors.js +59 -0
  352. package/dist/errors.js.map +1 -0
  353. package/dist/events.d.ts +11 -5
  354. package/dist/events.js +158 -0
  355. package/dist/events.js.map +1 -0
  356. package/dist/exactMath.js +273 -0
  357. package/dist/exactMath.js.map +1 -0
  358. package/dist/features.d.ts +1 -1
  359. package/dist/features.js +127 -0
  360. package/dist/features.js.map +1 -0
  361. package/dist/fields.d.ts +25 -5
  362. package/dist/fields.js +140 -0
  363. package/dist/fields.js.map +1 -0
  364. package/dist/fixture.d.ts +3 -3
  365. package/dist/fixture.js +512 -0
  366. package/dist/fixture.js.map +1 -0
  367. package/dist/fog.d.ts +26 -3
  368. package/dist/fog.js +333 -0
  369. package/dist/fog.js.map +1 -0
  370. package/dist/foliage.d.ts +476 -0
  371. package/dist/foliage.js +1478 -0
  372. package/dist/foliage.js.map +1 -0
  373. package/dist/foliageDebug.d.ts +57 -0
  374. package/dist/foliageDebug.js +172 -0
  375. package/dist/foliageDebug.js.map +1 -0
  376. package/dist/foliageRegrowth.d.ts +20 -0
  377. package/dist/foliageRegrowth.js +332 -0
  378. package/dist/foliageRegrowth.js.map +1 -0
  379. package/dist/formState.d.ts +67 -0
  380. package/dist/formState.js +65 -0
  381. package/dist/formState.js.map +1 -0
  382. package/dist/formation.d.ts +46 -8
  383. package/dist/formation.js +297 -0
  384. package/dist/formation.js.map +1 -0
  385. package/dist/forms.d.ts +58 -0
  386. package/dist/forms.js +146 -0
  387. package/dist/forms.js.map +1 -0
  388. package/dist/friendlyFire.d.ts +2 -2
  389. package/dist/friendlyFire.js +37 -0
  390. package/dist/friendlyFire.js.map +1 -0
  391. package/dist/game.d.ts +141 -48
  392. package/dist/game.js +834 -0
  393. package/dist/game.js.map +1 -0
  394. package/dist/gameData.d.ts +96 -22
  395. package/dist/gameData.js +1690 -0
  396. package/dist/gameData.js.map +1 -0
  397. package/dist/gameFiles.d.ts +3 -3
  398. package/dist/gameFiles.js +14 -0
  399. package/dist/gameFiles.js.map +1 -0
  400. package/dist/gates.js +92 -0
  401. package/dist/gates.js.map +1 -0
  402. package/dist/generate.d.ts +28 -1
  403. package/dist/generate.js +1062 -0
  404. package/dist/generate.js.map +1 -0
  405. package/dist/generateWorker.d.ts +7 -3
  406. package/dist/generateWorker.js +86 -0
  407. package/dist/generateWorker.js.map +1 -0
  408. package/dist/grid.d.ts +9 -0
  409. package/dist/grid.js +102 -0
  410. package/dist/grid.js.map +1 -0
  411. package/dist/ground.d.ts +17 -1
  412. package/dist/ground.js +375 -0
  413. package/dist/ground.js.map +1 -0
  414. package/dist/groundObjects.d.ts +70 -0
  415. package/dist/groundObjects.js +371 -0
  416. package/dist/groundObjects.js.map +1 -0
  417. package/dist/groundSpeed.d.ts +20 -3
  418. package/dist/groundSpeed.js +117 -0
  419. package/dist/groundSpeed.js.map +1 -0
  420. package/dist/hero.d.ts +126 -10
  421. package/dist/hero.js +432 -0
  422. package/dist/hero.js.map +1 -0
  423. package/dist/holds.d.ts +94 -0
  424. package/dist/holds.js +305 -0
  425. package/dist/holds.js.map +1 -0
  426. package/dist/home.d.ts +1 -1
  427. package/dist/home.js +30 -0
  428. package/dist/home.js.map +1 -0
  429. package/dist/hooks.d.ts +339 -57
  430. package/dist/hooks.js +105 -0
  431. package/dist/hooks.js.map +1 -0
  432. package/dist/hotReload.d.ts +6 -5
  433. package/dist/hotReload.js +145 -0
  434. package/dist/hotReload.js.map +1 -0
  435. package/dist/ids.d.ts +3 -3
  436. package/dist/ids.js +30 -0
  437. package/dist/ids.js.map +1 -0
  438. package/dist/idsFile.d.ts +36 -0
  439. package/dist/idsFile.js +134 -0
  440. package/dist/idsFile.js.map +1 -0
  441. package/dist/index.d.ts +105 -68
  442. package/dist/index.js +194 -4701
  443. package/dist/inspect.d.ts +29 -2
  444. package/dist/{inspect-D9dWHmZ0.js → inspect.js} +21 -12
  445. package/dist/inspect.js.map +1 -0
  446. package/dist/inventory.d.ts +14 -1
  447. package/dist/inventory.js +84 -0
  448. package/dist/inventory.js.map +1 -0
  449. package/dist/items.d.ts +136 -8
  450. package/dist/items.js +585 -0
  451. package/dist/items.js.map +1 -0
  452. package/dist/lanes.d.ts +12 -3
  453. package/dist/lanes.js +496 -0
  454. package/dist/lanes.js.map +1 -0
  455. package/dist/life.d.ts +6 -2
  456. package/dist/life.js +287 -0
  457. package/dist/life.js.map +1 -0
  458. package/dist/log.d.ts +26 -3
  459. package/dist/log.js +192 -0
  460. package/dist/log.js.map +1 -0
  461. package/dist/manaBurn.d.ts +2 -2
  462. package/dist/manaBurn.js +75 -0
  463. package/dist/manaBurn.js.map +1 -0
  464. package/dist/map/file.d.ts +56 -3
  465. package/dist/map/file.js +264 -0
  466. package/dist/map/file.js.map +1 -0
  467. package/dist/map/images.js +61 -0
  468. package/dist/map/images.js.map +1 -0
  469. package/dist/map/look.d.ts +1 -1
  470. package/dist/map/look.js +30 -0
  471. package/dist/map/look.js.map +1 -0
  472. package/dist/map/pathProfile.js +183 -0
  473. package/dist/map/pathProfile.js.map +1 -0
  474. package/dist/map/resize.d.ts +4 -0
  475. package/dist/map/resize.js +136 -0
  476. package/dist/map/resize.js.map +1 -0
  477. package/dist/map/schema.js +257 -0
  478. package/dist/map/schema.js.map +1 -0
  479. package/dist/map/terrain.js +214 -0
  480. package/dist/map/terrain.js.map +1 -0
  481. package/dist/map/types.d.ts +92 -13
  482. package/dist/map/types.js +251 -0
  483. package/dist/map/types.js.map +1 -0
  484. package/dist/mapCheck/cells.js +94 -0
  485. package/dist/mapCheck/cells.js.map +1 -0
  486. package/dist/mapCheck/rules/foliage.d.ts +9 -0
  487. package/dist/mapCheck/rules/foliage.js +83 -0
  488. package/dist/mapCheck/rules/foliage.js.map +1 -0
  489. package/dist/mapCheck/rules/names.js +39 -0
  490. package/dist/mapCheck/rules/names.js.map +1 -0
  491. package/dist/mapCheck/rules/objects.d.ts +1 -1
  492. package/dist/mapCheck/rules/objects.js +56 -0
  493. package/dist/mapCheck/rules/objects.js.map +1 -0
  494. package/dist/mapCheck/rules/paths.js +32 -0
  495. package/dist/mapCheck/rules/paths.js.map +1 -0
  496. package/dist/mapCheck/rules/players.js +20 -0
  497. package/dist/mapCheck/rules/players.js.map +1 -0
  498. package/dist/mapCheck/rules/races.js +56 -0
  499. package/dist/mapCheck/rules/races.js.map +1 -0
  500. package/dist/mapCheck/rules/random.js +47 -0
  501. package/dist/mapCheck/rules/random.js.map +1 -0
  502. package/dist/mapCheck/rules/regions.js +30 -0
  503. package/dist/mapCheck/rules/regions.js.map +1 -0
  504. package/dist/mapCheck/rules/targets.js +31 -0
  505. package/dist/mapCheck/rules/targets.js.map +1 -0
  506. package/dist/mapCheck/rules/walking.js +45 -0
  507. package/dist/mapCheck/rules/walking.js.map +1 -0
  508. package/dist/mapCheck.d.ts +2 -2
  509. package/dist/mapCheck.js +63 -0
  510. package/dist/mapCheck.js.map +1 -0
  511. package/dist/mapFields.d.ts +25 -2
  512. package/dist/mapFields.js +134 -0
  513. package/dist/mapFields.js.map +1 -0
  514. package/dist/mapFile.js +176 -0
  515. package/dist/mapFile.js.map +1 -0
  516. package/dist/mapMeasure.d.ts +8 -0
  517. package/dist/mapMeasure.js +283 -0
  518. package/dist/mapMeasure.js.map +1 -0
  519. package/dist/mapMerge.d.ts +1 -0
  520. package/dist/mapMerge.js +172 -0
  521. package/dist/mapMerge.js.map +1 -0
  522. package/dist/mapObjectives.js +138 -0
  523. package/dist/mapObjectives.js.map +1 -0
  524. package/dist/mapObjects.js +80 -0
  525. package/dist/mapObjects.js.map +1 -0
  526. package/dist/math.d.ts +37 -7
  527. package/dist/math.js +155 -0
  528. package/dist/math.js.map +1 -0
  529. package/dist/messages.d.ts +71 -4
  530. package/dist/messages.js +29 -0
  531. package/dist/messages.js.map +1 -0
  532. package/dist/missionRules.d.ts +10 -2
  533. package/dist/{missionRules-C-bGxm0Q.js → missionRules.js} +30 -150
  534. package/dist/missionRules.js.map +1 -0
  535. package/dist/mods.d.ts +39 -20
  536. package/dist/mods.js +271 -0
  537. package/dist/mods.js.map +1 -0
  538. package/dist/moves.d.ts +87 -0
  539. package/dist/moves.js +539 -0
  540. package/dist/moves.js.map +1 -0
  541. package/dist/names.d.ts +7 -0
  542. package/dist/names.js +122 -0
  543. package/dist/names.js.map +1 -0
  544. package/dist/navigation/agentParams.js +14 -0
  545. package/dist/navigation/agentParams.js.map +1 -0
  546. package/dist/navigation/air.d.ts +7 -3
  547. package/dist/navigation/air.js +401 -0
  548. package/dist/navigation/air.js.map +1 -0
  549. package/dist/navigation/builds.d.ts +34 -2
  550. package/dist/navigation/builds.js +287 -0
  551. package/dist/navigation/builds.js.map +1 -0
  552. package/dist/navigation/groundAreas.d.ts +59 -1
  553. package/dist/navigation/groundAreas.js +407 -0
  554. package/dist/navigation/groundAreas.js.map +1 -0
  555. package/dist/navigation/navigation.d.ts +98 -9
  556. package/dist/navigation/recast.d.ts +194 -18
  557. package/dist/navigation/recast.js +1379 -0
  558. package/dist/navigation/recast.js.map +1 -0
  559. package/dist/navigation/sidePaths.d.ts +8 -3
  560. package/dist/navigation/sidePaths.js +241 -0
  561. package/dist/navigation/sidePaths.js.map +1 -0
  562. package/dist/navigation/sized.js +243 -0
  563. package/dist/navigation/sized.js.map +1 -0
  564. package/dist/nearest.js +32 -0
  565. package/dist/nearest.js.map +1 -0
  566. package/dist/noise.js +59 -0
  567. package/dist/noise.js.map +1 -0
  568. package/dist/objectives.d.ts +12 -3
  569. package/dist/objectives.js +144 -0
  570. package/dist/objectives.js.map +1 -0
  571. package/dist/orders/basic.d.ts +5 -5
  572. package/dist/orders/basic.js +417 -0
  573. package/dist/orders/basic.js.map +1 -0
  574. package/dist/orders/build.js +278 -0
  575. package/dist/orders/build.js.map +1 -0
  576. package/dist/orders/cast.d.ts +13 -3
  577. package/dist/orders/cast.js +558 -0
  578. package/dist/orders/cast.js.map +1 -0
  579. package/dist/orders/facts.js +16 -0
  580. package/dist/orders/facts.js.map +1 -0
  581. package/dist/orders/harvest.d.ts +21 -5
  582. package/dist/orders/harvest.js +540 -0
  583. package/dist/orders/harvest.js.map +1 -0
  584. package/dist/orders/idle.d.ts +3 -1
  585. package/dist/orders/idle.js +234 -0
  586. package/dist/orders/idle.js.map +1 -0
  587. package/dist/orders/items.js +92 -0
  588. package/dist/orders/items.js.map +1 -0
  589. package/dist/orders/queue.js +108 -0
  590. package/dist/orders/queue.js.map +1 -0
  591. package/dist/orders/waiting.d.ts +39 -0
  592. package/dist/orders/waiting.js +149 -0
  593. package/dist/orders/waiting.js.map +1 -0
  594. package/dist/pack.schema.js +13 -0
  595. package/dist/pack.schema.js.map +1 -0
  596. package/dist/pack.schema.json +7622 -841
  597. package/dist/packs/director/index.d.ts +13 -5
  598. package/dist/packs/director/index.js +204 -0
  599. package/dist/packs/director/index.js.map +1 -0
  600. package/dist/packs/heroes/campaign.d.ts +3 -2
  601. package/dist/packs/heroes/campaign.js +241 -0
  602. package/dist/packs/heroes/campaign.js.map +1 -0
  603. package/dist/packs/heroes/carry.d.ts +6 -0
  604. package/dist/packs/heroes/carry.js +112 -0
  605. package/dist/packs/heroes/carry.js.map +1 -0
  606. package/dist/packs/heroes/commands.js +115 -0
  607. package/dist/packs/heroes/commands.js.map +1 -0
  608. package/dist/packs/heroes/fallen.d.ts +43 -0
  609. package/dist/packs/heroes/fallen.js +61 -0
  610. package/dist/packs/heroes/fallen.js.map +1 -0
  611. package/dist/packs/heroes/hire.js +60 -0
  612. package/dist/packs/heroes/hire.js.map +1 -0
  613. package/dist/packs/heroes/index.d.ts +7 -6
  614. package/dist/packs/heroes/index.js +130 -0
  615. package/dist/packs/heroes/index.js.map +1 -0
  616. package/dist/packs/heroes/loop.d.ts +95 -0
  617. package/dist/packs/heroes/loop.js +250 -0
  618. package/dist/packs/heroes/loop.js.map +1 -0
  619. package/dist/packs/heroes/making.d.ts +6 -3
  620. package/dist/packs/heroes/making.js +55 -0
  621. package/dist/packs/heroes/making.js.map +1 -0
  622. package/dist/packs/heroes/respawn.d.ts +3 -3
  623. package/dist/packs/heroes/respawn.js +87 -0
  624. package/dist/packs/heroes/respawn.js.map +1 -0
  625. package/dist/packs/heroes/sets.d.ts +32 -0
  626. package/dist/packs/heroes/sets.js +51 -0
  627. package/dist/packs/heroes/sets.js.map +1 -0
  628. package/dist/packs/heroes/spells.d.ts +16 -0
  629. package/dist/packs/heroes/spells.js +269 -0
  630. package/dist/packs/heroes/spells.js.map +1 -0
  631. package/dist/packs/items/defaults.d.ts +43 -0
  632. package/dist/packs/items/defaults.js +1504 -0
  633. package/dist/packs/items/defaults.js.map +1 -0
  634. package/dist/packs/items/index.d.ts +27 -0
  635. package/dist/packs/items/index.js +214 -0
  636. package/dist/packs/items/index.js.map +1 -0
  637. package/dist/packs/moba/index.d.ts +3 -3
  638. package/dist/packs/moba/index.js +174 -0
  639. package/dist/packs/moba/index.js.map +1 -0
  640. package/dist/packs/pack.d.ts +15 -15
  641. package/dist/packs/pack.js +14 -0
  642. package/dist/packs/pack.js.map +1 -0
  643. package/dist/packs.d.ts +15 -7
  644. package/dist/packs.js +222 -0
  645. package/dist/packs.js.map +1 -0
  646. package/dist/paths.d.ts +2 -0
  647. package/dist/paths.js +109 -0
  648. package/dist/paths.js.map +1 -0
  649. package/dist/plain.js +57 -0
  650. package/dist/plain.js.map +1 -0
  651. package/dist/player.d.ts +33 -10
  652. package/dist/player.js +159 -0
  653. package/dist/player.js.map +1 -0
  654. package/dist/portals.d.ts +1 -1
  655. package/dist/portals.js +194 -0
  656. package/dist/portals.js.map +1 -0
  657. package/dist/prefabs.d.ts +25 -2
  658. package/dist/prefabs.js +239 -0
  659. package/dist/prefabs.js.map +1 -0
  660. package/dist/presetBuildings.js +58 -0
  661. package/dist/presetBuildings.js.map +1 -0
  662. package/dist/presetFoliage.d.ts +27 -0
  663. package/dist/presetFoliage.js +98 -0
  664. package/dist/presetFoliage.js.map +1 -0
  665. package/dist/presetGround.js +65 -0
  666. package/dist/presetGround.js.map +1 -0
  667. package/dist/proxies.d.ts +12 -0
  668. package/dist/proxies.js +79 -0
  669. package/dist/proxies.js.map +1 -0
  670. package/dist/query.d.ts +56 -0
  671. package/dist/query.js +88 -0
  672. package/dist/query.js.map +1 -0
  673. package/dist/races.d.ts +15 -14
  674. package/dist/races.js +172 -0
  675. package/dist/races.js.map +1 -0
  676. package/dist/randomGroups.js +91 -0
  677. package/dist/randomGroups.js.map +1 -0
  678. package/dist/registry.d.ts +117 -53
  679. package/dist/registry.js +323 -0
  680. package/dist/registry.js.map +1 -0
  681. package/dist/remains.d.ts +11 -9
  682. package/dist/remains.js +188 -0
  683. package/dist/remains.js.map +1 -0
  684. package/dist/replication.d.ts +12 -7
  685. package/dist/replication.js +100 -0
  686. package/dist/replication.js.map +1 -0
  687. package/dist/rng.d.ts +2 -0
  688. package/dist/rng.js +40 -0
  689. package/dist/rng.js.map +1 -0
  690. package/dist/rules.d.ts +186 -99
  691. package/dist/rules.js +179 -0
  692. package/dist/rules.js.map +1 -0
  693. package/dist/rulesCheck.d.ts +5 -4
  694. package/dist/rulesCheck.js +693 -0
  695. package/dist/rulesCheck.js.map +1 -0
  696. package/dist/runes.d.ts +2 -2
  697. package/dist/runes.js +80 -0
  698. package/dist/runes.js.map +1 -0
  699. package/dist/save.d.ts +37 -12
  700. package/dist/save.js +532 -0
  701. package/dist/save.js.map +1 -0
  702. package/dist/scenario.d.ts +2 -2
  703. package/dist/scenario.js +99 -0
  704. package/dist/scenario.js.map +1 -0
  705. package/dist/scheduler.d.ts +3 -0
  706. package/dist/scheduler.js +156 -0
  707. package/dist/scheduler.js.map +1 -0
  708. package/dist/score.d.ts +19 -19
  709. package/dist/score.js +709 -0
  710. package/dist/score.js.map +1 -0
  711. package/dist/sequences.d.ts +10 -6
  712. package/dist/sequences.js +206 -0
  713. package/dist/sequences.js.map +1 -0
  714. package/dist/server/doorman.js +154 -0
  715. package/dist/server/doorman.js.map +1 -0
  716. package/dist/server/gameServer.d.ts +16 -1
  717. package/dist/server/gameServer.js +643 -0
  718. package/dist/server/gameServer.js.map +1 -0
  719. package/dist/server/index.d.ts +1 -1
  720. package/dist/server/lobby.js +199 -0
  721. package/dist/server/lobby.js.map +1 -0
  722. package/dist/server/log.js +18 -0
  723. package/dist/server/log.js.map +1 -0
  724. package/dist/server/match.js +267 -0
  725. package/dist/server/match.js.map +1 -0
  726. package/dist/server/mode.d.ts +18 -9
  727. package/dist/server/mode.js +220 -0
  728. package/dist/server/mode.js.map +1 -0
  729. package/dist/{navigation-worker.js → server/navigation-worker.js} +1 -1
  730. package/dist/server/navigation-worker.js.map +1 -0
  731. package/dist/server/navigation.js +39 -0
  732. package/dist/server/navigation.js.map +1 -0
  733. package/dist/server/ops.d.ts +4 -0
  734. package/dist/server/ops.js +137 -0
  735. package/dist/server/ops.js.map +1 -0
  736. package/dist/server/packs.d.ts +3 -3
  737. package/dist/server/packs.js +32 -0
  738. package/dist/server/packs.js.map +1 -0
  739. package/dist/server/ratings.d.ts +5 -0
  740. package/dist/server/ratings.js +104 -0
  741. package/dist/server/ratings.js.map +1 -0
  742. package/dist/server/relay.d.ts +12 -2
  743. package/dist/server/relay.js +144 -0
  744. package/dist/server/relay.js.map +1 -0
  745. package/dist/server/rooms.d.ts +9 -2
  746. package/dist/server/rooms.js +442 -0
  747. package/dist/server/rooms.js.map +1 -0
  748. package/dist/server/seat.js +116 -0
  749. package/dist/server/seat.js.map +1 -0
  750. package/dist/server/seatSettings.d.ts +3 -3
  751. package/dist/server/seatSettings.js +63 -0
  752. package/dist/server/seatSettings.js.map +1 -0
  753. package/dist/server/secret.js +13 -0
  754. package/dist/server/secret.js.map +1 -0
  755. package/dist/server/start.d.ts +13 -6
  756. package/dist/server/start.js +76 -0
  757. package/dist/server/start.js.map +1 -0
  758. package/dist/server/websocket.d.ts +9 -1
  759. package/dist/server/websocket.js +306 -0
  760. package/dist/server/websocket.js.map +1 -0
  761. package/dist/server.js +15 -2861
  762. package/dist/session/can.js +26 -0
  763. package/dist/session/can.js.map +1 -0
  764. package/dist/session/commandReplay.d.ts +8 -2
  765. package/dist/session/commandReplay.js +293 -0
  766. package/dist/session/commandReplay.js.map +1 -0
  767. package/dist/session/debug.js +151 -0
  768. package/dist/session/debug.js.map +1 -0
  769. package/dist/session/delay.js +62 -0
  770. package/dist/session/delay.js.map +1 -0
  771. package/dist/session/delta.d.ts +14 -1
  772. package/dist/session/delta.js +407 -0
  773. package/dist/session/delta.js.map +1 -0
  774. package/dist/session/entityState.js +415 -0
  775. package/dist/session/entityState.js.map +1 -0
  776. package/dist/session/local.d.ts +47 -5
  777. package/dist/session/local.js +670 -0
  778. package/dist/session/local.js.map +1 -0
  779. package/dist/session/memory.d.ts +20 -2
  780. package/dist/session/memory.js +131 -0
  781. package/dist/session/memory.js.map +1 -0
  782. package/dist/session/protocol.d.ts +325 -31
  783. package/dist/session/protocol.js +55 -0
  784. package/dist/session/protocol.js.map +1 -0
  785. package/dist/session/remote.d.ts +74 -12
  786. package/dist/session/remote.js +1394 -0
  787. package/dist/session/remote.js.map +1 -0
  788. package/dist/session/replay.d.ts +11 -2
  789. package/dist/session/replay.js +160 -0
  790. package/dist/session/replay.js.map +1 -0
  791. package/dist/session/seed.js +12 -0
  792. package/dist/session/seed.js.map +1 -0
  793. package/dist/session/share.d.ts +5 -1
  794. package/dist/session/share.js +94 -0
  795. package/dist/session/share.js.map +1 -0
  796. package/dist/session/socket.d.ts +1 -1
  797. package/dist/session/socket.js +29 -0
  798. package/dist/session/socket.js.map +1 -0
  799. package/dist/session/wire.d.ts +5 -0
  800. package/dist/session/wire.js +84 -0
  801. package/dist/session/wire.js.map +1 -0
  802. package/dist/session/worker.d.ts +77 -12
  803. package/dist/session/worker.js +499 -0
  804. package/dist/session/worker.js.map +1 -0
  805. package/dist/shared.d.ts +31 -5
  806. package/dist/shared.js +166 -0
  807. package/dist/shared.js.map +1 -0
  808. package/dist/sides.d.ts +9 -3
  809. package/dist/sides.js +149 -0
  810. package/dist/sides.js.map +1 -0
  811. package/dist/sight.js +85 -0
  812. package/dist/sight.js.map +1 -0
  813. package/dist/simulate-worker.js +1 -1
  814. package/dist/simulate.d.ts +12 -8
  815. package/dist/{simulate-oXBiw1Ff.js → simulate.js} +10 -11
  816. package/dist/simulate.js.map +1 -0
  817. package/dist/smart.js +77 -0
  818. package/dist/smart.js.map +1 -0
  819. package/dist/spatial.d.ts +32 -16
  820. package/dist/spatial.js +234 -0
  821. package/dist/spatial.js.map +1 -0
  822. package/dist/spawning.d.ts +1 -0
  823. package/dist/spawning.js +224 -0
  824. package/dist/spawning.js.map +1 -0
  825. package/dist/stances.d.ts +6 -3
  826. package/dist/stances.js +169 -0
  827. package/dist/stances.js.map +1 -0
  828. package/dist/start.d.ts +10 -10
  829. package/dist/start.js +75 -0
  830. package/dist/start.js.map +1 -0
  831. package/dist/stats.d.ts +42 -16
  832. package/dist/stats.js +290 -0
  833. package/dist/stats.js.map +1 -0
  834. package/dist/summoned.d.ts +52 -0
  835. package/dist/summoned.js +38 -0
  836. package/dist/summoned.js.map +1 -0
  837. package/dist/summons.d.ts +10 -13
  838. package/dist/summons.js +271 -0
  839. package/dist/summons.js.map +1 -0
  840. package/dist/systems/abilities.js +224 -0
  841. package/dist/systems/abilities.js.map +1 -0
  842. package/dist/systems/combat.d.ts +35 -1
  843. package/dist/systems/combat.js +677 -0
  844. package/dist/systems/combat.js.map +1 -0
  845. package/dist/systems/combatTold.d.ts +3 -1
  846. package/dist/systems/combatTold.js +85 -0
  847. package/dist/systems/combatTold.js.map +1 -0
  848. package/dist/systems/construction.js +80 -0
  849. package/dist/systems/construction.js.map +1 -0
  850. package/dist/systems/economy.d.ts +0 -6
  851. package/dist/systems/economy.js +128 -0
  852. package/dist/systems/economy.js.map +1 -0
  853. package/dist/systems/fog.d.ts +1 -1
  854. package/dist/systems/fog.js +120 -0
  855. package/dist/systems/fog.js.map +1 -0
  856. package/dist/systems/life.js +32 -0
  857. package/dist/systems/life.js.map +1 -0
  858. package/dist/systems/movement.d.ts +24 -12
  859. package/dist/systems/movement.js +1247 -0
  860. package/dist/systems/movement.js.map +1 -0
  861. package/dist/systems/orders.js +64 -0
  862. package/dist/systems/orders.js.map +1 -0
  863. package/dist/systems/production.js +322 -0
  864. package/dist/systems/production.js.map +1 -0
  865. package/dist/systems/productionQueue.js +120 -0
  866. package/dist/systems/productionQueue.js.map +1 -0
  867. package/dist/systems/victory.d.ts +1 -1
  868. package/dist/systems/victory.js +56 -0
  869. package/dist/systems/victory.js.map +1 -0
  870. package/dist/talk.d.ts +6 -6
  871. package/dist/talk.js +153 -0
  872. package/dist/talk.js.map +1 -0
  873. package/dist/targeting.d.ts +142 -0
  874. package/dist/targeting.js +49 -0
  875. package/dist/targeting.js.map +1 -0
  876. package/dist/tech.d.ts +20 -3
  877. package/dist/tech.js +239 -0
  878. package/dist/tech.js.map +1 -0
  879. package/dist/techTree.d.ts +7 -0
  880. package/dist/techTree.js +90 -0
  881. package/dist/techTree.js.map +1 -0
  882. package/dist/terrain.d.ts +59 -7
  883. package/dist/terrain.js +389 -0
  884. package/dist/terrain.js.map +1 -0
  885. package/dist/terrainSave.d.ts +6 -0
  886. package/dist/terrainSave.js +74 -0
  887. package/dist/terrainSave.js.map +1 -0
  888. package/dist/testing.d.ts +8 -7
  889. package/dist/testing.js +13 -739
  890. package/dist/testing.js.map +1 -1
  891. package/dist/tiles.d.ts +1 -1
  892. package/dist/tiles.js +43 -0
  893. package/dist/tiles.js.map +1 -0
  894. package/dist/timers.d.ts +29 -4
  895. package/dist/timers.js +242 -0
  896. package/dist/timers.js.map +1 -0
  897. package/dist/tomes.d.ts +4 -4
  898. package/dist/tomes.js +94 -0
  899. package/dist/tomes.js.map +1 -0
  900. package/dist/trade.js +103 -0
  901. package/dist/trade.js.map +1 -0
  902. package/dist/transport.d.ts +6 -1
  903. package/dist/transport.js +281 -0
  904. package/dist/transport.js.map +1 -0
  905. package/dist/tunables.d.ts +10 -3
  906. package/dist/tunables.js +56 -0
  907. package/dist/tunables.js.map +1 -0
  908. package/dist/unitResources.d.ts +67 -0
  909. package/dist/unitResources.js +266 -0
  910. package/dist/unitResources.js.map +1 -0
  911. package/dist/upkeep.d.ts +6 -1
  912. package/dist/upkeep.js +26 -0
  913. package/dist/upkeep.js.map +1 -0
  914. package/dist/veterancy.d.ts +8 -3
  915. package/dist/veterancy.js +131 -0
  916. package/dist/veterancy.js.map +1 -0
  917. package/dist/vision.d.ts +36 -0
  918. package/dist/vision.js +133 -0
  919. package/dist/vision.js.map +1 -0
  920. package/dist/walls.d.ts +1 -1
  921. package/dist/walls.js +278 -0
  922. package/dist/walls.js.map +1 -0
  923. package/dist/world.d.ts +606 -88
  924. package/dist/world.js +1263 -0
  925. package/dist/world.js.map +1 -0
  926. package/package.json +2 -2
  927. package/dist/ai.js.map +0 -1
  928. package/dist/attributes.d.ts +0 -66
  929. package/dist/brain-BvVdUhX8.js +0 -7659
  930. package/dist/brain-BvVdUhX8.js.map +0 -1
  931. package/dist/builds-C6LfgvEU.js +0 -460
  932. package/dist/builds-C6LfgvEU.js.map +0 -1
  933. package/dist/coreComponents-syuh2fPG.js +0 -5149
  934. package/dist/coreComponents-syuh2fPG.js.map +0 -1
  935. package/dist/debugCommands-CzjrSm66.js +0 -14739
  936. package/dist/debugCommands-CzjrSm66.js.map +0 -1
  937. package/dist/determinism-BCymQwiE.js +0 -518
  938. package/dist/determinism-BCymQwiE.js.map +0 -1
  939. package/dist/game-DiJEN-Ks.js +0 -5800
  940. package/dist/game-DiJEN-Ks.js.map +0 -1
  941. package/dist/index.js.map +0 -1
  942. package/dist/inspect-D9dWHmZ0.js.map +0 -1
  943. package/dist/local-Dkovq42k.js +0 -1379
  944. package/dist/local-Dkovq42k.js.map +0 -1
  945. package/dist/missionRules-C-bGxm0Q.js.map +0 -1
  946. package/dist/navigation-worker.js.map +0 -1
  947. package/dist/packs-g5thvmGn.js +0 -3199
  948. package/dist/packs-g5thvmGn.js.map +0 -1
  949. package/dist/profiles-B3NS9jwk.js.map +0 -1
  950. package/dist/server.js.map +0 -1
  951. package/dist/simulate-oXBiw1Ff.js.map +0 -1
package/dist/defs.d.ts CHANGED
@@ -1,32 +1,64 @@
1
1
  import type { AbilityAiView } from './ai/micro';
2
2
  import type { AiHints } from './ai/roles';
3
- import type { AbilityTextContext, AbilityValueDef, TextSegment } from './abilities/text';
3
+ import type { AbilityTextContext, AbilityValueDef, CasterFacts, TextSegment } from './abilities/text';
4
+ import type { EffectContext } from './abilities/effects';
4
5
  import type { EntityState } from './session/protocol';
5
6
  /**
6
7
  * Static game data. Everything a game module (melee, custom map, mod) defines about
7
8
  * its units lives in plain objects like these, the engine never hardcodes a unit.
8
9
  */
9
- import type { GameRules } from './rules';
10
+ import type { RuleSettings } from './rules';
10
11
  import type { AbilityState, BuffInstance, Entity } from './entity';
11
12
  import type { Vec2 } from './math';
12
13
  import type { World } from './world';
14
+ import type { BurnsDef } from './burning';
13
15
  /**
14
16
  * A value that can grow with the level of an ability: one number, or one per level
15
17
  *
16
18
  * @beta
17
19
  */
18
20
  export type Scaled = number | number[];
21
+ /**
22
+ * What an amount in code is asked with (`EffectValue`): the ability's level and what the caster brings now, and the effect
23
+ * as it lands, where it is landing. The tooltip asks it too (`abilityValues`), with no `effect` and no target
24
+ *
25
+ * @beta
26
+ */
27
+ export interface EffectValueContext {
28
+ /** The level of the ability */
29
+ level: number;
30
+ /** What the caster brings to the numbers now: its stats, its level as a hero (`casterFacts`) */
31
+ caster: CasterFacts;
32
+ /** The effect as it lands: the world, the caster, where, how far a missile came. Not there for the tooltip */
33
+ effect?: EffectContext;
34
+ }
35
+ /**
36
+ * An amount, a time or a size of an effect: a number, one per level (`Scaled`), or worked out in code for each target as
37
+ * it lands (`(context, target) => number`: a share of what the target lacks, more for each mark on it, by how far it
38
+ * flew). Code is asked with no target where the effect is not for one (a zone's time, an area's size) and by the
39
+ * tooltip; what the screen draws before a cast (the aim) has no caster to ask, and takes `AbilityDef.aim`
40
+ *
41
+ * @beta
42
+ */
43
+ export type EffectValue = Scaled | ((context: EffectValueContext, target?: Entity) => number);
19
44
  /**
20
45
  * The value at a level. Levels past the end of the list get the last one
21
46
  *
22
47
  * @beta
23
48
  */
24
49
  export declare function at(value: Scaled | undefined, level: number, fallback?: number): number;
50
+ /**
51
+ * The value of an amount where there is no caster to ask its code (`EffectValue`): at the level, or `fallback` for code.
52
+ * What the aim the screen draws and a computer player's guesses go by
53
+ *
54
+ * @beta
55
+ */
56
+ export declare function declaredAt(value: EffectValue | undefined, level: number, fallback?: number): number;
25
57
  /**
26
58
  * The stats the engine reads: what a unit has of health, mana and their regeneration, how it moves, sees and attacks,
27
59
  * and its armor and magic resist (the two kinds of damage there are besides true). Levels, items, buffs and research
28
- * change them. A game adds stats of its own with `GameModule.stats`, a pack its own (`GamePack.stats`: the MOBA
29
- * stats of `withMobaStats`).
60
+ * change them. A game adds stats of its own with `Rules.stats`, a pack its own (`GamePack.stats`: the MOBA
61
+ * stats of `mobaStatsPack`).
30
62
  *
31
63
  * @beta
32
64
  */
@@ -37,13 +69,33 @@ export interface CoreStats {
37
69
  attackSpeed: number;
38
70
  /** Measured between the edges of attacker and target */
39
71
  attackRange: number;
72
+ /** The most health a unit has; the entity's `maxHealth` follows it */
40
73
  health: number;
41
74
  /** Against physical damage: 100 of it halve what arrives */
42
75
  armor: number;
43
76
  /** The same against magic damage */
44
77
  magicResist: number;
78
+ /**
79
+ * Part by which the damage it takes is more or less, after armor or magic resist and before shields: -0.3 takes 30%
80
+ * less, 0.2 a fifth more. Added up with the part of the damage's own type (below), and never below none
81
+ */
82
+ incomingDamage: number;
83
+ /** The same, of physical damage only, on top of `incomingDamage` */
84
+ incomingPhysicalDamage: number;
85
+ /** The same, of magic damage only, on top of `incomingDamage` */
86
+ incomingMagicDamage: number;
87
+ /** The same, of true damage only, on top of `incomingDamage` */
88
+ incomingTrueDamage: number;
89
+ /**
90
+ * Part by which all the damage it deals, of attacks and abilities, is more or less: -0.35 deals 35% less. Never below
91
+ * none
92
+ */
93
+ outgoingDamage: number;
94
+ /** Part by which the healing it gets is more or less: -0.4 heals 40% less (an anti-heal). Never below none */
95
+ incomingHealing: number;
45
96
  /** Per second */
46
97
  healthRegen: number;
98
+ /** The most mana a unit has */
47
99
  mana: number;
48
100
  /** Per second */
49
101
  manaRegen: number;
@@ -70,7 +122,9 @@ export type StatKey = string;
70
122
  * @beta
71
123
  */
72
124
  export interface StatDef {
125
+ /** The stat's id, which units, changes and abilities name it by */
73
126
  id: string;
127
+ /** What the player sees the stat called */
74
128
  name: string;
75
129
  /** Shown when the pointer is over it */
76
130
  description?: string;
@@ -78,11 +132,16 @@ export interface StatDef {
78
132
  default?: number;
79
133
  /** It never goes below or above these, whatever changes it */
80
134
  min?: number;
135
+ /** The highest the stat goes, whatever changes it; no upper bound when left out */
81
136
  max?: number;
82
137
  /** How it is shown: a whole number, a decimal, or a part of one as a percentage. A whole number when left out */
83
138
  format?: 'number' | 'decimal' | 'percent';
84
139
  }
85
- /** @beta */
140
+ /**
141
+ * Gives a `CoreStats` with every stat at 0
142
+ *
143
+ * @beta
144
+ */
86
145
  export declare const noStats: () => CoreStats;
87
146
  /**
88
147
  * How the days go by. Hours run from 0 to 24
@@ -105,7 +164,11 @@ export interface DayCycle {
105
164
  * @beta
106
165
  */
107
166
  export declare function hourOf(day: DayCycle | null, seconds: number): number;
108
- /** @beta */
167
+ /**
168
+ * Whether the hour (0..24) is night under the day cycle, before its dawn or from its dusk; never night without a day cycle
169
+ *
170
+ * @beta
171
+ */
109
172
  export declare const isNight: (day: DayCycle | null, hour: number) => boolean;
110
173
  /**
111
174
  * Something that changes stats: `stats` is added, `percent` makes them bigger or smaller by a part of what
@@ -114,7 +177,9 @@ export declare const isNight: (day: DayCycle | null, hour: number) => boolean;
114
177
  * @beta
115
178
  */
116
179
  export interface StatChange {
180
+ /** Amounts added to stats, by stat */
117
181
  stats?: Partial<Stats>;
182
+ /** Parts stats grow or shrink by, by stat: 0.1 is 10% more, and the parts add up before they are applied */
118
183
  percent?: Partial<Stats>;
119
184
  }
120
185
  /**
@@ -123,7 +188,9 @@ export interface StatChange {
123
188
  * @beta
124
189
  */
125
190
  export interface ScaledStatChange {
191
+ /** Amounts added to stats, by stat, each growing with the ability's level */
126
192
  stats?: Partial<Record<StatKey, Scaled>>;
193
+ /** Parts stats grow or shrink by, by stat, each growing with the ability's level */
127
194
  percent?: Partial<Record<StatKey, Scaled>>;
128
195
  }
129
196
  /**
@@ -144,17 +211,112 @@ export interface HeroDef {
144
211
  learns: string[];
145
212
  /** Abilities it has from the start and does not learn: the two spells every hero brings along. No mana, and nothing shortens their cooldown */
146
213
  spells?: string[];
214
+ /**
215
+ * Its innate: an ability it has from level 1, for no point, that grows with it: its level is the hero's (up to the
216
+ * ability's own `maxLevel` where it says one), or goes up at the hero levels of `innateLevels`. A passive most often
217
+ * (its buffs, its triggers), or one it casts
218
+ *
219
+ * @beta
220
+ */
221
+ innate?: string;
222
+ /**
223
+ * The hero levels its innate goes up a level at, from its first: `[1, 6, 11, 16]` has it at level 2 from the hero's
224
+ * sixth. The hero's own level, when left out
225
+ *
226
+ * @beta
227
+ */
228
+ innateLevels?: number[];
229
+ /**
230
+ * What it is good at, by calling (`CallingDef`, the game's: `heroesPack({ callings })`), each with a strength from 1
231
+ * to 3: `{ stalker: 3, roamer: 2 }`. They lock nothing: the shop's suggestions and filters, the tooltips and the
232
+ * computer players go by them
233
+ *
234
+ * @beta
235
+ */
236
+ callings?: Record<string, 1 | 2 | 3>;
147
237
  /** The level it stops at. 10 when left out */
148
238
  maxLevel?: number;
149
239
  /** A buff whose stacks are shown next to its health and mana, as so many points out of as many as it can have */
150
240
  meter?: string;
151
241
  /**
152
- * Its primary attribute, in a game with the attributes pack (`withAttributes`): each point of it adds to its attack
153
- * as well. `AttributesOptions.primaryOf` says it in code
242
+ * The forms it takes (a `morph` effect's `into`), by unit type: what it learns in each (`HeroForm`). A form is a
243
+ * hero's type of its own (its stats, its growth, its look); this says what of the hero's it takes along
244
+ *
245
+ * @beta
246
+ */
247
+ forms?: Record<string, HeroForm>;
248
+ }
249
+ /**
250
+ * What becomes of a hero's cooldowns going in and out of a form (`HeroForm.cooldowns`)
251
+ *
252
+ * @beta
253
+ */
254
+ export type FormCooldowns = 'keep' | 'reset' | 'shared';
255
+ /**
256
+ * What a hero is in one of its forms (`HeroDef.forms`): the abilities it learns there by id (`learns`), the level each
257
+ * starts at (`levels`: that of one of the hero's own, or a number), and what of its own the form leaves in place
258
+ * (`keeps`). Everything else of its own is put away until it turns back
259
+ *
260
+ * ```ts
261
+ * // Nidalee's cougar: Takedown at Rocket Grab's level and Pounce at Void Swarm's, Swipe learned in the form; the
262
+ * // aspect (it made the form) and the ultimate stay as they are
263
+ * forms: { cougar: { learns: ['takedown', 'pounce', 'swipe'], levels: { takedown: 'rocketGrab', pounce: 'voidSwarm' }, keeps: ['heartbreaker'] } }
264
+ * ```
265
+ *
266
+ * The shorter shape, a list alone with neither `levels` nor `keeps`, is read by slot: the first at the level of the
267
+ * first the hero learns as itself, the second of the second, and so on (Q is Q), a point put into one in the form going
268
+ * to the hero's own at that slot too
269
+ *
270
+ * @beta
271
+ */
272
+ export interface HeroForm {
273
+ /**
274
+ * The abilities it learns in the form, by id: what the HUD's card and hero panel show there, and what its points go
275
+ * into, in this order (the hero's own it keeps after them). One of the hero's own named here is kept as it is. What
276
+ * the form's type learns (its `hero.learns`) when left out
277
+ */
278
+ learns?: string[];
279
+ /**
280
+ * The level each of `learns` starts at in the form, by id: the id of one of the hero's own abilities, whose level it
281
+ * has (a point put into it in the form goes to that one too), or a number. 0 for what is not said: learned in the form
282
+ */
283
+ levels?: Record<string, string | number>;
284
+ /**
285
+ * The hero's own abilities the form leaves in place, by id: castable in the form as they are, level and cooldown (an
286
+ * ultimate, a passive); learned there, those it learns as itself. The ability that made the form and the spells it
287
+ * brought along (`HeroDef.spells`) are kept unsaid
288
+ */
289
+ keeps?: string[];
290
+ /**
291
+ * What becomes of the cooldowns of what the form puts away and of what it brings, when the hero goes in and out of it
292
+ * within the time of a cooldown:
293
+ *
294
+ * - left out: what the hero puts away runs down by the time it is away, and comes back with what is left; what the
295
+ * form brings starts ready each time. The default
296
+ * - `'keep'`: what is put away comes back exactly as it was left, the time away not counted: a form is not a way to
297
+ * wait out a cooldown
298
+ * - `'reset'`: what is put away comes back ready, its cooldown 0: a form is a way to get them back
299
+ * - `'shared'`: an ability of the form whose level is one of the hero's own (`levels` by id, or by slot in the shorter
300
+ * shape) has one cooldown with it: it starts with the cooldown of the one it takes the place of, and gives its
301
+ * own, what it has by then (cast in the form or run down), back as the hero turns back. The rest as when left out
302
+ *
303
+ * What the form keeps in place (`keeps`, the ability that made it, the spells) is one ability in both and is never
304
+ * touched by any of them
154
305
  */
155
- primary?: 'strength' | 'agility' | 'intelligence';
306
+ cooldowns?: FormCooldowns;
156
307
  }
157
- /** @beta */
308
+ /**
309
+ * What turns a form back into the hero it was (`EffectFields.back`): the ability that made it cast again (`ability`),
310
+ * its time up (`time`), or its death (`death`: it falls as itself, and is brought back as itself)
311
+ *
312
+ * @beta
313
+ */
314
+ export type MorphBack = 'ability' | 'time' | 'death';
315
+ /**
316
+ * What an entity is: a unit, a building or a resource
317
+ *
318
+ * @beta
319
+ */
158
320
  export type EntityKind = 'unit' | 'building' | 'resource';
159
321
  /**
160
322
  * Where something is: on the ground, or above it
@@ -185,7 +347,7 @@ export interface AttackStats {
185
347
  */
186
348
  export interface AttackDef {
187
349
  /**
188
- * The stats its numbers are, by id: a stat of the game's (`GameModule.stats`) for a weapon whose damage, speed or
350
+ * The stats its numbers are, by id: a stat of the game's (`Rules.stats`) for a weapon whose damage, speed or
189
351
  * range is not the unit's first's. What changes those stats (research, items, buffs) changes this attack alone
190
352
  */
191
353
  stats?: AttackStats;
@@ -193,11 +355,18 @@ export interface AttackDef {
193
355
  damageType?: DamageType;
194
356
  /** Seconds from the start of the swing until damage lands (or the projectile leaves), at the attack speed the unit starts with */
195
357
  damagePoint: number;
358
+ /**
359
+ * Seconds after the blow during which the unit is held: an order it is given (a move, another attack) waits until
360
+ * they are over, unless the rules let it cut them (`RuleSettings.combat.recoveryCancels`). At the attack speed the unit
361
+ * starts with, shorter as it attacks faster, and never past its next swing. None when left out: it may walk away
362
+ * the moment the blow lands (kiting), as in LoL
363
+ */
364
+ recovery?: number;
196
365
  /** Enemies closer than this are attacked automatically */
197
366
  acquisitionRange: number;
198
367
  /**
199
368
  * How near is too near, edge to edge: what is closer than this the attack does not hit (a siege weapon's dead zone).
200
- * Another of the unit's attacks takes over there where one reaches (`GameRules.combat.pickAttack`); with none, a unit
369
+ * Another of the unit's attacks takes over there where one reaches (`RuleSettings.combat.pickAttack`); with none, a unit
201
370
  * told to attack steps back out of it first, and one left to itself does not pick what is that near. None when left out
202
371
  */
203
372
  minRange?: number;
@@ -223,6 +392,13 @@ export interface AttackDef {
223
392
  ground?: boolean;
224
393
  /** Brings down what is `fellable` in the area it hits */
225
394
  fells?: boolean;
395
+ /**
396
+ * A blow from up close (no missile) also strikes the target's other enemies near it, a part of its damage each:
397
+ * a cleave. With a buff's (`BuffDef.cleave`), the one of the larger part counts
398
+ *
399
+ * @beta
400
+ */
401
+ cleave?: Cleave;
226
402
  /**
227
403
  * How what this attack kills dies, for the screen (`'shot'`, `'crushed'`, `'burnt'`): the death's `how`, which the
228
404
  * view shows its way (`UnitLook.death`). A word, or one decided for each blow. The `death` hook has the last say
@@ -235,25 +411,38 @@ export interface AttackDef {
235
411
  crit: boolean;
236
412
  tags?: readonly string[];
237
413
  }) => string | undefined);
238
- /**
239
- * The attack's type against the target's armour type, by the game's damage table (`GameRules.combat.damageTable`): `pierce`,
240
- * `siege`… Left out, the attack is multiplied by nothing
241
- */
242
- attackType?: string;
414
+ }
415
+ /**
416
+ * What a blow from up close does to the enemies around its target (`AttackDef.cleave`, `BuffDef.cleave`): a part of
417
+ * its damage, before their armor, for each of them within `radius` of the target and, where `angle` says, within a
418
+ * cone of that angle that opens from the attacker through the target (so ahead of the attacker, round and behind the
419
+ * target). Not the target itself, nor anyone the attack could not hit
420
+ *
421
+ * @beta
422
+ */
423
+ export interface Cleave {
424
+ /** The part of the blow's damage each other enemy takes, by level for a buff's: 0.5 is half */
425
+ part: Scaled;
426
+ /** How far from the target's edge the enemies it reaches stand */
427
+ radius: number;
428
+ /** How wide the cone is, in radians (1.57: a quarter turn). All the way round the target when left out */
429
+ angle?: number;
243
430
  }
244
431
  /**
245
432
  * The id of a resource, as its game module defines it (`ResourceDef`)
246
433
  *
247
434
  * @beta
248
435
  */
249
- export type ResourceKind = string;
436
+ export type ResourceId = string;
250
437
  /**
251
438
  * Something players have amounts of and pay with, like gold, lumber or crystals. A game module lists its own
252
439
  *
253
440
  * @beta
254
441
  */
255
442
  export interface ResourceDef {
256
- id: ResourceKind;
443
+ /** The resource's id, which prices, players' amounts and gatherers name it by */
444
+ id: ResourceId;
445
+ /** What the player sees the resource called */
257
446
  name: string;
258
447
  /** What every player starts a game with. Nothing when left out */
259
448
  start?: number;
@@ -265,17 +454,31 @@ export interface ResourceDef {
265
454
  *
266
455
  * @beta
267
456
  */
268
- export type Cost = Record<ResourceKind, number>;
269
- /** @beta */
457
+ export type Cost = Record<ResourceId, number>;
458
+ /**
459
+ * The definition of a unit type: a unit, building or resource, with its stats, abilities, costs and what it does
460
+ *
461
+ * @public
462
+ */
270
463
  export interface UnitTypeDef {
464
+ /** The type's id, shared by every game: give it a prefix of the game's */
271
465
  id: string;
466
+ /** What the player sees the type called */
272
467
  name: string;
273
468
  /**
274
469
  * The definition this one is a copy of, made from the data (`copyOf` in a `data.json`, the editor's Copy as new):
275
470
  * what it is drawn, heard and pictured as where the game gives it no look of its own
276
471
  */
277
472
  basedOn?: string;
473
+ /** Whether the type is a unit, a building or a resource */
278
474
  kind: EntityKind;
475
+ /**
476
+ * Words of the game's for what it is (`undead`, `mechanical`, `ward`): what an effect's `tags`, an ability's
477
+ * `targets.tags` and an `if`'s condition (`UnitCondition.tags`) go by
478
+ *
479
+ * @beta
480
+ */
481
+ tags?: string[];
279
482
  /** Collision radius */
280
483
  radius: number;
281
484
  /** Size in grid cells. Required for buildings and resources */
@@ -301,12 +504,12 @@ export interface UnitTypeDef {
301
504
  */
302
505
  naval?: boolean;
303
506
  /**
304
- * A waygate, in a game with the portals pack (`withPortals`): a unit told to it walks in and is at once where it
507
+ * A waygate, in a game with the portals pack (`portalsPack`): a unit told to it walks in and is at once where it
305
508
  * leads (its `waygate` field, a point of the map; `setWaygate` in code)
306
509
  */
307
510
  waygate?: boolean;
308
511
  /**
309
- * Rocks, a barricade, a gate to break down, in a game with the destructibles pack (`withDestructibles`): it stands in
512
+ * Rocks, a barricade, a gate to break down, in a game with the destructibles pack (`destructiblesPack`): it stands in
310
513
  * the way as any building does until it is brought down, and any unit whose attack reaches it attacks it when told
311
514
  * to, never of its own accord
312
515
  */
@@ -327,14 +530,15 @@ export interface UnitTypeDef {
327
530
  /** Attack damage each one inside adds; or in code, all of what they add, by who is inside (none for nobody) */
328
531
  armed?: number | ((world: World, building: Entity, inside: Entity[]) => number);
329
532
  };
330
- /** Radians per second */
533
+ /** How fast it turns, in radians a second: the game's for every unit (`RuleSettings.movement.turnRate`, 12) when left out */
331
534
  turnRate?: number;
332
535
  /**
333
536
  * How it attacks, as the classic RTS two weapons: against each target the first that reaches it (its `targets`), or
334
- * the one the game picks (`GameRules.combat.pickAttack`). It swings one at a time: a hit's cooldown is that attack's,
537
+ * the one the game picks (`RuleSettings.combat.pickAttack`). It swings one at a time: a hit's cooldown is that attack's,
335
538
  * whichever swings next. None for what does not attack
336
539
  */
337
540
  attacks?: AttackDef[];
541
+ /** Makes the type a hero, with its levels and the rest of `HeroDef`; none for a unit that is not one */
338
542
  hero?: HeroDef;
339
543
  /** How dangerous it is, for creeps. Shown to the player, and added up per camp */
340
544
  level?: number;
@@ -356,7 +560,7 @@ export interface UnitTypeDef {
356
560
  /** Building types the player has to have before this can be built or trained */
357
561
  requires?: string[];
358
562
  /**
359
- * The race it is of (`GameModule.races`): only its players may build or train it. Everyone's when left out: creeps,
563
+ * The race it is of (`Rules.races`): only its players may build or train it. Everyone's when left out: creeps,
360
564
  * what is shared. What a player may have is the game's to change (the `available` hook)
361
565
  */
362
566
  race?: string;
@@ -388,16 +592,19 @@ export interface UnitTypeDef {
388
592
  revives?: boolean;
389
593
  /** Ids of the abilities the unit has */
390
594
  abilities?: string[];
595
+ /** What it costs to build or train, in resources */
391
596
  cost?: Cost;
392
- /** Supply (food) it takes up for as long as it lives, and while it is being trained */
393
- supply?: number;
394
- /** What it takes of the game's other pools of supply, by name (`GameRules.supply.pools`): `{ command: 1 }` */
395
- supplies?: Record<string, number>;
597
+ /**
598
+ * Supply (food) it takes up for as long as it lives, and while it is being trained: of the one pool there always is, or by
599
+ * pool (`{ supply: 2, command: 1 }`: `supply` that one, the rest the game's own, `RuleSettings.supply.pools`). Read with
600
+ * `supplyOf` and `supplyPoolsOf`
601
+ */
602
+ supply?: number | Record<string, number>;
396
603
  /** Seconds to build or train */
397
604
  buildTime?: number;
398
- supplyProvided?: number;
399
- /** What it provides of the game's other pools of supply, by name (`GameRules.supply.pools`), once it stands finished */
400
- suppliesProvided?: Record<string, number>;
605
+ /** What it provides once it stands finished: of the one pool, or by pool, as `supply` is said. Read with `supplyGivenOf` and `supplyPoolsGivenOf` */
606
+ supplyGiven?: number | Record<string, number>;
607
+ /** Makes it a worker that gathers: how much it carries, seconds a load takes, and which resources it gathers */
401
608
  harvester?: {
402
609
  capacity: number;
403
610
  gatherTime: number;
@@ -405,7 +612,7 @@ export interface UnitTypeDef {
405
612
  * The kinds of resource it gathers: all of them when left out. The undead's acolytes gold and nothing else, ghouls
406
613
  * lumber. The `canHarvest` hook has the last word (`canHarvest`)
407
614
  */
408
- kinds?: ResourceKind[];
615
+ ids?: ResourceId[];
409
616
  };
410
617
  /** Building types this unit can construct */
411
618
  builds?: string[];
@@ -414,19 +621,19 @@ export interface UnitTypeDef {
414
621
  /** Upgrades that can be researched here */
415
622
  researches?: string[];
416
623
  /** Accepts harvested resources: all of them, or only the ones listed */
417
- dropOff?: boolean | ResourceKind[];
624
+ dropOff?: boolean | ResourceId[];
418
625
  /**
419
626
  * Goes up on a resource of this kind, over it, of the same footprint: the undead's cursed gold mine. The resource is
420
627
  * its owner's alone from then on (`canHarvest`); one that takes what is gathered there (`dropOff`) has its owner's
421
628
  * workers gather at it from around it, handing in where they stand, as many at once as `gatherers` says. It goes
422
629
  * down with the resource, which stands again where it is destroyed
423
630
  */
424
- builtOn?: ResourceKind;
631
+ builtOn?: ResourceId;
425
632
  /** Workers that gather at once at it, when it stands on a resource (`builtOn`): 5 when left out */
426
633
  gatherers?: number;
427
634
  /**
428
635
  * Goes up on its own once it is put down, as the undead summon theirs: the builder is free at once, and nobody
429
- * helps (`GameRules.production.buildRate` of one builder, all the way). The same as `construction: 'self'`
636
+ * helps (`RuleSettings.production.buildRate` of one builder, all the way). The same as `construction: 'self'`
430
637
  */
431
638
  buildsItself?: boolean;
432
639
  /**
@@ -438,14 +645,15 @@ export interface UnitTypeDef {
438
645
  */
439
646
  construction?: 'builder' | 'self' | 'instant';
440
647
  /**
441
- * How fast it goes up with so many builders at it, 1 being one builder's: the game's rule (`GameRules.production.buildRate`) for
648
+ * How fast it goes up with so many builders at it, 1 being one builder's: the game's rule (`RuleSettings.production.buildRate`) for
442
649
  * every type when left out
443
650
  *
444
651
  * @beta
445
652
  */
446
653
  buildRate?: (builders: number, world: World, structure: Entity) => number;
654
+ /** Makes it a deposit that can be gathered from: which resource, how much, how many workers fit and how they gather */
447
655
  resource?: {
448
- kind: ResourceKind;
656
+ id: ResourceId;
449
657
  amount: number;
450
658
  /** Workers that fit inside at once, for resources that are entered */
451
659
  slots: number;
@@ -458,7 +666,14 @@ export interface UnitTypeDef {
458
666
  hotkey?: string;
459
667
  /** Higher values are picked first when acquiring targets */
460
668
  threat?: number;
669
+ /** Whether it cannot be hurt */
461
670
  invulnerable?: boolean;
671
+ /**
672
+ * Ids of the abilities that alone may target it (a soul that only `possess` takes). Nothing else may: not an ability
673
+ * clicked on it or used on it by the AI, nor an attack, nor the area of one, nor a heal; the ones named get through
674
+ * the target rules as they say (`targets`). It is untouched as `invulnerable` is, but for them
675
+ */
676
+ targetableBy?: string[];
462
677
  /** Takes damage like anything else but never dies of it: it is left with a little health, like something to practise on */
463
678
  undying?: boolean;
464
679
  /** Seconds after it was last hurt that it is whole again, all at once */
@@ -468,7 +683,15 @@ export interface UnitTypeDef {
468
683
  /** Destroyed by attacks that fell, like a tree by a catapult, whatever else it withstands */
469
684
  fellable?: boolean;
470
685
  /**
471
- * A piece of wall (`withWalls`): it joins with the pieces of its family beside it, and its shape (`single`, `end`,
686
+ * Whether it burns, in a game with the burning pack (`burningPack`), and how (`BurnsDef`: for how long, what it
687
+ * leaves, whether its wood is kept, what kind of burning it is): `true` as the pack says, `false` never. What can be
688
+ * felled (`fellable`: trees) burns when left out; anything else does not
689
+ *
690
+ * @beta
691
+ */
692
+ burns?: boolean | BurnsDef;
693
+ /**
694
+ * A piece of wall (`wallsPack`): it joins with the pieces of its family beside it, and its shape (`single`, `end`,
472
695
  * `straight`, `corner`, `tee`, `cross`) is its look. A gate (`gate`) joins as a piece does, turned along its line,
473
696
  * and its owner opens and shuts it for everyone (`wallGateCommand`): its look `open` or `shut`. Pieces join by their
474
697
  * footprints, so a gate wider than a cell sits in a line of pieces of one: one of a cell lets nobody through, the
@@ -484,23 +707,124 @@ export interface UnitTypeDef {
484
707
  invisible?: {
485
708
  after?: number;
486
709
  };
487
- /** Goes down after this many attacks and spells, whatever they deal: its health counts hits */
488
- hits?: number;
710
+ /**
711
+ * Finds what of its enemies is invisible or camouflaged within this far of it, for its team, for as long as it stays
712
+ * that near, in a game with the vision pack (`visionPack`): a Sentry Ward's true sight, a Control Ward
713
+ *
714
+ * @beta
715
+ */
716
+ trueSight?: number;
717
+ /**
718
+ * Goes down after this many attacks and spells, whatever they deal: its health counts hits, and its most health is
719
+ * this whatever its `stats.health` or what changes its stats say
720
+ */
721
+ uses?: number;
722
+ /**
723
+ * A trap, a mine, a pickup, in a game with the ground objects pack (`groundObjectsPack`): an ability of the game's that
724
+ * goes off as one of those it is for comes within its `radius` (`GroundTrigger`)
725
+ *
726
+ * @beta
727
+ */
728
+ trigger?: GroundTrigger;
729
+ /**
730
+ * Something others click on, in a game with the ground objects pack (`groundObjectsPack`): a unit of those it is for
731
+ * told to it (right-clicked) walks up to it and uses it, an ability of the game's going off (`GroundUse`): Thresh's
732
+ * lantern, Bard's portals
733
+ *
734
+ * @beta
735
+ */
736
+ use?: GroundUse;
737
+ /**
738
+ * Stops the missiles of abilities that come at it, in a game with the ground objects pack (`groundObjectsPack`):
739
+ * those of its enemies (`enemies`), or of everyone (`all`); they are gone where they meet it, with nothing happening
740
+ * (Yasuo's Wind Wall, a line of them: `EffectFields.line`). A missile thrown (`arc`) flies over it
741
+ *
742
+ * @beta
743
+ */
744
+ blocksMissiles?: 'enemies' | 'all';
745
+ /**
746
+ * What happens where it dies, in a game with the ground objects pack (`groundObjectsPack`): an ability of the game's
747
+ * goes off there in its maker's name (`ability`), and those of its type and owner within `chain` of it die too and
748
+ * go off in turn: Gangplank's barrels (`uses: 3` counts the hits that bring one down)
749
+ *
750
+ * @beta
751
+ */
752
+ burst?: {
753
+ ability: string;
754
+ chain?: number;
755
+ };
756
+ /**
757
+ * Resources of its own beside mana, in a game with the resources pack (`resourcesPack`), by id: energy, fury, heat,
758
+ * flow, ammo (`PoolDef`: how much at most, at the start, back each second, lost each second when nothing used it,
759
+ * gained by walking, refilled when empty, and buffs at thresholds). What its abilities cost of them (`AbilityDef.cost`)
760
+ * and give (`gain`), what its attacks cost (`attackCost`), the `gain` effect
761
+ *
762
+ * @beta
763
+ */
764
+ pools?: Record<string, PoolDef>;
765
+ /**
766
+ * What each of its attacks costs of its pools (`pools`), in a game with the resources pack: with less than that it
767
+ * does not attack (Jhin's four shots, then the reload)
768
+ *
769
+ * @beta
770
+ */
771
+ attackCost?: Record<string, number>;
489
772
  /**
490
773
  * What the computer player takes it for (`AiHints`): its roles (`worker`, `hall`, `soldier`...), the game's words
491
774
  * about it, what it answers. Declared where what the kit infers from the rest of the definition is wrong or cannot
492
775
  * be known; inferred otherwise (`inferRoles` in `@v12-engine/engine/ai`)
493
776
  */
494
777
  ai?: AiHints;
495
- /** Its armour type, the column of the game's damage table (`GameRules.combat.damageTable`): `light`, `heavy`, `fortified`… */
496
- armourType?: string;
497
778
  }
498
779
  /**
499
- * How an ability is aimed
780
+ * The names of a game's own ways of aiming an ability (`defineTargeting`), by declaration merging:
781
+ * `declare module '@v12-engine/engine' { interface AbilityTargetings { wall: true } }` makes `target: 'wall'` an
782
+ * ability's way of aiming
783
+ *
784
+ * @beta
785
+ */
786
+ export interface AbilityTargetings {
787
+ }
788
+ /**
789
+ * How an ability is aimed: the engine's ways (`AimKind`: `none`, `unit`, `point`, `direction`, `vector`, `passive`), or a
790
+ * game's own (`AbilityTargetings`, `defineTargeting`)
791
+ *
792
+ * @beta
793
+ */
794
+ export type AbilityTarget = 'none' | 'unit' | 'point' | 'direction' | 'vector' | 'passive' | keyof AbilityTargetings;
795
+ /**
796
+ * How an ability is cast again after it is cast (`AbilityDef.recast`): for `window` seconds the same button casts the
797
+ * recast, `count` times, each doing its `effects` (no wind-up, no channel, `manaCost` its own: none when left out); the
798
+ * cooldown waits for the last recast or the window's end (`after`) or starts at the first cast (`first`). The window
799
+ * and its recasts are the ability's state (`AbilityState.recast`), saved and told to its owner's button
800
+ * (`AbilityInfo.recast`)
500
801
  *
501
802
  * @beta
502
803
  */
503
- export type AbilityTarget = 'none' | 'unit' | 'point' | 'direction' | 'passive';
804
+ export interface AbilityRecast {
805
+ /** Seconds it may be cast again for, from the cast */
806
+ window: Scaled;
807
+ /** How many times it may be cast again in the window: once when left out */
808
+ count?: number;
809
+ /** What a recast does: the ability's own `effects` when left out */
810
+ effects?: EffectDef[];
811
+ /** How a recast is aimed: as the ability is when left out; with a `mark`, at the marked unit, with no aim of its own */
812
+ target?: AbilityTarget;
813
+ /** How far away a recast's target may be: the ability's `range` when left out */
814
+ range?: Scaled;
815
+ /**
816
+ * A buff the cast leaves on a unit (Sonic Wave's mark): a recast goes to the unit that carries it from the caster
817
+ * (the nearest, where there are more), its target and its point, and is refused while none does (`noMark`)
818
+ */
819
+ mark?: string;
820
+ /**
821
+ * When the cooldown starts: `after` the last recast, or the window's end (when left out), with what it was as the
822
+ * ability was cast; or at the `first` cast, as usual, the recasts not waiting for it
823
+ */
824
+ cooldown?: 'after' | 'first';
825
+ /** Mana a recast costs: none when left out */
826
+ manaCost?: Scaled;
827
+ }
504
828
  /**
505
829
  * What every effect may say, whatever its type: who of what it reaches it applies to (`effectTargets`)
506
830
  *
@@ -509,89 +833,663 @@ export type AbilityTarget = 'none' | 'unit' | 'point' | 'direction' | 'passive';
509
833
  export interface EffectCommon {
510
834
  /** Only hits what carries this buff */
511
835
  ifBuff?: string;
836
+ /**
837
+ * Which look of its ability the screen draws it with (`AbilityLook.effects` in the client: by this name, else by its
838
+ * place in the ability or its type). Nothing to the rules: the same game with another look
839
+ *
840
+ * @beta
841
+ */
842
+ look?: string;
512
843
  /** Only hits heroes */
513
844
  only?: 'heroes';
845
+ /**
846
+ * Only hits what has one of these tags of its type (`UnitTypeDef.tags`): `['undead']`. Everything when left out
847
+ *
848
+ * @beta
849
+ */
850
+ tags?: string[];
851
+ /**
852
+ * It happens by chance: this share of the times it would (0.25 one in four), drawn from the world's numbers
853
+ * (`world.rng`), so the same every run. Once each time its list runs, for all it reaches; for a trigger (`onHit`,
854
+ * `onDamaged`…), each time it would go off (Bash), its cooldown starting only when it does; for an `if`, a
855
+ * condition like its others, drawn for each it asks of (and `otherwise` when the draw fails). A number, one per
856
+ * level, or code (`EffectValue`) asked with the target
857
+ *
858
+ * @beta
859
+ */
860
+ chance?: EffectValue;
514
861
  /** Only hits these kinds of things. Everything but resources when left out */
515
862
  kinds?: EntityKind[];
516
863
  /** Where what it hits has to be: on the ground, in the air. Both when left out */
517
864
  layers?: Layer[];
518
- /** Makes the effect hit everything around the point of impact. Required for auras, and the size of a missile */
519
- radius?: Scaled;
865
+ /**
866
+ * Makes the effect hit everything around the point of impact. Required for auras, and the size of a missile. In code
867
+ * (`EffectValue`), asked as it lands with no target
868
+ */
869
+ radius?: EffectValue;
870
+ /**
871
+ * What ground it covers (`EffectShape`), turned the way the ability was aimed: `circle` (its `radius`, what an effect
872
+ * with a radius alone covers), `cone` (`length`, `angle`), `line` (`length`, `width`), `rect` (`length`, `width`),
873
+ * `ring` (`radius`, `width`), `arc` (`radius`, `angle`, `width`), `cross` (`length`, `width`). A circle, a ring, a
874
+ * rectangle and a cross lie around where it landed; a cone, a line and an arc go off from the caster (or the
875
+ * context's `origin`) the way of where it landed. Everything in it, as `affects` says, is hit (`effectArea`,
876
+ * `inArea`). Of a zone: what is inside it, for `onEnter`, `onLeave` and `edge`
877
+ *
878
+ * @beta
879
+ */
880
+ shape?: EffectShape;
881
+ /** Of a `cone`, a `line`, a `rect` and a `cross`: how long it is, end to end. In code (`EffectValue`), asked as it lands @beta */
882
+ length?: EffectValue;
883
+ /**
884
+ * Of a `line`, a `rect` and a `cross`: how far it covers on either side of its middle; of a `ring` and an `arc`, how
885
+ * thick it is, inwards from its `radius`. 1 when left out
886
+ *
887
+ * @beta
888
+ */
889
+ width?: EffectValue;
890
+ /** Of a `cone` and an `arc`: how wide it opens, in radians @beta */
891
+ angle?: EffectValue;
520
892
  /** Who an effect with a radius applies to. Follows from the kind of effect when left out */
521
893
  affects?: 'enemies' | 'allies' | 'all';
894
+ /**
895
+ * Only hits what this says of it (`UnitCondition`: a buff or none, health under or over a share, a hero, tags, enemy
896
+ * or ally of the caster), or code (`UnitConditionCheck`, asked with the target): `{ healthBelow: 0.5, notTags:
897
+ * ['mechanical'] }`. Of an effect with an area, asked of each in it; of one without, of its target
898
+ *
899
+ * @beta
900
+ */
901
+ where?: UnitCondition | UnitConditionCheck;
902
+ /**
903
+ * Of what its area reaches, the order it goes to them in (`TargetOrder`), or a comparison: the first `limit` of it are
904
+ * hit. The nearest to the middle of its area (where it landed, or the caster for a cone, a line and an arc) when left
905
+ * out with a `limit`
906
+ *
907
+ * @beta
908
+ */
909
+ sort?: TargetOrder | ((a: Entity, b: Entity) => number);
910
+ /**
911
+ * Of what its area reaches, at most this many, the first by `sort`: a number, or one per level. `{ sort:
912
+ * 'lowestHealthShare', limit: 3 }` heals the three most hurt; `{ sort: 'random', limit: 1 }` strikes one of them.
913
+ * Chosen before the game has its say (`beforeEffect`): a spell shield on one chosen takes the blow
914
+ *
915
+ * @beta
916
+ */
917
+ limit?: Scaled;
522
918
  /** Applies to the caster, wherever the ability was aimed */
523
919
  on?: 'caster';
920
+ /**
921
+ * When it happens, in a chain (`EffectMoment`): not now, but as the nearest effect before it in its list that
922
+ * comes to that moment gets there: `hit` a missile's every hit, `arrived` a pull's target arriving, `landed` a
923
+ * dash's end, `end` a missile's or zone's end. `[missile, { type: 'damage', when: 'hit' }]` is `[{ ...missile, effects: [damage] }]`:
924
+ * what waits goes into what it waits on (`lowerChain`), so one waiting on what waits itself happens later still.
925
+ * One with nothing before it to wait on never happens (`checkRules` says so)
926
+ *
927
+ * @beta
928
+ */
929
+ when?: EffectMoment;
930
+ /**
931
+ * Goes off from units of the caster's of a type (`ProxyOrigin`), not from the caster: once from each it picks, that one
932
+ * the context's `origin` (a missile starts there, an area never takes it in, the strike says it came from there), the
933
+ * caster still who does it (whose the damage, the kills and the scaling are). Zed's shadows, Orianna's ball, Syndra's
934
+ * spheres, Azir's soldiers. Nothing where none is picked, unless `caster` says otherwise
935
+ *
936
+ * @beta
937
+ */
938
+ origin?: ProxyOrigin;
524
939
  }
525
940
  /**
526
- * The fields the engine's effects read, by name: each type of effect has those of them it reads (`EffectTypes`, a
527
- * `Pick` of these), and a game's own type picks of them or says its own
941
+ * Units of the caster's an effect goes off from (`EffectCommon.origin`): proxies, a shadow, a ball, a sphere, a soldier.
942
+ * The caster's are those it put down (`madeBy`, a `spawn` of the ground objects pack), or, of one nobody says put down,
943
+ * those of its owner. In code, a game's effect runs its effects from a unit of its own choice (`EffectContext.origin`,
944
+ * `runEffects`), or asks which a proxy origin picks (`proxiesOf`)
528
945
  *
529
946
  * @beta
530
947
  */
531
- export interface EffectFields {
532
- /** For `teleport`: where to, however far: the caster's side's home (`homeOf`), where it was aimed, or by its target */
533
- to?: 'home' | 'point' | 'target';
534
- amount?: Scaled;
535
- /** Id of the buff to put on the targets */
536
- buff?: string;
537
- /** Unit type, for effects that bring one into the world */
538
- unit?: string;
539
- /** For `onHit`: only while the attacker carries this buff */
540
- whileBuff?: string;
541
- /** For `charged`: what happens when the ability is not charged */
542
- otherwise?: EffectDef[];
543
- /** For missiles: buildings and trees in its way stop it, without anything happening to them */
544
- blocked?: boolean;
545
- /** For `onKill`: only when it was an attack of the carrier that killed */
546
- attack?: boolean;
547
- /** For `refresh`: the ability that is ready again, when it is not the one the effect belongs to */
548
- ability?: string;
549
- /** For `dash`: how high the caster rises on the way, which makes it a leap. For whoever draws it */
550
- leap?: number;
948
+ export interface ProxyOrigin {
949
+ /** The unit type of the caster's it goes off from */
950
+ proxy: string;
551
951
  /**
552
- * For a leap: how much higher than where it takes off the ground on its way may stand. What stands higher
553
- * is a wall to it: it comes down in front of it. Over anything when left out
952
+ * Which of them: the one `nearest` to where it was aimed (when left out), `all` of them (each in the order they came
953
+ * into the world), the `newest` or the `oldest`
554
954
  */
555
- climb?: number;
556
- /** Seconds the buff lasts, when that is different from its usual duration */
557
- duration?: Scaled;
955
+ pick?: 'nearest' | 'all' | 'newest' | 'oldest';
558
956
  /**
559
- * What the stats of the caster add to the amount: `{ abilityPower: 0.6 }` adds 60% of its ability power.
560
- * `level` is for every level of the hero past the first
957
+ * From the caster as well (`true`: Zed and his shadows, each a Razor Shuriken), or from the caster where none is
958
+ * picked (`otherwise`: Orianna's ball, with her when it is nowhere). From the picked alone when left out
561
959
  */
562
- scaling?: Scaling;
563
- /** For damage. Magic when left out */
564
- damageType?: DamageType;
565
- /** For damage: how what it kills dies, for the screen, over the ability's own `how` */
566
- how?: string;
567
- /** For missiles: seconds they take shape where they were cast before they set off. The caster is free to go */
568
- delay?: Scaled;
569
- /** For missiles: how fast they travel, in units per second, and how far */
570
- speed?: number;
571
- distance?: Scaled;
572
- /** For missiles: how many are sent, spread over an angle in radians. What one of them hit the others pass by */
573
- count?: Scaled;
574
- spread?: number;
575
- /** For missiles: flies after the unit the ability was cast on, and only hits that one */
576
- homing?: boolean;
577
- /** For missiles: flies to the spot the ability was aimed at and stops there, `distance` away at the most */
578
- toPoint?: boolean;
579
- /** For missiles: how far the team of the caster sees around it */
580
- sight?: number;
960
+ caster?: boolean | 'otherwise';
961
+ /** Only those within this far of the caster: Azir's soldiers within his reach. Any distance when left out */
962
+ range?: number;
963
+ /** Only those within this far of where it was aimed: the soldiers near what Azir attacks. Any distance when left out */
964
+ near?: number;
581
965
  /**
582
- * What happens to what is hit. For missiles: everything they pass through. For `onHit`: the target of an attack.
583
- * For `dash`: what is around where it ends. For `after`: what is there when the time is up. For `zone`: what is inside, over and over
966
+ * Where it lands: where it was aimed (`aim`, when left out), or where each it goes off from stands (`proxy`: Orianna's
967
+ * Dissonance around the ball, Zed's Shadow Slash around each shadow)
584
968
  */
585
- effects?: EffectDef[];
586
- /** For missiles that were not stopped, and for zones: what happens where and when they end */
587
- onEnd?: EffectDef[];
969
+ at?: 'aim' | 'proxy';
970
+ /** The one it goes off from is its target too: a swap with it (Zed's Living Shadow cast again), a dash to it */
971
+ target?: boolean;
972
+ }
973
+ /**
974
+ * The shapes of ground an effect may cover (`EffectCommon.shape`)
975
+ *
976
+ * @beta
977
+ */
978
+ export type EffectShape = 'circle' | 'cone' | 'line' | 'rect' | 'ring' | 'arc' | 'cross';
979
+ /**
980
+ * A resource of a unit's own beside mana (`UnitTypeDef.pools`), in a game with the resources pack (`resourcesPack`):
981
+ * Akali's energy (`regen`), Tryndamere's fury (gained by attacks, `decay` after `idle`), Rumble's heat (gained by casts,
982
+ * overheating at a threshold), Yasuo's flow (`moving`), Jhin's ammo (`reload`)
983
+ *
984
+ * @beta
985
+ */
986
+ export interface PoolDef {
987
+ /** What it is called on the screen: its id when left out */
988
+ name?: string;
989
+ /** The colour of its bar, a CSS colour: the client's own when left out */
990
+ color?: string;
991
+ /** How much it holds at most */
992
+ max: number;
993
+ /** How much it holds as the unit comes into the world: full when left out */
994
+ start?: number;
995
+ /** How much comes back each second, always (energy) */
996
+ regen?: number;
997
+ /** How much goes each second once nothing has spent or given any for `idle` seconds (fury, heat) */
998
+ decay?: number;
999
+ /** Seconds without its being spent or given before it decays: at once when left out */
1000
+ idle?: number;
1001
+ /** How much comes for each cell the unit walks (Yasuo's flow) */
1002
+ moving?: number;
1003
+ /** Seconds after it runs out until it is full again (a reload) */
1004
+ reload?: number;
1005
+ /** Buffs its carrier gets as it fills (`PoolThreshold`): overheated, in the danger zone */
1006
+ thresholds?: PoolThreshold[];
1007
+ }
1008
+ /**
1009
+ * A buff a unit gets as one of its pools reaches `at` (`PoolDef.thresholds`): kept on while it holds that much or more
1010
+ * (`kept`: Rumble's danger zone), or put on once as it gets there; one that `empties` holds the pool still while it
1011
+ * lasts, and empties it as it ends (Rumble's overheat)
1012
+ *
1013
+ * @beta
1014
+ */
1015
+ export interface PoolThreshold {
1016
+ /** How much the pool holds for it */
1017
+ at: number;
1018
+ /** The buff, in the carrier's own name */
1019
+ buff: string;
1020
+ /** On while the pool holds `at` or more, off below: put on once as it gets there when left out */
1021
+ kept?: boolean;
1022
+ /** The pool stays as it is while the buff lasts, and is empty as it ends (not with `kept`) */
1023
+ empties?: boolean;
1024
+ }
1025
+ /**
1026
+ * What an `if` asks of a unit, its caster or its target (`EffectFields.caster`, `EffectFields.target`): each part it
1027
+ * says must hold. Or code (`UnitConditionCheck`)
1028
+ *
1029
+ * @beta
1030
+ */
1031
+ export interface UnitCondition {
1032
+ /** It carries this buff */
1033
+ buff?: string;
1034
+ /** It does not carry this buff */
1035
+ noBuff?: string;
1036
+ /** Its health is under this share of its max (0.2: below 20%: an execute) */
1037
+ healthBelow?: number;
1038
+ /** Its health is at or over this share of its max (1: unhurt) */
1039
+ healthAbove?: number;
1040
+ /** It is a hero (true) or not (false) */
1041
+ hero?: boolean;
588
1042
  /**
589
- * For `after`: the name its arrival goes by for whoever draws it and plays its sound, where one ability sets off
590
- * several that do not look alike: the last of a barrage. The ability's own when left out
1043
+ * It is a structure, a building (true), or not (false). `{ hero: false, structure: false }` is a creep: any unit
1044
+ * that is neither, a camp's, a lane's, a summon. What a passive that works in every kind of game names
1045
+ *
1046
+ * @beta
1047
+ */
1048
+ structure?: boolean;
1049
+ /** Its type has one of these tags (`UnitTypeDef.tags`) */
1050
+ tags?: string[];
1051
+ /** Its type has none of these tags: `['undead']` for the living */
1052
+ notTags?: string[];
1053
+ /** What it is to the caster: an `enemy` or an `ally` (the caster itself is one) */
1054
+ is?: 'enemy' | 'ally';
1055
+ }
1056
+ /**
1057
+ * The orders a query and an effect sort what they found in (`WorldQuery.sort`, `EffectCommon.sort`): `nearest` and
1058
+ * `farthest` to its point (by the edge of each), the least or most `health`, the least or most of it as a share of its
1059
+ * max (`lowestHealthShare`: the most hurt), or `random`, drawn from the world's numbers (`world.rng`), so the same every
1060
+ * run. Ties go by who came into the world first
1061
+ *
1062
+ * @beta
1063
+ */
1064
+ export type TargetOrder = 'nearest' | 'farthest' | 'lowestHealth' | 'highestHealth' | 'lowestHealthShare' | 'highestHealthShare' | 'random';
1065
+ /**
1066
+ * An `if`'s condition in code: whether it holds of the unit (the caster or the target), as the effect lands
1067
+ *
1068
+ * @beta
1069
+ */
1070
+ export type UnitConditionCheck = (context: EffectValueContext, unit: Entity) => boolean;
1071
+ /**
1072
+ * A ground object's trap, mine or pickup (`UnitTypeDef.trigger`), in a game with the ground objects pack
1073
+ *
1074
+ * @beta
1075
+ */
1076
+ export interface GroundTrigger {
1077
+ /**
1078
+ * The ability whose `effects` go off: in the name of whoever put it down (its maker, a `spawn` of the pack's: the
1079
+ * object's own where there is none or it is gone), the one who came its target, the object where they go off from
1080
+ * (`EffectContext.origin`), at the level it was put down at
1081
+ */
1082
+ ability: string;
1083
+ /** How near its edge one comes for it to go off: 1 when left out */
1084
+ radius?: number;
1085
+ /** Who sets it off: `enemies` of its owner (when left out), `allies`, `all`, or its `maker` alone (a soul, a chime) */
1086
+ by?: 'enemies' | 'allies' | 'all' | 'maker';
1087
+ /** Seconds after it is put down before it works (a mine arming): at once when left out */
1088
+ arm?: number;
1089
+ /** Times it goes off before it is gone: once when left out, for ever with 0 */
1090
+ times?: number;
1091
+ }
1092
+ /**
1093
+ * Something on the ground others use (`UnitTypeDef.use`), in a game with the ground objects pack
1094
+ *
1095
+ * @beta
1096
+ */
1097
+ export interface GroundUse {
1098
+ /**
1099
+ * The ability whose `effects` go off as one uses it: in its maker's name (its own where there is none), the one who
1100
+ * uses it the target, the object the `origin`, and the point the next of those put down with it (the other end of a
1101
+ * portal) or the object itself
1102
+ */
1103
+ ability: string;
1104
+ /** Who may use it: `allies` of its owner (when left out), `enemies` or `all` */
1105
+ by?: 'allies' | 'enemies' | 'all';
1106
+ /** How near its edge one comes to use it: 1 when left out */
1107
+ range?: number;
1108
+ /** Times it is used before it is gone: for ever when left out */
1109
+ times?: number;
1110
+ }
1111
+ /**
1112
+ * The spots a `spawn` of the ground objects pack lays its units on (`EffectFields.line`): `count` of them, ends
1113
+ * included, along the way it was aimed, `length` long around where it landed (or from where it went off from to there,
1114
+ * when left out), or `across` it, a quarter turn round (a wall in front of the caster)
1115
+ *
1116
+ * @beta
1117
+ */
1118
+ export interface SpawnLine {
1119
+ /** How many, ends included */
1120
+ count: number;
1121
+ /** How long it is, around where it landed: from where it went off from to there when left out */
1122
+ length?: number;
1123
+ /** It lies across the way it was aimed, a quarter turn round: a wall in front */
1124
+ across?: boolean;
1125
+ }
1126
+ /**
1127
+ * Which way a `knockback` throws, in a game with the moves pack (`EffectFields.direction`)
1128
+ *
1129
+ * @beta
1130
+ */
1131
+ export type KnockbackDirection = 'away' | 'aim' | 'over' | 'towards';
1132
+ /**
1133
+ * The moment an effect of a chain waits for (`EffectCommon.when`): a missile's hit (`hit`), a pull's arrival
1134
+ * (`arrived`), a dash's landing (`landed`), a missile's or a zone's end (`end`)
1135
+ *
1136
+ * @beta
1137
+ */
1138
+ export type EffectMoment = 'hit' | 'arrived' | 'landed' | 'end';
1139
+ /**
1140
+ * What an effect waiting for a moment waits on (`EffectCommon.when`): the types that come to it, and the list of
1141
+ * theirs it goes into
1142
+ *
1143
+ * @beta
1144
+ */
1145
+ export declare const EFFECT_MOMENTS: Readonly<Record<EffectMoment, {
1146
+ readonly types: readonly string[];
1147
+ readonly into: 'effects' | 'onEnd';
1148
+ }>>;
1149
+ /**
1150
+ * The fields the engine's effects read, by name: each type of effect has those of them it reads (`EffectTypes`, a
1151
+ * `Pick` of these), and a game's own type picks of them or says its own
1152
+ *
1153
+ * @beta
1154
+ */
1155
+ export interface EffectFields {
1156
+ /**
1157
+ * For `teleport`: where to, however far: the caster's side's home (`homeOf`), where it was aimed, or by its target.
1158
+ * For `dash`, in a game with the moves pack (`movesPack`): `target` rushes to the unit it was cast on, after it as it
1159
+ * moves, to its edge (or `through` it); its `effects` happen to it there
1160
+ */
1161
+ to?: 'home' | 'point' | 'target';
1162
+ /**
1163
+ * For a `dash` to a unit (`to: 'target'`), in a game with the moves pack: it goes on through the unit, this far past
1164
+ * its middle, along the way from where the caster set off (Yasuo's Sweeping Blade); the place is fixed as it sets off
1165
+ *
1166
+ * @beta
1167
+ */
1168
+ through?: number;
1169
+ /**
1170
+ * For `dash` and `knockback`, in a game with the moves pack (`movesPack`): what happens to each enemy of the caster
1171
+ * the one moved meets on its way, once each, in the caster's name, the one met its target and the one moved where they
1172
+ * go off from (`EffectContext.origin`): Lee Sin's Dragon's Rage (who the kicked one flies into is hurt and thrown up),
1173
+ * Rammus's Powerball
1174
+ *
1175
+ * @beta
1176
+ */
1177
+ collide?: EffectDef[];
1178
+ /** For `dash` and `knockback` with `collide`: the one moved stops at the first one it meets @beta */
1179
+ stops?: boolean;
1180
+ /**
1181
+ * For `knockback`, in a game with the moves pack (`movesPack`): which way it throws (`KnockbackDirection`): `away` from
1182
+ * where the effects go off from (the caster, or the context's `origin`: what it always did), `aim` the way the ability
1183
+ * was aimed (Thresh's Flay, Vayne's Condemn, Poppy's charge), `over` the caster to land `distance` beyond it on its
1184
+ * other side (Singed's Fling: give it a `leap`), or `towards` it, to its edge at the most (a yank)
1185
+ *
1186
+ * @beta
1187
+ */
1188
+ direction?: KnockbackDirection;
1189
+ /**
1190
+ * For `attach`, in a game with the moves pack: who is put on whom: the `caster` on the unit it was cast on (Yuumi's
1191
+ * You and Me!, when left out) or that unit on the caster (Kalista's Fate's Call)
1192
+ *
1193
+ * @beta
1194
+ */
1195
+ rider?: 'caster' | 'target';
1196
+ /** For `raiseDead`: the corpses rise as what they were, the caster's (Animate Dead), rather than as its `unit` @beta */
1197
+ as?: 'themselves';
1198
+ /** For `onFatal`: the share of its max health the carrier is left with, rather than dying: all of it when left out @beta */
1199
+ health?: number;
1200
+ /**
1201
+ * For `if`: what must hold of the caster (`UnitCondition`, or code), for `effects` to happen rather than `otherwise`
1202
+ *
1203
+ * @beta
1204
+ */
1205
+ caster?: UnitCondition | UnitConditionCheck;
1206
+ /**
1207
+ * For `if`: what must hold of the target (`UnitCondition`, or code): the unit it was cast on, or each one within its
1208
+ * `radius` or `shape`, where it has one. With no target there, it does not hold
1209
+ *
1210
+ * @beta
1211
+ */
1212
+ target?: UnitCondition | UnitConditionCheck;
1213
+ /**
1214
+ * How much: of damage, healing, mana, a shield (`buff`). A number, one per level, or code asked for each target
1215
+ * (`EffectValue`); with what the caster's stats add (`scaling`) and the formulas of `damage`, `heal` and `buff`
1216
+ * (`byMaxHealth`, `byCurrentHealth`, `byMissingHealth`, `byStacks`, `byDistance`, `targetScaling`) on top
1217
+ */
1218
+ amount?: EffectValue;
1219
+ /** Id of the buff to put on the targets */
1220
+ buff?: string;
1221
+ /** Unit type, for effects that bring one into the world */
1222
+ unit?: string;
1223
+ /** For `spawn`: whose it is: the caster's when left out, or the neutral player's (a soul nobody owns) */
1224
+ owner?: 'neutral';
1225
+ /** For `spawn`: drawn as the target or the caster is (its model, its owner's colour, its size), while it stays what its own type is */
1226
+ looksLike?: 'target' | 'caster';
1227
+ /** For `spawn`: components it starts with, by id, in the form a save keeps them in */
1228
+ data?: Record<string, unknown>;
1229
+ /**
1230
+ * For `spawn`, in a game with the ground objects pack (`groundObjectsPack`): so many along a line (`SpawnLine`),
1231
+ * buildings one to a cell: Anivia's Crystallize (`across`), Taliyah's Weaver's Wall, Yasuo's Wind Wall, Bard's portals
1232
+ * (two: one where he stands, one where he aimed)
1233
+ *
1234
+ * @beta
1235
+ */
1236
+ line?: SpawnLine;
1237
+ /**
1238
+ * For `spawn`, in a game with the ground objects pack: `count` round a circle of `radius` about where it landed, the
1239
+ * first the way it was aimed: Jarvan's Cataclysm
1240
+ *
1241
+ * @beta
1242
+ */
1243
+ ring?: {
1244
+ count: number;
1245
+ radius: number;
1246
+ };
1247
+ /**
1248
+ * For `gain`, in a game with the resources pack (`resourcesPack`): which of the pools (`UnitTypeDef.pools`) of what it
1249
+ * reaches it fills (or empties, with an `amount` under 0)
1250
+ *
1251
+ * @beta
1252
+ */
1253
+ pool?: string;
1254
+ /** For `onHit` and `onKill`: only while the carrier carries this buff */
1255
+ whileBuff?: string;
1256
+ /**
1257
+ * For `onHit`: only every so many of the carrier's attacks that land (while it carries `whileBuff`, where it says),
1258
+ * counted on the carrier and saved with it: Jhin's fourth shot, a third strike. Every attack when left out
1259
+ *
1260
+ * @beta
1261
+ */
1262
+ every?: number;
1263
+ /**
1264
+ * For `onHit`: the attack that sets it off uses up one of `whileBuff`'s stacks, the buff for its last (or one that does
1265
+ * not count them): "the next attack" of Power Fist, Siphoning Strike, Nether Blade, Flurry's two. Used up by the
1266
+ * attack that kills too, after what the kill sets off (`onKill` still sees it)
1267
+ *
1268
+ * @beta
1269
+ */
1270
+ consumes?: boolean;
1271
+ /**
1272
+ * For `onHit`: the slot it takes among what the carrier's attacks set off (its attack modifiers: an orb, a poison, a
1273
+ * frost), from its abilities, items and buffs alike. Of those that share a slot only one goes off, the one of the
1274
+ * highest `priority`; those of different slots, and those of none, all add up (`RuleSettings.combat.attackModifiers`)
1275
+ *
1276
+ * @beta
1277
+ */
1278
+ slot?: string;
1279
+ /**
1280
+ * For `onHit` with a `slot`: which of those sharing it goes off, the highest first (0 when left out); the first of
1281
+ * the carrier's abilities, then items, then buffs among equals
1282
+ *
1283
+ * @beta
1284
+ */
1285
+ priority?: number;
1286
+ /**
1287
+ * For the triggers of a passive (`onHit`, `onKill`, `onCast`, `onDamaged`, `onAbilityHit`, `onLowHealth`): seconds
1288
+ * before it can go off again once it did, kept on the ability's own cooldown (`AbilityState.cooldown`, shown on its
1289
+ * button) for an ability, on the carrier for an item's or a buff's. Every time when left out
1290
+ *
1291
+ * @beta
1292
+ */
1293
+ cooldown?: Scaled;
1294
+ /**
1295
+ * For `onLowHealth`: the part of its max health (0.3: 30%) the carrier's health falls below for it to go off: once
1296
+ * as it falls past it, not again until it is back above
1297
+ *
1298
+ * @beta
1299
+ */
1300
+ below?: number;
1301
+ /**
1302
+ * For `onDamaged`: only for an attack that hits from up close (one with no missile: `AttackDef.projectileSpeed`
1303
+ * left out): Thorns Aura, Spiked Carapace
1304
+ *
1305
+ * @beta
1306
+ */
1307
+ melee?: boolean;
1308
+ /**
1309
+ * For `removeBuff`: how many stacks of `buff` come off: all of it when left out, the buff itself once none is left
1310
+ *
1311
+ * @beta
1312
+ */
1313
+ stacks?: Scaled;
1314
+ /** For `charged`: what happens when the ability is not charged. For `if`: what happens when its conditions do not hold */
1315
+ otherwise?: EffectDef[];
1316
+ /** For missiles: buildings and trees in its way stop it, without anything happening to them */
1317
+ blocked?: boolean;
1318
+ /** For `onKill`: only when it was an attack of the carrier that killed. For `onDamaged`: only when an attack hurt it */
1319
+ attack?: boolean;
1320
+ /**
1321
+ * For `refresh`: the ability that is ready again, when it is not the one the effect belongs to. For `grantAbility`
1322
+ * and `swapAbility`, in a game with the ability changes pack (`abilityChangesPack`): the ability given
1323
+ */
1324
+ ability?: string;
1325
+ /**
1326
+ * For `swapAbility`, in a game with the ability changes pack: the caster's ability that gives way, the one the effect
1327
+ * belongs to when left out
1328
+ *
1329
+ * @beta
1330
+ */
1331
+ from?: string;
1332
+ /**
1333
+ * For `grantAbility`, `swapAbility` and `stealAbility`, in a game with the ability changes pack: casts of it before it
1334
+ * is gone (and what it took the place of is back): one for a stolen one when left out, for ever otherwise
1335
+ *
1336
+ * @beta
1337
+ */
1338
+ uses?: number;
1339
+ /**
1340
+ * For `grantAbility` and `swapAbility`, in a game with the ability changes pack: the level it is given at: the level of
1341
+ * what it takes the place of, or the effect's own, when left out
1342
+ *
1343
+ * @beta
1344
+ */
1345
+ atLevel?: number;
1346
+ /**
1347
+ * For `stealAbility`, in a game with the ability changes pack: which of the target's abilities it takes: its
1348
+ * `ultimate` (when left out), its `first`, or one at `random` (`world.rng`)
1349
+ *
1350
+ * @beta
1351
+ */
1352
+ pick?: 'ultimate' | 'first' | 'random';
1353
+ /** For `dash`: how high the caster rises on the way, which makes it a leap. For whoever draws it */
1354
+ leap?: number;
1355
+ /**
1356
+ * For a leap: how much higher than where it takes off the ground on its way may stand. What stands higher
1357
+ * is a wall to it: it comes down in front of it. Over anything when left out
1358
+ */
1359
+ climb?: number;
1360
+ /** Seconds the buff lasts, when that is different from its usual duration. In code (`EffectValue`), asked for each target */
1361
+ duration?: EffectValue;
1362
+ /**
1363
+ * What the stats of the caster add to the amount: `{ abilityPower: 0.6 }` adds 60% of its ability power.
1364
+ * `level` is for every level of the hero past the first
1365
+ */
1366
+ scaling?: Scaling;
1367
+ /** For damage. Magic when left out */
1368
+ damageType?: DamageType;
1369
+ /** For damage: how what it kills dies, for the screen, over the ability's own `how` */
1370
+ how?: string;
1371
+ /** For missiles: seconds they take shape where they were cast before they set off. The caster is free to go */
1372
+ delay?: Scaled;
1373
+ /** For missiles: how fast they travel, in units per second, and how far */
1374
+ speed?: number;
1375
+ /** For missiles: how far they fly, in cells */
1376
+ distance?: Scaled;
1377
+ /** For missiles: how many are sent, spread over an angle in radians. What one of them hit the others pass by */
1378
+ count?: Scaled;
1379
+ /** For missiles: the angle, in radians, the missiles are spread over */
1380
+ spread?: number;
1381
+ /** For missiles: flies after the unit the ability was cast on, and only hits that one */
1382
+ homing?: boolean;
1383
+ /**
1384
+ * For missiles: flies to the spot the ability was aimed at and stops there, `distance` away at the most. For `pull`:
1385
+ * drags to where the effect landed (a zone's middle, the spot of an `after`) rather than to the caster
1386
+ */
1387
+ toPoint?: boolean;
1388
+ /** For missiles: how far the team of the caster sees around it */
1389
+ sight?: number;
1390
+ /**
1391
+ * What happens to what is hit. For missiles: everything they pass through. For `onHit`: the target of an attack.
1392
+ * For `dash`: what is around where it ends. For `pull`: what was pulled, as it arrives. For `after`: what is there when the time is up. For `zone`: what is inside, over and over
1393
+ */
1394
+ effects?: EffectDef[];
1395
+ /** For missiles that were not stopped, and for zones: what happens where and when they end */
1396
+ onEnd?: EffectDef[];
1397
+ /**
1398
+ * For `after`: the name its arrival goes by for whoever draws it and plays its sound, where one ability sets off
1399
+ * several that do not look alike: the last of a barrage. The ability's own when left out
591
1400
  */
592
1401
  impact?: string;
593
- /** For missiles: goes on after it hit something. False for the ones that are used up by the first thing in their way */
594
- pierce?: boolean;
1402
+ /**
1403
+ * For missiles: goes on after it hit something. False for the ones that are used up by the first thing in their way;
1404
+ * a number for those that go through so many and are used up by the next (1: Lux's Light Binding, two at the most)
1405
+ */
1406
+ pierce?: boolean | number;
1407
+ /**
1408
+ * For missiles that go through what they hit (`pierce`): what part of the amounts each one it went through takes off
1409
+ * the next (0.3: a third less on the second, less again on the third). Read by `damage`, `heal` and `mana` (`share`)
1410
+ *
1411
+ * @beta
1412
+ */
1413
+ falloff?: number;
1414
+ /**
1415
+ * For missiles that come back (`returns`): on the way back they hit what they pass through again, each once more
1416
+ * (Ahri's Orb of Deception); the caster's place is still where it ends
1417
+ *
1418
+ * @beta
1419
+ */
1420
+ hitsOnReturn?: boolean;
1421
+ /**
1422
+ * For missiles: they find their own targets: while one flies with nobody to go after, it turns after the nearest it may
1423
+ * hit within this far of it and flies after that one (Fox-Fire, Dance of Arrows); another, if that one is gone first
1424
+ *
1425
+ * @beta
1426
+ */
1427
+ seek?: number;
1428
+ /**
1429
+ * For missiles: what happens where it meets a wall (ground it cannot cross, a cliff above where it set off, the edge of
1430
+ * the play area, a building or a tree): it stops there, and these go off there, to the last one it hit where there is
1431
+ * one (Bard's Cosmic Binding). For `dash` and `knockback`, in a game with the moves pack (`movesPack`): the one moved
1432
+ * stops at such a wall (what flies meets none), and these go off there in the caster's name, to the one moved
1433
+ * (Vayne's Condemn, Poppy's Heroic Charge)
1434
+ *
1435
+ * @beta
1436
+ */
1437
+ onWall?: EffectDef[];
1438
+ /**
1439
+ * For missiles: what goes off from where it is, the way it flew, once it is done (it hit what used it up, reached
1440
+ * whom it flew after, or came to the end of its way) or is split by the game (`splitMissile`): missiles in it fly on
1441
+ * from there at their own `spread` (Vel'Koz's Plasma Fission: two at a half turn's spread, a quarter either side)
1442
+ *
1443
+ * @beta
1444
+ */
1445
+ split?: EffectDef[];
1446
+ /**
1447
+ * For missiles: turned by their owner as they fly, towards the point the `steer` command gives (`steerMissile`), at most
1448
+ * `rate` radians a second (π when left out): Yuumi's Prowling Projectile, Viktor's storm
1449
+ *
1450
+ * @beta
1451
+ */
1452
+ steer?: {
1453
+ rate?: number;
1454
+ };
1455
+ /**
1456
+ * For `zone`: goes with a unit, the `caster` or the `target`, and faces the way it does; it ends (with its `onEnd`) when
1457
+ * that one dies or leaves the world
1458
+ *
1459
+ * @beta
1460
+ */
1461
+ follow?: 'caster' | 'target';
1462
+ /**
1463
+ * For `zone`: what happens to each who comes into it (its own `radius` or `shape`, as `affects` says), those inside as
1464
+ * it is laid included. Each in it is seen to every round of the world, not four times a second
1465
+ *
1466
+ * @beta
1467
+ */
1468
+ onEnter?: EffectDef[];
1469
+ /** For `zone`: what happens to each who goes out of it, alive @beta */
1470
+ onLeave?: EffectDef[];
1471
+ /**
1472
+ * For `zone`: what happens to each who crosses its edge, in or out, once it is laid (Veigar's Event Horizon, Thresh's
1473
+ * Box): those inside as it is laid have not crossed it
1474
+ *
1475
+ * @beta
1476
+ */
1477
+ edge?: EffectDef[];
1478
+ /**
1479
+ * For missiles: once done (it hit what used it up or what it flew after, came to the end of its way, or came down)
1480
+ * it flies back to the caster, after it wherever it goes, and touches nobody on the way; its `onEnd` happens where
1481
+ * the caster is when it gets there, not where it turned. Gone, with nothing more, if the caster is
1482
+ *
1483
+ * @beta
1484
+ */
1485
+ returns?: boolean;
1486
+ /**
1487
+ * For `pull`: how long the drag takes, from where the target is to where it ends. Its speed is set by it as it
1488
+ * starts: a caster that walks off makes it take longer
1489
+ *
1490
+ * @beta
1491
+ */
1492
+ seconds?: Scaled;
595
1493
  /**
596
1494
  * For missiles: thrown, not shot. It goes `height` up in the middle of its way and comes down at its end, `time`
597
1495
  * seconds after it set off however far that is (`speed` otherwise). It flies over everything, and what is within
@@ -620,7 +1518,91 @@ export interface EffectFields {
620
1518
  buy?: string;
621
1519
  /** For `exchange`: how much of `buy` comes for each one of `sell` (0.5: 100 lumber for 50 gold) */
622
1520
  rate?: number;
1521
+ /**
1522
+ * For `damage`: a part of what the target has lost of its health, added to the amount for each it hits (0.1: a tenth
1523
+ * of its missing health), worked out as it lands
1524
+ *
1525
+ * @beta
1526
+ */
1527
+ byMissingHealth?: Scaled;
1528
+ /**
1529
+ * For `damage`, `heal` and a shield (`buff`): a part of the target's maximum health, added for each it reaches (0.08:
1530
+ * 8% of its max health). Death and Decay, a % health nuke
1531
+ *
1532
+ * @beta
1533
+ */
1534
+ byMaxHealth?: Scaled;
1535
+ /**
1536
+ * For `damage`, `heal` and a shield (`buff`): a part of the health the target has now, added for each it reaches
1537
+ *
1538
+ * @beta
1539
+ */
1540
+ byCurrentHealth?: Scaled;
1541
+ /**
1542
+ * For `damage`, `heal` and a shield (`buff`): `amount` more for each stack of `buff` on the target (`of: 'target'`,
1543
+ * when left out) or the caster: Rend's spears, a passive's marks
1544
+ *
1545
+ * @beta
1546
+ */
1547
+ byStacks?: {
1548
+ buff: string;
1549
+ of?: 'target' | 'caster';
1550
+ amount: Scaled;
1551
+ };
1552
+ /**
1553
+ * For `damage`, `heal` and a shield (`buff`): the whole of it times 1 and `per` for every unit of distance from where
1554
+ * it went off to the target (a missile's way, or from the caster or the `origin`), `most` times at the most: a
1555
+ * javelin that hurts more the farther it flew
1556
+ *
1557
+ * @beta
1558
+ */
1559
+ byDistance?: {
1560
+ per: number;
1561
+ most?: number;
1562
+ };
1563
+ /**
1564
+ * For `damage`, `heal` and a shield (`buff`): parts of the target's stats added (`{ armor: 1 }`: as much as its armor;
1565
+ * `{ health: 0.05 }`: 5% of its max health), as `scaling` adds the caster's
1566
+ *
1567
+ * @beta
1568
+ */
1569
+ targetScaling?: Partial<Record<StatKey, Scaled>>;
1570
+ /**
1571
+ * For `damage`, `heal` and a shield (`buff`) a trigger sets off: a part of the damage that set it off
1572
+ * (`EffectContext.damage`), added (0.2: a fifth of it): Spiked Carapace's returned damage, a heal by what was taken
1573
+ *
1574
+ * @beta
1575
+ */
1576
+ byDamage?: Scaled;
1577
+ /**
1578
+ * For `morph`: the unit type the caster turns into where it stands, a hero's form (`HeroDef.forms`)
1579
+ *
1580
+ * @beta
1581
+ */
1582
+ into?: string;
1583
+ /**
1584
+ * For `morph`: the form lasts until the ability is cast again in it, which turns it back (a toggle); with a
1585
+ * `duration` too, until whichever comes first
1586
+ *
1587
+ * @beta
1588
+ */
1589
+ toggle?: boolean;
1590
+ /**
1591
+ * For `morph`: what turns the form back (`MorphBack`): the ability cast again, its `duration` up, its death. All
1592
+ * three when left out (the ability only with `toggle`); without `ability`, the ability cast again in the form starts
1593
+ * its time over
1594
+ *
1595
+ * @beta
1596
+ */
1597
+ back?: MorphBack[];
623
1598
  }
1599
+ /**
1600
+ * The fields of the formulas an amount of `damage`, `heal` and a shield (`buff`) may add to it, for each target as it
1601
+ * lands (`effectAmount`)
1602
+ *
1603
+ * @beta
1604
+ */
1605
+ export type AmountFormula = 'byMissingHealth' | 'byMaxHealth' | 'byCurrentHealth' | 'byStacks' | 'byDistance' | 'targetScaling' | 'byDamage';
624
1606
  /**
625
1607
  * The types of effect there are, each with the fields it reads: the engine's, and a game's own, added by declaration
626
1608
  * merging as it defines them (`declare module '@v12-engine/engine' { interface EffectTypes { arrowStun: { ... } } }`,
@@ -630,107 +1612,399 @@ export interface EffectFields {
630
1612
  */
631
1613
  export interface EffectTypes {
632
1614
  /** Hurts what it reaches: `amount`, with what of the caster's stats adds to it (`scaling`), of a type (magic when left out) */
633
- damage: Pick<EffectFields, 'amount' | 'scaling' | 'damageType' | 'how'>;
1615
+ damage: Pick<EffectFields, 'amount' | 'scaling' | 'damageType' | 'how' | AmountFormula>;
634
1616
  /** Heals what it reaches, more for the caster's heal and shield power */
635
- heal: Pick<EffectFields, 'amount' | 'scaling'>;
1617
+ heal: Pick<EffectFields, 'amount' | 'scaling' | AmountFormula>;
636
1618
  /** Gives mana to what it reaches */
637
1619
  mana: Pick<EffectFields, 'amount' | 'scaling'>;
638
- /** Puts a buff on what it reaches: for its own time or `duration`, one more of it with `stack` */
1620
+ /**
1621
+ * Fills a pool of what it reaches (`pool`, one of `UnitTypeDef.pools`) by `amount` (empties it, under 0), in a game
1622
+ * with the resources pack (`resourcesPack`): allies when it says nothing, the caster with `on: 'caster'` (Tryndamere's
1623
+ * fury from an `onHit`)
1624
+ *
1625
+ * @beta
1626
+ */
1627
+ gain: {
1628
+ pool: string;
1629
+ } & Pick<EffectFields, 'amount' | 'scaling'>;
1630
+ /**
1631
+ * Does something to the grass and bushes where it lands, in a game with the foliage pack (`foliagePack`): sets it
1632
+ * alight (`ignite`, by the caster), puts it out (`extinguish`), ruins it (`ruin`, as `how` says: `cut` when left
1633
+ * out), has it grow back (`regrow`, over `over` seconds) or takes it away (`clear`). Over its `radius` or `shape`,
1634
+ * the cell it landed on when it has neither; on `layer`, every layer of the pack when left out. It acts on cells, not
1635
+ * on what stands there: the fields of whom (`affects`, `kinds`, `tags`, `where`, `limit`...) say nothing to it. A
1636
+ * fire arrow, a mower, a rain spell
1637
+ *
1638
+ * @beta
1639
+ */
1640
+ foliage: {
1641
+ act: 'ignite' | 'extinguish' | 'ruin' | 'regrow' | 'clear';
1642
+ layer?: string;
1643
+ how?: 'cut' | 'crush' | 'scorch';
1644
+ over?: number;
1645
+ };
1646
+ /**
1647
+ * Sets alight what burns where it lands, by the caster (`light`), or puts it out (`putOut`), in a game with the
1648
+ * burning pack (`burningPack`): over its `radius` or `shape`, else the unit it was cast on, else what stands where it
1649
+ * landed. `how`: the kind of burning it sets off (a blight, frost: the look's `burning.how` and the death's), the
1650
+ * thing's own when left out; `seconds`: how long it burns. Of what it finds, what its fields of whom say (`affects`:
1651
+ * `enemies` lights the caster's enemies' alone; `kinds`, `tags`, `layers`, `where`, `sort`, `limit`), everything
1652
+ * that burns, trees among it, when it says none. A fire arrow, a torch, a rain spell
1653
+ *
1654
+ * @beta
1655
+ */
1656
+ burn: {
1657
+ act: 'light' | 'putOut';
1658
+ how?: string;
1659
+ seconds?: number;
1660
+ };
1661
+ /**
1662
+ * Puts a buff on what it reaches: for its own time or `duration`, one more of it with `stack`. With an `amount` (and
1663
+ * `scaling`, the formulas), its shield holds that rather than the buff's own `shield`
1664
+ */
639
1665
  buff: {
640
1666
  buff: string;
641
- } & Pick<EffectFields, 'duration' | 'stack'>;
1667
+ } & Pick<EffectFields, 'duration' | 'stack' | 'amount' | 'scaling' | AmountFormula>;
642
1668
  /** Sends a missile: how fast, how far, how many, and what it does to what it passes through and where it ends */
643
- missile: Pick<EffectFields, 'speed' | 'distance' | 'count' | 'spread' | 'homing' | 'toPoint' | 'delay' | 'sight' | 'blocked' | 'pierce' | 'arc' | 'bounce' | 'effects' | 'onEnd'>;
1669
+ missile: Pick<EffectFields, 'speed' | 'distance' | 'count' | 'spread' | 'homing' | 'toPoint' | 'delay' | 'sight' | 'blocked' | 'pierce' | 'arc' | 'bounce' | 'effects' | 'onEnd' | 'returns' | 'falloff' | 'hitsOnReturn' | 'seek' | 'onWall' | 'split' | 'steer'>;
644
1670
  /** A passive's buff on what is around the carrier, kept up by the ability system */
645
1671
  aura: {
646
1672
  buff: string;
647
1673
  };
648
- /** Brings a unit of the caster's into the world where it landed, for `duration` seconds or for good */
1674
+ /**
1675
+ * Brings a unit into the world where it landed, the caster's (the neutral player's with `owner`), for `duration` seconds
1676
+ * or for good, with `data` and the looks of the target or the caster. In a game with the ground objects pack
1677
+ * (`groundObjectsPack`): so many along a `line` or round a `ring`, each knowing who put it down (`madeBy`)
1678
+ */
649
1679
  spawn: {
650
1680
  unit: string;
651
- } & Pick<EffectFields, 'duration'>;
1681
+ } & Pick<EffectFields, 'duration' | 'owner' | 'looksLike' | 'data' | 'line' | 'ring'>;
652
1682
  /** Puts a buff on the caster for as long as it likes, or takes it off */
653
1683
  toggle: {
654
1684
  buff: string;
655
1685
  };
656
1686
  /** The caster's team sees the spot for a while */
657
1687
  reveal: Pick<EffectFields, 'duration'>;
658
- /** A passive's: `effects` happen to the target of every attack of the carrier, while it carries `whileBuff` */
659
- onHit: Pick<EffectFields, 'whileBuff' | 'effects'>;
1688
+ /**
1689
+ * A passive's (an ability's, an item's or a buff's: `BuffDef.passive`): `effects` happen to the target of every attack
1690
+ * of the carrier that lands, while it carries `whileBuff`; of every `every`th, using up a stack of `whileBuff` with
1691
+ * `consumes`, once in `cooldown` seconds
1692
+ */
1693
+ onHit: Pick<EffectFields, 'whileBuff' | 'effects' | 'every' | 'consumes' | 'cooldown' | 'slot' | 'priority'>;
660
1694
  /** The caster is ready to strike again at once */
661
1695
  resetAttack: object;
662
1696
  /** The caster is elsewhere at once, `distance` away at the most */
663
1697
  blink: Pick<EffectFields, 'distance'>;
664
1698
  /** The caster is elsewhere at once, however far (`to`) */
665
1699
  teleport: Pick<EffectFields, 'to'>;
666
- /** The caster rushes to the spot (a leap with `leap`), and `effects` happen around where it ends */
667
- dash: Pick<EffectFields, 'distance' | 'leap' | 'climb' | 'speed' | 'effects' | 'buff'>;
668
- /** Throws what it reaches `distance` away from the caster */
669
- knockback: Pick<EffectFields, 'distance' | 'speed' | 'leap'>;
1700
+ /**
1701
+ * The caster rushes to the spot (a leap with `leap`), and `effects` happen around where it ends. In a game with the
1702
+ * moves pack (`movesPack`): to a unit (`to: 'target'`, after it as it moves, or `through` it), with what happens to who
1703
+ * it meets (`collide`, `stops`) and at a wall (`onWall`)
1704
+ */
1705
+ dash: Pick<EffectFields, 'distance' | 'leap' | 'climb' | 'speed' | 'effects' | 'buff' | 'to' | 'through' | 'collide' | 'stops' | 'onWall'>;
1706
+ /**
1707
+ * Throws what it reaches `distance` away from the caster. In a game with the moves pack (`movesPack`): which way
1708
+ * (`direction`), with what happens to who the thrown one meets (`collide`, `stops`) and at a wall (`onWall`)
1709
+ */
1710
+ knockback: Pick<EffectFields, 'distance' | 'speed' | 'leap' | 'direction' | 'collide' | 'stops' | 'onWall'>;
1711
+ /**
1712
+ * The caster and the unit it was cast on trade places, at once, in a game with the moves pack (`movesPack`). Nothing
1713
+ * where either is a structure, rushing or dragged, or the target cannot be moved (`BuffDef.unstoppable`)
1714
+ *
1715
+ * @beta
1716
+ */
1717
+ swap: object;
1718
+ /**
1719
+ * Sends the unit the effect goes off from (a proxy of the caster's: `EffectCommon.origin`) to where it was aimed, at
1720
+ * `speed` (at once when left out), and its `effects` happen where it arrives, in the caster's name, from it: Orianna's
1721
+ * ball flown to where she aims, Azir's soldiers sent. Nothing where it goes off from the caster
1722
+ *
1723
+ * @beta
1724
+ */
1725
+ sendProxy: Pick<EffectFields, 'speed' | 'effects'>;
1726
+ /**
1727
+ * The caster's team sees each unit it reaches for `duration` seconds (4 when left out), wherever it goes: in the fog,
1728
+ * in a bush, invisible or camouflaged, in a game with the vision pack (`visionPack`). A unit, not a spot (`reveal`):
1729
+ * Rengar's Thrill of the Hunt on the champions about him, Pyke's Death from Below, a Dust of Appearance
1730
+ *
1731
+ * @beta
1732
+ */
1733
+ revealUnit: Pick<EffectFields, 'duration'>;
1734
+ /**
1735
+ * One unit rides another, in a game with the moves pack (`movesPack`): the `rider` (the caster, or the unit it was
1736
+ * cast on) is out of the world (`World.setHidden`: not found, not hit, in nobody's way) and goes where its host goes,
1737
+ * until the host dies or leaves the world, `duration` seconds are up, or whoever cast it casts the ability again (on the
1738
+ * host, or with a point: the ability's cooldown starts then). Then it is back where its host is, and `onEnd` happens in
1739
+ * the rider's name, at the point the recast gave (where it is otherwise), the host its target: Yuumi's You and Me!,
1740
+ * Kalista's Fate's Call (the ally thrown where she aims)
1741
+ *
1742
+ * @beta
1743
+ */
1744
+ attach: Pick<EffectFields, 'rider' | 'duration' | 'onEnd'>;
1745
+ /**
1746
+ * Drags what it reaches to the caster's edge (or to where it landed, `toPoint`) over `seconds`, after the caster as it
1747
+ * moves; `effects` happen to it as it arrives, in the caster's name. While dragged it does nothing of its own (its
1748
+ * orders wait, it casts nothing, uses nothing) and nothing else moves it (a knockback, a dash). Who is rushing
1749
+ * somewhere already, and structures, are not pulled
1750
+ *
1751
+ * @beta
1752
+ */
1753
+ pull: Pick<EffectFields, 'seconds' | 'toPoint' | 'effects'>;
670
1754
  /** An ability of the caster is ready again: `ability`, or the one the effect belongs to */
671
1755
  refresh: Pick<EffectFields, 'ability'>;
672
- /** A passive's: `effects` happen around whoever the carrier kills (by an attack, with `attack`) */
673
- onKill: Pick<EffectFields, 'attack' | 'effects'>;
1756
+ /** A passive's: `effects` happen around whoever the carrier kills (by an attack, with `attack`; while it carries `whileBuff`) */
1757
+ onKill: Pick<EffectFields, 'attack' | 'whileBuff' | 'effects' | 'cooldown'>;
674
1758
  /** A passive's: `effects` happen to the carrier whenever it casts */
675
- onCast: Pick<EffectFields, 'effects'>;
1759
+ onCast: Pick<EffectFields, 'effects' | 'cooldown'>;
1760
+ /**
1761
+ * Gives what it reaches an ability (`ability`) at `atLevel` (the effect's level), for `duration` seconds or `uses`
1762
+ * casts, or for good, in a game with the ability changes pack (`abilityChangesPack`): allies when it says nothing
1763
+ *
1764
+ * @beta
1765
+ */
1766
+ grantAbility: {
1767
+ ability: string;
1768
+ } & Pick<EffectFields, 'atLevel' | 'duration' | 'uses'>;
1769
+ /**
1770
+ * The caster's ability `from` (the one the effect belongs to) gives way to `ability` in its place on the card, at its
1771
+ * level (or `atLevel`), for `duration` seconds or `uses` casts, then back; for good with neither. In a game with the
1772
+ * ability changes pack: a stance, an awakened ability, a weapon of a set
1773
+ *
1774
+ * @beta
1775
+ */
1776
+ swapAbility: {
1777
+ ability: string;
1778
+ } & Pick<EffectFields, 'from' | 'atLevel' | 'duration' | 'uses'>;
1779
+ /**
1780
+ * Takes one of the abilities of the unit it was cast on (`pick`: its ultimate when left out) and puts it in the place
1781
+ * of the one the effect belongs to, at that one's level, for `uses` casts (one when left out) or `duration` seconds,
1782
+ * then back: Sylas's Hijack. In a game with the ability changes pack
1783
+ *
1784
+ * @beta
1785
+ */
1786
+ stealAbility: Pick<EffectFields, 'pick' | 'duration' | 'uses'>;
1787
+ /**
1788
+ * What it reaches becomes the caster's owner's (`World.setOwner`), for `duration` seconds or for good: Charm,
1789
+ * Dominate. Heroes and structures are left as they are. In a game with the ability changes pack
1790
+ *
1791
+ * @beta
1792
+ */
1793
+ convert: Pick<EffectFields, 'duration'>;
1794
+ /**
1795
+ * A passive's: `effects` happen to whoever hurt the carrier (by an attack with `attack`, from up close with `melee`),
1796
+ * in the carrier's name, the damage it took in `EffectContext.damage` (`byDamage`): Thorns Aura, Frost Armor, Spiked
1797
+ * Carapace, Defensive Ball Curl. Not for damage a trigger's effects did: two of them never echo
1798
+ *
1799
+ * @beta
1800
+ */
1801
+ onDamaged: Pick<EffectFields, 'attack' | 'melee' | 'effects' | 'cooldown'>;
1802
+ /**
1803
+ * A passive's: `effects` happen to an enemy an ability of the carrier hurt, each time one does (not its attacks, not
1804
+ * a trigger's effects), the damage in `EffectContext.damage`: Essence Theft, Phenomenal Evil
1805
+ *
1806
+ * @beta
1807
+ */
1808
+ onAbilityHit: Pick<EffectFields, 'effects' | 'cooldown'>;
1809
+ /**
1810
+ * A passive's: `effects` happen to the carrier once its health falls below `below` of its max (as it falls past it),
1811
+ * once in `cooldown` seconds: Mana Barrier
1812
+ *
1813
+ * @beta
1814
+ */
1815
+ onLowHealth: Pick<EffectFields, 'below' | 'effects' | 'cooldown'>;
1816
+ /**
1817
+ * A passive's: instead of dying of a blow or a kill, the carrier is left with `health` of its max (all of it when
1818
+ * left out) and `effects` happen to it, in its name, once in `cooldown` seconds: Reincarnation, Guardian Angel (an
1819
+ * item's), Anivia's Rebirth (a `morph` into the egg), Zilean's Chronoshift (a buff's)
1820
+ *
1821
+ * @beta
1822
+ */
1823
+ onFatal: Pick<EffectFields, 'health' | 'effects' | 'cooldown'>;
1824
+ /**
1825
+ * Takes `buff` off what it reaches: `stacks` of it, or all of it (every one of it there is) when left out. A mark
1826
+ * popped, stacks spent
1827
+ *
1828
+ * @beta
1829
+ */
1830
+ removeBuff: {
1831
+ buff: string;
1832
+ } & Pick<EffectFields, 'stacks'>;
1833
+ /**
1834
+ * Takes off what holds them up from what it reaches (allies when it says nothing): harmful stuns, roots, silences,
1835
+ * disarms, controls, grounds and slows, not a suppression nor being thrown up (`isCleansable`): Remove Scurvy
1836
+ *
1837
+ * @beta
1838
+ */
1839
+ cleanse: object;
676
1840
  /** `effects` when the ability went off charged, `otherwise` when it did not */
677
1841
  charged: Pick<EffectFields, 'effects' | 'otherwise'>;
1842
+ /**
1843
+ * `effects` when what it asks holds, `otherwise` when it does not: of the `caster` and of the `target`
1844
+ * (`UnitCondition`: a buff, health below a share, a hero, tags, enemy or ally; or code) and by `chance`. On the unit it
1845
+ * was cast on, or, with a `radius` or `shape`, on each within it (as `affects` says, enemies when it says nothing),
1846
+ * each then the target of what it does. Execute below 20%, Holy Light on the undead, Bash's chance (`conditionHolds`)
1847
+ *
1848
+ * @beta
1849
+ */
1850
+ if: Pick<EffectFields, 'caster' | 'target' | 'effects' | 'otherwise'>;
678
1851
  /** `effects` happen at the spot, `delay` seconds from now */
679
1852
  after: Pick<EffectFields, 'delay' | 'effects' | 'impact'>;
680
1853
  /** For `duration` seconds `effects` happen to what is at the spot, over and over, and `onEnd` at the end */
681
- zone: Pick<EffectFields, 'duration' | 'effects' | 'onEnd'>;
1854
+ zone: Pick<EffectFields, 'duration' | 'effects' | 'onEnd' | 'follow' | 'onEnter' | 'onLeave' | 'edge'>;
682
1855
  /** Finds what is invisible around the spot: the caster's team sees it for `duration` seconds */
683
1856
  detect: Pick<EffectFields, 'duration'>;
684
1857
  /** Raises `count` of the corpses around the spot as units of `unit`, for `duration` seconds or for good */
685
1858
  raiseDead: {
686
- unit: string;
687
- } & Pick<EffectFields, 'duration' | 'count'>;
1859
+ unit?: string;
1860
+ } & Pick<EffectFields, 'duration' | 'count' | 'as'>;
1861
+ /**
1862
+ * Brings back the corpses of the caster's side around the spot (within `radius`, 6) as what they were, their owners'
1863
+ * again and whole, `count` of them at most (all when left out): Resurrection
1864
+ *
1865
+ * @beta
1866
+ */
1867
+ revive: Pick<EffectFields, 'count'>;
688
1868
  /**
689
1869
  * Makes `count` copies of the target, for `duration` seconds: they deal `dealt` of its damage (a third when left out)
690
1870
  * and take `taken` times what they are dealt (twice when left out)
691
1871
  */
692
- illusion: Pick<EffectFields, 'count' | 'duration'> & {
693
- dealt?: number;
694
- taken?: number;
1872
+ illusion: Pick<EffectFields, 'count' | 'duration'> & {
1873
+ dealt?: number;
1874
+ taken?: number;
1875
+ };
1876
+ /**
1877
+ * Brings `count` (1) units of `unit` around where it landed, `spread` cells from it (1.5), for `lifetime` seconds (for
1878
+ * good when left out): the caster's summons (`summoned`). With nothing to attack they walk with the caster (`follow`,
1879
+ * true); `aggro` says whom they go for (`mastersAttacker` when left out: whoever hits the caster, then the nearest);
1880
+ * they die with the caster unless `diesWithMaster` is false
1881
+ *
1882
+ * @beta
1883
+ */
1884
+ summon: {
1885
+ unit: string;
1886
+ } & Pick<EffectFields, 'count'> & {
1887
+ lifetime?: Scaled;
1888
+ spread?: number;
1889
+ follow?: boolean;
1890
+ aggro?: 'nearest' | 'mastersAttacker' | 'none';
1891
+ diesWithMaster?: boolean;
1892
+ };
1893
+ /** Takes the buffs off what it reaches, and hurts what is summoned by `amount` */
1894
+ dispel: Pick<EffectFields, 'amount'>;
1895
+ /**
1896
+ * Turns the caster into another unit type where it stands (`into`), a form (`takeForm`): its level, experience,
1897
+ * items, buffs and the share of its health and mana kept, what it was told going on, and the form's abilities
1898
+ * learned at the levels its form says (`HeroDef.forms`). For `duration` seconds, or until cast again (`toggle`), or
1899
+ * both; `back` says what turns it back
1900
+ *
1901
+ * @beta
1902
+ */
1903
+ morph: {
1904
+ into: string;
1905
+ } & Pick<EffectFields, 'duration' | 'toggle' | 'back'>;
1906
+ /**
1907
+ * Trades `amount` of a resource of the caster's owner (`sell`) for another (`buy`), `rate` of it for each one sold:
1908
+ * a marketplace's (`presetMarket`, `exchange` in code). Nothing of it with less than `amount` to sell
1909
+ */
1910
+ exchange: {
1911
+ sell: string;
1912
+ buy: string;
1913
+ rate: number;
1914
+ amount: Scaled;
1915
+ };
1916
+ /**
1917
+ * A tome's, in a game with the tomes pack (`tomesPack`): what it reaches gains `gain` for good (a point of strength),
1918
+ * a hero `xp` experience and `levels` levels
1919
+ */
1920
+ tome: {
1921
+ gain?: StatChange;
1922
+ xp?: number;
1923
+ levels?: number;
1924
+ };
1925
+ /**
1926
+ * Mana burn, in a game with its pack (`manaBurnPack`): takes `amount` of the mana of what it reaches, and hurts it by
1927
+ * as much as it took, times `ratio` (1 when left out), magic damage unless `damageType` says
1928
+ */
1929
+ manaBurn: Pick<EffectFields, 'amount' | 'scaling' | 'damageType'> & {
1930
+ ratio?: number;
1931
+ };
1932
+ /**
1933
+ * A town portal, in a game with the portals pack (`portalsPack`): the caster and as many as `count` (12 when left out)
1934
+ * of its own units within `radius` (7) of it are at once at its side's home nearest where it was aimed (`homeOf`)
1935
+ */
1936
+ townPortal: Pick<EffectFields, 'count'>;
1937
+ /**
1938
+ * A passive's, in a game with the default items (`defaultItemsPack`): keeps `buff` on the allies within `radius` of
1939
+ * the carrier (itself too) while the carrier does not carry `spent`: Dawnmender's ward, whose `onFatal` spends it
1940
+ * (`wardSpent`)
1941
+ *
1942
+ * @beta
1943
+ */
1944
+ allyWard: {
1945
+ buff: string;
1946
+ spent: string;
1947
+ };
1948
+ /**
1949
+ * Of a ward's trigger (`allyWard`), on the ally it saved: puts `spent` on whoever gave the ward for `duration`
1950
+ * seconds and takes the ward (`buff`) off everyone it gave it to: one save a while, for all of them
1951
+ *
1952
+ * @beta
1953
+ */
1954
+ wardSpent: {
1955
+ buff: string;
1956
+ spent: string;
1957
+ } & Pick<EffectFields, 'duration'>;
1958
+ /**
1959
+ * The caster's abilities are ready again: the ones it learns (`HeroDef.learns`), not its ultimate unless `ultimate`,
1960
+ * not what its items do. Nightfang's kill. In a game with the default items
1961
+ *
1962
+ * @beta
1963
+ */
1964
+ refreshAbilities: {
1965
+ ultimate?: boolean;
695
1966
  };
696
- /** Takes the buffs off what it reaches, and hurts what is summoned by `amount` */
697
- dispel: Pick<EffectFields, 'amount'>;
698
1967
  /**
699
- * Trades `amount` of a resource of the caster's owner (`sell`) for another (`buy`), `rate` of it for each one sold:
700
- * a marketplace's (`presetMarket`, `exchange` in code). Nothing of it with less than `amount` to sell
1968
+ * A passive's: the caster's ability `spell` (by id, a hero spell's: `reap`) cools down `part` faster (0.5: half
1969
+ * again). Nothing for a caster without it. In a game with the default items
1970
+ *
1971
+ * @beta
701
1972
  */
702
- exchange: {
703
- sell: string;
704
- buy: string;
705
- rate: number;
706
- amount: Scaled;
1973
+ quicken: {
1974
+ spell: string;
1975
+ part: number;
707
1976
  };
708
1977
  /**
709
- * A tome's, in a game with the tomes pack (`withTomes`): what it reaches gains `gain` for good (a point of strength),
710
- * a hero `xp` experience and `levels` levels
1978
+ * A passive's: `buff` on the carrier while it is out of fights, neither hurt nor attacking for `after` seconds (5
1979
+ * when left out): Shadow Cowl's, Wanderer's Boots' speed. In a game with the default items
1980
+ *
1981
+ * @beta
711
1982
  */
712
- tome: {
713
- gain?: StatChange;
714
- xp?: number;
715
- levels?: number;
1983
+ outOfFights: {
1984
+ buff: string;
1985
+ after?: number;
716
1986
  };
717
1987
  /**
718
- * Mana burn, in a game with its pack (`withManaBurn`): takes `amount` of the mana of what it reaches, and hurts it by
719
- * as much as it took, times `ratio` (1 when left out), magic damage unless `damageType` says
1988
+ * Gives the caster's owner `amount` of the game's currency: a kill near the Ring of the Old King. In a game with the
1989
+ * default items
1990
+ *
1991
+ * @beta
720
1992
  */
721
- manaBurn: Pick<EffectFields, 'amount' | 'scaling' | 'damageType'> & {
722
- ratio?: number;
723
- };
1993
+ reward: Pick<EffectFields, 'amount'>;
724
1994
  /**
725
- * A town portal, in a game with the portals pack (`withPortals`): the caster and as many as `count` (12 when left out)
726
- * of its own units within `radius` (7) of it are at once at its side's home nearest where it was aimed (`homeOf`)
1995
+ * A passive's: a `unit` of the carrier's at its side at night, its summon (`summoned`), gone by day: Wolfhide Charm.
1996
+ * In a game with the default items
1997
+ *
1998
+ * @beta
727
1999
  */
728
- townPortal: Pick<EffectFields, 'count'>;
2000
+ nightCompanion: {
2001
+ unit: string;
2002
+ };
729
2003
  }
730
2004
  /**
731
2005
  * One thing an ability does: its `type`, which picks the handler and says which fields it has (`EffectTypes`)
732
2006
  *
733
- * @beta
2007
+ * @public
734
2008
  */
735
2009
  export type EffectDef = {
736
2010
  [K in keyof EffectTypes]: {
@@ -753,6 +2027,16 @@ export type AnyEffect = {
753
2027
  * @beta
754
2028
  */
755
2029
  export declare const anyEffect: (effect: EffectDef) => AnyEffect;
2030
+ /**
2031
+ * A list of effects as it runs (`EffectCommon.when`): every effect that waits for a moment taken out of the list and
2032
+ * put at the end of the list of the nearest one before it that comes to that moment (a missile's `effects` for `hit`,
2033
+ * its `onEnd` for `end`), copied; what waits on what waits itself goes in there. The list itself when nothing in it
2034
+ * waits, so the nested shape (`{ type: 'missile', effects: [...] }`) and a chain are one thing by the time they run.
2035
+ * One with nothing to wait on is dropped, and `orphan` told of it by its index in the list
2036
+ *
2037
+ * @beta
2038
+ */
2039
+ export declare function lowerChain(effects: readonly EffectDef[], orphan?: (index: number, effect: EffectDef) => void): EffectDef[];
756
2040
  /**
757
2041
  * An effect of one type
758
2042
  *
@@ -779,10 +2063,41 @@ export type AimShape = {
779
2063
  shape: 'cone';
780
2064
  length: number;
781
2065
  angle: number;
2066
+ }
2067
+ /** A ring at the spot: what is `radius` away and up to `width` closer, not what is in the middle */
2068
+ | {
2069
+ shape: 'ring';
2070
+ radius: number;
2071
+ width: number;
2072
+ }
2073
+ /** A stretch of a ring around the caster, `radius` away, `angle` wide (radians) and `width` thick, its middle the way it is aimed */
2074
+ | {
2075
+ shape: 'arc';
2076
+ radius: number;
2077
+ angle: number;
2078
+ width: number;
2079
+ }
2080
+ /** A rectangle around the spot, `length` long the way it is aimed and `width` out on either side */
2081
+ | {
2082
+ shape: 'rect';
2083
+ length: number;
2084
+ width: number;
2085
+ }
2086
+ /** An X at the spot: two bars `length` long and `width` out on either side, crossing square, each turned an eighth from the way it is aimed */
2087
+ | {
2088
+ shape: 'cross';
2089
+ length: number;
2090
+ width: number;
782
2091
  };
783
- /** @beta */
2092
+ /**
2093
+ * The definition of an ability: how it is aimed, what it costs and the effects it has
2094
+ *
2095
+ * @public
2096
+ */
784
2097
  export interface AbilityDef {
2098
+ /** The ability's id, shared by every game: give it a prefix of the game's */
785
2099
  id: string;
2100
+ /** What the player sees the ability called */
786
2101
  name: string;
787
2102
  /**
788
2103
  * How what its damage kills dies, for the screen (`'burnt'`, `'frozen'`, `'blasted'`): the death's `how`, which the
@@ -803,7 +2118,7 @@ export interface AbilityDef {
803
2118
  /**
804
2119
  * What it does, in words: a template with values in braces, worked out for the caster as it is now ("Deals {damage}
805
2120
  * magic damage" shows "Deals 80 (50 + 60% ability power) magic damage"). The values are its own (`values`), or found
806
- * in its effects: `damage`, `heal`, `shield`, `amount`, `duration`, `radius`, `range`, `cooldown`, `charges`, `refill`,
2121
+ * in its effects: `damage`, `heal`, `shield`, `amount`, `duration`, `radius`, `chance` (in percent), `range`, `cooldown`, `charges`, `refill`,
807
2122
  * `mana`, `count`, `distance` (see `abilityValues`)
808
2123
  */
809
2124
  description?: string;
@@ -811,10 +2126,13 @@ export interface AbilityDef {
811
2126
  values?: Record<string, AbilityValueDef>;
812
2127
  /** What it does, said in code instead of `description`: words with `{values}` in them, or words and values already put together */
813
2128
  describe?: (context: AbilityTextContext) => string | TextSegment[];
2129
+ /** The key that casts it from the command card */
814
2130
  hotkey?: string;
815
2131
  /**
816
2132
  * none: happens at once. unit, point: needs a target, and the caster walks into range of it.
817
- * direction: goes off from where the caster stands, towards where it was aimed. passive: always on, cannot be cast
2133
+ * direction: goes off from where the caster stands, towards where it was aimed. vector: two points, where it starts
2134
+ * (walked into range of, its effects' `origin`) and the way it goes from there (their `point`): Death Ray, Seismic
2135
+ * Shove. passive: always on, cannot be cast. Or a game's own (`defineTargeting`, `Rules.targetings`)
818
2136
  */
819
2137
  target: AbilityTarget;
820
2138
  /** What may be targeted, for abilities cast on a unit */
@@ -824,11 +2142,39 @@ export interface AbilityDef {
824
2142
  self?: boolean;
825
2143
  kinds?: EntityKind[];
826
2144
  layers?: Layer[];
2145
+ /** True: heroes alone; false: anything but a hero (a creep, a minion, a building: Reap). Heroes or not when left out */
827
2146
  heroes?: boolean;
2147
+ /** Only what has one of these tags of its type (`UnitTypeDef.tags`): Death Coil on the undead @beta */
2148
+ tags?: string[];
828
2149
  };
2150
+ /** Mana it costs per cast, by level */
829
2151
  manaCost?: Scaled;
830
2152
  /** Health it costs, as a part of all the caster can have. It cannot be cast with less than that left */
831
2153
  healthCost?: Scaled;
2154
+ /**
2155
+ * What it costs of the caster's pools (`UnitTypeDef.pools`), by pool, in a game with the resources pack
2156
+ * (`resourcesPack`): it is not ready with less, and pays as it goes off (Akali's energy, a shot of ammo)
2157
+ *
2158
+ * @beta
2159
+ */
2160
+ cost?: Record<string, Scaled>;
2161
+ /**
2162
+ * What it gives the caster's pools as it goes off, by pool, in a game with the resources pack: Rumble's heat, a
2163
+ * fury's spender's opposite
2164
+ *
2165
+ * @beta
2166
+ */
2167
+ gain?: Record<string, Scaled>;
2168
+ /**
2169
+ * Its costs (its mana and `cost`) grow with the stacks of a buff of the caster's, in a game with the resources pack:
2170
+ * times one and `per` for each stack (Kassadin's Riftwalk: `per: 1`, twice with one stack, three times with two)
2171
+ *
2172
+ * @beta
2173
+ */
2174
+ costGrowth?: {
2175
+ buff: string;
2176
+ per: number;
2177
+ };
832
2178
  /** Seconds before it can be used again */
833
2179
  cooldown?: Scaled;
834
2180
  /**
@@ -840,6 +2186,13 @@ export interface AbilityDef {
840
2186
  count: Scaled;
841
2187
  refill: Scaled;
842
2188
  };
2189
+ /**
2190
+ * It may be cast again for a while after it is cast (`AbilityRecast`): Ahri's Spirit Rush thrice, Lee Sin's second
2191
+ * Sonic Wave to the one the first marked, Lux's Lucent Singularity set off
2192
+ *
2193
+ * @beta
2194
+ */
2195
+ recast?: AbilityRecast;
843
2196
  /** How far away the target may be */
844
2197
  range?: Scaled;
845
2198
  /** The target may be as far away as the caster's attacks reach, and `range` farther */
@@ -851,8 +2204,14 @@ export interface AbilityDef {
851
2204
  tags?: string[];
852
2205
  /** Levels a hero can put into it. 3 when left out */
853
2206
  maxLevel?: number;
854
- /** Hero level needed for the first level of the ability. Ultimates ask for 6 */
2207
+ /** Hero level needed for the first level of the ability. 1 when left out, 6 for an `ultimate` */
855
2208
  requiresLevel?: number;
2209
+ /**
2210
+ * A hero's ultimate: first learned at level 6 (unless `requiresLevel` says otherwise), what the AI uses on a crowd
2211
+ * only (as it does what asks for a level), and what a game's own code can tell apart (what a possession of another
2212
+ * hero leaves the hero's own: `keeps`)
2213
+ */
2214
+ ultimate?: boolean;
856
2215
  /** Hero levels between two levels of the ability. 2 when left out */
857
2216
  levelStep?: number;
858
2217
  /**
@@ -874,6 +2233,23 @@ export interface AbilityDef {
874
2233
  shape: 'cone';
875
2234
  length: Scaled;
876
2235
  angle: number;
2236
+ } | {
2237
+ shape: 'ring';
2238
+ radius: Scaled;
2239
+ width: Scaled;
2240
+ } | {
2241
+ shape: 'arc';
2242
+ radius: Scaled;
2243
+ angle: number;
2244
+ width: Scaled;
2245
+ } | {
2246
+ shape: 'rect';
2247
+ length: Scaled;
2248
+ width: Scaled;
2249
+ } | {
2250
+ shape: 'cross';
2251
+ length: Scaled;
2252
+ width: Scaled;
877
2253
  };
878
2254
  /** Units use it on their own when they have nothing else to do. The player can switch this off */
879
2255
  autocast?: boolean;
@@ -882,6 +2258,7 @@ export interface AbilityDef {
882
2258
  * `charged` effects do their other thing, and casting it takes the buff away
883
2259
  */
884
2260
  charge?: string;
2261
+ /** What it does, one effect after the other, when it is cast */
885
2262
  effects: EffectDef[];
886
2263
  /** What an ability that is cast does all the time besides, once it is learned: buffs, auras, `onHit` */
887
2264
  passive?: EffectDef[];
@@ -901,6 +2278,7 @@ export interface AbilityDef {
901
2278
  ai?: (view: AbilityAiView, caster: EntityState, level: number) => {
902
2279
  point: Vec2;
903
2280
  target?: number;
2281
+ to?: Vec2;
904
2282
  } | null | undefined;
905
2283
  /** How far away the target may be, in code: the range on high ground, say. `range` is what the screen shows */
906
2284
  rangeOf?: (world: World, caster: Entity, level: number) => number;
@@ -920,7 +2298,70 @@ export interface AbilityDef {
920
2298
  finished?: EffectDef[];
921
2299
  /** Broken off when the caster is hurt, as a recall is: any damage, from anyone */
922
2300
  breaksOnDamage?: boolean;
2301
+ /**
2302
+ * A tether: broken off (`interrupted`) as the unit it was cast on gets farther than this from the caster's edge,
2303
+ * dies or hides: Siphon Mana, Life Drain, Morgana's Soul Shackles
2304
+ *
2305
+ * @beta
2306
+ */
2307
+ leash?: number;
2308
+ /**
2309
+ * Aimed as it goes: where it goes off at (`point`) follows the player's `aim` commands, in a game with the holds
2310
+ * pack (`holdsPack`): Vel'Koz's ray, Jhin's Curtain Call, Starfall's sweep. The caster turns to it
2311
+ *
2312
+ * @beta
2313
+ */
2314
+ aimed?: boolean;
2315
+ /**
2316
+ * Kept up as the caster walks, in a game with the holds pack (`holdsPack`): not an order the caster stands in, so
2317
+ * it may be told to go elsewhere while it lasts; broken off by a stun, a silence, its death
2318
+ *
2319
+ * @beta
2320
+ */
2321
+ walks?: boolean;
2322
+ };
2323
+ /**
2324
+ * What it may be made into for good, chosen once (`upgradeAbility`, the `upgradeAbility` command), in a game with the
2325
+ * ability changes pack (`abilityChangesPack`): Viktor's augments, Engineering Upgrade's better abilities. The new one
2326
+ * takes its place at its level and cooldown
2327
+ *
2328
+ * @beta
2329
+ */
2330
+ upgrades?: string[];
2331
+ /**
2332
+ * Held to charge and let go, in a game with the holds pack (`holdsPack`): the cast starts the hold where the caster
2333
+ * stands, going on with what it was doing, and the `release` command (the key let go, or a click) sets it off, as
2334
+ * full as it was held (`HoldDef`): farther, harder, or a tap's other effects. Paid as it is let go
2335
+ *
2336
+ * @beta
2337
+ */
2338
+ hold?: HoldDef;
2339
+ }
2340
+ /**
2341
+ * How an ability is held to charge and let go (`AbilityDef.hold`), in a game with the holds pack: Varus's Piercing Arrow,
2342
+ * Xerath's Arcanopulse, Pyke's Bone Skewer, Viego's Spectral Maw
2343
+ *
2344
+ * @beta
2345
+ */
2346
+ export interface HoldDef {
2347
+ /** Seconds held for it to be full */
2348
+ max: number;
2349
+ /** Seconds held after which it goes off by itself, where it was last aimed: as it is full when left out */
2350
+ upTo?: number;
2351
+ /** How far it reaches let go at once (`from`) and full (`to`): where it is let go at is brought that near */
2352
+ range?: {
2353
+ from: number;
2354
+ to: number;
923
2355
  };
2356
+ /** What its amounts come to full, times what they are let go at once (1.5: half again); what comes between is between */
2357
+ scale?: number;
2358
+ /** Let go before `under` seconds: these effects in place of its own (Pyke's stab, not his hook) */
2359
+ tap?: {
2360
+ under: number;
2361
+ effects: EffectDef[];
2362
+ };
2363
+ /** A buff on the caster while it holds: a slow */
2364
+ buff?: string;
924
2365
  }
925
2366
  /**
926
2367
  * What the stats of the caster add to an amount. `level` is for every level of a hero past the first,
@@ -932,21 +2373,31 @@ export type Scaling = Partial<Record<StatKey | 'level' | 'bonusAttackDamage', Sc
932
2373
  /**
933
2374
  * Something lasting on a unit that changes what it can do
934
2375
  *
935
- * @beta
2376
+ * @public
936
2377
  */
937
2378
  export interface BuffDef extends ScaledStatChange {
2379
+ /** The buff's id, shared by every game: give it a prefix of the game's */
938
2380
  id: string;
2381
+ /** What the player sees the buff called */
939
2382
  name: string;
940
2383
  /**
941
2384
  * The definition this one is a copy of, made from the data (`copyOf` in a `data.json`, the editor's Copy as new):
942
2385
  * what it is drawn, heard and pictured as where the game gives it no look of its own
943
2386
  */
944
2387
  basedOn?: string;
2388
+ /** What the buff does, in words, shown when the pointer is over it */
945
2389
  description?: string;
946
2390
  /** Seconds. Lasts until removed when left out */
947
2391
  duration?: number;
948
2392
  /** A debuff: by default it goes on enemies */
949
2393
  harmful?: boolean;
2394
+ /**
2395
+ * Free words to find it by and to sort it with (`fire`, `slow`, `anti-heal`), as abilities and units have: what a
2396
+ * search matches, what a game's code asks (`buffsTagged`)
2397
+ *
2398
+ * @beta
2399
+ */
2400
+ tags?: string[];
950
2401
  /** The unit cannot do anything. A function says so for one carrier, one moment */
951
2402
  stun?: boolean | BuffCheck;
952
2403
  /** Thrown into the air for as long as it lasts. Comes with a stun, the rest is for the eye */
@@ -979,6 +2430,29 @@ export interface BuffDef extends ScaledStatChange {
979
2430
  disarm?: boolean | BuffCheck;
980
2431
  /** Who carries it is immune to spells while it lasts, as an avatar is (see `UnitTypeDef.spellImmune`). Or while its function says */
981
2432
  spellImmune?: boolean | BuffCheck;
2433
+ /**
2434
+ * Who carries it takes no damage while it lasts, and no enemy's ability may be cast on it (Divine Shield, Kayle's
2435
+ * Intervention, Zhonya's stasis with a `stun`). Effects other than damage still reach it. Or while its function says
2436
+ *
2437
+ * @beta
2438
+ */
2439
+ invulnerable?: boolean | BuffCheck;
2440
+ /**
2441
+ * Who carries it is out of reach while it lasts (Fizz's Playful, Zed's Death Mark dash, Vlad's pool): no ability may be
2442
+ * cast on it but by itself, no attack is aimed at it nor lands, and no effect of anyone else's reaches it (an area,
2443
+ * a missile, a chain), allies' too; it is still seen and still in the way. Or while its function says
2444
+ *
2445
+ * @beta
2446
+ */
2447
+ untargetable?: boolean | BuffCheck;
2448
+ /**
2449
+ * The least health damage leaves its carrier with while it lasts (Tryndamere's Undying Rage at 1, Kindred's Lamb's
2450
+ * Respite at a tenth of its max): a number, one per level, or code with the carrier. It is hurt down to it, never past
2451
+ * it. The highest of what it carries counts
2452
+ *
2453
+ * @beta
2454
+ */
2455
+ minHealth?: Scaled | ((world: World, carrier: Entity, instance: BuffInstance) => number);
982
2456
  /**
983
2457
  * Whether a dispel takes it off (see the effect `dispel`). Yes when left out: no for what nothing should end early.
984
2458
  * Decided in code for each dispel: by who dispels it (`by`), its level
@@ -1013,7 +2487,153 @@ export interface BuffDef extends ScaledStatChange {
1013
2487
  };
1014
2488
  /** Code run when it comes off, run out (`expired`) or taken off. Not for the buffs of something that dies */
1015
2489
  onRemove?: (world: World, carrier: Entity, instance: BuffInstance, expired: boolean) => void;
2490
+ /**
2491
+ * It takes its carrier's orders while it lasts: what it was told waits (a channel is broken off), the player's and
2492
+ * anyone's new orders are refused, and it goes on with what it was told after, as from a stun. `fear`: it walks away
2493
+ * from who put it on; `charm`: it walks to them; `taunt`: it attacks them (walks to them where it cannot). Code
2494
+ * (`BuffControl`) steers it itself every tick. The last of them it carries is the one it does
2495
+ *
2496
+ * @beta
2497
+ */
2498
+ control?: ControlKind | BuffControl;
2499
+ /**
2500
+ * Held like a stun, and more: tenacity does not cut it short and a `cleanse` does not take it off (Malzahar's
2501
+ * Nether Grasp, Skarner's Impale)
2502
+ *
2503
+ * @beta
2504
+ */
2505
+ suppress?: boolean;
2506
+ /**
2507
+ * Its carrier cannot rush or jump anywhere of its own: an ability of its with a `dash` or a `blink` is refused
2508
+ * ("Grounded"), and such an effect of its does nothing (Singed's Mega Adhesive). Not `grounds`, which brings a flyer down
2509
+ *
2510
+ * @beta
2511
+ */
2512
+ grounded?: boolean;
2513
+ /**
2514
+ * What it takes of its carrier each second while it lasts, by pool (`UnitTypeDef.pools`) or `mana`, in a game with
2515
+ * the resources pack (`resourcesPack`): taken off when there is not enough for the next second's (Immolation, a
2516
+ * Glacial Storm kept up)
2517
+ *
2518
+ * @beta
2519
+ */
2520
+ drain?: Record<string, number>;
2521
+ /**
2522
+ * Nothing that holds a unit up does anything to its carrier while it lasts: harmful stuns, roots, silences, disarms,
2523
+ * controls, suppressions and grounds on it hold nothing, new ones do not take, and it is neither thrown nor pulled
2524
+ * (Olaf's Ragnarok, Malphite's Unstoppable Force). Slows still slow
2525
+ *
2526
+ * @beta
2527
+ */
2528
+ unstoppable?: boolean;
2529
+ /**
2530
+ * Its carrier is seen by the team of whoever put it on while it lasts, wherever it stands: in the fog, in a bush,
2531
+ * invisible or camouflaged (the fog lit where it stands, as for what a `detect` found), in a game with the vision
2532
+ * pack (`visionPack`): Kindred's mark, a hunter's quarry
2533
+ *
2534
+ * @beta
2535
+ */
2536
+ revealed?: boolean;
2537
+ /**
2538
+ * Its carrier is camouflaged while it lasts, in a game with the vision pack (`visionPack`): its enemies see it only
2539
+ * from within this far of it (a unit of theirs that near), unless something finds it (`trueSight`, `detect`,
2540
+ * `revealUnit`) or it attacked them a moment ago: Pyke's Ghostwater Dive, Rengar's Thrill of the Hunt, Viego's mist.
2541
+ * A function says how far for one carrier, one moment
2542
+ *
2543
+ * @beta
2544
+ */
2545
+ camouflage?: number | ((world: World, carrier: Entity, instance: BuffInstance) => number);
2546
+ /**
2547
+ * Its carrier finds what of its enemies is invisible or camouflaged within this far of it, for its team, while it
2548
+ * lasts, in a game with the vision pack (`visionPack`): an Oracle Lens, a Magic Sentry on a tower
2549
+ *
2550
+ * @beta
2551
+ */
2552
+ trueSight?: number;
2553
+ /**
2554
+ * Its carrier walks through other units, and they through it, while it lasts: neither steers round nor pushes the
2555
+ * other (a Ghost, a Phantom Stride). Walls, cliffs, buildings and trees still stop it. A function says so for one
2556
+ * carrier, one moment
2557
+ *
2558
+ * @beta
2559
+ */
2560
+ phasing?: boolean | BuffCheck;
2561
+ /**
2562
+ * Its carrier's blows from up close strike the enemies around their target too, a part of their damage each, as an
2563
+ * attack's own cleave (`AttackDef.cleave`): the larger part counts
2564
+ *
2565
+ * @beta
2566
+ */
2567
+ cleave?: Cleave;
2568
+ /**
2569
+ * The healing past full health that its carrier gives (`given`, when left out) or gets (`taken`) becomes a shield on
2570
+ * whoever was healed: the buff `buff` (its own time, and a shield of its own where it says), holding `part` of what
2571
+ * spilled over (all of it when left out), up to `most` of the healed one's max health (a third when left out)
2572
+ *
2573
+ * @beta
2574
+ */
2575
+ overheal?: {
2576
+ buff: string;
2577
+ part?: Scaled;
2578
+ most?: number;
2579
+ of?: 'given' | 'taken';
2580
+ };
2581
+ /**
2582
+ * Its carrier pays for its abilities with health, not mana, while it carries it: this much health for each point of
2583
+ * mana they cost (1 for `true`). It cannot cast with no more health than that; items still cost nothing
2584
+ *
2585
+ * @beta
2586
+ */
2587
+ paysWithHealth?: boolean | number;
2588
+ /**
2589
+ * What its carrier's attacks, hurts, casts and kills set off while it carries it, as an ability's passive does
2590
+ * (`onHit`, `onKill`, `onCast`, `onDamaged`, `onAbilityHit`, `onLowHealth`), in the carrier's name: Frost Armor's
2591
+ * slow on who strikes it, a Thorns Aura's buff, the empowered next attack of a buff a cast put on
2592
+ *
2593
+ * @beta
2594
+ */
2595
+ passive?: EffectDef[];
2596
+ /**
2597
+ * What takes it off before its time: `damage` (its carrier hurt: Sleep), `attack` (an attack of its carrier lands,
2598
+ * after what the attack sets off: Wind Walk), `cast` (its carrier casts an ability other than the one that put it on)
2599
+ *
2600
+ * @beta
2601
+ */
2602
+ breaksOn?: BuffBreak[];
2603
+ /**
2604
+ * What happens where its carrier dies carrying it, in the name of who put it on (while they live): Doom's demon, Black
2605
+ * Arrow's skeleton, a mark that spreads
2606
+ *
2607
+ * @beta
2608
+ */
2609
+ onCarrierDeath?: EffectDef[];
2610
+ /**
2611
+ * What happens to its carrier as an effect (`stack`) brings it to `maxStacks`, in the name of who put it on: Gravity
2612
+ * Field's stun on the third, Hemorrhage's might on the fifth. A `removeBuff` among them spends the stacks
2613
+ *
2614
+ * @beta
2615
+ */
2616
+ onMaxStacks?: EffectDef[];
1016
2617
  }
2618
+ /**
2619
+ * The orders a buff gives its carrier (`BuffDef.control`): away from who put it on, to them, or at them
2620
+ *
2621
+ * @beta
2622
+ */
2623
+ export type ControlKind = 'fear' | 'charm' | 'taunt';
2624
+ /**
2625
+ * A buff's own control (`BuffDef.control` in code): run every tick it holds its carrier, in place of the orders it
2626
+ * waits on, to steer it as it likes (with `moveTo`, `engage` and the like). `source` is who put it on, while it is there
2627
+ *
2628
+ * @beta
2629
+ */
2630
+ export type BuffControl = (world: World, carrier: Entity, instance: BuffInstance, dt: number, source: Entity | undefined) => void;
2631
+ /**
2632
+ * What takes a buff off before its time (`BuffDef.breaksOn`): its carrier hurt, an attack of its landing, a cast of its
2633
+ *
2634
+ * @beta
2635
+ */
2636
+ export type BuffBreak = 'damage' | 'attack' | 'cast';
1017
2637
  /** Whether a buff does what it says (stuns, roots) to one carrier, at this moment */
1018
2638
  export type BuffCheck = (world: World, carrier: Entity, instance: BuffInstance) => boolean;
1019
2639
  /** Code a buff runs on its carrier: as it is put on, or every so often */
@@ -1027,14 +2647,55 @@ export interface IncomingBuff {
1027
2647
  source: number;
1028
2648
  }
1029
2649
  /**
1030
- * Where an item is in a shop. The client's tiers, or a game's own (`GameView.shopTiers`)
2650
+ * Where an item is in a shop, and in its build tree: what is used up (`consumable`), what a hero starts with
2651
+ * (`starter`), the parts (`basic`), what they build (`intermediate`), what it all leads to (`legendary`), and what is
2652
+ * found, never sold (`relic`: loot of camps, bosses and quests). The client's tiers, or a game's own
2653
+ * (`GameView.hud.shopTiers`). `epic` is the old word for `intermediate`, still read as it (`itemTier`)
2654
+ *
2655
+ * @beta
2656
+ */
2657
+ export type ItemTier = 'consumable' | 'starter' | 'basic' | 'intermediate' | 'legendary' | 'relic' | 'epic' | (string & {});
2658
+ /**
2659
+ * How an item's charges come back (`ItemDef.refill`): all of them at a shop of the carrier's side or an ally's
2660
+ * (`shop`), and one every `every` seconds. An item that refills is kept at no charges, waiting for them
2661
+ *
2662
+ * @beta
2663
+ */
2664
+ export interface ItemRefill {
2665
+ /** Every charge back while its carrier stands at a shop it may trade with */
2666
+ shop?: boolean;
2667
+ /** Seconds for one charge to come back, wherever it is carried. None when left out */
2668
+ every?: number;
2669
+ }
2670
+ /**
2671
+ * A tag of items (`ItemDef.tags`), named and given a look: what a shop shows of it and whether it is one of the shop's
2672
+ * filters. A tag no `TagDef` names still works, shown as its own word (`Rules.tags`)
1031
2673
  *
1032
2674
  * @beta
1033
2675
  */
1034
- export type ItemTier = 'consumable' | 'starter' | 'basic' | 'epic' | 'legendary' | (string & {});
1035
- /** @beta */
2676
+ export interface TagDef {
2677
+ /** The tag as items say it: `attack`, `lifesteal`, `anti-heal` */
2678
+ id: string;
2679
+ /** What the player sees it called: its id when left out */
2680
+ name?: string;
2681
+ /** A line about it, shown when the pointer is over it */
2682
+ description?: string;
2683
+ /** An icon of its own, by path or by a name of the game's icons */
2684
+ icon?: string;
2685
+ /** The colour it is shown in, as CSS has it (`#e0a030`) */
2686
+ color?: string;
2687
+ /** One of the shop's filters, a chip to pick: not when left out */
2688
+ filter?: boolean;
2689
+ }
2690
+ /**
2691
+ * The definition of an item: what it costs, what it gives its carrier and how it is used
2692
+ *
2693
+ * @public
2694
+ */
1036
2695
  export interface ItemDef {
2696
+ /** The item's id, shared by every game: give it a prefix of the game's */
1037
2697
  id: string;
2698
+ /** What the player sees the item called */
1038
2699
  name: string;
1039
2700
  /** How good it is, 1 and up (campaign plan GP3): what an item table draws by (`{ level: 3 }`) */
1040
2701
  level?: number;
@@ -1045,7 +2706,9 @@ export interface ItemDef {
1045
2706
  * what it is drawn, heard and pictured as where the game gives it no look of its own
1046
2707
  */
1047
2708
  basedOn?: string;
2709
+ /** What the item does, in words, shown when the pointer is over it */
1048
2710
  description?: string;
2711
+ /** What it costs in a shop, in resources */
1049
2712
  cost: Cost;
1050
2713
  /** Uses before it is gone. Items without charges stay */
1051
2714
  charges?: number;
@@ -1055,8 +2718,52 @@ export interface ItemDef {
1055
2718
  passive?: string;
1056
2719
  /** Items it is made of. Those the buyer carries are used up and taken off the price, which is for all of it */
1057
2720
  from?: string[];
1058
- /** Where it goes in a shop: consumable, starter, basic, epic, legendary */
2721
+ /**
2722
+ * Where it goes in a shop: consumable, starter, basic, intermediate, legendary, relic (`ItemTier`). `epic`, the old
2723
+ * word, is read as intermediate
2724
+ */
1059
2725
  tier?: ItemTier;
2726
+ /**
2727
+ * The name of its passive (or the passive of items that share it): two carried, of it or of items sharing the name,
2728
+ * work once (the first carried). Its stats (`bonus`) always count. Every passive works when left out
2729
+ *
2730
+ * @beta
2731
+ */
2732
+ unique?: string;
2733
+ /**
2734
+ * A group of items a hero carries only so many of (`boots`): `groupLimit`, or the game's limit of the group
2735
+ * (`ItemSettings.groups`), 1 when neither says. Buying, picking up or being handed one more is refused, saying why
2736
+ *
2737
+ * @beta
2738
+ */
2739
+ group?: string;
2740
+ /** How many of its `group` one carrier may have: the game's limit of the group, or 1, when left out @beta */
2741
+ groupLimit?: number;
2742
+ /**
2743
+ * How many of it go in one slot: another bought, picked up or handed over goes into the slot of one carried, its
2744
+ * charges added, up to so many of it (a stack of potions). One a slot when left out
2745
+ *
2746
+ * @beta
2747
+ */
2748
+ stack?: number;
2749
+ /** How its charges come back (`ItemRefill`): at a shop, over time. Used up for good when left out @beta */
2750
+ refill?: ItemRefill;
2751
+ /** The part of its price a shop gives back for it, over the game's (`EconomySettings.sellPrice`) @beta */
2752
+ sellRate?: number;
2753
+ /**
2754
+ * Free words of the game's for what it is (`attack`, `lifesteal`, `anti-heal`, `early`): its categories, what a
2755
+ * search finds it by (`#lifesteal`), what a shop filters by. A `TagDef` gives one a name and a look (`Rules.tags`)
2756
+ *
2757
+ * @beta
2758
+ */
2759
+ tags?: string[];
2760
+ /**
2761
+ * The callings of heroes it is meant for (`vanguard`, `ranger`…): what a shop suggests and filters by. Never a lock:
2762
+ * any hero may buy it
2763
+ *
2764
+ * @beta
2765
+ */
2766
+ suits?: string[];
1060
2767
  /** Applies for as long as the item is carried */
1061
2768
  bonus?: StatChange;
1062
2769
  /** How many a shop has at most, and the seconds it takes to get one back. As many as anyone wants when left out */
@@ -1064,10 +2771,11 @@ export interface ItemDef {
1064
2771
  max: number;
1065
2772
  restock: number;
1066
2773
  };
2774
+ /** The key that uses it from the command card */
1067
2775
  hotkey?: string;
1068
2776
  /**
1069
2777
  * Used as it is picked up, by walking over it or by the order, and never carried: a rune, a tome. Its ability is cast by
1070
- * whoever picked it. In a game with the runes pack (`withRunes`, whose `powerUp` says it in code)
2778
+ * whoever picked it. In a game with the runes pack (`runesPack`, whose `powerUp` says it in code)
1071
2779
  */
1072
2780
  powerUp?: boolean;
1073
2781
  }
@@ -1079,6 +2787,7 @@ export interface ItemDef {
1079
2787
  export interface UpkeepTier {
1080
2788
  /** Applies when the player uses more supply than this */
1081
2789
  above: number;
2790
+ /** What the player sees the tier called */
1082
2791
  name: string;
1083
2792
  /** Part of what is gathered that still arrives, 0..1 */
1084
2793
  income: number;
@@ -1095,27 +2804,33 @@ export interface UpgradeEffect extends StatChange {
1095
2804
  /**
1096
2805
  * Research that improves a player's units for the rest of the game
1097
2806
  *
1098
- * @beta
2807
+ * @public
1099
2808
  */
1100
2809
  export interface UpgradeDef {
2810
+ /** The upgrade's id, shared by every game: give it a prefix of the game's */
1101
2811
  id: string;
2812
+ /** What the player sees the upgrade called */
1102
2813
  name: string;
1103
2814
  /**
1104
2815
  * The definition this one is a copy of, made from the data (`copyOf` in a `data.json`, the editor's Copy as new):
1105
2816
  * what it is drawn, heard and pictured as where the game gives it no look of its own
1106
2817
  */
1107
2818
  basedOn?: string;
2819
+ /** What the upgrade does, in words, shown when the pointer is over it */
1108
2820
  description?: string;
1109
2821
  /** Paid for every level */
1110
2822
  cost: Cost;
1111
2823
  /** Seconds per level */
1112
2824
  researchTime: number;
2825
+ /** The highest level that can be researched; 1 when left out */
1113
2826
  maxLevel?: number;
1114
2827
  /** Building types needed, one list per level. Levels past the end of the list need nothing */
1115
2828
  requires?: string[][];
1116
- /** The race it is of (`GameModule.races`): only its players may research it. Everyone's when left out */
2829
+ /** The race it is of (`Rules.races`): only its players may research it. Everyone's when left out */
1117
2830
  race?: string;
2831
+ /** The key that researches it from the command card */
1118
2832
  hotkey?: string;
2833
+ /** What each level changes in the stats of the units it applies to */
1119
2834
  effects: UpgradeEffect[];
1120
2835
  /**
1121
2836
  * What it does besides stats, in code, to each unit of the player's: as a level is researched (to the units there
@@ -1131,18 +2846,33 @@ export interface UpgradeDef {
1131
2846
  * @beta
1132
2847
  */
1133
2848
  export declare const upgradesOf: (def: Pick<UnitTypeDef, 'upgradesTo'>) => readonly string[];
1134
- /** @beta */
2849
+ /**
2850
+ * Gives the footprint of a unit type: its own, or a square the width of its collision diameter, rounded up
2851
+ *
2852
+ * @beta
2853
+ */
1135
2854
  export declare const footprintOf: (def: UnitTypeDef) => {
1136
2855
  w: number;
1137
2856
  d: number;
1138
2857
  };
2858
+ /** The one pool of supply there always is, in a supply said by pool (`UnitTypeDef.supply`) @beta */
2859
+ export declare const MAIN_SUPPLY = "supply";
2860
+ /** What a type takes of the one pool of supply there always is (`UnitTypeDef.supply`, a number or its `supply`) @beta */
2861
+ export declare function supplyOf(def: Pick<UnitTypeDef, 'supply'>): number;
2862
+ /** What a type takes of the game's own pools of supply, by name (`UnitTypeDef.supply` said by pool, the one pool left out) @beta */
2863
+ export declare function supplyPoolsOf(def: Pick<UnitTypeDef, 'supply'>): Record<string, number>;
2864
+ /** What a finished building of a type provides of the one pool of supply (`UnitTypeDef.supplyGiven`) @beta */
2865
+ export declare function supplyGivenOf(def: Pick<UnitTypeDef, 'supplyGiven'>): number;
2866
+ /** What a finished building of a type provides of the game's own pools, by name (`UnitTypeDef.supplyGiven` said by pool) @beta */
2867
+ export declare function supplyPoolsGivenOf(def: Pick<UnitTypeDef, 'supplyGiven'>): Record<string, number>;
1139
2868
  /**
1140
2869
  * What base stats are worked out under: the rules of a game, and what its own stats start at. A `Registry` is one
1141
2870
  *
1142
2871
  * @beta
1143
2872
  */
1144
2873
  export interface StatSource {
1145
- readonly rules: Readonly<GameRules>;
2874
+ /** The rules of the game the stats are worked out under, as `RuleSettings` */
2875
+ readonly settings: Readonly<RuleSettings>;
1146
2876
  /** Every stat of the game at 0, its own at their default */
1147
2877
  readonly statDefaults: Readonly<Stats>;
1148
2878
  }