@v12-engine/engine 0.1.0 → 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"game.js","names":[],"sources":["../src/game.ts"],"sourcesContent":["import type { CellLayerDef } from './cellLayers'\nimport { regionCinematic } from './cinematics'\nimport type { GameFileDef } from './gameFiles'\nimport { toldBuffOff, toldBuffOn } from './abilities/buffs'\nimport { toldCast, toldCastCancelled, toldChannelEnded, toldChannelStarted, toldWindup } from './abilities/castTold'\nimport { toldMana, toldMissileHit } from './abilities/effects'\nimport { toldStrike } from './abilities/land'\nimport { toldCells, toldCellsSeen } from './cellLayers'\nimport { cameraPart, toldCamera } from './cameraOrders'\nimport { toldCinematic, toldCinematicCue } from './cinematics'\nimport { toldCommand } from './commands'\nimport { toldRustle } from './concealment'\nimport { toldGust } from './foliage'\nimport { toldLine, toldLineEnded } from './dialog'\nimport { toldFx, toldFxStopped } from './effects'\nimport { toldBounty } from './features'\nimport { toldRedefined } from './gameData'\nimport { toldLevelUp, toldRevived, toldXp } from './hero'\nimport { itemTier, toldPicked } from './items'\nimport { toldCrit, toldDamage, toldDeath, toldHeal } from './life'\nimport { toldEnvironment } from './map'\nimport { toldMessage } from './messages'\nimport { toldObjective } from './objectives'\nimport { eventsPart, type ReplicatedEvent, type SnapshotField, snapshotField } from './replication'\nimport { debugPart } from './debugCommands'\nimport { hourPart } from './clock'\nimport { outcomePart } from './systems/victory'\nimport { projectilesPart } from './systems/combatTold'\nimport { missilesPart } from './abilities/effects'\nimport { itemsPart } from './items'\nimport { revealsPart } from './systems/fog'\nimport { areasPart } from './abilities/screen'\nimport { scoreLinePart, scorePart } from './score'\nimport { corpsesPart } from './summons'\nimport { toldAttack, toldAttackCancelled, toldImpact, toldMiss, toldShot } from './systems/combatTold'\nimport { toldBuilt, toldConstructionCancelled, toldConstructionStarted, toldWork } from './systems/construction'\nimport { toldChop, toldResource } from './systems/economy'\nimport { toldResearched, toldTrained, toldUpgradeStarted } from './systems/production'\nimport { toldUpgradeCancelled } from './systems/productionQueue'\nimport { toldChat, toldPing } from './talk'\nimport { toldMorphed } from './tech'\nimport type { PrefabDef } from './prefabs'\nimport type { MapGenerator } from './generate'\nimport type { ErrorPolicy } from './errors'\nimport type { Logger, LogLevel } from './log'\nimport type { Component } from './components'\nimport type { EventKey } from './events'\nimport type { EffectType } from './abilities/effects'\nimport type { Targeting } from './targeting'\nimport { coreEffects } from './abilities/effects/core'\nimport { coreFormations, type FormationDef } from './formation'\nimport { type CommandDef, coreCommands } from './commands'\nimport { debugCommands, redefineCommand, toldGround } from './debugCommands'\nimport { foliageDebugCommands } from './foliageDebug'\nimport { drawFromGroup, dropFromTable } from './randomGroups'\nimport { boardOrder, loadOrder, transportSank, transportSystem, unloadOrder } from './transport'\nimport { gateStates, setUpGates } from './gates'\nimport { tuneCommand, type TunableDef } from './tunables'\nimport type { EditableData } from './gameData'\nimport { spawnCamp } from './camps'\nimport { corpseSystem, summonEffects } from './summons'\nimport { dispelEffects } from './abilities/dispel'\nimport { coreHooks } from './features'\nimport type { HookDef } from './hooks'\nimport { checkRaces, type RaceDef, raceHooks, raceResources } from './races'\nimport { spawnStartingBase, type StartingBase } from './start'\nimport {\n\ttype AbilityDef,\n\ttype BuffDef,\n\ttype Cost,\n\ttype DayCycle,\n\ttype ItemDef,\n\tnoStats,\n\ttype ResourceDef,\n\ttype ResourceId,\n\ttype StatDef,\n\ttype Stats,\n\ttype TagDef,\n\ttype UnitTypeDef,\n\ttype UpgradeDef,\n\ttype UpkeepTier\n} from './defs'\nimport type { ChosenDefaults } from './defaultSets'\nimport { RecastNavigation, type RecastNavigationOptions } from './navigation/recast'\nimport { allOrFreed } from './navigation/builds'\nimport { SidePaths, sideKnowledgeSystem } from './navigation/sidePaths'\nimport { SizedNavigation } from './navigation/sized'\nimport type { Navigation } from './navigation/navigation'\nimport {\n\tattackGroundOrder,\n\tattackMoveOrder,\n\tattackOrder,\n\tattackPathOrder,\n\tpatrolPathOrder,\n\tfollowOrder,\n\tfollowPathOrder,\n\tholdOrder,\n\tmoveOrder,\n\tpatrolOrder\n} from './orders/basic'\nimport { buildOrder, constructOrder, repairOrder } from './orders/build'\nimport { castOrder } from './orders/cast'\nimport { dropItemOrder, pickUpOrder } from './orders/items'\nimport { harvestOrder, returnOrder } from './orders/harvest'\nimport type { Entity, PlayerId } from './entity'\nimport type { BrainDef } from './ai/brain'\nimport type { GameAi } from './ai/profiles'\nimport type { GamePack } from './packs/pack'\nimport type { StatField } from './stats'\nimport type { MapProblem } from './mapFields'\nimport { inventorySlots } from './inventory'\nimport { gathering } from './orders/harvest'\nimport { productionQueue } from './systems/productionQueue'\nimport { cargo } from './transport'\nimport { fieldValues, type MapEditorDef, mapCampData, mapFields, mapRegionData, mapPlayerData } from './mapFields'\nimport { MAX_TILES, type TileDef } from './tiles'\nimport { DEFAULT_MAX_PLAYERS, type GameMap, MAP_CREEPS, MAP_NEUTRAL, MAX_MAP_PLAYERS, type MapObjectOrder } from './map'\nimport { mapInfo } from './names'\nimport { type GameData, layData } from './gameData'\nimport type { PlayerInit, Purse } from './player'\nimport { type OrderBehavior, Registry, type System, type SystemDef } from './registry'\nimport { overSettings, resolveSettings, type RuleSettingsInit } from './rules'\nimport { abilitySystem } from './systems/abilities'\nimport { combatSystem } from './systems/combat'\nimport { constructionSystem } from './systems/construction'\nimport { supplySystem } from './systems/economy'\nimport { fogSystem } from './systems/fog'\nimport { lifeSystem } from './systems/life'\nimport { formSystem } from './forms'\nimport { movementSystem } from './systems/movement'\nimport { orderSystem } from './systems/orders'\nimport { productionSystem } from './systems/production'\nimport { lastTeamStanding } from './systems/victory'\nimport type { Terrain } from './terrain'\nimport { restoreWorld, SaveError, savedPlayers, type SaveRules, updateSave, type WorldSave } from './save'\nimport { cloneTerrain, groundOf, MissingGround, startedOn, startingTerrain } from './ground'\nimport { World, type WorldChecks } from './world'\nimport { resolveScore, scoreSystem } from './score'\nimport { type AreaDef, areaSystem } from './areas'\nimport { type SequenceDef, sequenceSystem } from './sequences'\nimport { type TimerDef, timerSystem } from './timers'\nimport type { ListenerDef } from './events'\nimport { giveMapOrders, spawnMapObject } from './mapObjects'\nimport { coreComponents } from './coreComponents'\nimport { hasGroundSpeeds, navigationSpeedOn } from './groundSpeed'\n\nconst coreOrders: OrderBehavior[] = [\n\tmoveOrder,\n\tholdOrder,\n\tattackOrder,\n\tattackMoveOrder,\n\tfollowPathOrder,\n\tattackPathOrder,\n\tpatrolPathOrder,\n\tattackGroundOrder,\n\tpatrolOrder,\n\tfollowOrder,\n\tharvestOrder,\n\treturnOrder,\n\tbuildOrder,\n\tconstructOrder,\n\trepairOrder,\n\tcastOrder,\n\tpickUpOrder,\n\tdropItemOrder,\n\tboardOrder,\n\tloadOrder,\n\tunloadOrder\n]\n\n/**\n * The systems the engine brings along, by phase: decisions first, then movement, then everything that reacts to where\n * units ended up. Within a phase, in this order. A module can do without any of them by name (`Rules.withoutSystems`),\n * or put its own in place of one by giving a system the same name\n *\n * @beta\n */\nexport const coreSystems: readonly System[] = [\n\ttimerSystem,\n\tabilitySystem,\n\torderSystem,\n\tmovementSystem,\n\tcombatSystem,\n\tconstructionSystem,\n\tproductionSystem,\n\tsupplySystem,\n\tareaSystem,\n\tformSystem,\n\tlifeSystem,\n\tfogSystem,\n\tsequenceSystem,\n\ttransportSystem,\n\tcorpseSystem\n]\n\n/**\n * A game module is the data and rules of one kind of game. The engine knows nothing\n * about peasants or town halls, it gets all of that from here.\n *\n * @public\n */\nexport interface Rules {\n\t/** The game's id, which a save and a server know it by */\n\tid: string\n\t/** What the player sees the game called */\n\tname: string\n\t/** `major.minor.patch`, for mods to say which versions of the game they work with. 1.0.0 when left out */\n\tversion?: string\n\t/** The mods on it, with their versions, when it was made with `composeGame` */\n\tmods?: { id: string; version: string; hash?: string }[]\n\t/**\n\t * Players a map of the game may have, besides the neutral and the creeps: 8 when left out, 32 at most\n\t * (`MAX_MAP_PLAYERS`). A map with more is refused, saying so, not cut\n\t */\n\tmaxPlayers?: number\n\t/** The unit types of the game */\n\tunits: UnitTypeDef[]\n\t/**\n\t * The sides players can play, each with its own roster (`UnitTypeDef.race`): none when left out, and with that no\n\t * race anywhere. The first is what a player plays when nobody chose\n\t */\n\traces?: RaceDef[]\n\t/** The upgrades of the game; none when left out */\n\tupgrades?: UpgradeDef[]\n\t/** The abilities of the game; none when left out */\n\tabilities?: AbilityDef[]\n\t/** The buffs of the game; none when left out */\n\tbuffs?: BuffDef[]\n\t/** The items of the game; none when left out */\n\titems?: ItemDef[]\n\t/**\n\t * The tags of its items named and given a look, and which of them a shop filters by (`TagDef`). A tag no\n\t * definition names still works, shown as its word. None when left out\n\t *\n\t * @beta\n\t */\n\ttags?: TagDef[]\n\t/**\n\t * The default sets the game took (`useDefaults`), what it chose of each, and how to choose again (what a\n\t * `data.json`'s `defaults` does). Set by `useDefaults`, never by hand\n\t *\n\t * @beta\n\t */\n\tdefaults?: ChosenDefaults\n\t/** What players have amounts of and pay with, in the order they are shown. None when left out */\n\tresources?: ResourceDef[]\n\t/** The resource prices, bounties, revives and sales are in. The first resource when left out */\n\tcurrency?: ResourceId\n\t/** The tiers of upkeep, by supply used; none when left out */\n\tupkeep?: UpkeepTier[]\n\t/** Stats of the game's own, next to the engine's (`CoreStats`). Units, buffs, items and upgrades change them, and abilities scale with them, like any other */\n\tstats?: StatDef[]\n\t/** Day and night. Always day when left out */\n\tday?: DayCycle\n\t/** The numbers of the game that are not about any one unit, like the supply cap. The engine's for those left out */\n\tsettings?: RuleSettingsInit\n\t/**\n\t * Kinds of effects abilities can have, next to the ones the engine knows (`defineEffect`): one of a type the engine has\n\t * takes its place\n\t */\n\teffects?: EffectType[]\n\t/**\n\t * Ways of aiming an ability of the game's own (`defineTargeting`), next to the engine's (`AimKind`): named by an\n\t * ability's `target`\n\t */\n\ttargetings?: Targeting[]\n\t/** Extra order types, or replacements for the core ones */\n\torders?: OrderBehavior[]\n\t/**\n\t * Formations of its own for units ordered to a point together (`FormationDef`), next to the engine's `rows`,\n\t * `circle`, `square` and `none`, or in place of one of the same id. Which an order takes is the order's to say\n\t * (`OrderInit.formation`), and the rules' where it does not (`RuleSettings.movement.formation`)\n\t */\n\tformations?: FormationDef[]\n\t/** Commands of the game's own, made with `defineCommand`, or replacements for the core ones */\n\tcommands?: CommandDef[]\n\t/** Types of the engine's own commands, or a pack's, the module does without (`coreCommands`, `heroCommands`) @beta */\n\twithoutCommands?: string[]\n\t/** Types of the engine's own orders, or a pack's, the module does without: a unit is then never given one @beta */\n\twithoutOrders?: string[]\n\t/**\n\t * The parts of the rules the game opts into, with what they bring (`GamePack`): `[heroesPack()]` for heroes, camps\n\t * and shops. None when left out. The game's own commands, orders, systems and hooks come after a pack's, and one of\n\t * the same id takes its place\n\t *\n\t * @beta\n\t */\n\tpacks?: GamePack[]\n\t/**\n\t * Systems of the game's own. They run after the core ones unless they give a phase (see `System`); one with the name\n\t * of a core system takes its place, and its phase too unless it gives its own. A function makes a system for each\n\t * world: what keeps state between ticks has to be made that way, or every game made from the module shares it\n\t */\n\tsystems?: SystemDef[]\n\t/** Names of the engine's own systems the module does without (see `coreSystems`) */\n\twithoutSystems?: string[]\n\t/** Handlers of hooks: how the module takes part in damage, deaths, orders. One with the id of a core one takes its place */\n\thooks?: HookDef[]\n\t/** Ids of the engine's own hook handlers the module does without, like `bounty` (see `coreHooks`) */\n\twithoutHooks?: string[]\n\t/** How the game reacts to events, the engine's and its own (see `defineListener`) */\n\tlisteners?: ListenerDef[]\n\t/**\n\t * The state of its own the game keeps (see `defineComponent`): on entities, players and the world. Given here as\n\t * timers and listeners are, so that a world knows who is told which (`replicate`) from its own game, and not from\n\t * whatever else the process has loaded. One used without being listed is an error (`UnlistedError`): no world\n\t * finds it, so a save or a snapshot would lose it\n\t */\n\tcomponents?: Component<any>[]\n\t/** The events of its own the game emits (see `defineEvent`): given here for the same reason */\n\tevents?: EventKey<any>[]\n\t/** Parts of the map the rules watch: who walks in and out (see `AreaDef`) */\n\tareas?: AreaDef[]\n\t/** Groups of things the game spawns as one (see `definePrefab`, `world.spawnPrefab`); a designer's from the editor through `prefabsFrom` */\n\tprefabs?: PrefabDef[]\n\t/** What the game sets to go off later (see `defineTimer`): given here, so that a save finds them by id */\n\ttimers?: TimerDef[]\n\t/** Scripts of steps the game starts, like a mission's (see `defineSequence`): given here, so that a save finds them */\n\tsequences?: SequenceDef[]\n\t/** Files of the game's own data its rules read as they run, and a panel edits (see `defineGameFile`, `registry.file`) */\n\tfiles?: GameFileDef<unknown>[]\n\t/** Decides who is out and who won. The last team with a building, when left out. Null for a game nobody can lose */\n\tvictory?: SystemDef | null\n\t/**\n\t * How its saves outlive its patches (`SaveRules`): the version of what it keeps in a save, the steps that bring an\n\t * older save up to it, and what becomes of a save made with other rules. A game that declares it, even empty, loads\n\t * the saves made before a patch; one that does not refuses every save not made with its very rules, as a test wants\n\t */\n\tsaves?: SaveRules\n\t/**\n\t * Runs once a world is loaded from a save, everything put back: for what a game keeps outside the world, to make\n\t * again from what is in it\n\t */\n\tafterLoad?: (world: World) => void\n\t/**\n\t * Runs as a world takes a new version of the game while it runs (hot reload, `reloadGame`), the new version's: for\n\t * what the game made of the old one (a cache of its definitions, a state worked out of them), to make again. What\n\t * else hears it: `world.events.on(gameReloaded, …)`, and a screen's `GameView.on`\n\t */\n\tonReload?: (world: World) => void\n\t/** What the game does on a server, around its games: who joins and leaves, the start and the end (see `ServerHooks`) */\n\tserver?: ServerHooks\n\t/** What a player starts a map with, for players the map places nothing for: a hall and workers as data, or a function (`StartingBase`) */\n\tstartingBase?: StartingBase\n\t/**\n\t * The brains of its computer players (`defineBrain`), given here as components and timers are, so that a save that\n\t * remembers a seat by its brain's id (`world.computers.seat`) finds the brain again when loaded. The first is what a\n\t * seat that names no brain gets: `meleeBrain` of `@v12-engine/engine/ai` for a game played as melee, or a computer\n\t * player of the game's own (`defineComputer`). None listed: the game has no computer player, and seating one throws\n\t */\n\tbrains?: BrainDef[]\n\t/**\n\t * What it says of its computer players' profiles (`GameAi`, AI plan D1): difficulties and personalities of its own\n\t * beside the engine's, defaults over the engine's, and whether a lobby offers each seat a difficulty and a\n\t * personality (`seatSettingsOf`)\n\t */\n\tai?: GameAi\n\t/**\n\t * What the ground of its maps can be painted with, in order: the first is index 1 of `Terrain.tiles`, 0 being no\n\t * paint (see `TileDef`). What each looks like is the view's (`GameView.ground.tiles`)\n\t */\n\ttiles?: TileDef[]\n\t/**\n\t * Its own layers of cells, for its rules to read and the editor to paint: where the bushes are (see `CellLayerDef`).\n\t * Any layer can be read and set by id whether it is listed or not; listed, the editor offers it\n\t */\n\tcellLayers?: CellLayerDef[]\n\t/** Numbers of its rules to be tuned while it plays (`defineTunable`), read with `world.tunable(id)` */\n\ttunables?: TunableDef[]\n\t/**\n\t * The maps the game ships (S36): a world made from one of them keeps, in its save and in the welcome a server sends,\n\t * only what changed of its ground, and whoever reads it finds the rest here (by its name and the ground it makes).\n\t * Not in the game's hash. A map not among them, or changed since, is kept whole, as before\n\t */\n\tmaps?: readonly GameMap[]\n\t/**\n\t * Its generator of maps (`MapGenerator`, `generateMap`): what the editor's New map from a generator and the page's\n\t * Random map make a map with, its parameters as their sliders. None when left out: the engine's `presetGenerator`\n\t * is there to take, with the game's trees and rocks\n\t */\n\tgenerator?: MapGenerator\n\t/**\n\t * Which fields of its definitions the editor's Data panel may change (S61): `all`, or by kind (`units`,\n\t * `abilities`, `buffs`, `items`, `upgrades`) all of them, some (their paths, `stats.health`, or fields said in full,\n\t * with bounds and a kind), or each definition's own in code. None when left out. What is changed there is kept in\n\t * the game's `data.json`, which the game reads over its code with `layData`\n\t */\n\teditable?: EditableData\n\t/**\n\t * How its worlds find their way: the radius the walkable ground is cut for, how steep it may be, how many units the\n\t * crowd makes room for at first (`maxAgents`), the sizes it is cut for (`radii`: `'auto'` unless said, a navigation for\n\t * each size of ground unit the game has). What a world is made with (`CreateWorldOptions.navigation`) goes over it\n\t */\n\tnavigation?: GameNavigationOptions\n\t/**\n\t * What a route of a ground unit knows of the buildings in its way (determinism plan F2): `all` of them (the default),\n\t * as the ground is; or only those its side has `seen`, so the way it goes in the dark says nothing of what is there.\n\t * With `seen`, each side has a navigation of its own to plan on, of what it knows: a few megabytes a side on a big\n\t * map. Units still walk around every building: they see one before they reach it, and plan again\n\t *\n\t * @beta\n\t */\n\tpaths?: 'all' | 'seen'\n\t/**\n\t * How much its worlds say (`world.log`): the least an entry must matter to be said, everything when left out.\n\t * Where the entries go is whoever runs the game's to say (`world.log.to`, the logger a world is made under)\n\t */\n\tlog?: { level?: LogLevel }\n\t/**\n\t * What becomes of a part of the game that throws (a hook's handler, a listener, a system, a timer, an order, a\n\t * command): `throw` (the error goes on: tests), `end` (the game ends there, the players told), `disable` (the part\n\t * is switched off and the game goes on), or a function that says which for each. When left out: a world throws, and\n\t * a server and a launched game end the game (`world.errorPolicy`)\n\t */\n\tonError?: ErrorPolicy\n\t/** What the game brings to the map editor (see `MapEditorDef`) */\n\teditor?: MapEditorDef\n\t/**\n\t * What the game tells each player about itself, beyond what the engine knows: the wave a tower defense is at,\n\t * a score, a countdown. Plain data that survives being sent; it goes into every snapshot as `report`, where the\n\t * game's view (`GameView.hud.status`) puts it on the screen. Only what that player may know\n\t */\n\treport?: (world: World, player: PlayerId) => Record<string, unknown>\n}\n\n/**\n * A seat at a game on a server: a player who joined, or a computer player\n *\n * @beta\n */\nexport interface ServerSeat {\n\t/** The player the seat is for */\n\tplayer: PlayerId\n\t/** The name shown for who sits there */\n\tname: string\n\t/** Whether a computer player plays the seat */\n\tai: boolean\n\t/** Whether someone is connected to it right now */\n\tconnected: boolean\n\t/** The team it plays for, where the mode says: who it is with and against */\n\tteam?: number\n\t/** Whether who sits there said they are ready, in the lobby: once every player seated is, the game starts */\n\tready?: boolean\n\t/** What is chosen for this seat (`ServerHooks.seatSettings`), by name: none where the game has no such settings */\n\tsettings?: Record<string, string>\n\t/** Settings of the seat the mode fixes (`ModeSeat.fixed`: a race the map gives its player), by name: not the lobby's to change */\n\tfixed?: string[]\n\t/** Who sits there, as they are rated (`ratedId`: a hash of their key, safe to show), and their rating in the mode where the server keeps ratings */\n\trated?: string\n\t/** The rating of who sits there in the mode, where the server keeps ratings */\n\trating?: number\n\t/** A vote to let who sits there go (`kick`), in the lobby: how many voted, and how many it takes */\n\tkick?: { votes: number; needed: number }\n}\n\n/**\n * How a game on a server ended: who won, and each seat's outcome\n *\n * @beta\n */\nexport interface GameResult {\n\t/** The id of the game that was played */\n\tgame: string\n\t/** The id of the mode it was played in */\n\tmode: string\n\t/** The winning team, or null for a game that was stopped */\n\twinner: number | null\n\t/** Seconds of game time */\n\tduration: number\n\t/** What the players were told, for a game that ended on an error and not by its rules (`World.failure`) */\n\tfailed?: string\n\t/** Every seat with how it ended for it */\n\tseats: (ServerSeat & { outcome: 'victory' | 'defeat' | 'none' })[]\n}\n\n/**\n * What a game does on a server (`Rules.server`). Only ever run there: a player's screen has none of it. The\n * lobby's settings come to `onGameStart` as the lobby left them\n *\n * @beta\n */\nexport interface ServerHooks {\n\t/** Settings of the lobby, by name: what can be chosen, and what is chosen until someone does */\n\tsettings?: Record<string, LobbySetting>\n\t/**\n\t * Settings of each seat, by name: a race, a difficulty, a colour. Chosen in the lobby by who sits there, and for a\n\t * seat the computer plays or nobody holds, by any player seated; each seat's (`ServerSeat.settings`) are handed to\n\t * its computer player (`GameMode.ai`) and to the start (`onGameStart`)\n\t */\n\tseatSettings?: Record<string, LobbySetting>\n\t/** Someone took a seat in the lobby, or came back to theirs in a game (`world` then) */\n\tonPlayerJoin?(seat: ServerSeat, world?: World): void\n\t/** Someone left their seat: in the lobby, or in a game (`world` then), where they may come back */\n\tonPlayerLeave?(seat: ServerSeat, world?: World): void\n\t/** The game starts, with the world made and the lobby's settings */\n\tonGameStart?(world: World, seats: readonly ServerSeat[], settings: Record<string, string>): void\n\t/** The game ended: who won, as plain data, before it is kept (`saveResult`) */\n\tonGameEnd?(world: World, result: GameResult): void\n\t/** Keeps a game's result: in a file, a database, a ranking. A server writes it to a file of its own without */\n\tsaveResult?(result: GameResult): void | Promise<void>\n}\n\n/**\n * A setting of a lobby or of a seat (`ServerHooks.settings`, `seatSettings`)\n *\n * @beta\n */\nexport interface LobbySetting {\n\t/** What the setting is called in the lobby */\n\tlabel: string\n\t/** What can be chosen, as it is kept */\n\toptions: string[]\n\t/** What each option is shown as, where it is not the option itself */\n\tlabels?: Record<string, string>\n\t/** What is chosen until someone does */\n\tdefault: string\n\t/** Of a seat: no two seats may hold the same (a colour). One held by another seat is not chosen */\n\tunique?: boolean\n}\n\n/**\n * What a new world is made from: terrain, rules, players, seed and navigation\n *\n * @beta\n */\nexport interface CreateWorldOptions extends WorldChecks {\n\t/** The terrain the world stands on */\n\tterrain: Terrain\n\t/** The game's rules the world runs */\n\trules: Rules\n\t/** The players of the world, in order */\n\tplayers: PlayerInit[]\n\t/** The races one is drawn from for a player given `random` (`PlayerInit.race`): all of the game's when left out */\n\trandomRaces?: readonly string[]\n\t/** Seed of the world's random numbers: the same seed gives the same game; 1 when left out */\n\tseed?: number\n\t/**\n\t * Simulation steps per second: 30 when left out. A save made at another rate is refused (`loadWorld`), so a game\n\t * that changes it starts new games\n\t *\n\t * @beta\n\t */\n\ttickRate?: number\n\t/** Options for how the world's units find their way, over the game's (`Rules.navigation`) */\n\tnavigation?: GameNavigationOptions\n\t/**\n\t * Components the app keeps in the world beside the game's own (`Rules.components`): what is the app's, not\n\t * the game's rules (where the screen is played from, a tool's own; `Component.portable` false). Its game's and the\n\t * engine's when left out: one neither lists is an error (`UnlistedError`)\n\t */\n\tcomponents?: readonly Component<unknown, unknown>[]\n\t/** The logger the world's own is made under (`world.log`): a server's, a page's. The root one when left out */\n\tlog?: Logger\n\t/** What becomes of a part of the game that throws, where the game does not say (`Rules.onError`) */\n\tonError?: ErrorPolicy\n}\n\n/**\n * How the engine's events are told to the players, each written beside what emits it, in the order a seat hears them:\n * two told of one event (a hit and its critical number) are told in this order\n */\nconst coreReplications: readonly ReplicatedEvent[] = [\n\ttoldDeath,\n\ttoldCells,\n\ttoldCellsSeen,\n\ttoldRedefined,\n\ttoldEnvironment,\n\ttoldGround,\n\ttoldCommand,\n\ttoldAttack,\n\ttoldAttackCancelled,\n\ttoldDamage,\n\ttoldHeal,\n\ttoldBuffOn,\n\ttoldBuffOff,\n\ttoldTrained,\n\ttoldConstructionStarted,\n\ttoldBuilt,\n\ttoldConstructionCancelled,\n\ttoldUpgradeStarted,\n\ttoldUpgradeCancelled,\n\ttoldMorphed,\n\ttoldRevived,\n\ttoldPicked,\n\ttoldResearched,\n\ttoldShot,\n\ttoldMissileHit,\n\ttoldWindup,\n\ttoldCastCancelled,\n\ttoldChannelStarted,\n\ttoldChannelEnded,\n\ttoldCast,\n\ttoldStrike,\n\ttoldCrit,\n\ttoldMiss,\n\ttoldImpact,\n\ttoldWork,\n\ttoldChop,\n\ttoldLevelUp,\n\ttoldXp,\n\ttoldMana,\n\ttoldResource,\n\ttoldBounty,\n\ttoldMessage,\n\ttoldObjective,\n\ttoldLine,\n\ttoldLineEnded,\n\ttoldCinematic,\n\ttoldCinematicCue,\n\ttoldCamera,\n\ttoldFx,\n\ttoldFxStopped,\n\ttoldRustle,\n\ttoldGust,\n\ttoldPing,\n\ttoldChat\n]\n\n/** What the game tells each player about itself, with its packs' beside it (`Snapshot.report`, `Rules.report`) */\nconst reportPart = snapshotField('report', ({ world, player }) => world.registry.report?.(world, player))\n\n/** The engine's parts of a player's snapshot, each captured by its feature, in their order (`SnapshotField`) */\nconst coreSnapshotParts: readonly SnapshotField[] = [\n\tdebugPart,\n\thourPart,\n\toutcomePart,\n\tprojectilesPart,\n\tmissilesPart,\n\titemsPart,\n\trevealsPart,\n\tareasPart,\n\tcameraPart,\n\teventsPart,\n\treportPart,\n\tscorePart,\n\tscoreLinePart,\n\tcorpsesPart\n]\n\n/**\n * The engine's parts that give an entity something as it is made, or call it off as it leaves its owner: a worker's\n * load, a building's queue, the slots of what carries, a hold\n */\nconst coreParts: readonly Component<unknown, unknown>[] = [gathering, productionQueue, inventorySlots, cargo] as Component<unknown, unknown>[]\n\n/**\n * A game put together with its packs (`assembleGame`): every list the engine runs, the packs' in it, in one place. A\n * pack's parts come before the game's own, so that one of the game's of the same id or name takes its place; what the\n * game leaves out of the engine's (`withoutCommands`, `withoutOrders`, `withoutHooks`, `withoutSystems`) it leaves out\n * of its packs' too\n *\n * @beta\n */\nexport interface AssembledGame {\n\t/** The game the assembly is made of */\n\treadonly rules: Rules\n\t/** The packs' commands and the game's */\n\treadonly commands: readonly CommandDef[]\n\t/** The packs' orders and the game's */\n\treadonly orders: readonly OrderBehavior[]\n\t/** The packs' systems, as given (made for each world, and left out by name then: `withoutSystems`) */\n\treadonly packSystems: readonly SystemDef[]\n\t/** The hooks of the packs and the game */\n\treadonly hooks: readonly HookDef[]\n\t/** The listeners of the packs and the game */\n\treadonly listeners: readonly ListenerDef[]\n\t/** The packs' kinds of effects (`GamePack.effects`), before the game's own */\n\treadonly effects: readonly EffectType[]\n\t/** The timers of the packs and the game */\n\treadonly timers: readonly TimerDef[]\n\t/** The components of the engine, packs and game */\n\treadonly components: readonly Component<unknown, unknown>[]\n\t/** The events of the packs and the game */\n\treadonly events: readonly EventKey<unknown>[]\n\t/** The fields of stats the packs and the game add */\n\treadonly statFields: readonly StatField[]\n\t/** The stats of the game: its packs' (`GamePack.stats`), then its own (`Rules.stats`) */\n\treadonly stats: readonly StatDef[]\n\t/** The packs' ways of telling the players of the world's events (`GamePack.replications`) */\n\treadonly replications: readonly ReplicatedEvent[]\n\t/** The packs' parts of the players' snapshots (`GamePack.snapshotFields`) */\n\treadonly snapshotFields: readonly SnapshotField[]\n\t/** The game's rules with what each pack lays over them, in order */\n\treadonly settings: RuleSettingsInit\n\t/** The game's report of a player at the end, with each pack's beside it: none where none says */\n\treadonly report: ((world: World, player: PlayerId) => Record<string, unknown>) | null\n\t/** How it is won: the game's own where it says, else the last pack's that says, else the engine's (`lastTeamStanding`) */\n\treadonly victory: SystemDef | null | undefined\n\t/** What the game and its packs find wrong with a map, in the editor */\n\treadonly check: ((map: GameMap, registry: Registry) => MapProblem[]) | undefined\n}\n\n/** Each game's assembly, made once */\nconst assemblies = new WeakMap<Rules, AssembledGame>()\n\n/**\n * A game with its packs put together (`AssembledGame`): what the registry, the systems, the hooks, the listeners and the\n * timers of a world of it are made of. Refuses a pack without one it says it goes with (`GamePack.requires`)\n *\n * @beta\n */\nexport function assembleGame(game: Rules): AssembledGame {\n\tconst known = assemblies.get(game)\n\tif (known) return known\n\tconst packs = game.packs ?? []\n\tfor (const pack of packs)\n\t\tfor (const needed of pack.requires ?? [])\n\t\t\tif (!packs.some((each) => each.id === needed))\n\t\t\t\tthrow new Error(`The pack \"${pack.id}\" goes with the pack \"${needed}\", which \"${game.id}\" does not have`)\n\tconst from = <T>(pick: (pack: GamePack) => readonly T[] | undefined): T[] => packs.flatMap((pack) => pick(pack) ?? [])\n\tconst withoutCommands = new Set(game.withoutCommands ?? [])\n\tconst withoutOrders = new Set(game.withoutOrders ?? [])\n\tconst withoutHooks = new Set(game.withoutHooks ?? [])\n\tlet settings: RuleSettingsInit = game.settings ?? {}\n\tfor (const pack of packs) {\n\t\tif (!pack.settings) continue\n\t\tconst over = pack.settings(resolveSettings(settings))\n\t\tsettings = overSettings(settings, over)\n\t}\n\tconst reports = [game.report, ...packs.map((pack) => pack.report?.bind(pack))].filter((each) => each !== undefined)\n\tconst checks = [game.editor?.check, ...packs.map((pack) => pack.check?.bind(pack))].filter((each) => each !== undefined)\n\tconst victories = packs.filter((pack) => pack.victory !== undefined)\n\tconst assembly: AssembledGame = {\n\t\trules: game,\n\t\tcommands: [...from((pack) => pack.commands).filter((command) => !withoutCommands.has(command.type)), ...(game.commands ?? [])],\n\t\torders: [...from((pack) => pack.orders).filter((order) => !withoutOrders.has(order.type)), ...(game.orders ?? [])],\n\t\tpackSystems: from((pack) => pack.systems),\n\t\thooks: [...from((pack) => pack.hooks).filter((hook) => !withoutHooks.has(hook.id)), ...(game.hooks ?? [])],\n\t\tlisteners: [...from((pack) => pack.listeners), ...(game.listeners ?? [])],\n\t\teffects: [...from((pack) => pack.effects), ...(game.effects ?? [])],\n\t\ttimers: [...from((pack) => pack.timers), ...(game.timers ?? [])],\n\t\tcomponents: [...from((pack) => pack.components), ...(game.components ?? [])],\n\t\tevents: [...from((pack) => pack.events), ...(game.events ?? [])],\n\t\tstatFields: from((pack) => pack.statFields),\n\t\tstats: [...from((pack) => pack.stats), ...(game.stats ?? [])],\n\t\treplications: from((pack) => pack.replications),\n\t\tsnapshotFields: from((pack) => pack.snapshotFields),\n\t\tsettings,\n\t\treport: reports.length ? (world, player) => Object.assign({}, ...reports.map((report) => report!(world, player))) : null,\n\t\tvictory: game.victory !== undefined ? game.victory : victories.at(-1)?.victory,\n\t\tcheck: checks.length ? (map, registry) => checks.flatMap((check) => check!(map, registry)) : undefined\n\t}\n\tassemblies.set(game, assembly)\n\treturn assembly\n}\n\n/**\n * Everything a game module defines, looked up by id: with the engine's own components, and those an app keeps in its\n * worlds (`own`: `CreateWorldOptions.components`)\n *\n * @public\n */\nexport function createRegistry(game: Rules, own: readonly Component<unknown, unknown>[] = []): Registry {\n\tconst registry = new Registry()\n\tregistry.defineCore(coreComponents())\n\tconst assembly = assembleGame(game)\n\tregistry.assembly = assembly\n\tconst withoutOrders = new Set(game.withoutOrders ?? [])\n\tfor (const order of coreOrders) if (!withoutOrders.has(order.type)) registry.orders.define(order)\n\tfor (const order of assembly.orders) registry.orders.define(order)\n\tfor (const formation of coreFormations) registry.formations.define(formation)\n\tfor (const formation of game.formations ?? []) registry.formations.define(formation)\n\tconst withoutCommands = new Set(game.withoutCommands ?? [])\n\tfor (const command of [\n\t\t...(coreCommands as readonly CommandDef[]).filter((command) => !withoutCommands.has(command.type)),\n\t\t...debugCommands,\n\t\t...foliageDebugCommands,\n\t\ttuneCommand,\n\t\tredefineCommand\n\t])\n\t\tregistry.commands.define(command as CommandDef)\n\tfor (const command of assembly.commands) registry.commands.define(command)\n\tfor (const kind of [...coreEffects, ...summonEffects, ...dispelEffects, ...assembly.effects]) registry.effects.define(kind)\n\tfor (const targeting of game.targetings ?? []) registry.targetings.define(targeting)\n\tfor (const buff of game.buffs ?? []) registry.buffs.define(buff)\n\tfor (const ability of game.abilities ?? []) registry.abilities.define(ability)\n\tfor (const item of game.items ?? []) registry.items.define(itemTier(item) === item.tier ? item : { ...item, tier: itemTier(item) })\n\tfor (const tag of game.tags ?? []) registry.tags.define(tag)\n\tfor (const prefab of game.prefabs ?? []) registry.prefabs.define(prefab)\n\tregistry.upkeep = [...(game.upkeep ?? [])].sort((a, b) => a.above - b.above)\n\tregistry.game = game.id\n\tregistry.module = game\n\tregistry.day = game.day ?? null\n\tregistry.settings = resolveSettings(assembly.settings)\n\tregistry.score = resolveScore(registry.settings.score, game)\n\tregistry.report = assembly.report\n\tregistry.resources = [...(game.resources ?? [])]\n\tregistry.currency = game.currency ?? game.resources?.[0]?.id ?? null\n\tregistry.tiles = checkTiles(game.tiles ?? [])\n\tregistry.cellLayers = game.cellLayers ?? []\n\tregistry.tunables = [...(game.tunables ?? [])]\n\tregistry.defineParts([...assembly.components, ...own], assembly.events)\n\t// what each part gives an entity as it is made, and calls off as it leaves its owner: the engine's, then the game's\n\tconst parts = [...coreParts, ...assembly.components]\n\tregistry.spawning = parts.filter((part) => part.onSpawn)\n\tregistry.leaving = parts.filter((part) => part.onLeave)\n\tregistry.passing = parts.filter((part) => part.passable)\n\tdefineStats(registry, assembly.stats)\n\tregistry.statFields = [...assembly.statFields]\n\tregistry.replications = [...coreReplications, ...assembly.replications]\n\tregistry.snapshotFields = [...coreSnapshotParts, ...assembly.snapshotFields]\n\tfor (const race of game.races ?? []) registry.races.define(race)\n\tfor (const file of game.files ?? []) registry.setFile(file, file.read(file.data))\n\tfor (const unit of game.units) registry.units.define(unit)\n\tfor (const upgrade of game.upgrades ?? []) registry.upgrades.define(upgrade)\n\tcheckCosts(game)\n\tcheckRaces(game)\n\tcheckStats(game, new Set(registry.statKeys))\n\tcheckSaves(game)\n\treturn registry\n}\n\n/**\n * Throws when what a game says of its saves cannot be: a version that is no whole number from 1, or a step from a\n * version the game is not past yet, which would never run\n */\nfunction checkSaves(game: Rules): void {\n\tconst { version = 1, migrate } = game.saves ?? {}\n\tif (!Number.isInteger(version) || version < 1)\n\t\tthrow new Error(`The version of the saves of \"${game.id}\" is a whole number from 1, not ${String(version)}`)\n\tif (typeof migrate !== 'object') return\n\tfor (const from of Object.keys(migrate).map(Number)) {\n\t\tif (!Number.isInteger(from) || from < 1 || from >= version) {\n\t\t\tthrow new Error(\n\t\t\t\t`\"${game.id}\" has a step for saves of version ${from}, and its saves are of version ${version}: the steps are from 1 to ${version - 1}, each to the version after it`\n\t\t\t)\n\t\t}\n\t}\n}\n\n/** The game's tiles, as they are: throws for one that is there twice, or for too many to keep in a byte */\nfunction checkTiles(tiles: TileDef[]): TileDef[] {\n\tif (tiles.length > MAX_TILES) throw new Error(`A game has at most ${MAX_TILES} tiles, not ${tiles.length}`)\n\tconst seen = new Set<string>()\n\tfor (const tile of tiles) {\n\t\tif (seen.has(tile.id)) throw new Error(`The tile \"${tile.id}\" is there twice`)\n\t\tseen.add(tile.id)\n\t}\n\treturn [...tiles]\n}\n\n/** The game's own stats next to the engine's, and what every unit starts with of them */\nfunction defineStats(registry: Registry, stats: readonly StatDef[]): void {\n\tconst defaults: Record<string, number> = { ...noStats() }\n\tfor (const stat of stats) {\n\t\tif (stat.id in defaults) throw new Error(`The stat \"${stat.id}\" is there twice, or is one of the engine's`)\n\t\tdefaults[stat.id] = stat.default ?? 0\n\t}\n\tregistry.stats = [...stats]\n\tregistry.statKeys = Object.keys(defaults)\n\tregistry.statDefaults = Object.freeze(defaults) as Stats\n}\n\n/**\n * Throws when something changes or scales with a stat the game does not have: most likely a typo, which would\n * otherwise do nothing, or turn a stat into NaN. Stats are any text to the type checker, so this is where it is caught\n */\nfunction checkStats(game: Rules, known: Set<string>): void {\n\tconst check = (what: string, keys: object | undefined, also: string[] = []) => {\n\t\tfor (const key in keys) if (!known.has(key) && !also.includes(key)) throw new Error(`${what} has the stat \"${key}\", which the game does not have`)\n\t}\n\tconst change = (what: string, change: { stats?: object; percent?: object } | undefined) => {\n\t\tcheck(what, change?.stats)\n\t\tcheck(what, change?.percent)\n\t}\n\t// scaling can be anywhere in a tree of effects\n\tconst scaling = (what: string, within: unknown): void => {\n\t\tif (typeof within !== 'object' || within === null) return\n\t\tfor (const [key, value] of Object.entries(within)) {\n\t\t\tif (key === 'scaling' || key === 'shieldScaling') check(what, value as object, ['level', 'bonusAttackDamage'])\n\t\t\telse scaling(what, value)\n\t\t}\n\t}\n\tfor (const unit of game.units) {\n\t\tcheck(`Unit type \"${unit.id}\"`, unit.stats)\n\t\tchange(`The growth of \"${unit.id}\"`, unit.hero?.growth)\n\t\tfor (const [i, attack] of (unit.attacks ?? []).entries())\n\t\t\tfor (const stat of Object.values(attack.stats ?? {}))\n\t\t\t\tif (!known.has(stat)) throw new Error(`Attack ${i + 1} of \"${unit.id}\" reads the stat \"${stat}\", which the game does not have`)\n\t}\n\tfor (const buff of game.buffs ?? []) {\n\t\tchange(`Buff \"${buff.id}\"`, buff)\n\t\tscaling(`Buff \"${buff.id}\"`, buff)\n\t}\n\tfor (const item of game.items ?? []) change(`Item \"${item.id}\"`, item.bonus)\n\tfor (const upgrade of game.upgrades ?? []) for (const effect of upgrade.effects) change(`Upgrade \"${upgrade.id}\"`, effect)\n\tfor (const ability of game.abilities ?? []) scaling(`Ability \"${ability.id}\"`, ability)\n}\n\n/**\n * Throws when something costs a resource the game does not have: a typo, or something that is not a resource at\n * all, like supply. Either would otherwise make it something nobody can ever afford, without a word\n */\nfunction checkCosts(game: Rules): void {\n\tconst known = new Set((game.resources ?? []).map((resource) => resource.id))\n\tif (game.currency !== undefined && !known.has(game.currency)) throw new Error(`The currency \"${game.currency}\" is not a resource of the game`)\n\tconst check = (what: string, cost: Cost | undefined) => {\n\t\tfor (const kind in cost) if (!known.has(kind)) throw new Error(`${what} costs \"${kind}\", which is not a resource of the game`)\n\t}\n\tfor (const unit of game.units) check(`Unit type \"${unit.id}\"`, unit.cost)\n\tfor (const upgrade of game.upgrades ?? []) check(`Upgrade \"${upgrade.id}\"`, upgrade.cost)\n\tfor (const item of game.items ?? []) check(`Item \"${item.id}\"`, item.cost)\n}\n\n/**\n * How a game's worlds find their way (`Rules.navigation`): `RecastNavigationOptions`, with `radii` also `'auto'`\n * (the default) or `false`\n *\n * @beta\n */\nexport type GameNavigationOptions = Omit<RecastNavigationOptions, 'radii'> & {\n\t/**\n\t * The sizes the ground is cut for. `'auto'` (when left out): the ground units' radii in three groups, up to 0.5, up\n\t * to 0.75 and over, a navigation for each group the game has a unit type in (the first cut for 0.5 at least, the\n\t * others for their group's largest radius), so an ogre keeps from walls as far as it needs where a footman still\n\t * fits through a gap. `false`: one navigation cut for `agentRadius` (0.5), as it was. A list: a navigation for\n\t * each size, a unit on the one for the biggest size it is not smaller than. Each size has its own crowd (see\n\t * `SizedNavigation`)\n\t */\n\tradii?: number[] | 'auto' | false\n}\n\n/** Where the groups of ground units' radii end (the last group is over the last edge) */\nconst BUCKET_EDGES = [0.5, 0.75]\n\n/**\n * The sizes the ground units of a game are cut for (`radii: 'auto'`): their radii in groups (up to 0.5, up to 0.75,\n * over), each cut for its largest radius (the first for 0.5 at least), a group only where a unit type falls in it. Each\n * with the radius of the biggest unit it takes, `upTo`. What flies or sails has navigation of its own\n */\nexport function autoNavigationSizes(registry: Registry): { radius: number; upTo: number }[] {\n\tconst largest: number[] = new Array(BUCKET_EDGES.length + 1).fill(0)\n\tfor (const def of registry.units.all()) {\n\t\tif (def.kind !== 'unit' || def.flying || def.naval) continue\n\t\tconst bucket = BUCKET_EDGES.findIndex((edge) => def.radius <= edge)\n\t\tconst i = bucket < 0 ? BUCKET_EDGES.length : bucket\n\t\tlargest[i] = Math.max(largest[i], def.radius)\n\t}\n\tconst sizes: { radius: number; upTo: number }[] = []\n\tlargest.forEach((radius, i) => {\n\t\tif (radius > 0) sizes.push({ radius: i === 0 ? Math.max(radius, 0.5) : radius, upTo: i < BUCKET_EDGES.length ? BUCKET_EDGES[i] : Infinity })\n\t})\n\treturn sizes\n}\n\n/**\n * The ground's navigation: cut for a unit of ordinary size (0.5), for each size the game names (`radii`), or for each\n * group of sizes its unit types are in (`autoSizes`), each unit on the one for its size. Big ones on one cut for 0.5\n * fit through the same gaps and overlap walls a little, which is better than everyone keeping the distance from a wall\n * that the biggest unit in the game needs\n */\nasync function groundNavigationOf(\n\tterrain: Terrain,\n\toptions: RecastNavigationOptions = {},\n\tautoSizes?: { radius: number; upTo: number }[]\n): Promise<Navigation> {\n\tconst named = [...new Set(options.radii ?? [])].sort((a, b) => a - b)\n\tconst wanted: { radius: number; upTo?: number }[] = autoSizes ?? named.map((radius) => ({ radius }))\n\t// ground with nothing to walk on (a sea) is cut once: Recast cannot hold two navigations of an empty ground\n\tif (wanted.length < 2 || !terrain.buildMesh(true).indices.length) {\n\t\treturn RecastNavigation.create(terrain, { agentRadius: wanted[0]?.radius ?? 0.5, ...options, radii: undefined })\n\t}\n\t// built side by side (a worker each, where the builder has them), kept in the order of their sizes\n\tconst navigations = await allOrFreed(wanted.map(({ radius }) => () => RecastNavigation.create(terrain, { ...options, agentRadius: radius, radii: undefined })))\n\treturn new SizedNavigation(wanted.map(({ radius, upTo }, i) => ({ radius, upTo, navigation: navigations[i] })))\n}\n\n\n/**\n * The navigations the sides plan their routes on (`Rules.paths: 'seen'`): one for each team that plays, cut for\n * the game's smallest unit. None where routes know everything\n */\nasync function sidePathsOf(\n\tgame: Rules,\n\tterrain: Terrain,\n\tplayers: readonly { team: number; neutral?: boolean; creeps?: boolean }[],\n\toptions: RecastNavigationOptions\n): Promise<SidePaths | undefined> {\n\tif (game.paths !== 'seen') return undefined\n\tconst teams = [...new Set(players.filter((player) => !player.neutral && !player.creeps).map((player) => player.team))].sort((a, b) => a - b)\n\tconst radius = Math.min(...(options.radii?.length ? options.radii : [options.agentRadius ?? 0.5]))\n\treturn SidePaths.create(terrain, teams, { ...options, agentRadius: radius })\n}\n\n/** Where boats go, on a map with deep water: a navigation of the water at its surface. Nothing on one without */\nasync function waterNavigationOf(terrain: Terrain, options?: RecastNavigationOptions): Promise<RecastNavigation | undefined> {\n\tif (!terrain.hasDeepWater) return undefined\n\t// boats are cut for one size: the smallest the game names\n\treturn RecastNavigation.create(terrain, {\n\t\tagentRadius: 0.5,\n\t\t...options,\n\t\t...(options?.radii?.length && { agentRadius: Math.min(...options.radii) }),\n\t\tsurface: 'water'\n\t})\n}\n\n/**\n * Makes a world from terrain, rules and players; resolves once it is ready to step\n *\n * @public\n */\nexport async function createWorld(options: CreateWorldOptions): Promise<World> {\n\tconst { terrain, rules: game, players, seed } = options\n\tconst registry = createRegistry(game, options.components)\n\n\tconst world = await makeWorld(game, registry, terrain, {\n\t\tplayers: players.map((player) => ({ ...player, resources: startingResources(game, player) })),\n\t\tnavigation: options.navigation,\n\t\trandomRaces: options.randomRaces,\n\t\tseed,\n\t\ttickRate: options.tickRate,\n\t\tlog: options.log,\n\t\tonError: options.onError,\n\t\tchecks: options.checks\n\t})\n\t// what each race starts its players with, once the races are settled (one drawn for those given random)\n\traceResources(world, players)\n\t// what each side knows without seeing, as it is put down from now (`Rules.paths: 'seen'`)\n\tworld.sidePaths?.attach(world)\n\treturn world\n}\n\n/**\n * A world of a game on a terrain, its navigations built (freed again where what follows fails), its parts the game's put\n * together with its packs (`assembleGame`): what a world made new and a world loaded from a save have in common\n */\nasync function makeWorld(\n\tgame: Rules,\n\tregistry: Registry,\n\tterrain: Terrain,\n\toptions: WorldChecks & {\n\t\tplayers: PlayerInit[]\n\t\tnavigation?: GameNavigationOptions\n\t\trandomRaces?: readonly string[]\n\t\tseed?: number\n\t\ttickRate?: number\n\t\tlog?: Logger\n\t\tonError?: ErrorPolicy\n\t}\n): Promise<World> {\n\tconst { radii, ...given } = { ...game.navigation, ...options.navigation }\n\tconst navigationOptions: RecastNavigationOptions = {\n\t\t// slow ground weighed by the ways, where the game has any (EN2)\n\t\t...(hasGroundSpeeds(registry) && { speedAt: (x: number, z: number) => navigationSpeedOn(registry, terrain, x, z) }),\n\t\t...given,\n\t\t...(Array.isArray(radii) && { radii })\n\t}\n\t// the sizes of its ground units, where the game names none and no one size is asked for\n\tconst auto = radii === undefined || radii === 'auto'\n\tconst sizes = auto && given.agentRadius === undefined ? autoNavigationSizes(registry) : undefined\n\t// the ground's, the water's and the sides' built side by side: none waits on another (a worker each, where the\n\t// builder has them)\n\tconst [navigation, waterNavigation, sidePaths] = (await allOrFreed<{ dispose(): void } | undefined>([\n\t\t() => groundNavigationOf(terrain, navigationOptions, sizes),\n\t\t() => waterNavigationOf(terrain, navigationOptions),\n\t\t() => sidePathsOf(game, terrain, options.players, navigationOptions)\n\t])) as [Navigation, RecastNavigation | undefined, SidePaths | undefined]\n\tconst assembly = registry.assembly!\n\treturn freedOnError(navigation, () =>\n\t\tfreedOnError(\n\t\t\twaterNavigation,\n\t\t\t() =>\n\t\t\t\tnew World({\n\t\t\t\t\tterrain,\n\t\t\t\t\tnavigation,\n\t\t\t\t\twaterNavigation,\n\t\t\t\t\tsidePaths,\n\t\t\t\t\tregistry,\n\t\t\t\t\tplayers: options.players,\n\t\t\t\t\trandomRaces: options.randomRaces,\n\t\t\t\t\tseed: options.seed,\n\t\t\t\t\ttickRate: options.tickRate,\n\t\t\t\t\tlog: options.log,\n\t\t\t\t\tlogLevel: game.log?.level,\n\t\t\t\t\tonError: game.onError ?? options.onError,\n\t\t\t\t\tchecks: options.checks,\n\t\t\t\t\tsystems: (world) => systemsOf(world, assembly),\n\t\t\t\t\thooks: hooksOf(assembly),\n\t\t\t\t\tlisteners: listenersOf(assembly),\n\t\t\t\t\tareas: game.areas,\n\t\t\t\t\ttimers: timersOf(assembly),\n\t\t\t\t\tsequences: game.sequences\n\t\t\t\t})\n\t\t)\n\t)\n}\n\n/**\n * Runs what makes something of a navigation already made: the navigation is freed when it fails (WebAssembly memory,\n * which nothing else would free), and the error goes on\n */\nasync function freedOnError<T>(navigation: { dispose(): void } | undefined, make: () => T | Promise<T>): Promise<T> {\n\ttry {\n\t\treturn await make()\n\t} catch (error) {\n\t\tnavigation?.dispose()\n\t\tthrow error\n\t}\n}\n\n/** Runs what is done to a world just made: the world is disposed when it fails, and the error goes on */\nasync function disposedOnError(world: World, run: () => void | Promise<void>): Promise<World> {\n\ttry {\n\t\tawait run()\n\t\treturn world\n\t} catch (error) {\n\t\tworld.dispose()\n\t\tthrow error\n\t}\n}\n\n/**\n * What a player starts with: what they were given, or else what the game starts everyone with (nothing, for the\n * neutral players). Every resource of the game is in it, at 0 at least\n */\nfunction startingResources(game: Rules, player: PlayerInit): Purse {\n\tconst purse: Purse = {}\n\tfor (const resource of game.resources ?? []) {\n\t\tpurse[resource.id] = player.resources ? (player.resources[resource.id] ?? 0) : player.neutral ? 0 : (resource.start ?? 0)\n\t}\n\treturn { ...player.resources, ...purse }\n}\n\n/**\n * The engine's hook handlers without the ones the module does without, then the module's own\n *\n * @beta\n */\nexport interface LoadWorldOptions extends WorldChecks {\n\t/** The game module the save was made with, by id. A save holds no code: rules come from here */\n\trules: Rules\n\t/**\n\t * The map it is loaded on (a scene that opens its map again): its definitions are laid over the game's in place\n\t * of those the save kept (`GameMap.definitions`). The save's own when left out\n\t */\n\tmap?: Pick<GameMap, 'definitions'>\n\t/** Options for how the world's units find their way, over the game's (`Rules.navigation`) */\n\tnavigation?: GameNavigationOptions\n\t/** Components the app keeps in the world beside the game's own, as `CreateWorldOptions.components`: those of the world saved */\n\tcomponents?: readonly Component<unknown, unknown>[]\n\t/**\n\t * Loads a save made with other rules of the game (its code or its mods changed since) whatever the game says of\n\t * those (`Rules.saves.onMismatch`). An older version of its saves is brought up to date all the same\n\t */\n\tanyVersion?: boolean\n\t/** The logger the world's own is made under, as `CreateWorldOptions.log` */\n\tlog?: Logger\n\t/** What becomes of a part of the game that throws, as `CreateWorldOptions.onError` */\n\tonError?: ErrorPolicy\n\t/** The maps a save's ground may be one of (S36): the game's own (`Rules.maps`) when left out */\n\tmaps?: readonly GameMap[]\n}\n\n/**\n * A world from a save (see `saveWorld`), carrying on where it was. A save made before, by an older engine or by the\n * game before a patch, is brought up to date first (`updateSave`), or refused with a `SaveError` that says why.\n * Navigation is built again; units come back with the speed and destination they had, but the way they find around\n * each other is worked out anew, so the game from there on is close to, and not quite, the one that was saved\n *\n * @public\n */\nexport async function loadWorld(saved: WorldSave, options: LoadWorldOptions): Promise<World> {\n\t// the definitions of the map it was made from laid over the game again (RC8): the map's it is loaded on, where the\n\t// caller says one, else those the save kept. Its rules hash has them: a save of other definitions is the game's\n\t// mismatch (`SaveRules.onMismatch`)\n\tconst kept = (saved.state?.[mapInfo.id] as { definitions?: GameData } | undefined)?.definitions\n\tconst definitions = options.map ? options.map.definitions : kept\n\tconst game = definitions ? layData(options.rules, definitions) : options.rules\n\tconst registry = createRegistry(game, options.components)\n\t// as the game reads it now, or refused, before anything is built for it\n\tconst save = updateSave(saved, registry, { anyVersion: options.anyVersion })\n\t// all of the ground, or the map the world was made from and what changed of it (S36): that map is one of the game's\n\tlet ground: ReturnType<typeof groundOf>\n\ttry {\n\t\tground = groundOf(save.terrain, options.maps ?? game.maps, game)\n\t} catch (error) {\n\t\tif (error instanceof MissingGround) throw new SaveError(`Save: ${error.message}`, 'ground')\n\t\tthrow error\n\t}\n\tconst { terrain } = ground\n\tconst world = await makeWorld(game, registry, terrain, {\n\t\tplayers: savedPlayers(save),\n\t\tnavigation: options.navigation,\n\t\ttickRate: save.tickRate,\n\t\tlog: options.log,\n\t\tonError: options.onError,\n\t\tchecks: options.checks\n\t})\n\t// a save that is refused, or a game's afterLoad that throws, leaves nothing behind\n\treturn disposedOnError(world, () => {\n\t\t// what it started as, for its next save\n\t\tworld.ground = ground.base\n\t\trestoreWorld(world, save)\n\t\t// the gates as the save had them: the obstacles of shut ones are not in it\n\t\tif (save.state && gateStates.id in save.state) setUpGates(world)\n\t\t// the computer players the save remembers, seated again with their memory, before the game looks\n\t\tworld.computers.restore()\n\t\tgame.afterLoad?.(world)\n\t})\n}\n\n/** The systems of a world of the game: the core ones and its packs', but those it leaves out, then its own, then who wins */\nfunction systemsOf(world: World, assembly: AssembledGame): System[] {\n\tconst { rules: game } = assembly\n\tconst make = (def: SystemDef) => (typeof def === 'function' ? def(world) : def)\n\tconst without = new Set(game.withoutSystems ?? [])\n\tconst systems = [...coreSystems, ...assembly.packSystems.map(make)].filter((system) => !without.has(system.name))\n\tfor (const def of game.systems ?? []) {\n\t\tconst system = make(def)\n\t\tconst index = systems.findIndex((core) => core.name === system.name)\n\t\tif (index < 0) systems.push(system)\n\t\t// in place of the core one, and in its phase unless it says\n\t\telse\n\t\t\tsystems[index] = system.phase\n\t\t\t\t? system\n\t\t\t\t: { ...system, phase: systems[index].phase, update: system.update?.bind(system), each: system.each?.bind(system) }\n\t}\n\t// what each side learns of the buildings in its way, right after the fog says what it sees\n\tif (game.paths === 'seen') systems.splice(systems.findIndex((system) => system.name === 'fog') + 1, 0, sideKnowledgeSystem)\n\t// the score's gauges and timeline, in a game that counts\n\tif (world.registry.score) systems.push(scoreSystem(world))\n\tif (assembly.victory !== null) systems.push(make(assembly.victory ?? lastTeamStanding))\n\treturn systems\n}\n\nfunction hooksOf(assembly: AssembledGame): HookDef[] {\n\tconst without = new Set(assembly.rules.withoutHooks ?? [])\n\treturn [...coreHooks.filter((hook) => !without.has(hook.id)), ...assembly.hooks, ...raceHooks(assembly.rules)]\n}\n\n/** How the world reacts to events: the engine's, the packs', the game's */\nfunction listenersOf(assembly: AssembledGame): ListenerDef[] {\n\treturn [dropFromTable, transportSank, regionCinematic, ...assembly.listeners]\n}\n\n/** What can be set to go off later: the packs' and the game's */\nfunction timersOf(assembly: AssembledGame): TimerDef[] | undefined {\n\treturn assembly.timers.length ? [...assembly.timers] : undefined\n}\n\n/**\n * What a world made from a map is made from: the map, the rules, and what the lobby chose for the players\n *\n * @beta\n */\nexport interface MapWorldOptions extends WorldChecks {\n\t/** The map the world is made from: its terrain, players and what it places */\n\tmap: GameMap\n\t/** The game's rules the world runs */\n\trules: Rules\n\t/**\n\t * The race each player plays, by player (`Rules.races`): one of the game's, or `random`. Chosen in a lobby, a\n\t * page's own menu. Those left out play what the map fixes for them (`MapPlayer.race`), or the game's first\n\t */\n\traces?: Readonly<Record<PlayerId, string>>\n\t/** The team each player plays for, by player, over the map's (`MapPlayer.team`): chosen in a lobby */\n\tteams?: Readonly<Record<PlayerId, number>>\n\t/** The colour of each player, by player, over the map's (`MapPlayer.color`): chosen in a lobby */\n\tcolors?: Readonly<Record<PlayerId, [number, number, number]>>\n\t/**\n\t * Whether the world has the creeps player. When the map has something for it when left out: a camp, or something\n\t * placed for the creeps. A world without camps that had one anyway would never be won: a team would always be left\n\t */\n\tcreeps?: boolean\n\t/** Seed of the world's random numbers: the same seed gives the same game */\n\tseed?: number\n\t/** Options for how the world's units find their way, over the game's (`Rules.navigation`) */\n\tnavigation?: GameNavigationOptions\n\t/** Components the app keeps in the world beside the game's own, as `CreateWorldOptions.components` */\n\tcomponents?: readonly Component<unknown, unknown>[]\n\t/** The logger the world's own is made under, as `CreateWorldOptions.log` */\n\tlog?: Logger\n\t/** What becomes of a part of the game that throws, as `CreateWorldOptions.onError` */\n\tonError?: ErrorPolicy\n}\n\n/**\n * A world as a map lays it out: its ground, the players it has room for, and everything placed on it.\n * Players with a start location that the map places nothing for get what the game starts everyone with.\n * Throws for a map made for another game (`GameMap.game`).\n *\n * @public\n */\nexport async function createWorldFromMap(options: MapWorldOptions): Promise<World> {\n\tconst { map } = options\n\t// the map's own definitions over the game's data (RC8): a footman of this map alone\n\tconst game = map.definitions ? layData(options.rules, map.definitions) : options.rules\n\tif (map.game !== undefined && map.game !== game.id) throw new Error(`\"${map.name}\" is a map for the game \"${map.game}\", not for \"${game.id}\"`)\n\tconst most = maxPlayersOf(game)\n\tconst seated = map.players.filter((player) => player.id !== MAP_CREEPS && player.id !== MAP_NEUTRAL).length\n\tif (seated > most) throw new Error(`\"${map.name}\" has ${seated} players, and ${game.name} allows ${most} (\\`Rules.maxPlayers\\`)`)\n\tconst creeps = options.creeps ?? (map.camps.length > 0 || map.objects.some((object) => object.owner === MAP_CREEPS))\n\tconst players: PlayerInit[] = [\n\t\t{ id: MAP_NEUTRAL, name: 'Neutral', team: 0, color: [0.8, 0.75, 0.4], neutral: true },\n\t\t...map.players.map((player) => ({\n\t\t\tid: player.id,\n\t\t\tname: player.name,\n\t\t\tteam: options.teams?.[player.id] ?? player.team,\n\t\t\tcolor: options.colors?.[player.id] ?? player.color,\n\t\t\t...(player.resources && { resources: { ...player.resources } }),\n\t\t\t// as the code says, or else as the map fixes it\n\t\t\t...((options.races?.[player.id] ?? player.race) !== undefined && { race: options.races?.[player.id] ?? player.race })\n\t\t})),\n\t\t...(creeps ? [{ id: MAP_CREEPS, name: 'Creeps', team: 1000, color: [0.42, 0.36, 0.3] as [number, number, number], creeps: true }] : [])\n\t]\n\t// painted as the game's tiles go: what is painted with a tile the game does not have is plain ground. The ground\n\t// it starts as is kept with the world: a save of it keeps only what changed, where the game has the map (S36)\n\tconst terrain = startingTerrain(map, game)\n\tconst base = startedOn(map.name, cloneTerrain(terrain))\n\tconst world = await createWorld({\n\t\tterrain,\n\t\trules: game,\n\t\tplayers,\n\t\t// random draws from what the map offers\n\t\t...(map.races?.length && { randomRaces: map.races }),\n\t\tseed: options.seed,\n\t\tnavigation: options.navigation,\n\t\t...(options.components && { components: options.components }),\n\t\tlog: options.log,\n\t\tonError: options.onError,\n\t\tchecks: options.checks\n\t})\n\t// what the map puts in the world, and what the game does with it: a failure leaves nothing behind\n\tworld.ground = base\n\treturn disposedOnError(world, () => {\n\t\t// a copy: the world is its own, and so is its save\n\t\tworld.setState(mapInfo, {\n\t\t\tname: map.name,\n\t\t\t// the map's own fields with what they are when not set, a region, a point or a path by its name\n\t\t\tdata: fieldValues(mapFields(world.registry), structuredClone(map.data), map),\n\t\t\tpoints: structuredClone(map.points),\n\t\t\tpaths: structuredClone(map.paths),\n\t\t\t...(map.environment && { environment: structuredClone(map.environment) }),\n\t\t\t...(map.doodads.length > 0 && { doodads: structuredClone(map.doodads) }),\n\t\t\t...(map.regions.length > 0 && { regions: structuredClone(map.regions) }),\n\t\t\t...(map.cameras.length > 0 && { cameras: structuredClone(map.cameras) }),\n\t\t\tplayers: map.players.map((player) => ({\n\t\t\t\tid: player.id,\n\t\t\t\t...(player.controller && { controller: player.controller }),\n\t\t\t\tdata: mapPlayerData(world.registry, player, map)\n\t\t\t})),\n\t\t\t...(map.forces?.length && { forces: structuredClone(map.forces) }),\n\t\t\t...(map.itemTables?.length && { itemTables: structuredClone(map.itemTables) }),\n\t\t\t...(map.definitions && { definitions: structuredClone(map.definitions) })\n\t\t})\n\t\t// the gates, shut ones in the way\n\t\tsetUpGates(world)\n\t\t// a force that shares control: every player of it may command the others' units\n\t\tfor (const force of map.forces ?? []) {\n\t\t\tif (!force.sharedControl) continue\n\t\t\tconst members = map.players.filter((player) => player.team === force.team)\n\t\t\tfor (const one of members) for (const other of members) if (one !== other) world.sides.shareControl(one.id, other.id)\n\t\t}\n\t\t// the whole map explored from the start, as the map says, else as the game's rules do (`FogSettings.startExplored`)\n\t\tworld.fog.exploreFromStart(map.explored ?? world.settings.fog?.startExplored ?? false)\n\t\t// the time of day the map starts at, and whether it moves\n\t\tif (map.day?.start !== undefined) world.clock.setHour(map.day.start)\n\t\tif (map.day?.still) world.clock.stop()\n\t\t// the regions first: what is placed may be inside one from the start, and the game's hooks may ask\n\t\tfor (const region of map.regions) {\n\t\t\tif (world.areas.has(region.name)) throw new Error(`The region \"${region.name}\" of \"${map.name}\" has the name of an area of the game`)\n\t\t\tconst area = { id: region.name, shape: { ...region.shape } }\n\t\t\tworld.areas.add(area)\n\t\t\tif (world.hooks.has('mapRegion')) world.hooks.run('mapRegion', { area, region, data: mapRegionData(world.registry, region, map) })\n\t\t}\n\t\tconst known = new Set(players.map((player) => player.id))\n\t\tconst placed = new Set<PlayerId>()\n\t\t// what is drawn from a random group is drawn now, once, from the world's own numbers: the same for the same seed\n\t\tconst groups = new Map((map.randomGroups ?? []).map((group) => [group.name, group]))\n\t\tconst drawn = (type: string, random: string | undefined) => {\n\t\t\tconst group = random === undefined ? undefined : groups.get(random)\n\t\t\treturn (group && drawFromGroup(group, world.registry, world.rng)) ?? type\n\t\t}\n\t\t// what stands still goes first, so that units find their way around it\n\t\tconst objects = map.objects\n\t\t\t.map((object) => (object.random ? { ...object, type: drawn(object.type, object.random) } : object))\n\t\t\t.filter((object) => world.registry.units.has(object.type) && known.has(object.owner))\n\t\t// and of that, resources before buildings: what goes up on a resource (`builtOn`) finds it there\n\t\tconst rank = (type: string) => ({ resource: 0, building: 1, unit: 2 })[world.registry.unit(type).kind] ?? 1\n\t\tobjects.sort((a, b) => rank(a.type) - rank(b.type))\n\t\t// every structure's obstacle made into the ground's tiles together, as a load does (RV42): a wooded tile once, not\n\t\t// once a tree. Let go before the first unit, which is put on the ways with every structure in them\n\t\tlet held = true\n\t\tworld.nav.holdObstacles?.(true)\n\t\tconst letGo = () => {\n\t\t\tif (held) world.nav.holdObstacles?.(false)\n\t\t\theld = false\n\t\t}\n\t\t/** Units of the map with orders of their own, given once everything stands (a path's ends, a guard's post) */\n\t\tconst ordered: [Entity, MapObjectOrder[]][] = []\n\t\tfor (const object of objects) {\n\t\t\tif (held && rank(object.type) === 2) letGo()\n\t\t\tconst entity = spawnMapObject(world, object, map)\n\t\t\tif (object.orders?.length) ordered.push([entity, object.orders])\n\t\t\tplaced.add(object.owner)\n\t\t}\n\t\tletGo()\n\t\tfor (const [entity, orders] of ordered) giveMapOrders(world, entity, orders)\n\t\tfor (const camp of map.camps) {\n\t\t\t// a unit of a camp is one of a random group when it says `@group`\n\t\t\tconst units = camp.units\n\t\t\t\t.map((type) => (type.startsWith('@') ? drawn('', type.slice(1)) : type))\n\t\t\t\t.filter((type) => world.registry.units.has(type))\n\t\t\tif (!units.length) continue\n\t\t\tconst made = spawnCamp(world, MAP_CREEPS, camp, units)\n\t\t\tif (camp.name) made.name = camp.name\n\t\t\tif (camp.respawn !== undefined) made.respawn = camp.respawn\n\t\t\tif (world.hooks.has('mapCamp')) world.hooks.run('mapCamp', { camp: made, from: camp, data: mapCampData(world.registry, camp, map) })\n\t\t}\n\t\t// a player's race has a start of its own, in place of the game's\n\t\tconst raceDef = (player: PlayerId) => {\n\t\t\tconst race = world.players.get(player)?.race\n\t\t\treturn race === undefined ? undefined : world.registry.race(race)\n\t\t}\n\t\tfor (const player of map.players) {\n\t\t\tif (player.start && !placed.has(player.id)) spawnStartingBase(world, raceDef(player.id)?.startingBase ?? game.startingBase, player.id, player.start)\n\t\t}\n\t\t// a copy of a race keeps the original's `onStart` unless it says not to (`RaceDef.inherits`)\n\t\tfor (const player of map.players) {\n\t\t\tconst race = raceDef(player.id)\n\t\t\tif (race && race.inherits?.onStart !== false) race.onStart?.(world, player.id)\n\t\t}\n\t\t// what a pack starts of its own from the map: the objectives it gives at the start (`mapObjectives`)\n\t\tif (world.hooks.has('mapStart')) world.hooks.run('mapStart', { map })\n\t})\n}\n\n/**\n * Players a map of the game may have (`Rules.maxPlayers`): 8 when it says nothing, never more than the fog keeps apart\n *\n * @beta\n */\nexport const maxPlayersOf = (game: Rules): number => Math.max(1, Math.min(Math.floor(game.maxPlayers ?? DEFAULT_MAX_PLAYERS), MAX_MAP_PLAYERS))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkJA,IAAM,aAA8B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;;;;AASA,IAAa,cAAiC;CAC7C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAgXA,IAAM,mBAA+C;CACpD;CACA;CACA;CACA;CAC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AM,UAAU,IAAI,SACxB,IAAI,OAAO,SAAS,CAAC,OAAO,IAAI,OAAO,EAAE,GAAG,kBAAkB,OAAO,QAAQ,OAAO,EAAE,CAAC,EAAE,gBAAgB,KAAK,cAAc,OAAO,IAAI,OAAO,KAAK;EAGpJ,KAAK,MAAM,UAAU,IAAI,SAAS;GACjC,MAAM,OAAO,QAAQ,OAAO,EAAE;GAC9B,IAAI,QAAQ,KAAK,UAAU,YAAY,OAAO,KAAK,UAAU,OAAO,OAAO,EAAE;EAC9E;EAEA,IAAI,MAAM,MAAM,IAAI,UAAU,GAAG,MAAM,MAAM,IAAI,YAAY,EAAE,IAAI,CAAC;CACrE,CAAC;AACF;;;;;;AAOA,IAAa,gBAAgB,SAAwB,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,MAAM,KAAK,cAAA,CAAiC,GAAA,EAAkB,CAAC"}
@@ -1,8 +1,10 @@
1
- import type { DamageTable } from './rules';
1
+ import { type CallingDef } from './callings';
2
+ import { type DataCellLayer } from './cellLayers';
2
3
  import type { AiProfile } from './ai/profiles';
3
- import { type AbilityDef, type BuffDef, type ItemDef, type ResourceDef, type UnitTypeDef, type UpgradeDef, type UpkeepTier } from './defs';
4
+ import { type DataSetChoice } from './defaultSets';
5
+ import { type AbilityDef, type BuffDef, type ItemDef, type ResourceDef, type TagDef, type UnitTypeDef, type UpgradeDef, type UpkeepTier } from './defs';
4
6
  import { type Check } from './fields';
5
- import type { GameModule } from './game';
7
+ import type { Rules } from './game';
6
8
  import type { RaceDef } from './races';
7
9
  import type { Registry } from './registry';
8
10
  /**
@@ -11,7 +13,11 @@ import type { Registry } from './registry';
11
13
  * @beta
12
14
  */
13
15
  export declare const DATA_KINDS: readonly ['units', 'abilities', 'buffs', 'items', 'upgrades', 'races'];
14
- /** @beta */
16
+ /**
17
+ * The kind of definition a game's data is kept for: one of `DATA_KINDS` (`units`, `abilities`, `buffs`, `items`, `upgrades`, `races`)
18
+ *
19
+ * @beta
20
+ */
15
21
  export type DataKind = (typeof DATA_KINDS)[number];
16
22
  /**
17
23
  * What a definition of each kind must have besides its id and its name, as the type says (`UnitTypeDef.radius`...),
@@ -41,11 +47,17 @@ export declare function blankDefinition<K extends DataKind>(kind: K, id: string,
41
47
  * @beta
42
48
  */
43
49
  export interface DataDefs {
50
+ /** The unit types of the game, each a `UnitTypeDef` */
44
51
  units: UnitTypeDef;
52
+ /** The abilities of the game, each an `AbilityDef` */
45
53
  abilities: AbilityDef;
54
+ /** The buffs of the game, each a `BuffDef` */
46
55
  buffs: BuffDef;
56
+ /** The items of the game, each an `ItemDef` */
47
57
  items: ItemDef;
58
+ /** The upgrades of the game, each an `UpgradeDef` */
48
59
  upgrades: UpgradeDef;
60
+ /** The races of the game, each a `RaceDef` */
49
61
  races: RaceDef;
50
62
  }
51
63
  /**
@@ -79,6 +91,7 @@ export declare const COPY_OF = "copyOf";
79
91
  * @beta
80
92
  */
81
93
  export interface DataValues {
94
+ /** A field of the definition by name: a value, a list of values, or nested values (a `stats` group, a list of `effects`) */
82
95
  [field: string]: DataValue | DataValue[] | DataValues | DataValues[];
83
96
  }
84
97
  /**
@@ -91,24 +104,66 @@ export type GameData = Partial<Record<DataKind, Record<string, DataValues>>> & {
91
104
  removed?: Partial<Record<DataKind, string[]>>;
92
105
  /**
93
106
  * How the game's computers play each race (campaign plan AR4), by race id: each a whole profile, in the place of the
94
- * code's (`GameModule.ai.races`). What the editor's Data panel writes of a race's AI
107
+ * code's (`Rules.ai.races`). What the editor's Data panel writes of a race's AI
95
108
  */
96
109
  ai?: {
97
110
  races?: Record<string, AiProfile>;
98
111
  };
99
112
  /** The rules as data (campaign plan RC7), laid over the game's (`DataRules`): what the Data panel's Rules writes */
100
113
  rules?: DataRules;
114
+ /**
115
+ * What the game takes of the default sets it took in code (`useDefaults`), by set id, over what its code chose: all
116
+ * of a set, none, only some ids or all but some (`DataSetChoice`): `{ "items": { "except": ["sightWard"] } }`. Laid
117
+ * first, so the rest of the file changes what it took
118
+ */
119
+ defaults?: Record<string, DataSetChoice>;
120
+ /**
121
+ * The tags named and given a look (`TagDef`), by tag (items-and-spells plan, phase 9): each over the code's `TagDef`
122
+ * of that tag, or one of its own. What the Data panel's Tags writes: `{ "lifesteal": { "color": "#c04040", "filter": true } }`
123
+ */
124
+ tags?: Record<string, DataTag>;
125
+ /**
126
+ * The callings heroes may have (`CallingDef`), by id: each over the game's calling of that id (its name, line, icon,
127
+ * colour), or one of its own. What the Data panel's Callings writes: `{ "vanguard": { "name": "Bulwark" } }`. A calling
128
+ * of the default set is left out with `defaults.callings`
129
+ */
130
+ callings?: Record<string, DataCalling>;
131
+ /**
132
+ * The values of the game's layers of cells (`CellLayerDef.values`), by layer: each over the code's value of the same
133
+ * number, or one of its own (`DataCellLayer`). What the editor writes of a style of grass made or changed there, its
134
+ * name and what it is to the rules (`FoliageStyleDef`): in the game's `data.json` for every map, in a map's
135
+ * definitions (`GameMap.definitions`) for that map alone
136
+ */
137
+ cellLayers?: Record<string, DataCellLayer>;
101
138
  };
102
139
  /**
103
- * The rules a `data.json` may say (campaign plan RC7), each over the game's: the damage table whole, the supply's and
104
- * the heroes' numbers, the resources and the upkeep's tiers whole (in place of `GameModule.resources`, `upkeep`)
140
+ * What a `data.json` says of a tag (`GameData.tags`): a `TagDef` without its id, over the code's of the same tag
141
+ *
142
+ * @beta
143
+ */
144
+ export type DataTag = Omit<TagDef, 'id'>;
145
+ /**
146
+ * What a `data.json` says of a calling (`GameData.callings`): a `CallingDef` without its id, any of it, over the game's
147
+ * of the same id. One of its own is named by its id where it says no name
148
+ *
149
+ * @beta
150
+ */
151
+ export type DataCalling = Partial<Omit<CallingDef, 'id'>>;
152
+ /**
153
+ * Why what a `data.json` says of its tags or callings (`GameData.tags`, `callings`) is not right, where it first is
154
+ * not: nothing when it is
155
+ *
156
+ * @beta
157
+ */
158
+ export declare function dataEntriesProblem(section: 'tags' | 'callings', said: unknown): string | undefined;
159
+ /**
160
+ * The rules a `data.json` may say (campaign plan RC7), each over the game's: the supply's and
161
+ * the heroes' numbers, the resources and the upkeep's tiers whole (in place of `Rules.resources`, `upkeep`)
105
162
  *
106
163
  * @beta
107
164
  */
108
165
  export interface DataRules {
109
- combat?: {
110
- damageTable?: DamageTable;
111
- };
166
+ /** The supply numbers: `max` is the most supply a player can have, `pools` names the extra supply pools by id with their own `max` */
112
167
  supply?: {
113
168
  max?: number;
114
169
  pools?: Record<string, {
@@ -116,12 +171,21 @@ export interface DataRules {
116
171
  max: number;
117
172
  }>;
118
173
  };
174
+ /**
175
+ * The hero rules: `maxHeroes` a player may have, `maxHeroLevel` a hero can reach, `xpRange` the distance within which
176
+ * units share experience, `assistTime` the seconds within which harm or help makes an assist (0 for none), and
177
+ * `buybackCooldown` the seconds a hero bought back waits to be again
178
+ */
119
179
  heroes?: {
120
180
  maxHeroes?: number;
121
181
  maxHeroLevel?: number;
122
182
  xpRange?: number;
183
+ assistTime?: number;
184
+ buybackCooldown?: number;
123
185
  };
186
+ /** The resource kinds of the game whole, in place of `Rules.resources` */
124
187
  resources?: ResourceDef[];
188
+ /** The upkeep tiers whole, in place of `Rules.upkeep` */
125
189
  upkeep?: UpkeepTier[];
126
190
  }
127
191
  /**
@@ -144,9 +208,11 @@ export interface EditableField {
144
208
  * What it holds. What the definition has there now, when left out (a number where it has nothing). A `list` is of
145
209
  * words, in order: ids of the kind `of` says, when it says. An `id` is one id of the kind `of` says (the hall a race
146
210
  * starts with), picked from what the game has of that kind. `rows` is a list of things, each with fields of its own
147
- * (`effects.0.amount`), added, taken out and put in another order whole: an ability's effects
211
+ * (`effects.0.amount`), added, taken out and put in another order whole: an ability's effects. An `either` is a value
212
+ * of more than one kind: yes or no, one of the words of `options` (`origin.caster`: true, false or `otherwise`), or a
213
+ * number as well where `orNumber` says (a missile's `pierce`: true, false or how many it goes through)
148
214
  */
149
- kind?: 'number' | 'integer' | 'text' | 'boolean' | 'choice' | 'list' | 'id' | 'rows';
215
+ kind?: 'number' | 'integer' | 'text' | 'boolean' | 'choice' | 'either' | 'list' | 'id' | 'rows';
150
216
  /** Of a `list` or an `id`: the kind of definition its words are ids of (`abilities` for a unit's abilities) */
151
217
  of?: DataKind;
152
218
  /**
@@ -154,11 +220,16 @@ export interface EditableField {
154
220
  * kept as the one id
155
221
  */
156
222
  one?: boolean;
223
+ /** Of a `number` or `integer` field, or the number of an `either`: the least it can be set to in the editor */
157
224
  min?: number;
225
+ /** Of a `number` or `integer` field, or the number of an `either`: the most it can be set to in the editor */
158
226
  max?: number;
227
+ /** Of a `number` field, or the number of an `either`: the size of one step of the editor's input */
159
228
  step?: number;
160
- /** What a `choice` can be */
229
+ /** What a `choice` can be; the words an `either` can be besides yes and no */
161
230
  options?: readonly string[];
231
+ /** Of an `either`: it may be a number besides, any (`number`) or a whole one (`integer`). Not a number when left out */
232
+ orNumber?: 'number' | 'integer';
162
233
  /** Of `rows` of effects: the types a row can be, those the game has (`defineEffect`). A row of no type when left out */
163
234
  types?: readonly string[];
164
235
  /** The heading it is shown under: the first part of its path, when left out (`stats`, `cost`) */
@@ -172,8 +243,11 @@ export interface EditableField {
172
243
  * @beta
173
244
  */
174
245
  export interface DataField extends EditableField {
246
+ /** The field's path in the definition (`stats.health`, `cost.gold`), as `data.json` nests it */
175
247
  name: string;
248
+ /** How the field is edited, `EditableField.kind` with the guess made when the game did not say */
176
249
  kind: NonNullable<EditableField['kind']>;
250
+ /** The heading the field is shown under in the editor, the first part of its path when `EditableField.group` is not said */
177
251
  group: string;
178
252
  }
179
253
  /**
@@ -185,7 +259,7 @@ export interface DataField extends EditableField {
185
259
  */
186
260
  export type EditableFields<D = unknown> = 'all' | readonly (string | EditableField)[] | ((def: D) => 'all' | readonly (string | EditableField)[] | null);
187
261
  /**
188
- * What of a game's data the editor can change, by kind (`GameModule.editable`). `all` for every field of every definition
262
+ * What of a game's data the editor can change, by kind (`Rules.editable`). `all` for every field of every definition
189
263
  *
190
264
  * @beta
191
265
  */
@@ -210,20 +284,20 @@ export declare function nested(path: string, value: FieldValue): DataValues;
210
284
  *
211
285
  * @beta
212
286
  */
213
- export declare function effectFields(game: Pick<GameModule, 'effects'> | null | undefined, type: string): EditableField[];
287
+ export declare function effectFields(game: (Pick<Rules, 'effects'> & Partial<Pick<Rules, 'packs'>>) | null | undefined, type: string): EditableField[];
214
288
  /**
215
289
  * The types of effect a game has (`defineEffect`): the engine's and its own, in order of their names
216
290
  *
217
291
  * @beta
218
292
  */
219
- export declare function effectTypesOf(game: Pick<GameModule, 'effects'> | null | undefined): string[];
293
+ export declare function effectTypesOf(game: (Pick<Rules, 'effects'> & Partial<Pick<Rules, 'packs'>>) | null | undefined): string[];
220
294
  /**
221
- * The fields of a definition the editor may change, as the game says (`GameModule.editable`), each with what it
295
+ * The fields of a definition the editor may change, as the game says (`Rules.editable`), each with what it
222
296
  * holds and the heading it goes under. None for a game that says nothing of that kind
223
297
  *
224
298
  * @beta
225
299
  */
226
- export declare function editableFields<K extends DataKind>(game: (Pick<GameModule, 'editable'> & Partial<Pick<GameModule, 'effects' | 'stats'>>) | null | undefined, kind: K, def: DataDefs[K]): DataField[];
300
+ export declare function editableFields<K extends DataKind>(game: (Pick<Rules, 'editable'> & Partial<Pick<Rules, 'effects' | 'stats' | 'packs' | 'units'>>) | null | undefined, kind: K, def: DataDefs[K]): DataField[];
227
301
  /**
228
302
  * A value as a field takes it, or the reason it does not
229
303
  *
@@ -241,7 +315,7 @@ export declare function fitValue(field: DataField, value: unknown): {
241
315
  *
242
316
  * @beta
243
317
  */
244
- export declare function withValues<D>(def: D, values: DataValues): D;
318
+ export declare function layValues<D>(def: D, values: DataValues): D;
245
319
  /**
246
320
  * Values merged: what `b` says over what `a` says, at any depth. Places said over a list go into it (`{ 0: { amount:
247
321
  * 50 } }` over a list of effects); a list said is the list
@@ -257,13 +331,13 @@ export declare function mergeValues(a: DataValues, b: DataValues): DataValues;
257
331
  */
258
332
  export declare function editableValues(fields: readonly DataField[], values: DataValues, said?: (why: string) => void): DataValues;
259
333
  /**
260
- * The game with what its `data.json` says over what its code says: `export default withData(game, dataFile)`. Only
261
- * the fields the game lets be changed (`GameModule.editable`) are taken, and of the kind each holds; anything else in
334
+ * The game with what its `data.json` says over what its code says: `export default layData(game, dataFile)`. Only
335
+ * the fields the game lets be changed (`Rules.editable`) are taken, and of the kind each holds; anything else in
262
336
  * the file is left out, and said in the log. The game given is not changed
263
337
  *
264
338
  * @beta
265
339
  */
266
- export declare function withData(game: GameModule, file: unknown): GameModule;
340
+ export declare function layData(game: Rules, file: unknown): Rules;
267
341
  /**
268
342
  * What a world's definitions were changed to while it runs (`world.redefine`), by kind and id: kept with the world
269
343
  * and in its save, so that a load has them again