@datamoc/mw_games 0.44.2 → 0.46.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 (1695) hide show
  1. package/3d/models.d.ts +1 -0
  2. package/3d/models.js +1 -0
  3. package/3d.d.ts +1 -0
  4. package/3d.js +1 -0
  5. package/README.md +5 -732
  6. package/actors.d.ts +1 -0
  7. package/actors.js +1 -0
  8. package/ai/lua.d.ts +1 -0
  9. package/ai/lua.js +1 -0
  10. package/ai.d.ts +1 -0
  11. package/ai.js +1 -0
  12. package/assets/binary.d.ts +1 -0
  13. package/assets/binary.js +1 -0
  14. package/assets/paths.d.ts +1 -0
  15. package/assets/paths.js +1 -0
  16. package/assets.d.ts +1 -0
  17. package/assets.js +1 -0
  18. package/audio.d.ts +1 -0
  19. package/audio.js +1 -0
  20. package/battle.d.ts +1 -0
  21. package/battle.js +1 -0
  22. package/board.d.ts +1 -0
  23. package/board.js +1 -0
  24. package/core.d.ts +1 -0
  25. package/core.js +1 -0
  26. package/headless.d.ts +1 -0
  27. package/headless.js +1 -0
  28. package/i18n.d.ts +1 -0
  29. package/i18n.js +1 -0
  30. package/index.d.ts +1 -0
  31. package/index.js +1 -0
  32. package/mwl/presentation.d.ts +1 -0
  33. package/mwl/presentation.js +1 -0
  34. package/mwl/pyroeis.d.ts +1 -0
  35. package/mwl/pyroeis.js +1 -0
  36. package/mwl.d.ts +1 -0
  37. package/mwl.js +1 -0
  38. package/package.json +212 -394
  39. package/physics/xpbd.d.ts +1 -0
  40. package/physics/xpbd.js +1 -0
  41. package/physics.d.ts +1 -0
  42. package/physics.js +1 -0
  43. package/roguelike.d.ts +1 -0
  44. package/roguelike.js +1 -0
  45. package/rpg.d.ts +1 -0
  46. package/rpg.js +1 -0
  47. package/simulation.d.ts +1 -0
  48. package/simulation.js +1 -0
  49. package/skeleton.d.ts +1 -0
  50. package/skeleton.js +1 -0
  51. package/testing.d.ts +1 -0
  52. package/testing.js +1 -0
  53. package/threads.d.ts +1 -0
  54. package/threads.js +1 -0
  55. package/tools/asset-report.d.mts +1 -37
  56. package/tools/asset-report.mjs +1 -157
  57. package/tools/audio.d.mts +1 -75
  58. package/tools/audio.mjs +1 -437
  59. package/tools/audit-adoptions.d.mts +1 -65
  60. package/tools/audit-adoptions.mjs +1 -252
  61. package/tools/benchmark-browser.d.mts +1 -33
  62. package/tools/benchmark-browser.mjs +1 -169
  63. package/tools/benchmark-history.d.mts +1 -8
  64. package/tools/benchmark-history.mjs +1 -31
  65. package/tools/browser-driver.d.mts +1 -122
  66. package/tools/browser-driver.mjs +1 -861
  67. package/tools/browser-smoke.d.mts +1 -30
  68. package/tools/browser-smoke.mjs +1 -184
  69. package/tools/build-tablebases.d.mts +1 -22
  70. package/tools/build-tablebases.mjs +1 -557
  71. package/tools/bundle-size.d.mts +1 -11
  72. package/tools/bundle-size.mjs +1 -142
  73. package/tools/classic-html.d.mts +1 -6
  74. package/tools/classic-html.mjs +1 -69
  75. package/tools/compile-openings.d.mts +1 -20
  76. package/tools/compile-openings.mjs +1 -138
  77. package/tools/compile-resources.d.mts +1 -66
  78. package/tools/compile-resources.mjs +1 -406
  79. package/tools/compress-dist.d.mts +1 -42
  80. package/tools/compress-dist.mjs +1 -193
  81. package/tools/csp.d.mts +1 -7
  82. package/tools/csp.mjs +1 -65
  83. package/tools/emit-page.d.mts +1 -61
  84. package/tools/emit-page.mjs +1 -273
  85. package/tools/extract-html.d.mts +1 -18
  86. package/tools/extract-html.mjs +1 -235
  87. package/tools/extract-rgssad.d.mts +1 -5
  88. package/tools/extract-rgssad.mjs +1 -64
  89. package/tools/find-chrome.d.mts +1 -7
  90. package/tools/find-chrome.mjs +1 -106
  91. package/tools/i18n-edit.d.mts +1 -29
  92. package/tools/i18n-edit.mjs +1 -748
  93. package/tools/init.d.mts +1 -5
  94. package/tools/init.mjs +1 -155
  95. package/tools/make-example-assets.d.mts +1 -2
  96. package/tools/make-example-assets.mjs +1 -731
  97. package/tools/multiplayer-server.d.mts +1 -27
  98. package/tools/multiplayer-server.mjs +1 -199
  99. package/tools/play-uci.d.mts +1 -26
  100. package/tools/play-uci.mjs +1 -205
  101. package/tools/sbom.d.mts +1 -83
  102. package/tools/sbom.mjs +1 -340
  103. package/tools/single-file.d.mts +1 -33
  104. package/tools/single-file.mjs +1 -239
  105. package/tools/soundfonts.d.mts +1 -79
  106. package/tools/soundfonts.mjs +1 -301
  107. package/tools/svg-optimise.d.mts +1 -8
  108. package/tools/svg-optimise.mjs +1 -45
  109. package/tools/verify-scenarios.d.mts +1 -15
  110. package/tools/verify-scenarios.mjs +1 -133
  111. package/tools/vite.d.mts +1 -17
  112. package/tools/vite.mjs +1 -102
  113. package/tools/webp-convert.d.mts +1 -8
  114. package/tools/webp-convert.mjs +1 -98
  115. package/two-d/pixi-interop.d.ts +1 -0
  116. package/two-d/pixi-interop.js +1 -0
  117. package/two-d/presentation.d.ts +1 -0
  118. package/two-d/presentation.js +1 -0
  119. package/two-d/render.d.ts +1 -0
  120. package/two-d/render.js +1 -0
  121. package/two-d/stage.d.ts +1 -0
  122. package/two-d/stage.js +1 -0
  123. package/two-d/ui.d.ts +1 -0
  124. package/two-d/ui.js +1 -0
  125. package/two-d.d.ts +1 -0
  126. package/two-d.js +1 -0
  127. package/world.d.ts +1 -0
  128. package/world.js +1 -0
  129. package/CHANGELOG.md +0 -3196
  130. package/LICENSE +0 -373
  131. package/MWG - Best Practices.md +0 -97
  132. package/MWG - Deep Code and Architecture Review.md +0 -238
  133. package/REFERENCE.md +0 -2256
  134. package/api-surface.json +0 -18128
  135. package/data/microgm-essential.PROVENANCE.md +0 -13
  136. package/data/microgm-essential.sf2 +0 -0
  137. package/data/microgm-opt.PROVENANCE.md +0 -23
  138. package/data/microgm-opt.sf2 +0 -0
  139. package/data/soundfont-catalog.json +0 -191
  140. package/dist/actors/Advancement.d.ts +0 -90
  141. package/dist/actors/Advancement.d.ts.map +0 -1
  142. package/dist/actors/Advancement.js +0 -115
  143. package/dist/actors/Advancement.js.map +0 -1
  144. package/dist/actors/Affix.d.ts +0 -96
  145. package/dist/actors/Affix.d.ts.map +0 -1
  146. package/dist/actors/Affix.js +0 -68
  147. package/dist/actors/Affix.js.map +0 -1
  148. package/dist/actors/Appearances.d.ts +0 -48
  149. package/dist/actors/Appearances.d.ts.map +0 -1
  150. package/dist/actors/Appearances.js +0 -62
  151. package/dist/actors/Appearances.js.map +0 -1
  152. package/dist/actors/Aura.d.ts +0 -45
  153. package/dist/actors/Aura.d.ts.map +0 -1
  154. package/dist/actors/Aura.js +0 -85
  155. package/dist/actors/Aura.js.map +0 -1
  156. package/dist/actors/Barrier.d.ts +0 -60
  157. package/dist/actors/Barrier.d.ts.map +0 -1
  158. package/dist/actors/Barrier.js +0 -70
  159. package/dist/actors/Barrier.js.map +0 -1
  160. package/dist/actors/Charges.d.ts +0 -66
  161. package/dist/actors/Charges.d.ts.map +0 -1
  162. package/dist/actors/Charges.js +0 -61
  163. package/dist/actors/Charges.js.map +0 -1
  164. package/dist/actors/EntityTemplate.d.ts +0 -127
  165. package/dist/actors/EntityTemplate.d.ts.map +0 -1
  166. package/dist/actors/EntityTemplate.js +0 -117
  167. package/dist/actors/EntityTemplate.js.map +0 -1
  168. package/dist/actors/Equipment.d.ts +0 -88
  169. package/dist/actors/Equipment.d.ts.map +0 -1
  170. package/dist/actors/Equipment.js +0 -107
  171. package/dist/actors/Equipment.js.map +0 -1
  172. package/dist/actors/Inventory.d.ts +0 -123
  173. package/dist/actors/Inventory.d.ts.map +0 -1
  174. package/dist/actors/Inventory.js +0 -165
  175. package/dist/actors/Inventory.js.map +0 -1
  176. package/dist/actors/ItemState.d.ts +0 -43
  177. package/dist/actors/ItemState.d.ts.map +0 -1
  178. package/dist/actors/ItemState.js +0 -63
  179. package/dist/actors/ItemState.js.map +0 -1
  180. package/dist/actors/ItemStatusEffect.d.ts +0 -40
  181. package/dist/actors/ItemStatusEffect.d.ts.map +0 -1
  182. package/dist/actors/ItemStatusEffect.js +0 -39
  183. package/dist/actors/ItemStatusEffect.js.map +0 -1
  184. package/dist/actors/Loot.d.ts +0 -38
  185. package/dist/actors/Loot.d.ts.map +0 -1
  186. package/dist/actors/Loot.js +0 -28
  187. package/dist/actors/Loot.js.map +0 -1
  188. package/dist/actors/Progression.d.ts +0 -52
  189. package/dist/actors/Progression.d.ts.map +0 -1
  190. package/dist/actors/Progression.js +0 -59
  191. package/dist/actors/Progression.js.map +0 -1
  192. package/dist/actors/Resource.d.ts +0 -53
  193. package/dist/actors/Resource.d.ts.map +0 -1
  194. package/dist/actors/Resource.js +0 -57
  195. package/dist/actors/Resource.js.map +0 -1
  196. package/dist/actors/Scaling.d.ts +0 -30
  197. package/dist/actors/Scaling.d.ts.map +0 -1
  198. package/dist/actors/Scaling.js +0 -9
  199. package/dist/actors/Scaling.js.map +0 -1
  200. package/dist/actors/Shop.d.ts +0 -40
  201. package/dist/actors/Shop.d.ts.map +0 -1
  202. package/dist/actors/Shop.js +0 -36
  203. package/dist/actors/Shop.js.map +0 -1
  204. package/dist/actors/SkillPoints.d.ts +0 -72
  205. package/dist/actors/SkillPoints.d.ts.map +0 -1
  206. package/dist/actors/SkillPoints.js +0 -87
  207. package/dist/actors/SkillPoints.js.map +0 -1
  208. package/dist/actors/StatBlock.d.ts +0 -86
  209. package/dist/actors/StatBlock.d.ts.map +0 -1
  210. package/dist/actors/StatBlock.js +0 -110
  211. package/dist/actors/StatBlock.js.map +0 -1
  212. package/dist/actors/StatusEffect.d.ts +0 -67
  213. package/dist/actors/StatusEffect.d.ts.map +0 -1
  214. package/dist/actors/StatusEffect.js +0 -59
  215. package/dist/actors/StatusEffect.js.map +0 -1
  216. package/dist/actors/Support.d.ts +0 -43
  217. package/dist/actors/Support.d.ts.map +0 -1
  218. package/dist/actors/Support.js +0 -71
  219. package/dist/actors/Support.js.map +0 -1
  220. package/dist/actors/Traits.d.ts +0 -43
  221. package/dist/actors/Traits.d.ts.map +0 -1
  222. package/dist/actors/Traits.js +0 -35
  223. package/dist/actors/Traits.js.map +0 -1
  224. package/dist/actors/craft.d.ts +0 -63
  225. package/dist/actors/craft.d.ts.map +0 -1
  226. package/dist/actors/craft.js +0 -86
  227. package/dist/actors/craft.js.map +0 -1
  228. package/dist/actors/index.d.ts +0 -46
  229. package/dist/actors/index.d.ts.map +0 -1
  230. package/dist/actors/index.js +0 -24
  231. package/dist/actors/index.js.map +0 -1
  232. package/dist/actors/skillCheck.d.ts +0 -21
  233. package/dist/actors/skillCheck.d.ts.map +0 -1
  234. package/dist/actors/skillCheck.js +0 -24
  235. package/dist/actors/skillCheck.js.map +0 -1
  236. package/dist/ai/Heuristics.d.ts +0 -240
  237. package/dist/ai/Heuristics.d.ts.map +0 -1
  238. package/dist/ai/Heuristics.js +0 -298
  239. package/dist/ai/Heuristics.js.map +0 -1
  240. package/dist/ai/Neural.d.ts +0 -65
  241. package/dist/ai/Neural.d.ts.map +0 -1
  242. package/dist/ai/Neural.js +0 -169
  243. package/dist/ai/Neural.js.map +0 -1
  244. package/dist/ai/Suggest.d.ts +0 -54
  245. package/dist/ai/Suggest.d.ts.map +0 -1
  246. package/dist/ai/Suggest.js +0 -48
  247. package/dist/ai/Suggest.js.map +0 -1
  248. package/dist/ai/index.d.ts +0 -136
  249. package/dist/ai/index.d.ts.map +0 -1
  250. package/dist/ai/index.js +0 -207
  251. package/dist/ai/index.js.map +0 -1
  252. package/dist/ai/lua.d.ts +0 -74
  253. package/dist/ai/lua.d.ts.map +0 -1
  254. package/dist/ai/lua.js +0 -217
  255. package/dist/ai/lua.js.map +0 -1
  256. package/dist/ai/score.d.ts +0 -162
  257. package/dist/ai/score.d.ts.map +0 -1
  258. package/dist/ai/score.js +0 -147
  259. package/dist/ai/score.js.map +0 -1
  260. package/dist/ai/search.d.ts +0 -108
  261. package/dist/ai/search.d.ts.map +0 -1
  262. package/dist/ai/search.js +0 -148
  263. package/dist/ai/search.js.map +0 -1
  264. package/dist/assets/ByteProgress.d.ts +0 -37
  265. package/dist/assets/ByteProgress.d.ts.map +0 -1
  266. package/dist/assets/ByteProgress.js +0 -54
  267. package/dist/assets/ByteProgress.js.map +0 -1
  268. package/dist/assets/Streaming.d.ts +0 -56
  269. package/dist/assets/Streaming.d.ts.map +0 -1
  270. package/dist/assets/Streaming.js +0 -100
  271. package/dist/assets/Streaming.js.map +0 -1
  272. package/dist/assets/SvgParts.d.ts +0 -31
  273. package/dist/assets/SvgParts.d.ts.map +0 -1
  274. package/dist/assets/SvgParts.js +0 -54
  275. package/dist/assets/SvgParts.js.map +0 -1
  276. package/dist/assets/SvgSource.d.ts +0 -3
  277. package/dist/assets/SvgSource.d.ts.map +0 -1
  278. package/dist/assets/SvgSource.js +0 -22
  279. package/dist/assets/SvgSource.js.map +0 -1
  280. package/dist/assets/binary.d.ts +0 -52
  281. package/dist/assets/binary.d.ts.map +0 -1
  282. package/dist/assets/binary.js +0 -57
  283. package/dist/assets/binary.js.map +0 -1
  284. package/dist/assets/index.d.ts +0 -27
  285. package/dist/assets/index.d.ts.map +0 -1
  286. package/dist/assets/index.js +0 -20
  287. package/dist/assets/index.js.map +0 -1
  288. package/dist/assets/loader.d.ts +0 -70
  289. package/dist/assets/loader.d.ts.map +0 -1
  290. package/dist/assets/loader.js +0 -115
  291. package/dist/assets/loader.js.map +0 -1
  292. package/dist/assets/paths.d.ts +0 -73
  293. package/dist/assets/paths.d.ts.map +0 -1
  294. package/dist/assets/paths.js +0 -91
  295. package/dist/assets/paths.js.map +0 -1
  296. package/dist/assets/svg.d.ts +0 -87
  297. package/dist/assets/svg.d.ts.map +0 -1
  298. package/dist/assets/svg.js +0 -166
  299. package/dist/assets/svg.js.map +0 -1
  300. package/dist/audio/AdaptiveMusic.d.ts +0 -85
  301. package/dist/audio/AdaptiveMusic.d.ts.map +0 -1
  302. package/dist/audio/AdaptiveMusic.js +0 -230
  303. package/dist/audio/AdaptiveMusic.js.map +0 -1
  304. package/dist/audio/AudioLoader.d.ts +0 -33
  305. package/dist/audio/AudioLoader.d.ts.map +0 -1
  306. package/dist/audio/AudioLoader.js +0 -58
  307. package/dist/audio/AudioLoader.js.map +0 -1
  308. package/dist/audio/AudioViews.d.ts +0 -70
  309. package/dist/audio/AudioViews.d.ts.map +0 -1
  310. package/dist/audio/AudioViews.js +0 -119
  311. package/dist/audio/AudioViews.js.map +0 -1
  312. package/dist/audio/BusBudget.d.ts +0 -89
  313. package/dist/audio/BusBudget.d.ts.map +0 -1
  314. package/dist/audio/BusBudget.js +0 -120
  315. package/dist/audio/BusBudget.js.map +0 -1
  316. package/dist/audio/Captions.d.ts +0 -27
  317. package/dist/audio/Captions.d.ts.map +0 -1
  318. package/dist/audio/Captions.js +0 -16
  319. package/dist/audio/Captions.js.map +0 -1
  320. package/dist/audio/Channels.d.ts +0 -282
  321. package/dist/audio/Channels.d.ts.map +0 -1
  322. package/dist/audio/Channels.js +0 -573
  323. package/dist/audio/Channels.js.map +0 -1
  324. package/dist/audio/CoreHost.d.ts +0 -114
  325. package/dist/audio/CoreHost.d.ts.map +0 -1
  326. package/dist/audio/CoreHost.js +0 -335
  327. package/dist/audio/CoreHost.js.map +0 -1
  328. package/dist/audio/DecoderGuard.d.ts +0 -139
  329. package/dist/audio/DecoderGuard.d.ts.map +0 -1
  330. package/dist/audio/DecoderGuard.js +0 -208
  331. package/dist/audio/DecoderGuard.js.map +0 -1
  332. package/dist/audio/Fft.d.ts +0 -3
  333. package/dist/audio/Fft.d.ts.map +0 -1
  334. package/dist/audio/Fft.js +0 -45
  335. package/dist/audio/Fft.js.map +0 -1
  336. package/dist/audio/LoopTags.d.ts +0 -55
  337. package/dist/audio/LoopTags.d.ts.map +0 -1
  338. package/dist/audio/LoopTags.js +0 -136
  339. package/dist/audio/LoopTags.js.map +0 -1
  340. package/dist/audio/Midi.d.ts +0 -219
  341. package/dist/audio/Midi.d.ts.map +0 -1
  342. package/dist/audio/Midi.js +0 -409
  343. package/dist/audio/Midi.js.map +0 -1
  344. package/dist/audio/MidiRender.d.ts +0 -144
  345. package/dist/audio/MidiRender.d.ts.map +0 -1
  346. package/dist/audio/MidiRender.js +0 -448
  347. package/dist/audio/MidiRender.js.map +0 -1
  348. package/dist/audio/MidiSynth.d.ts +0 -147
  349. package/dist/audio/MidiSynth.d.ts.map +0 -1
  350. package/dist/audio/MidiSynth.js +0 -205
  351. package/dist/audio/MidiSynth.js.map +0 -1
  352. package/dist/audio/Music.d.ts +0 -70
  353. package/dist/audio/Music.d.ts.map +0 -1
  354. package/dist/audio/Music.js +0 -191
  355. package/dist/audio/Music.js.map +0 -1
  356. package/dist/audio/MusicPlayer.d.ts +0 -80
  357. package/dist/audio/MusicPlayer.d.ts.map +0 -1
  358. package/dist/audio/MusicPlayer.js +0 -147
  359. package/dist/audio/MusicPlayer.js.map +0 -1
  360. package/dist/audio/Orchestrator.d.ts +0 -58
  361. package/dist/audio/Orchestrator.d.ts.map +0 -1
  362. package/dist/audio/Orchestrator.js +0 -74
  363. package/dist/audio/Orchestrator.js.map +0 -1
  364. package/dist/audio/Playable.d.ts +0 -38
  365. package/dist/audio/Playable.d.ts.map +0 -1
  366. package/dist/audio/Playable.js +0 -29
  367. package/dist/audio/Playable.js.map +0 -1
  368. package/dist/audio/Positional.d.ts +0 -133
  369. package/dist/audio/Positional.d.ts.map +0 -1
  370. package/dist/audio/Positional.js +0 -138
  371. package/dist/audio/Positional.js.map +0 -1
  372. package/dist/audio/Resample.d.ts +0 -61
  373. package/dist/audio/Resample.d.ts.map +0 -1
  374. package/dist/audio/Resample.js +0 -97
  375. package/dist/audio/Resample.js.map +0 -1
  376. package/dist/audio/SampleDecoder.d.ts +0 -55
  377. package/dist/audio/SampleDecoder.d.ts.map +0 -1
  378. package/dist/audio/SampleDecoder.js +0 -74
  379. package/dist/audio/SampleDecoder.js.map +0 -1
  380. package/dist/audio/Settings.d.ts +0 -99
  381. package/dist/audio/Settings.d.ts.map +0 -1
  382. package/dist/audio/Settings.js +0 -134
  383. package/dist/audio/Settings.js.map +0 -1
  384. package/dist/audio/Sfx.d.ts +0 -148
  385. package/dist/audio/Sfx.d.ts.map +0 -1
  386. package/dist/audio/Sfx.js +0 -213
  387. package/dist/audio/Sfx.js.map +0 -1
  388. package/dist/audio/Sound.d.ts +0 -57
  389. package/dist/audio/Sound.d.ts.map +0 -1
  390. package/dist/audio/Sound.js +0 -79
  391. package/dist/audio/Sound.js.map +0 -1
  392. package/dist/audio/SoundFont.d.ts +0 -192
  393. package/dist/audio/SoundFont.d.ts.map +0 -1
  394. package/dist/audio/SoundFont.js +0 -862
  395. package/dist/audio/SoundFont.js.map +0 -1
  396. package/dist/audio/SpectralDistance.d.ts +0 -34
  397. package/dist/audio/SpectralDistance.d.ts.map +0 -1
  398. package/dist/audio/SpectralDistance.js +0 -64
  399. package/dist/audio/SpectralDistance.js.map +0 -1
  400. package/dist/audio/StreamChannel.d.ts +0 -150
  401. package/dist/audio/StreamChannel.d.ts.map +0 -1
  402. package/dist/audio/StreamChannel.js +0 -390
  403. package/dist/audio/StreamChannel.js.map +0 -1
  404. package/dist/audio/StreamPlayable.d.ts +0 -73
  405. package/dist/audio/StreamPlayable.d.ts.map +0 -1
  406. package/dist/audio/StreamPlayable.js +0 -130
  407. package/dist/audio/StreamPlayable.js.map +0 -1
  408. package/dist/audio/Synth.d.ts +0 -64
  409. package/dist/audio/Synth.d.ts.map +0 -1
  410. package/dist/audio/Synth.js +0 -133
  411. package/dist/audio/Synth.js.map +0 -1
  412. package/dist/audio/SyxBank.d.ts +0 -73
  413. package/dist/audio/SyxBank.d.ts.map +0 -1
  414. package/dist/audio/SyxBank.js +0 -130
  415. package/dist/audio/SyxBank.js.map +0 -1
  416. package/dist/audio/Underrun.d.ts +0 -25
  417. package/dist/audio/Underrun.d.ts.map +0 -1
  418. package/dist/audio/Underrun.js +0 -18
  419. package/dist/audio/Underrun.js.map +0 -1
  420. package/dist/audio/Wav.d.ts +0 -56
  421. package/dist/audio/Wav.d.ts.map +0 -1
  422. package/dist/audio/Wav.js +0 -164
  423. package/dist/audio/Wav.js.map +0 -1
  424. package/dist/audio/WebMidi.d.ts +0 -58
  425. package/dist/audio/WebMidi.d.ts.map +0 -1
  426. package/dist/audio/WebMidi.js +0 -79
  427. package/dist/audio/WebMidi.js.map +0 -1
  428. package/dist/audio/humanize/Groove.d.ts +0 -80
  429. package/dist/audio/humanize/Groove.d.ts.map +0 -1
  430. package/dist/audio/humanize/Groove.js +0 -102
  431. package/dist/audio/humanize/Groove.js.map +0 -1
  432. package/dist/audio/humanize/GrooveConverter.d.ts +0 -49
  433. package/dist/audio/humanize/GrooveConverter.d.ts.map +0 -1
  434. package/dist/audio/humanize/GrooveConverter.js +0 -344
  435. package/dist/audio/humanize/GrooveConverter.js.map +0 -1
  436. package/dist/audio/humanize/GrooveExtractor.d.ts +0 -49
  437. package/dist/audio/humanize/GrooveExtractor.d.ts.map +0 -1
  438. package/dist/audio/humanize/GrooveExtractor.js +0 -179
  439. package/dist/audio/humanize/GrooveExtractor.js.map +0 -1
  440. package/dist/audio/humanize/GrooveHumanizer.d.ts +0 -34
  441. package/dist/audio/humanize/GrooveHumanizer.d.ts.map +0 -1
  442. package/dist/audio/humanize/GrooveHumanizer.js +0 -37
  443. package/dist/audio/humanize/GrooveHumanizer.js.map +0 -1
  444. package/dist/audio/humanize/Humanize.d.ts +0 -54
  445. package/dist/audio/humanize/Humanize.d.ts.map +0 -1
  446. package/dist/audio/humanize/Humanize.js +0 -239
  447. package/dist/audio/humanize/Humanize.js.map +0 -1
  448. package/dist/audio/humanize/HumanizerFactory.d.ts +0 -68
  449. package/dist/audio/humanize/HumanizerFactory.d.ts.map +0 -1
  450. package/dist/audio/humanize/HumanizerFactory.js +0 -84
  451. package/dist/audio/humanize/HumanizerFactory.js.map +0 -1
  452. package/dist/audio/humanize/LiteHumanizer.d.ts +0 -30
  453. package/dist/audio/humanize/LiteHumanizer.d.ts.map +0 -1
  454. package/dist/audio/humanize/LiteHumanizer.js +0 -35
  455. package/dist/audio/humanize/LiteHumanizer.js.map +0 -1
  456. package/dist/audio/humanize/Onsets.d.ts +0 -26
  457. package/dist/audio/humanize/Onsets.d.ts.map +0 -1
  458. package/dist/audio/humanize/Onsets.js +0 -121
  459. package/dist/audio/humanize/Onsets.js.map +0 -1
  460. package/dist/audio/index.d.ts +0 -75
  461. package/dist/audio/index.d.ts.map +0 -1
  462. package/dist/audio/index.js +0 -38
  463. package/dist/audio/index.js.map +0 -1
  464. package/dist/battle/AttackDialog.d.ts +0 -75
  465. package/dist/battle/AttackDialog.d.ts.map +0 -1
  466. package/dist/battle/AttackDialog.js +0 -115
  467. package/dist/battle/AttackDialog.js.map +0 -1
  468. package/dist/battle/AttackPreview.d.ts +0 -70
  469. package/dist/battle/AttackPreview.d.ts.map +0 -1
  470. package/dist/battle/AttackPreview.js +0 -78
  471. package/dist/battle/AttackPreview.js.map +0 -1
  472. package/dist/battle/BattleAI.d.ts +0 -40
  473. package/dist/battle/BattleAI.d.ts.map +0 -1
  474. package/dist/battle/BattleAI.js +0 -63
  475. package/dist/battle/BattleAI.js.map +0 -1
  476. package/dist/battle/BattleStats.d.ts +0 -45
  477. package/dist/battle/BattleStats.d.ts.map +0 -1
  478. package/dist/battle/BattleStats.js +0 -63
  479. package/dist/battle/BattleStats.js.map +0 -1
  480. package/dist/battle/Evolution.d.ts +0 -34
  481. package/dist/battle/Evolution.d.ts.map +0 -1
  482. package/dist/battle/Evolution.js +0 -37
  483. package/dist/battle/Evolution.js.map +0 -1
  484. package/dist/battle/Field.d.ts +0 -36
  485. package/dist/battle/Field.d.ts.map +0 -1
  486. package/dist/battle/Field.js +0 -31
  487. package/dist/battle/Field.js.map +0 -1
  488. package/dist/battle/Hooks.d.ts +0 -39
  489. package/dist/battle/Hooks.d.ts.map +0 -1
  490. package/dist/battle/Hooks.js +0 -38
  491. package/dist/battle/Hooks.js.map +0 -1
  492. package/dist/battle/Move.d.ts +0 -45
  493. package/dist/battle/Move.d.ts.map +0 -1
  494. package/dist/battle/Move.js +0 -23
  495. package/dist/battle/Move.js.map +0 -1
  496. package/dist/battle/Party.d.ts +0 -32
  497. package/dist/battle/Party.d.ts.map +0 -1
  498. package/dist/battle/Party.js +0 -62
  499. package/dist/battle/Party.js.map +0 -1
  500. package/dist/battle/Species.d.ts +0 -50
  501. package/dist/battle/Species.d.ts.map +0 -1
  502. package/dist/battle/Species.js +0 -41
  503. package/dist/battle/Species.js.map +0 -1
  504. package/dist/battle/StatStages.d.ts +0 -52
  505. package/dist/battle/StatStages.d.ts.map +0 -1
  506. package/dist/battle/StatStages.js +0 -51
  507. package/dist/battle/StatStages.js.map +0 -1
  508. package/dist/battle/TypeMatrix.d.ts +0 -25
  509. package/dist/battle/TypeMatrix.d.ts.map +0 -1
  510. package/dist/battle/TypeMatrix.js +0 -35
  511. package/dist/battle/TypeMatrix.js.map +0 -1
  512. package/dist/battle/UnitSelector.d.ts +0 -72
  513. package/dist/battle/UnitSelector.d.ts.map +0 -1
  514. package/dist/battle/UnitSelector.js +0 -117
  515. package/dist/battle/UnitSelector.js.map +0 -1
  516. package/dist/battle/Whiteboard.d.ts +0 -50
  517. package/dist/battle/Whiteboard.d.ts.map +0 -1
  518. package/dist/battle/Whiteboard.js +0 -94
  519. package/dist/battle/Whiteboard.js.map +0 -1
  520. package/dist/battle/index.d.ts +0 -26
  521. package/dist/battle/index.d.ts.map +0 -1
  522. package/dist/battle/index.js +0 -15
  523. package/dist/battle/index.js.map +0 -1
  524. package/dist/board/Army.d.ts +0 -92
  525. package/dist/board/Army.d.ts.map +0 -1
  526. package/dist/board/Army.js +0 -123
  527. package/dist/board/Army.js.map +0 -1
  528. package/dist/board/Classics.d.ts +0 -419
  529. package/dist/board/Classics.d.ts.map +0 -1
  530. package/dist/board/Classics.js +0 -754
  531. package/dist/board/Classics.js.map +0 -1
  532. package/dist/board/Engine.d.ts +0 -95
  533. package/dist/board/Engine.d.ts.map +0 -1
  534. package/dist/board/Engine.js +0 -545
  535. package/dist/board/Engine.js.map +0 -1
  536. package/dist/board/FogOfWar.d.ts +0 -79
  537. package/dist/board/FogOfWar.d.ts.map +0 -1
  538. package/dist/board/FogOfWar.js +0 -150
  539. package/dist/board/FogOfWar.js.map +0 -1
  540. package/dist/board/HexSkirmish.d.ts +0 -213
  541. package/dist/board/HexSkirmish.d.ts.map +0 -1
  542. package/dist/board/HexSkirmish.js +0 -268
  543. package/dist/board/HexSkirmish.js.map +0 -1
  544. package/dist/board/Tactics.d.ts +0 -212
  545. package/dist/board/Tactics.d.ts.map +0 -1
  546. package/dist/board/Tactics.js +0 -303
  547. package/dist/board/Tactics.js.map +0 -1
  548. package/dist/board/bitboard.d.ts +0 -132
  549. package/dist/board/bitboard.d.ts.map +0 -1
  550. package/dist/board/bitboard.js +0 -495
  551. package/dist/board/bitboard.js.map +0 -1
  552. package/dist/board/chess.d.ts +0 -167
  553. package/dist/board/chess.d.ts.map +0 -1
  554. package/dist/board/chess.js +0 -578
  555. package/dist/board/chess.js.map +0 -1
  556. package/dist/board/index.d.ts +0 -23
  557. package/dist/board/index.d.ts.map +0 -1
  558. package/dist/board/index.js +0 -12
  559. package/dist/board/index.js.map +0 -1
  560. package/dist/board/openings.d.ts +0 -58
  561. package/dist/board/openings.d.ts.map +0 -1
  562. package/dist/board/openings.js +0 -45
  563. package/dist/board/openings.js.map +0 -1
  564. package/dist/board/tablebase.d.ts +0 -118
  565. package/dist/board/tablebase.d.ts.map +0 -1
  566. package/dist/board/tablebase.js +0 -414
  567. package/dist/board/tablebase.js.map +0 -1
  568. package/dist/board/tourney.d.ts +0 -97
  569. package/dist/board/tourney.d.ts.map +0 -1
  570. package/dist/board/tourney.js +0 -1002
  571. package/dist/board/tourney.js.map +0 -1
  572. package/dist/core/Achievements.d.ts +0 -101
  573. package/dist/core/Achievements.d.ts.map +0 -1
  574. package/dist/core/Achievements.js +0 -141
  575. package/dist/core/Achievements.js.map +0 -1
  576. package/dist/core/ActionJournal.d.ts +0 -43
  577. package/dist/core/ActionJournal.d.ts.map +0 -1
  578. package/dist/core/ActionJournal.js +0 -77
  579. package/dist/core/ActionJournal.js.map +0 -1
  580. package/dist/core/Blob.d.ts +0 -79
  581. package/dist/core/Blob.d.ts.map +0 -1
  582. package/dist/core/Blob.js +0 -140
  583. package/dist/core/Blob.js.map +0 -1
  584. package/dist/core/Clone.d.ts +0 -31
  585. package/dist/core/Clone.d.ts.map +0 -1
  586. package/dist/core/Clone.js +0 -84
  587. package/dist/core/Clone.js.map +0 -1
  588. package/dist/core/Collection.d.ts +0 -59
  589. package/dist/core/Collection.d.ts.map +0 -1
  590. package/dist/core/Collection.js +0 -77
  591. package/dist/core/Collection.js.map +0 -1
  592. package/dist/core/Csv.d.ts +0 -74
  593. package/dist/core/Csv.d.ts.map +0 -1
  594. package/dist/core/Csv.js +0 -201
  595. package/dist/core/Csv.js.map +0 -1
  596. package/dist/core/DialogueText.d.ts +0 -72
  597. package/dist/core/DialogueText.d.ts.map +0 -1
  598. package/dist/core/DialogueText.js +0 -68
  599. package/dist/core/DialogueText.js.map +0 -1
  600. package/dist/core/Entity.d.ts +0 -42
  601. package/dist/core/Entity.d.ts.map +0 -1
  602. package/dist/core/Entity.js +0 -61
  603. package/dist/core/Entity.js.map +0 -1
  604. package/dist/core/Feedback.d.ts +0 -27
  605. package/dist/core/Feedback.d.ts.map +0 -1
  606. package/dist/core/Feedback.js +0 -33
  607. package/dist/core/Feedback.js.map +0 -1
  608. package/dist/core/FixedStepper.d.ts +0 -38
  609. package/dist/core/FixedStepper.d.ts.map +0 -1
  610. package/dist/core/FixedStepper.js +0 -56
  611. package/dist/core/FixedStepper.js.map +0 -1
  612. package/dist/core/Grid.d.ts +0 -179
  613. package/dist/core/Grid.d.ts.map +0 -1
  614. package/dist/core/Grid.js +0 -201
  615. package/dist/core/Grid.js.map +0 -1
  616. package/dist/core/Handles.d.ts +0 -42
  617. package/dist/core/Handles.d.ts.map +0 -1
  618. package/dist/core/Handles.js +0 -38
  619. package/dist/core/Handles.js.map +0 -1
  620. package/dist/core/Hex.d.ts +0 -79
  621. package/dist/core/Hex.d.ts.map +0 -1
  622. package/dist/core/Hex.js +0 -161
  623. package/dist/core/Hex.js.map +0 -1
  624. package/dist/core/Hooks.d.ts +0 -48
  625. package/dist/core/Hooks.d.ts.map +0 -1
  626. package/dist/core/Hooks.js +0 -33
  627. package/dist/core/Hooks.js.map +0 -1
  628. package/dist/core/HttpTransport.d.ts +0 -53
  629. package/dist/core/HttpTransport.d.ts.map +0 -1
  630. package/dist/core/HttpTransport.js +0 -108
  631. package/dist/core/HttpTransport.js.map +0 -1
  632. package/dist/core/Input.d.ts +0 -256
  633. package/dist/core/Input.d.ts.map +0 -1
  634. package/dist/core/Input.js +0 -557
  635. package/dist/core/Input.js.map +0 -1
  636. package/dist/core/JavaRandom.d.ts +0 -55
  637. package/dist/core/JavaRandom.d.ts.map +0 -1
  638. package/dist/core/JavaRandom.js +0 -81
  639. package/dist/core/JavaRandom.js.map +0 -1
  640. package/dist/core/Loading.d.ts +0 -65
  641. package/dist/core/Loading.d.ts.map +0 -1
  642. package/dist/core/Loading.js +0 -119
  643. package/dist/core/Loading.js.map +0 -1
  644. package/dist/core/Log.d.ts +0 -48
  645. package/dist/core/Log.d.ts.map +0 -1
  646. package/dist/core/Log.js +0 -59
  647. package/dist/core/Log.js.map +0 -1
  648. package/dist/core/Math.d.ts +0 -14
  649. package/dist/core/Math.d.ts.map +0 -1
  650. package/dist/core/Math.js +0 -16
  651. package/dist/core/Math.js.map +0 -1
  652. package/dist/core/Motion.d.ts +0 -47
  653. package/dist/core/Motion.d.ts.map +0 -1
  654. package/dist/core/Motion.js +0 -122
  655. package/dist/core/Motion.js.map +0 -1
  656. package/dist/core/Multiplayer.d.ts +0 -101
  657. package/dist/core/Multiplayer.d.ts.map +0 -1
  658. package/dist/core/Multiplayer.js +0 -156
  659. package/dist/core/Multiplayer.js.map +0 -1
  660. package/dist/core/News.d.ts +0 -51
  661. package/dist/core/News.d.ts.map +0 -1
  662. package/dist/core/News.js +0 -65
  663. package/dist/core/News.js.map +0 -1
  664. package/dist/core/Pathfinding.d.ts +0 -41
  665. package/dist/core/Pathfinding.d.ts.map +0 -1
  666. package/dist/core/Pathfinding.js +0 -86
  667. package/dist/core/Pathfinding.js.map +0 -1
  668. package/dist/core/PlayerInput.d.ts +0 -57
  669. package/dist/core/PlayerInput.d.ts.map +0 -1
  670. package/dist/core/PlayerInput.js +0 -82
  671. package/dist/core/PlayerInput.js.map +0 -1
  672. package/dist/core/Presentation.d.ts +0 -56
  673. package/dist/core/Presentation.d.ts.map +0 -1
  674. package/dist/core/Presentation.js +0 -78
  675. package/dist/core/Presentation.js.map +0 -1
  676. package/dist/core/Random.d.ts +0 -259
  677. package/dist/core/Random.d.ts.map +0 -1
  678. package/dist/core/Random.js +0 -408
  679. package/dist/core/Random.js.map +0 -1
  680. package/dist/core/Reactions.d.ts +0 -67
  681. package/dist/core/Reactions.d.ts.map +0 -1
  682. package/dist/core/Reactions.js +0 -92
  683. package/dist/core/Reactions.js.map +0 -1
  684. package/dist/core/Registry.d.ts +0 -31
  685. package/dist/core/Registry.d.ts.map +0 -1
  686. package/dist/core/Registry.js +0 -46
  687. package/dist/core/Registry.js.map +0 -1
  688. package/dist/core/Replay.d.ts +0 -126
  689. package/dist/core/Replay.d.ts.map +0 -1
  690. package/dist/core/Replay.js +0 -162
  691. package/dist/core/Replay.js.map +0 -1
  692. package/dist/core/ReplayFile.d.ts +0 -197
  693. package/dist/core/ReplayFile.d.ts.map +0 -1
  694. package/dist/core/ReplayFile.js +0 -257
  695. package/dist/core/ReplayFile.js.map +0 -1
  696. package/dist/core/RunHistory.d.ts +0 -54
  697. package/dist/core/RunHistory.d.ts.map +0 -1
  698. package/dist/core/RunHistory.js +0 -40
  699. package/dist/core/RunHistory.js.map +0 -1
  700. package/dist/core/Sanitize.d.ts +0 -101
  701. package/dist/core/Sanitize.d.ts.map +0 -1
  702. package/dist/core/Sanitize.js +0 -162
  703. package/dist/core/Sanitize.js.map +0 -1
  704. package/dist/core/Save.d.ts +0 -123
  705. package/dist/core/Save.d.ts.map +0 -1
  706. package/dist/core/Save.js +0 -216
  707. package/dist/core/Save.js.map +0 -1
  708. package/dist/core/SaveSync.d.ts +0 -43
  709. package/dist/core/SaveSync.d.ts.map +0 -1
  710. package/dist/core/SaveSync.js +0 -56
  711. package/dist/core/SaveSync.js.map +0 -1
  712. package/dist/core/Scene.d.ts +0 -63
  713. package/dist/core/Scene.d.ts.map +0 -1
  714. package/dist/core/Scene.js +0 -81
  715. package/dist/core/Scene.js.map +0 -1
  716. package/dist/core/SceneComponents.d.ts +0 -67
  717. package/dist/core/SceneComponents.d.ts.map +0 -1
  718. package/dist/core/SceneComponents.js +0 -76
  719. package/dist/core/SceneComponents.js.map +0 -1
  720. package/dist/core/SceneStack.d.ts +0 -61
  721. package/dist/core/SceneStack.d.ts.map +0 -1
  722. package/dist/core/SceneStack.js +0 -91
  723. package/dist/core/SceneStack.js.map +0 -1
  724. package/dist/core/Scramble.d.ts +0 -21
  725. package/dist/core/Scramble.d.ts.map +0 -1
  726. package/dist/core/Scramble.js +0 -52
  727. package/dist/core/Scramble.js.map +0 -1
  728. package/dist/core/Session.d.ts +0 -31
  729. package/dist/core/Session.d.ts.map +0 -1
  730. package/dist/core/Session.js +0 -11
  731. package/dist/core/Session.js.map +0 -1
  732. package/dist/core/Settings.d.ts +0 -96
  733. package/dist/core/Settings.d.ts.map +0 -1
  734. package/dist/core/Settings.js +0 -190
  735. package/dist/core/Settings.js.map +0 -1
  736. package/dist/core/Signal.d.ts +0 -35
  737. package/dist/core/Signal.d.ts.map +0 -1
  738. package/dist/core/Signal.js +0 -41
  739. package/dist/core/Signal.js.map +0 -1
  740. package/dist/core/Spawner.d.ts +0 -65
  741. package/dist/core/Spawner.d.ts.map +0 -1
  742. package/dist/core/Spawner.js +0 -82
  743. package/dist/core/Spawner.js.map +0 -1
  744. package/dist/core/State.d.ts +0 -97
  745. package/dist/core/State.d.ts.map +0 -1
  746. package/dist/core/State.js +0 -177
  747. package/dist/core/State.js.map +0 -1
  748. package/dist/core/Stats.d.ts +0 -46
  749. package/dist/core/Stats.d.ts.map +0 -1
  750. package/dist/core/Stats.js +0 -47
  751. package/dist/core/Stats.js.map +0 -1
  752. package/dist/core/StoredValue.d.ts +0 -30
  753. package/dist/core/StoredValue.d.ts.map +0 -1
  754. package/dist/core/StoredValue.js +0 -38
  755. package/dist/core/StoredValue.js.map +0 -1
  756. package/dist/core/SyncGuard.d.ts +0 -57
  757. package/dist/core/SyncGuard.d.ts.map +0 -1
  758. package/dist/core/SyncGuard.js +0 -116
  759. package/dist/core/SyncGuard.js.map +0 -1
  760. package/dist/core/Telemetry.d.ts +0 -63
  761. package/dist/core/Telemetry.d.ts.map +0 -1
  762. package/dist/core/Telemetry.js +0 -83
  763. package/dist/core/Telemetry.js.map +0 -1
  764. package/dist/core/Twee.d.ts +0 -101
  765. package/dist/core/Twee.d.ts.map +0 -1
  766. package/dist/core/Twee.js +0 -174
  767. package/dist/core/Twee.js.map +0 -1
  768. package/dist/core/Tween.d.ts +0 -60
  769. package/dist/core/Tween.d.ts.map +0 -1
  770. package/dist/core/Tween.js +0 -98
  771. package/dist/core/Tween.js.map +0 -1
  772. package/dist/core/UndoHistory.d.ts +0 -52
  773. package/dist/core/UndoHistory.d.ts.map +0 -1
  774. package/dist/core/UndoHistory.js +0 -49
  775. package/dist/core/UndoHistory.js.map +0 -1
  776. package/dist/core/index.d.ts +0 -94
  777. package/dist/core/index.d.ts.map +0 -1
  778. package/dist/core/index.js +0 -53
  779. package/dist/core/index.js.map +0 -1
  780. package/dist/headless/index.d.ts +0 -87
  781. package/dist/headless/index.d.ts.map +0 -1
  782. package/dist/headless/index.js +0 -87
  783. package/dist/headless/index.js.map +0 -1
  784. package/dist/i18n/Content.d.ts +0 -151
  785. package/dist/i18n/Content.d.ts.map +0 -1
  786. package/dist/i18n/Content.js +0 -218
  787. package/dist/i18n/Content.js.map +0 -1
  788. package/dist/i18n/EditSession.d.ts +0 -101
  789. package/dist/i18n/EditSession.d.ts.map +0 -1
  790. package/dist/i18n/EditSession.js +0 -150
  791. package/dist/i18n/EditSession.js.map +0 -1
  792. package/dist/i18n/Fluent.d.ts +0 -7
  793. package/dist/i18n/Fluent.d.ts.map +0 -1
  794. package/dist/i18n/Fluent.js +0 -98
  795. package/dist/i18n/Fluent.js.map +0 -1
  796. package/dist/i18n/Format.d.ts +0 -25
  797. package/dist/i18n/Format.d.ts.map +0 -1
  798. package/dist/i18n/Format.js +0 -32
  799. package/dist/i18n/Format.js.map +0 -1
  800. package/dist/i18n/FormatSpec.d.ts +0 -76
  801. package/dist/i18n/FormatSpec.d.ts.map +0 -1
  802. package/dist/i18n/FormatSpec.js +0 -306
  803. package/dist/i18n/FormatSpec.js.map +0 -1
  804. package/dist/i18n/Po.d.ts +0 -54
  805. package/dist/i18n/Po.d.ts.map +0 -1
  806. package/dist/i18n/Po.js +0 -192
  807. package/dist/i18n/Po.js.map +0 -1
  808. package/dist/i18n/SemanticMessage.d.ts +0 -84
  809. package/dist/i18n/SemanticMessage.d.ts.map +0 -1
  810. package/dist/i18n/SemanticMessage.js +0 -54
  811. package/dist/i18n/SemanticMessage.js.map +0 -1
  812. package/dist/i18n/SoundMarkers.d.ts +0 -38
  813. package/dist/i18n/SoundMarkers.d.ts.map +0 -1
  814. package/dist/i18n/SoundMarkers.js +0 -48
  815. package/dist/i18n/SoundMarkers.js.map +0 -1
  816. package/dist/i18n/Validate.d.ts +0 -82
  817. package/dist/i18n/Validate.d.ts.map +0 -1
  818. package/dist/i18n/Validate.js +0 -106
  819. package/dist/i18n/Validate.js.map +0 -1
  820. package/dist/i18n/index.d.ts +0 -177
  821. package/dist/i18n/index.d.ts.map +0 -1
  822. package/dist/i18n/index.js +0 -331
  823. package/dist/i18n/index.js.map +0 -1
  824. package/dist/index.d.ts +0 -26
  825. package/dist/index.d.ts.map +0 -1
  826. package/dist/index.js +0 -26
  827. package/dist/index.js.map +0 -1
  828. package/dist/mw_games.global.js +0 -1410
  829. package/dist/mwl/MapFile.d.ts +0 -41
  830. package/dist/mwl/MapFile.d.ts.map +0 -1
  831. package/dist/mwl/MapFile.js +0 -53
  832. package/dist/mwl/MapFile.js.map +0 -1
  833. package/dist/mwl/actors.d.ts +0 -62
  834. package/dist/mwl/actors.d.ts.map +0 -1
  835. package/dist/mwl/actors.js +0 -82
  836. package/dist/mwl/actors.js.map +0 -1
  837. package/dist/mwl/campaign.d.ts +0 -51
  838. package/dist/mwl/campaign.d.ts.map +0 -1
  839. package/dist/mwl/campaign.js +0 -58
  840. package/dist/mwl/campaign.js.map +0 -1
  841. package/dist/mwl/carryover.d.ts +0 -86
  842. package/dist/mwl/carryover.d.ts.map +0 -1
  843. package/dist/mwl/carryover.js +0 -70
  844. package/dist/mwl/carryover.js.map +0 -1
  845. package/dist/mwl/catalog.d.ts +0 -98
  846. package/dist/mwl/catalog.d.ts.map +0 -1
  847. package/dist/mwl/catalog.js +0 -259
  848. package/dist/mwl/catalog.js.map +0 -1
  849. package/dist/mwl/compiler.d.ts +0 -135
  850. package/dist/mwl/compiler.d.ts.map +0 -1
  851. package/dist/mwl/compiler.js +0 -216
  852. package/dist/mwl/compiler.js.map +0 -1
  853. package/dist/mwl/conditions.d.ts +0 -30
  854. package/dist/mwl/conditions.d.ts.map +0 -1
  855. package/dist/mwl/conditions.js +0 -212
  856. package/dist/mwl/conditions.js.map +0 -1
  857. package/dist/mwl/content.d.ts +0 -140
  858. package/dist/mwl/content.d.ts.map +0 -1
  859. package/dist/mwl/content.js +0 -179
  860. package/dist/mwl/content.js.map +0 -1
  861. package/dist/mwl/expression.d.ts +0 -42
  862. package/dist/mwl/expression.d.ts.map +0 -1
  863. package/dist/mwl/expression.js +0 -164
  864. package/dist/mwl/expression.js.map +0 -1
  865. package/dist/mwl/grammar.d.ts +0 -100
  866. package/dist/mwl/grammar.d.ts.map +0 -1
  867. package/dist/mwl/grammar.js +0 -588
  868. package/dist/mwl/grammar.js.map +0 -1
  869. package/dist/mwl/hooks.d.ts +0 -201
  870. package/dist/mwl/hooks.d.ts.map +0 -1
  871. package/dist/mwl/hooks.js +0 -165
  872. package/dist/mwl/hooks.js.map +0 -1
  873. package/dist/mwl/index.d.ts +0 -51
  874. package/dist/mwl/index.d.ts.map +0 -1
  875. package/dist/mwl/index.js +0 -26
  876. package/dist/mwl/index.js.map +0 -1
  877. package/dist/mwl/objects.d.ts +0 -31
  878. package/dist/mwl/objects.d.ts.map +0 -1
  879. package/dist/mwl/objects.js +0 -83
  880. package/dist/mwl/objects.js.map +0 -1
  881. package/dist/mwl/package-container.d.ts +0 -185
  882. package/dist/mwl/package-container.d.ts.map +0 -1
  883. package/dist/mwl/package-container.js +0 -446
  884. package/dist/mwl/package-container.js.map +0 -1
  885. package/dist/mwl/package-document.d.ts +0 -217
  886. package/dist/mwl/package-document.d.ts.map +0 -1
  887. package/dist/mwl/package-document.js +0 -639
  888. package/dist/mwl/package-document.js.map +0 -1
  889. package/dist/mwl/package-rom.d.ts +0 -37
  890. package/dist/mwl/package-rom.d.ts.map +0 -1
  891. package/dist/mwl/package-rom.js +0 -96
  892. package/dist/mwl/package-rom.js.map +0 -1
  893. package/dist/mwl/package-verify.d.ts +0 -34
  894. package/dist/mwl/package-verify.d.ts.map +0 -1
  895. package/dist/mwl/package-verify.js +0 -111
  896. package/dist/mwl/package-verify.js.map +0 -1
  897. package/dist/mwl/package.d.ts +0 -184
  898. package/dist/mwl/package.d.ts.map +0 -1
  899. package/dist/mwl/package.js +0 -382
  900. package/dist/mwl/package.js.map +0 -1
  901. package/dist/mwl/persistence.d.ts +0 -67
  902. package/dist/mwl/persistence.d.ts.map +0 -1
  903. package/dist/mwl/persistence.js +0 -135
  904. package/dist/mwl/persistence.js.map +0 -1
  905. package/dist/mwl/presentation.d.ts +0 -86
  906. package/dist/mwl/presentation.d.ts.map +0 -1
  907. package/dist/mwl/presentation.js +0 -419
  908. package/dist/mwl/presentation.js.map +0 -1
  909. package/dist/mwl/pyroeis-runtime.d.ts +0 -82
  910. package/dist/mwl/pyroeis-runtime.d.ts.map +0 -1
  911. package/dist/mwl/pyroeis-runtime.js +0 -535
  912. package/dist/mwl/pyroeis-runtime.js.map +0 -1
  913. package/dist/mwl/pyroeis.d.ts +0 -54
  914. package/dist/mwl/pyroeis.d.ts.map +0 -1
  915. package/dist/mwl/pyroeis.js +0 -189
  916. package/dist/mwl/pyroeis.js.map +0 -1
  917. package/dist/mwl/readers.d.ts +0 -77
  918. package/dist/mwl/readers.d.ts.map +0 -1
  919. package/dist/mwl/readers.js +0 -150
  920. package/dist/mwl/readers.js.map +0 -1
  921. package/dist/mwl/report.d.ts +0 -44
  922. package/dist/mwl/report.d.ts.map +0 -1
  923. package/dist/mwl/report.js +0 -88
  924. package/dist/mwl/report.js.map +0 -1
  925. package/dist/mwl/runtime.d.ts +0 -577
  926. package/dist/mwl/runtime.d.ts.map +0 -1
  927. package/dist/mwl/runtime.js +0 -1741
  928. package/dist/mwl/runtime.js.map +0 -1
  929. package/dist/mwl/schema.d.ts +0 -151
  930. package/dist/mwl/schema.d.ts.map +0 -1
  931. package/dist/mwl/schema.js +0 -979
  932. package/dist/mwl/schema.js.map +0 -1
  933. package/dist/mwl/scripts.d.ts +0 -26
  934. package/dist/mwl/scripts.d.ts.map +0 -1
  935. package/dist/mwl/scripts.js +0 -34
  936. package/dist/mwl/scripts.js.map +0 -1
  937. package/dist/mwl/tables.d.ts +0 -95
  938. package/dist/mwl/tables.d.ts.map +0 -1
  939. package/dist/mwl/tables.js +0 -100
  940. package/dist/mwl/tables.js.map +0 -1
  941. package/dist/mwl/utils.d.ts +0 -10
  942. package/dist/mwl/utils.d.ts.map +0 -1
  943. package/dist/mwl/utils.js +0 -40
  944. package/dist/mwl/utils.js.map +0 -1
  945. package/dist/physics/PhysicsWorld.d.ts +0 -158
  946. package/dist/physics/PhysicsWorld.d.ts.map +0 -1
  947. package/dist/physics/PhysicsWorld.js +0 -376
  948. package/dist/physics/PhysicsWorld.js.map +0 -1
  949. package/dist/physics/XpbdWorld.d.ts +0 -213
  950. package/dist/physics/XpbdWorld.d.ts.map +0 -1
  951. package/dist/physics/XpbdWorld.js +0 -337
  952. package/dist/physics/XpbdWorld.js.map +0 -1
  953. package/dist/physics/cloth/index.d.ts +0 -99
  954. package/dist/physics/cloth/index.d.ts.map +0 -1
  955. package/dist/physics/cloth/index.js +0 -226
  956. package/dist/physics/cloth/index.js.map +0 -1
  957. package/dist/physics/index.d.ts +0 -7
  958. package/dist/physics/index.d.ts.map +0 -1
  959. package/dist/physics/index.js +0 -4
  960. package/dist/physics/index.js.map +0 -1
  961. package/dist/physics/spring/index.d.ts +0 -91
  962. package/dist/physics/spring/index.d.ts.map +0 -1
  963. package/dist/physics/spring/index.js +0 -120
  964. package/dist/physics/spring/index.js.map +0 -1
  965. package/dist/physics/xpbd.d.ts +0 -3
  966. package/dist/physics/xpbd.d.ts.map +0 -1
  967. package/dist/physics/xpbd.js +0 -2
  968. package/dist/physics/xpbd.js.map +0 -1
  969. package/dist/roguelike/Boss.d.ts +0 -79
  970. package/dist/roguelike/Boss.d.ts.map +0 -1
  971. package/dist/roguelike/Boss.js +0 -126
  972. package/dist/roguelike/Boss.js.map +0 -1
  973. package/dist/roguelike/Cave.d.ts +0 -124
  974. package/dist/roguelike/Cave.d.ts.map +0 -1
  975. package/dist/roguelike/Cave.js +0 -216
  976. package/dist/roguelike/Cave.js.map +0 -1
  977. package/dist/roguelike/Combat.d.ts +0 -35
  978. package/dist/roguelike/Combat.d.ts.map +0 -1
  979. package/dist/roguelike/Combat.js +0 -33
  980. package/dist/roguelike/Combat.js.map +0 -1
  981. package/dist/roguelike/ContentRoll.d.ts +0 -53
  982. package/dist/roguelike/ContentRoll.d.ts.map +0 -1
  983. package/dist/roguelike/ContentRoll.js +0 -48
  984. package/dist/roguelike/ContentRoll.js.map +0 -1
  985. package/dist/roguelike/Doors.d.ts +0 -73
  986. package/dist/roguelike/Doors.d.ts.map +0 -1
  987. package/dist/roguelike/Doors.js +0 -115
  988. package/dist/roguelike/Doors.js.map +0 -1
  989. package/dist/roguelike/DungeonParity.d.ts +0 -57
  990. package/dist/roguelike/DungeonParity.d.ts.map +0 -1
  991. package/dist/roguelike/DungeonParity.js +0 -87
  992. package/dist/roguelike/DungeonParity.js.map +0 -1
  993. package/dist/roguelike/Elevation.d.ts +0 -41
  994. package/dist/roguelike/Elevation.d.ts.map +0 -1
  995. package/dist/roguelike/Elevation.js +0 -52
  996. package/dist/roguelike/Elevation.js.map +0 -1
  997. package/dist/roguelike/Features.d.ts +0 -59
  998. package/dist/roguelike/Features.d.ts.map +0 -1
  999. package/dist/roguelike/Features.js +0 -76
  1000. package/dist/roguelike/Features.js.map +0 -1
  1001. package/dist/roguelike/FieldOfView.d.ts +0 -86
  1002. package/dist/roguelike/FieldOfView.d.ts.map +0 -1
  1003. package/dist/roguelike/FieldOfView.js +0 -148
  1004. package/dist/roguelike/FieldOfView.js.map +0 -1
  1005. package/dist/roguelike/Level.d.ts +0 -139
  1006. package/dist/roguelike/Level.d.ts.map +0 -1
  1007. package/dist/roguelike/Level.js +0 -189
  1008. package/dist/roguelike/Level.js.map +0 -1
  1009. package/dist/roguelike/MonsterAI.d.ts +0 -54
  1010. package/dist/roguelike/MonsterAI.d.ts.map +0 -1
  1011. package/dist/roguelike/MonsterAI.js +0 -83
  1012. package/dist/roguelike/MonsterAI.js.map +0 -1
  1013. package/dist/roguelike/MultiStageAbility.d.ts +0 -59
  1014. package/dist/roguelike/MultiStageAbility.d.ts.map +0 -1
  1015. package/dist/roguelike/MultiStageAbility.js +0 -76
  1016. package/dist/roguelike/MultiStageAbility.js.map +0 -1
  1017. package/dist/roguelike/MultiTurnBeam.d.ts +0 -108
  1018. package/dist/roguelike/MultiTurnBeam.d.ts.map +0 -1
  1019. package/dist/roguelike/MultiTurnBeam.js +0 -164
  1020. package/dist/roguelike/MultiTurnBeam.js.map +0 -1
  1021. package/dist/roguelike/Overworld.d.ts +0 -89
  1022. package/dist/roguelike/Overworld.d.ts.map +0 -1
  1023. package/dist/roguelike/Overworld.js +0 -325
  1024. package/dist/roguelike/Overworld.js.map +0 -1
  1025. package/dist/roguelike/Pathfinder.d.ts +0 -103
  1026. package/dist/roguelike/Pathfinder.d.ts.map +0 -1
  1027. package/dist/roguelike/Pathfinder.js +0 -213
  1028. package/dist/roguelike/Pathfinder.js.map +0 -1
  1029. package/dist/roguelike/Placement.d.ts +0 -62
  1030. package/dist/roguelike/Placement.d.ts.map +0 -1
  1031. package/dist/roguelike/Placement.js +0 -79
  1032. package/dist/roguelike/Placement.js.map +0 -1
  1033. package/dist/roguelike/RoomBuilders.d.ts +0 -60
  1034. package/dist/roguelike/RoomBuilders.d.ts.map +0 -1
  1035. package/dist/roguelike/RoomBuilders.js +0 -57
  1036. package/dist/roguelike/RoomBuilders.js.map +0 -1
  1037. package/dist/roguelike/Scheduler.d.ts +0 -96
  1038. package/dist/roguelike/Scheduler.d.ts.map +0 -1
  1039. package/dist/roguelike/Scheduler.js +0 -154
  1040. package/dist/roguelike/Scheduler.js.map +0 -1
  1041. package/dist/roguelike/Secrets.d.ts +0 -57
  1042. package/dist/roguelike/Secrets.d.ts.map +0 -1
  1043. package/dist/roguelike/Secrets.js +0 -77
  1044. package/dist/roguelike/Secrets.js.map +0 -1
  1045. package/dist/roguelike/Stealth.d.ts +0 -47
  1046. package/dist/roguelike/Stealth.d.ts.map +0 -1
  1047. package/dist/roguelike/Stealth.js +0 -48
  1048. package/dist/roguelike/Stealth.js.map +0 -1
  1049. package/dist/roguelike/Targeting.d.ts +0 -312
  1050. package/dist/roguelike/Targeting.d.ts.map +0 -1
  1051. package/dist/roguelike/Targeting.js +0 -483
  1052. package/dist/roguelike/Targeting.js.map +0 -1
  1053. package/dist/roguelike/TriggerTracker.d.ts +0 -46
  1054. package/dist/roguelike/TriggerTracker.d.ts.map +0 -1
  1055. package/dist/roguelike/TriggerTracker.js +0 -59
  1056. package/dist/roguelike/TriggerTracker.js.map +0 -1
  1057. package/dist/roguelike/generate.d.ts +0 -139
  1058. package/dist/roguelike/generate.d.ts.map +0 -1
  1059. package/dist/roguelike/generate.js +0 -166
  1060. package/dist/roguelike/generate.js.map +0 -1
  1061. package/dist/roguelike/index.d.ts +0 -48
  1062. package/dist/roguelike/index.d.ts.map +0 -1
  1063. package/dist/roguelike/index.js +0 -27
  1064. package/dist/roguelike/index.js.map +0 -1
  1065. package/dist/rpg/Collision.d.ts +0 -61
  1066. package/dist/rpg/Collision.d.ts.map +0 -1
  1067. package/dist/rpg/Collision.js +0 -94
  1068. package/dist/rpg/Collision.js.map +0 -1
  1069. package/dist/rpg/Event.d.ts +0 -50
  1070. package/dist/rpg/Event.d.ts.map +0 -1
  1071. package/dist/rpg/Event.js +0 -36
  1072. package/dist/rpg/Event.js.map +0 -1
  1073. package/dist/rpg/EventRunner.d.ts +0 -139
  1074. package/dist/rpg/EventRunner.d.ts.map +0 -1
  1075. package/dist/rpg/EventRunner.js +0 -125
  1076. package/dist/rpg/EventRunner.js.map +0 -1
  1077. package/dist/rpg/FreeMover.d.ts +0 -59
  1078. package/dist/rpg/FreeMover.d.ts.map +0 -1
  1079. package/dist/rpg/FreeMover.js +0 -79
  1080. package/dist/rpg/FreeMover.js.map +0 -1
  1081. package/dist/rpg/GameState.d.ts +0 -36
  1082. package/dist/rpg/GameState.d.ts.map +0 -1
  1083. package/dist/rpg/GameState.js +0 -49
  1084. package/dist/rpg/GameState.js.map +0 -1
  1085. package/dist/rpg/GridMover.d.ts +0 -71
  1086. package/dist/rpg/GridMover.d.ts.map +0 -1
  1087. package/dist/rpg/GridMover.js +0 -119
  1088. package/dist/rpg/GridMover.js.map +0 -1
  1089. package/dist/rpg/Marshal.d.ts +0 -81
  1090. package/dist/rpg/Marshal.d.ts.map +0 -1
  1091. package/dist/rpg/Marshal.js +0 -422
  1092. package/dist/rpg/Marshal.js.map +0 -1
  1093. package/dist/rpg/MovableSprite.d.ts +0 -31
  1094. package/dist/rpg/MovableSprite.d.ts.map +0 -1
  1095. package/dist/rpg/MovableSprite.js +0 -10
  1096. package/dist/rpg/MovableSprite.js.map +0 -1
  1097. package/dist/rpg/MoveRoute.d.ts +0 -118
  1098. package/dist/rpg/MoveRoute.d.ts.map +0 -1
  1099. package/dist/rpg/MoveRoute.js +0 -139
  1100. package/dist/rpg/MoveRoute.js.map +0 -1
  1101. package/dist/rpg/Quest.d.ts +0 -173
  1102. package/dist/rpg/Quest.d.ts.map +0 -1
  1103. package/dist/rpg/Quest.js +0 -221
  1104. package/dist/rpg/Quest.js.map +0 -1
  1105. package/dist/rpg/automap.d.ts +0 -81
  1106. package/dist/rpg/automap.d.ts.map +0 -1
  1107. package/dist/rpg/automap.js +0 -107
  1108. package/dist/rpg/automap.js.map +0 -1
  1109. package/dist/rpg/dialogue-text.d.ts +0 -81
  1110. package/dist/rpg/dialogue-text.d.ts.map +0 -1
  1111. package/dist/rpg/dialogue-text.js +0 -88
  1112. package/dist/rpg/dialogue-text.js.map +0 -1
  1113. package/dist/rpg/index.d.ts +0 -25
  1114. package/dist/rpg/index.d.ts.map +0 -1
  1115. package/dist/rpg/index.js +0 -14
  1116. package/dist/rpg/index.js.map +0 -1
  1117. package/dist/rpg/twee-events.d.ts +0 -48
  1118. package/dist/rpg/twee-events.d.ts.map +0 -1
  1119. package/dist/rpg/twee-events.js +0 -35
  1120. package/dist/rpg/twee-events.js.map +0 -1
  1121. package/dist/simulation/Campaign.d.ts +0 -60
  1122. package/dist/simulation/Campaign.d.ts.map +0 -1
  1123. package/dist/simulation/Campaign.js +0 -89
  1124. package/dist/simulation/Campaign.js.map +0 -1
  1125. package/dist/simulation/CampaignSave.d.ts +0 -68
  1126. package/dist/simulation/CampaignSave.d.ts.map +0 -1
  1127. package/dist/simulation/CampaignSave.js +0 -54
  1128. package/dist/simulation/CampaignSave.js.map +0 -1
  1129. package/dist/simulation/EventPresentation.d.ts +0 -111
  1130. package/dist/simulation/EventPresentation.d.ts.map +0 -1
  1131. package/dist/simulation/EventPresentation.js +0 -120
  1132. package/dist/simulation/EventPresentation.js.map +0 -1
  1133. package/dist/simulation/Harness.d.ts +0 -26
  1134. package/dist/simulation/Harness.d.ts.map +0 -1
  1135. package/dist/simulation/Harness.js +0 -26
  1136. package/dist/simulation/Harness.js.map +0 -1
  1137. package/dist/simulation/Runtime.d.ts +0 -189
  1138. package/dist/simulation/Runtime.d.ts.map +0 -1
  1139. package/dist/simulation/Runtime.js +0 -244
  1140. package/dist/simulation/Runtime.js.map +0 -1
  1141. package/dist/simulation/Scenario.d.ts +0 -44
  1142. package/dist/simulation/Scenario.d.ts.map +0 -1
  1143. package/dist/simulation/Scenario.js +0 -40
  1144. package/dist/simulation/Scenario.js.map +0 -1
  1145. package/dist/simulation/Training.d.ts +0 -220
  1146. package/dist/simulation/Training.d.ts.map +0 -1
  1147. package/dist/simulation/Training.js +0 -366
  1148. package/dist/simulation/Training.js.map +0 -1
  1149. package/dist/simulation/Turns.d.ts +0 -40
  1150. package/dist/simulation/Turns.d.ts.map +0 -1
  1151. package/dist/simulation/Turns.js +0 -41
  1152. package/dist/simulation/Turns.js.map +0 -1
  1153. package/dist/simulation/index.d.ts +0 -25
  1154. package/dist/simulation/index.d.ts.map +0 -1
  1155. package/dist/simulation/index.js +0 -16
  1156. package/dist/simulation/index.js.map +0 -1
  1157. package/dist/skeleton/index.d.ts +0 -212
  1158. package/dist/skeleton/index.d.ts.map +0 -1
  1159. package/dist/skeleton/index.js +0 -325
  1160. package/dist/skeleton/index.js.map +0 -1
  1161. package/dist/testing/FakeAudio.d.ts +0 -149
  1162. package/dist/testing/FakeAudio.d.ts.map +0 -1
  1163. package/dist/testing/FakeAudio.js +0 -219
  1164. package/dist/testing/FakeAudio.js.map +0 -1
  1165. package/dist/testing/SceneControls.d.ts +0 -35
  1166. package/dist/testing/SceneControls.d.ts.map +0 -1
  1167. package/dist/testing/SceneControls.js +0 -49
  1168. package/dist/testing/SceneControls.js.map +0 -1
  1169. package/dist/testing/index.d.ts +0 -125
  1170. package/dist/testing/index.d.ts.map +0 -1
  1171. package/dist/testing/index.js +0 -157
  1172. package/dist/testing/index.js.map +0 -1
  1173. package/dist/threads/index.d.ts +0 -3
  1174. package/dist/threads/index.d.ts.map +0 -1
  1175. package/dist/threads/index.js +0 -2
  1176. package/dist/threads/index.js.map +0 -1
  1177. package/dist/threads/spawn.d.ts +0 -73
  1178. package/dist/threads/spawn.d.ts.map +0 -1
  1179. package/dist/threads/spawn.js +0 -167
  1180. package/dist/threads/spawn.js.map +0 -1
  1181. package/dist/threads/worker.d.ts +0 -51
  1182. package/dist/threads/worker.d.ts.map +0 -1
  1183. package/dist/threads/worker.js +0 -84
  1184. package/dist/threads/worker.js.map +0 -1
  1185. package/dist/three-d/Character3D.d.ts +0 -74
  1186. package/dist/three-d/Character3D.d.ts.map +0 -1
  1187. package/dist/three-d/Character3D.js +0 -122
  1188. package/dist/three-d/Character3D.js.map +0 -1
  1189. package/dist/three-d/Collision3D.d.ts +0 -111
  1190. package/dist/three-d/Collision3D.d.ts.map +0 -1
  1191. package/dist/three-d/Collision3D.js +0 -119
  1192. package/dist/three-d/Collision3D.js.map +0 -1
  1193. package/dist/three-d/Engine3D.d.ts +0 -25
  1194. package/dist/three-d/Engine3D.d.ts.map +0 -1
  1195. package/dist/three-d/Engine3D.js +0 -45
  1196. package/dist/three-d/Engine3D.js.map +0 -1
  1197. package/dist/three-d/Grid.d.ts +0 -30
  1198. package/dist/three-d/Grid.d.ts.map +0 -1
  1199. package/dist/three-d/Grid.js +0 -24
  1200. package/dist/three-d/Grid.js.map +0 -1
  1201. package/dist/three-d/Heightmap.d.ts +0 -38
  1202. package/dist/three-d/Heightmap.d.ts.map +0 -1
  1203. package/dist/three-d/Heightmap.js +0 -29
  1204. package/dist/three-d/Heightmap.js.map +0 -1
  1205. package/dist/three-d/Models.d.ts +0 -49
  1206. package/dist/three-d/Models.d.ts.map +0 -1
  1207. package/dist/three-d/Models.js +0 -77
  1208. package/dist/three-d/Models.js.map +0 -1
  1209. package/dist/three-d/TileGrid3D.d.ts +0 -27
  1210. package/dist/three-d/TileGrid3D.d.ts.map +0 -1
  1211. package/dist/three-d/TileGrid3D.js +0 -66
  1212. package/dist/three-d/TileGrid3D.js.map +0 -1
  1213. package/dist/three-d/Vox.d.ts +0 -43
  1214. package/dist/three-d/Vox.d.ts.map +0 -1
  1215. package/dist/three-d/Vox.js +0 -108
  1216. package/dist/three-d/Vox.js.map +0 -1
  1217. package/dist/three-d/index.d.ts +0 -15
  1218. package/dist/three-d/index.d.ts.map +0 -1
  1219. package/dist/three-d/index.js +0 -8
  1220. package/dist/three-d/index.js.map +0 -1
  1221. package/dist/two-d/Game.d.ts +0 -240
  1222. package/dist/two-d/Game.d.ts.map +0 -1
  1223. package/dist/two-d/Game.js +0 -487
  1224. package/dist/two-d/Game.js.map +0 -1
  1225. package/dist/two-d/QualityScaler.d.ts +0 -63
  1226. package/dist/two-d/QualityScaler.d.ts.map +0 -1
  1227. package/dist/two-d/QualityScaler.js +0 -92
  1228. package/dist/two-d/QualityScaler.js.map +0 -1
  1229. package/dist/two-d/ResolutionFit.d.ts +0 -28
  1230. package/dist/two-d/ResolutionFit.d.ts.map +0 -1
  1231. package/dist/two-d/ResolutionFit.js +0 -39
  1232. package/dist/two-d/ResolutionFit.js.map +0 -1
  1233. package/dist/two-d/Scene2D.d.ts +0 -43
  1234. package/dist/two-d/Scene2D.d.ts.map +0 -1
  1235. package/dist/two-d/Scene2D.js +0 -53
  1236. package/dist/two-d/Scene2D.js.map +0 -1
  1237. package/dist/two-d/index.d.ts +0 -22
  1238. package/dist/two-d/index.d.ts.map +0 -1
  1239. package/dist/two-d/index.js +0 -19
  1240. package/dist/two-d/index.js.map +0 -1
  1241. package/dist/two-d/pixi-interop.d.ts +0 -66
  1242. package/dist/two-d/pixi-interop.d.ts.map +0 -1
  1243. package/dist/two-d/pixi-interop.js +0 -72
  1244. package/dist/two-d/pixi-interop.js.map +0 -1
  1245. package/dist/two-d/presentation/MwlPresentation.d.ts +0 -117
  1246. package/dist/two-d/presentation/MwlPresentation.d.ts.map +0 -1
  1247. package/dist/two-d/presentation/MwlPresentation.js +0 -755
  1248. package/dist/two-d/presentation/MwlPresentation.js.map +0 -1
  1249. package/dist/two-d/presentation/index.d.ts +0 -3
  1250. package/dist/two-d/presentation/index.d.ts.map +0 -1
  1251. package/dist/two-d/presentation/index.js +0 -2
  1252. package/dist/two-d/presentation/index.js.map +0 -1
  1253. package/dist/two-d/render/ActorAnimator.d.ts +0 -92
  1254. package/dist/two-d/render/ActorAnimator.d.ts.map +0 -1
  1255. package/dist/two-d/render/ActorAnimator.js +0 -97
  1256. package/dist/two-d/render/ActorAnimator.js.map +0 -1
  1257. package/dist/two-d/render/AnimatedSprite.d.ts +0 -154
  1258. package/dist/two-d/render/AnimatedSprite.d.ts.map +0 -1
  1259. package/dist/two-d/render/AnimatedSprite.js +0 -197
  1260. package/dist/two-d/render/AnimatedSprite.js.map +0 -1
  1261. package/dist/two-d/render/Autotile.d.ts +0 -74
  1262. package/dist/two-d/render/Autotile.d.ts.map +0 -1
  1263. package/dist/two-d/render/Autotile.js +0 -149
  1264. package/dist/two-d/render/Autotile.js.map +0 -1
  1265. package/dist/two-d/render/Beam.d.ts +0 -136
  1266. package/dist/two-d/render/Beam.d.ts.map +0 -1
  1267. package/dist/two-d/render/Beam.js +0 -203
  1268. package/dist/two-d/render/Beam.js.map +0 -1
  1269. package/dist/two-d/render/Camera.d.ts +0 -255
  1270. package/dist/two-d/render/Camera.d.ts.map +0 -1
  1271. package/dist/two-d/render/Camera.js +0 -376
  1272. package/dist/two-d/render/Camera.js.map +0 -1
  1273. package/dist/two-d/render/Capabilities.d.ts +0 -84
  1274. package/dist/two-d/render/Capabilities.d.ts.map +0 -1
  1275. package/dist/two-d/render/Capabilities.js +0 -129
  1276. package/dist/two-d/render/Capabilities.js.map +0 -1
  1277. package/dist/two-d/render/ClothSprite.d.ts +0 -83
  1278. package/dist/two-d/render/ClothSprite.d.ts.map +0 -1
  1279. package/dist/two-d/render/ClothSprite.js +0 -105
  1280. package/dist/two-d/render/ClothSprite.js.map +0 -1
  1281. package/dist/two-d/render/ColorBlindness.d.ts +0 -39
  1282. package/dist/two-d/render/ColorBlindness.d.ts.map +0 -1
  1283. package/dist/two-d/render/ColorBlindness.js +0 -45
  1284. package/dist/two-d/render/ColorBlindness.js.map +0 -1
  1285. package/dist/two-d/render/ColorTransformBatcher.d.ts +0 -143
  1286. package/dist/two-d/render/ColorTransformBatcher.d.ts.map +0 -1
  1287. package/dist/two-d/render/ColorTransformBatcher.js +0 -395
  1288. package/dist/two-d/render/ColorTransformBatcher.js.map +0 -1
  1289. package/dist/two-d/render/Flights.d.ts +0 -90
  1290. package/dist/two-d/render/Flights.d.ts.map +0 -1
  1291. package/dist/two-d/render/Flights.js +0 -135
  1292. package/dist/two-d/render/Flights.js.map +0 -1
  1293. package/dist/two-d/render/FogLayer.d.ts +0 -68
  1294. package/dist/two-d/render/FogLayer.d.ts.map +0 -1
  1295. package/dist/two-d/render/FogLayer.js +0 -83
  1296. package/dist/two-d/render/FogLayer.js.map +0 -1
  1297. package/dist/two-d/render/Halo.d.ts +0 -58
  1298. package/dist/two-d/render/Halo.d.ts.map +0 -1
  1299. package/dist/two-d/render/Halo.js +0 -48
  1300. package/dist/two-d/render/Halo.js.map +0 -1
  1301. package/dist/two-d/render/HazeLayer.d.ts +0 -112
  1302. package/dist/two-d/render/HazeLayer.d.ts.map +0 -1
  1303. package/dist/two-d/render/HazeLayer.js +0 -186
  1304. package/dist/two-d/render/HazeLayer.js.map +0 -1
  1305. package/dist/two-d/render/ImageModifiers.d.ts +0 -312
  1306. package/dist/two-d/render/ImageModifiers.d.ts.map +0 -1
  1307. package/dist/two-d/render/ImageModifiers.js +0 -728
  1308. package/dist/two-d/render/ImageModifiers.js.map +0 -1
  1309. package/dist/two-d/render/LayeredSprite.d.ts +0 -54
  1310. package/dist/two-d/render/LayeredSprite.d.ts.map +0 -1
  1311. package/dist/two-d/render/LayeredSprite.js +0 -80
  1312. package/dist/two-d/render/LayeredSprite.js.map +0 -1
  1313. package/dist/two-d/render/LightningArc.d.ts +0 -57
  1314. package/dist/two-d/render/LightningArc.d.ts.map +0 -1
  1315. package/dist/two-d/render/LightningArc.js +0 -91
  1316. package/dist/two-d/render/LightningArc.js.map +0 -1
  1317. package/dist/two-d/render/LiquidLayer.d.ts +0 -62
  1318. package/dist/two-d/render/LiquidLayer.d.ts.map +0 -1
  1319. package/dist/two-d/render/LiquidLayer.js +0 -102
  1320. package/dist/two-d/render/LiquidLayer.js.map +0 -1
  1321. package/dist/two-d/render/Minimap.d.ts +0 -100
  1322. package/dist/two-d/render/Minimap.d.ts.map +0 -1
  1323. package/dist/two-d/render/Minimap.js +0 -157
  1324. package/dist/two-d/render/Minimap.js.map +0 -1
  1325. package/dist/two-d/render/NeonGlow.d.ts +0 -100
  1326. package/dist/two-d/render/NeonGlow.d.ts.map +0 -1
  1327. package/dist/two-d/render/NeonGlow.js +0 -184
  1328. package/dist/two-d/render/NeonGlow.js.map +0 -1
  1329. package/dist/two-d/render/PaletteRemap.d.ts +0 -154
  1330. package/dist/two-d/render/PaletteRemap.d.ts.map +0 -1
  1331. package/dist/two-d/render/PaletteRemap.js +0 -217
  1332. package/dist/two-d/render/PaletteRemap.js.map +0 -1
  1333. package/dist/two-d/render/Particles.d.ts +0 -262
  1334. package/dist/two-d/render/Particles.d.ts.map +0 -1
  1335. package/dist/two-d/render/Particles.js +0 -371
  1336. package/dist/two-d/render/Particles.js.map +0 -1
  1337. package/dist/two-d/render/Projectile.d.ts +0 -67
  1338. package/dist/two-d/render/Projectile.d.ts.map +0 -1
  1339. package/dist/two-d/render/Projectile.js +0 -78
  1340. package/dist/two-d/render/Projectile.js.map +0 -1
  1341. package/dist/two-d/render/RpgmAutotile.d.ts +0 -324
  1342. package/dist/two-d/render/RpgmAutotile.d.ts.map +0 -1
  1343. package/dist/two-d/render/RpgmAutotile.js +0 -933
  1344. package/dist/two-d/render/RpgmAutotile.js.map +0 -1
  1345. package/dist/two-d/render/SceneTransition.d.ts +0 -301
  1346. package/dist/two-d/render/SceneTransition.d.ts.map +0 -1
  1347. package/dist/two-d/render/SceneTransition.js +0 -458
  1348. package/dist/two-d/render/SceneTransition.js.map +0 -1
  1349. package/dist/two-d/render/ScreenEffects.d.ts +0 -124
  1350. package/dist/two-d/render/ScreenEffects.d.ts.map +0 -1
  1351. package/dist/two-d/render/ScreenEffects.js +0 -215
  1352. package/dist/two-d/render/ScreenEffects.js.map +0 -1
  1353. package/dist/two-d/render/Shape2D.d.ts +0 -146
  1354. package/dist/two-d/render/Shape2D.d.ts.map +0 -1
  1355. package/dist/two-d/render/Shape2D.js +0 -166
  1356. package/dist/two-d/render/Shape2D.js.map +0 -1
  1357. package/dist/two-d/render/SkeletalSprite.d.ts +0 -121
  1358. package/dist/two-d/render/SkeletalSprite.d.ts.map +0 -1
  1359. package/dist/two-d/render/SkeletalSprite.js +0 -214
  1360. package/dist/two-d/render/SkeletalSprite.js.map +0 -1
  1361. package/dist/two-d/render/SpringSprite.d.ts +0 -40
  1362. package/dist/two-d/render/SpringSprite.d.ts.map +0 -1
  1363. package/dist/two-d/render/SpringSprite.js +0 -39
  1364. package/dist/two-d/render/SpringSprite.js.map +0 -1
  1365. package/dist/two-d/render/SpriteAttachment.d.ts +0 -55
  1366. package/dist/two-d/render/SpriteAttachment.d.ts.map +0 -1
  1367. package/dist/two-d/render/SpriteAttachment.js +0 -60
  1368. package/dist/two-d/render/SpriteAttachment.js.map +0 -1
  1369. package/dist/two-d/render/SpriteDeform.d.ts +0 -156
  1370. package/dist/two-d/render/SpriteDeform.d.ts.map +0 -1
  1371. package/dist/two-d/render/SpriteDeform.js +0 -278
  1372. package/dist/two-d/render/SpriteDeform.js.map +0 -1
  1373. package/dist/two-d/render/SpriteGroup.d.ts +0 -83
  1374. package/dist/two-d/render/SpriteGroup.d.ts.map +0 -1
  1375. package/dist/two-d/render/SpriteGroup.js +0 -107
  1376. package/dist/two-d/render/SpriteGroup.js.map +0 -1
  1377. package/dist/two-d/render/SpriteMotion.d.ts +0 -121
  1378. package/dist/two-d/render/SpriteMotion.d.ts.map +0 -1
  1379. package/dist/two-d/render/SpriteMotion.js +0 -193
  1380. package/dist/two-d/render/SpriteMotion.js.map +0 -1
  1381. package/dist/two-d/render/SpriteSheet.d.ts +0 -62
  1382. package/dist/two-d/render/SpriteSheet.d.ts.map +0 -1
  1383. package/dist/two-d/render/SpriteSheet.js +0 -122
  1384. package/dist/two-d/render/SpriteSheet.js.map +0 -1
  1385. package/dist/two-d/render/StatusVisuals.d.ts +0 -86
  1386. package/dist/two-d/render/StatusVisuals.d.ts.map +0 -1
  1387. package/dist/two-d/render/StatusVisuals.js +0 -111
  1388. package/dist/two-d/render/StatusVisuals.js.map +0 -1
  1389. package/dist/two-d/render/SvgSkeleton.d.ts +0 -54
  1390. package/dist/two-d/render/SvgSkeleton.d.ts.map +0 -1
  1391. package/dist/two-d/render/SvgSkeleton.js +0 -112
  1392. package/dist/two-d/render/SvgSkeleton.js.map +0 -1
  1393. package/dist/two-d/render/TerrainGraphics.d.ts +0 -142
  1394. package/dist/two-d/render/TerrainGraphics.d.ts.map +0 -1
  1395. package/dist/two-d/render/TerrainGraphics.js +0 -161
  1396. package/dist/two-d/render/TerrainGraphics.js.map +0 -1
  1397. package/dist/two-d/render/TerrainGraphicsLayer.d.ts +0 -55
  1398. package/dist/two-d/render/TerrainGraphicsLayer.d.ts.map +0 -1
  1399. package/dist/two-d/render/TerrainGraphicsLayer.js +0 -54
  1400. package/dist/two-d/render/TerrainGraphicsLayer.js.map +0 -1
  1401. package/dist/two-d/render/TileMap.d.ts +0 -395
  1402. package/dist/two-d/render/TileMap.d.ts.map +0 -1
  1403. package/dist/two-d/render/TileMap.js +0 -967
  1404. package/dist/two-d/render/TileMap.js.map +0 -1
  1405. package/dist/two-d/render/TiledMap.d.ts +0 -113
  1406. package/dist/two-d/render/TiledMap.d.ts.map +0 -1
  1407. package/dist/two-d/render/TiledMap.js +0 -129
  1408. package/dist/two-d/render/TiledMap.js.map +0 -1
  1409. package/dist/two-d/render/TintedSprite.d.ts +0 -60
  1410. package/dist/two-d/render/TintedSprite.d.ts.map +0 -1
  1411. package/dist/two-d/render/TintedSprite.js +0 -88
  1412. package/dist/two-d/render/TintedSprite.js.map +0 -1
  1413. package/dist/two-d/render/Types2D.d.ts +0 -56
  1414. package/dist/two-d/render/Types2D.d.ts.map +0 -1
  1415. package/dist/two-d/render/Types2D.js +0 -45
  1416. package/dist/two-d/render/Types2D.js.map +0 -1
  1417. package/dist/two-d/render/Viewport.d.ts +0 -68
  1418. package/dist/two-d/render/Viewport.d.ts.map +0 -1
  1419. package/dist/two-d/render/Viewport.js +0 -74
  1420. package/dist/two-d/render/Viewport.js.map +0 -1
  1421. package/dist/two-d/render/index.d.ts +0 -81
  1422. package/dist/two-d/render/index.d.ts.map +0 -1
  1423. package/dist/two-d/render/index.js +0 -43
  1424. package/dist/two-d/render/index.js.map +0 -1
  1425. package/dist/two-d/stage/DialogueStage.d.ts +0 -90
  1426. package/dist/two-d/stage/DialogueStage.d.ts.map +0 -1
  1427. package/dist/two-d/stage/DialogueStage.js +0 -218
  1428. package/dist/two-d/stage/DialogueStage.js.map +0 -1
  1429. package/dist/two-d/stage/StoryScreen.d.ts +0 -110
  1430. package/dist/two-d/stage/StoryScreen.d.ts.map +0 -1
  1431. package/dist/two-d/stage/StoryScreen.js +0 -178
  1432. package/dist/two-d/stage/StoryScreen.js.map +0 -1
  1433. package/dist/two-d/stage/dialogue-text.d.ts +0 -81
  1434. package/dist/two-d/stage/dialogue-text.d.ts.map +0 -1
  1435. package/dist/two-d/stage/dialogue-text.js +0 -95
  1436. package/dist/two-d/stage/dialogue-text.js.map +0 -1
  1437. package/dist/two-d/stage/index.d.ts +0 -10
  1438. package/dist/two-d/stage/index.d.ts.map +0 -1
  1439. package/dist/two-d/stage/index.js +0 -6
  1440. package/dist/two-d/stage/index.js.map +0 -1
  1441. package/dist/two-d/stage/script.d.ts +0 -160
  1442. package/dist/two-d/stage/script.d.ts.map +0 -1
  1443. package/dist/two-d/stage/script.js +0 -207
  1444. package/dist/two-d/stage/script.js.map +0 -1
  1445. package/dist/two-d/stage/twee.d.ts +0 -35
  1446. package/dist/two-d/stage/twee.d.ts.map +0 -1
  1447. package/dist/two-d/stage/twee.js +0 -28
  1448. package/dist/two-d/stage/twee.js.map +0 -1
  1449. package/dist/two-d/ui/Bar.d.ts +0 -83
  1450. package/dist/two-d/ui/Bar.d.ts.map +0 -1
  1451. package/dist/two-d/ui/Bar.js +0 -110
  1452. package/dist/two-d/ui/Bar.js.map +0 -1
  1453. package/dist/two-d/ui/BitmapLabel.d.ts +0 -58
  1454. package/dist/two-d/ui/BitmapLabel.d.ts.map +0 -1
  1455. package/dist/two-d/ui/BitmapLabel.js +0 -82
  1456. package/dist/two-d/ui/BitmapLabel.js.map +0 -1
  1457. package/dist/two-d/ui/Button.d.ts +0 -133
  1458. package/dist/two-d/ui/Button.d.ts.map +0 -1
  1459. package/dist/two-d/ui/Button.js +0 -254
  1460. package/dist/two-d/ui/Button.js.map +0 -1
  1461. package/dist/two-d/ui/Checkbox.d.ts +0 -44
  1462. package/dist/two-d/ui/Checkbox.d.ts.map +0 -1
  1463. package/dist/two-d/ui/Checkbox.js +0 -89
  1464. package/dist/two-d/ui/Checkbox.js.map +0 -1
  1465. package/dist/two-d/ui/DataTable.d.ts +0 -79
  1466. package/dist/two-d/ui/DataTable.d.ts.map +0 -1
  1467. package/dist/two-d/ui/DataTable.js +0 -164
  1468. package/dist/two-d/ui/DataTable.js.map +0 -1
  1469. package/dist/two-d/ui/Dropdown.d.ts +0 -79
  1470. package/dist/two-d/ui/Dropdown.d.ts.map +0 -1
  1471. package/dist/two-d/ui/Dropdown.js +0 -136
  1472. package/dist/two-d/ui/Dropdown.js.map +0 -1
  1473. package/dist/two-d/ui/DropdownView.d.ts +0 -100
  1474. package/dist/two-d/ui/DropdownView.d.ts.map +0 -1
  1475. package/dist/two-d/ui/DropdownView.js +0 -234
  1476. package/dist/two-d/ui/DropdownView.js.map +0 -1
  1477. package/dist/two-d/ui/EventDialogue.d.ts +0 -23
  1478. package/dist/two-d/ui/EventDialogue.d.ts.map +0 -1
  1479. package/dist/two-d/ui/EventDialogue.js +0 -33
  1480. package/dist/two-d/ui/EventDialogue.js.map +0 -1
  1481. package/dist/two-d/ui/FloatingText.d.ts +0 -123
  1482. package/dist/two-d/ui/FloatingText.d.ts.map +0 -1
  1483. package/dist/two-d/ui/FloatingText.js +0 -153
  1484. package/dist/two-d/ui/FloatingText.js.map +0 -1
  1485. package/dist/two-d/ui/FloatingTextStack.d.ts +0 -150
  1486. package/dist/two-d/ui/FloatingTextStack.d.ts.map +0 -1
  1487. package/dist/two-d/ui/FloatingTextStack.js +0 -170
  1488. package/dist/two-d/ui/FloatingTextStack.js.map +0 -1
  1489. package/dist/two-d/ui/HelpScreen.d.ts +0 -45
  1490. package/dist/two-d/ui/HelpScreen.d.ts.map +0 -1
  1491. package/dist/two-d/ui/HelpScreen.js +0 -59
  1492. package/dist/two-d/ui/HelpScreen.js.map +0 -1
  1493. package/dist/two-d/ui/IconGrid.d.ts +0 -143
  1494. package/dist/two-d/ui/IconGrid.d.ts.map +0 -1
  1495. package/dist/two-d/ui/IconGrid.js +0 -327
  1496. package/dist/two-d/ui/IconGrid.js.map +0 -1
  1497. package/dist/two-d/ui/Label.d.ts +0 -63
  1498. package/dist/two-d/ui/Label.d.ts.map +0 -1
  1499. package/dist/two-d/ui/Label.js +0 -134
  1500. package/dist/two-d/ui/Label.js.map +0 -1
  1501. package/dist/two-d/ui/Layout.d.ts +0 -139
  1502. package/dist/two-d/ui/Layout.d.ts.map +0 -1
  1503. package/dist/two-d/ui/Layout.js +0 -221
  1504. package/dist/two-d/ui/Layout.js.map +0 -1
  1505. package/dist/two-d/ui/ListView.d.ts +0 -130
  1506. package/dist/two-d/ui/ListView.d.ts.map +0 -1
  1507. package/dist/two-d/ui/ListView.js +0 -326
  1508. package/dist/two-d/ui/ListView.js.map +0 -1
  1509. package/dist/two-d/ui/LoadingScreen.d.ts +0 -54
  1510. package/dist/two-d/ui/LoadingScreen.d.ts.map +0 -1
  1511. package/dist/two-d/ui/LoadingScreen.js +0 -87
  1512. package/dist/two-d/ui/LoadingScreen.js.map +0 -1
  1513. package/dist/two-d/ui/MarkupText.d.ts +0 -66
  1514. package/dist/two-d/ui/MarkupText.d.ts.map +0 -1
  1515. package/dist/two-d/ui/MarkupText.js +0 -156
  1516. package/dist/two-d/ui/MarkupText.js.map +0 -1
  1517. package/dist/two-d/ui/MessageBox.d.ts +0 -134
  1518. package/dist/two-d/ui/MessageBox.d.ts.map +0 -1
  1519. package/dist/two-d/ui/MessageBox.js +0 -263
  1520. package/dist/two-d/ui/MessageBox.js.map +0 -1
  1521. package/dist/two-d/ui/MessageLog.d.ts +0 -90
  1522. package/dist/two-d/ui/MessageLog.d.ts.map +0 -1
  1523. package/dist/two-d/ui/MessageLog.js +0 -131
  1524. package/dist/two-d/ui/MessageLog.js.map +0 -1
  1525. package/dist/two-d/ui/Meter.d.ts +0 -76
  1526. package/dist/two-d/ui/Meter.d.ts.map +0 -1
  1527. package/dist/two-d/ui/Meter.js +0 -134
  1528. package/dist/two-d/ui/Meter.js.map +0 -1
  1529. package/dist/two-d/ui/NinePatch.d.ts +0 -49
  1530. package/dist/two-d/ui/NinePatch.d.ts.map +0 -1
  1531. package/dist/two-d/ui/NinePatch.js +0 -59
  1532. package/dist/two-d/ui/NinePatch.js.map +0 -1
  1533. package/dist/two-d/ui/OnScreenKeyboard.d.ts +0 -91
  1534. package/dist/two-d/ui/OnScreenKeyboard.d.ts.map +0 -1
  1535. package/dist/two-d/ui/OnScreenKeyboard.js +0 -109
  1536. package/dist/two-d/ui/OnScreenKeyboard.js.map +0 -1
  1537. package/dist/two-d/ui/RadioGroup.d.ts +0 -68
  1538. package/dist/two-d/ui/RadioGroup.d.ts.map +0 -1
  1539. package/dist/two-d/ui/RadioGroup.js +0 -177
  1540. package/dist/two-d/ui/RadioGroup.js.map +0 -1
  1541. package/dist/two-d/ui/RebindScreen.d.ts +0 -70
  1542. package/dist/two-d/ui/RebindScreen.d.ts.map +0 -1
  1543. package/dist/two-d/ui/RebindScreen.js +0 -129
  1544. package/dist/two-d/ui/RebindScreen.js.map +0 -1
  1545. package/dist/two-d/ui/RichLabel.d.ts +0 -62
  1546. package/dist/two-d/ui/RichLabel.d.ts.map +0 -1
  1547. package/dist/two-d/ui/RichLabel.js +0 -146
  1548. package/dist/two-d/ui/RichLabel.js.map +0 -1
  1549. package/dist/two-d/ui/ScrollBox.d.ts +0 -163
  1550. package/dist/two-d/ui/ScrollBox.d.ts.map +0 -1
  1551. package/dist/two-d/ui/ScrollBox.js +0 -340
  1552. package/dist/two-d/ui/ScrollBox.js.map +0 -1
  1553. package/dist/two-d/ui/ScrollText.d.ts +0 -131
  1554. package/dist/two-d/ui/ScrollText.d.ts.map +0 -1
  1555. package/dist/two-d/ui/ScrollText.js +0 -218
  1556. package/dist/two-d/ui/ScrollText.js.map +0 -1
  1557. package/dist/two-d/ui/SelectionModel.d.ts +0 -50
  1558. package/dist/two-d/ui/SelectionModel.d.ts.map +0 -1
  1559. package/dist/two-d/ui/SelectionModel.js +0 -73
  1560. package/dist/two-d/ui/SelectionModel.js.map +0 -1
  1561. package/dist/two-d/ui/SettingsScreen.d.ts +0 -112
  1562. package/dist/two-d/ui/SettingsScreen.d.ts.map +0 -1
  1563. package/dist/two-d/ui/SettingsScreen.js +0 -338
  1564. package/dist/two-d/ui/SettingsScreen.js.map +0 -1
  1565. package/dist/two-d/ui/Skins.d.ts +0 -59
  1566. package/dist/two-d/ui/Skins.d.ts.map +0 -1
  1567. package/dist/two-d/ui/Skins.js +0 -77
  1568. package/dist/two-d/ui/Skins.js.map +0 -1
  1569. package/dist/two-d/ui/Slider.d.ts +0 -91
  1570. package/dist/two-d/ui/Slider.d.ts.map +0 -1
  1571. package/dist/two-d/ui/Slider.js +0 -170
  1572. package/dist/two-d/ui/Slider.js.map +0 -1
  1573. package/dist/two-d/ui/Spinner.d.ts +0 -67
  1574. package/dist/two-d/ui/Spinner.d.ts.map +0 -1
  1575. package/dist/two-d/ui/Spinner.js +0 -137
  1576. package/dist/two-d/ui/Spinner.js.map +0 -1
  1577. package/dist/two-d/ui/StatsScreen.d.ts +0 -40
  1578. package/dist/two-d/ui/StatsScreen.d.ts.map +0 -1
  1579. package/dist/two-d/ui/StatsScreen.js +0 -42
  1580. package/dist/two-d/ui/StatsScreen.js.map +0 -1
  1581. package/dist/two-d/ui/TabbedList.d.ts +0 -118
  1582. package/dist/two-d/ui/TabbedList.d.ts.map +0 -1
  1583. package/dist/two-d/ui/TabbedList.js +0 -221
  1584. package/dist/two-d/ui/TabbedList.js.map +0 -1
  1585. package/dist/two-d/ui/TextModel.d.ts +0 -90
  1586. package/dist/two-d/ui/TextModel.d.ts.map +0 -1
  1587. package/dist/two-d/ui/TextModel.js +0 -175
  1588. package/dist/two-d/ui/TextModel.js.map +0 -1
  1589. package/dist/two-d/ui/TextPrompt.d.ts +0 -122
  1590. package/dist/two-d/ui/TextPrompt.d.ts.map +0 -1
  1591. package/dist/two-d/ui/TextPrompt.js +0 -236
  1592. package/dist/two-d/ui/TextPrompt.js.map +0 -1
  1593. package/dist/two-d/ui/TextSharpness.d.ts +0 -33
  1594. package/dist/two-d/ui/TextSharpness.d.ts.map +0 -1
  1595. package/dist/two-d/ui/TextSharpness.js +0 -56
  1596. package/dist/two-d/ui/TextSharpness.js.map +0 -1
  1597. package/dist/two-d/ui/Toast.d.ts +0 -57
  1598. package/dist/two-d/ui/Toast.d.ts.map +0 -1
  1599. package/dist/two-d/ui/Toast.js +0 -101
  1600. package/dist/two-d/ui/Toast.js.map +0 -1
  1601. package/dist/two-d/ui/Tooltip.d.ts +0 -177
  1602. package/dist/two-d/ui/Tooltip.d.ts.map +0 -1
  1603. package/dist/two-d/ui/Tooltip.js +0 -275
  1604. package/dist/two-d/ui/Tooltip.js.map +0 -1
  1605. package/dist/two-d/ui/TreeView.d.ts +0 -68
  1606. package/dist/two-d/ui/TreeView.d.ts.map +0 -1
  1607. package/dist/two-d/ui/TreeView.js +0 -133
  1608. package/dist/two-d/ui/TreeView.js.map +0 -1
  1609. package/dist/two-d/ui/VerticalLabel.d.ts +0 -69
  1610. package/dist/two-d/ui/VerticalLabel.d.ts.map +0 -1
  1611. package/dist/two-d/ui/VerticalLabel.js +0 -110
  1612. package/dist/two-d/ui/VerticalLabel.js.map +0 -1
  1613. package/dist/two-d/ui/Window.d.ts +0 -188
  1614. package/dist/two-d/ui/Window.d.ts.map +0 -1
  1615. package/dist/two-d/ui/Window.js +0 -311
  1616. package/dist/two-d/ui/Window.js.map +0 -1
  1617. package/dist/two-d/ui/WindowStack.d.ts +0 -63
  1618. package/dist/two-d/ui/WindowStack.d.ts.map +0 -1
  1619. package/dist/two-d/ui/WindowStack.js +0 -132
  1620. package/dist/two-d/ui/WindowStack.js.map +0 -1
  1621. package/dist/two-d/ui/a11y.d.ts +0 -43
  1622. package/dist/two-d/ui/a11y.d.ts.map +0 -1
  1623. package/dist/two-d/ui/a11y.js +0 -79
  1624. package/dist/two-d/ui/a11y.js.map +0 -1
  1625. package/dist/two-d/ui/contrast.d.ts +0 -30
  1626. package/dist/two-d/ui/contrast.d.ts.map +0 -1
  1627. package/dist/two-d/ui/contrast.js +0 -42
  1628. package/dist/two-d/ui/contrast.js.map +0 -1
  1629. package/dist/two-d/ui/index.d.ts +0 -96
  1630. package/dist/two-d/ui/index.d.ts.map +0 -1
  1631. package/dist/two-d/ui/index.js +0 -49
  1632. package/dist/two-d/ui/index.js.map +0 -1
  1633. package/dist/two-d/ui/markdown.d.ts +0 -55
  1634. package/dist/two-d/ui/markdown.d.ts.map +0 -1
  1635. package/dist/two-d/ui/markdown.js +0 -147
  1636. package/dist/two-d/ui/markdown.js.map +0 -1
  1637. package/dist/two-d/ui/markup.d.ts +0 -189
  1638. package/dist/two-d/ui/markup.d.ts.map +0 -1
  1639. package/dist/two-d/ui/markup.js +0 -387
  1640. package/dist/two-d/ui/markup.js.map +0 -1
  1641. package/dist/two-d/ui/reveal.d.ts +0 -41
  1642. package/dist/two-d/ui/reveal.d.ts.map +0 -1
  1643. package/dist/two-d/ui/reveal.js +0 -22
  1644. package/dist/two-d/ui/reveal.js.map +0 -1
  1645. package/dist/two-d/ui/theme.d.ts +0 -133
  1646. package/dist/two-d/ui/theme.d.ts.map +0 -1
  1647. package/dist/two-d/ui/theme.js +0 -122
  1648. package/dist/two-d/ui/theme.js.map +0 -1
  1649. package/dist/two-d/ui/themedText.d.ts +0 -20
  1650. package/dist/two-d/ui/themedText.d.ts.map +0 -1
  1651. package/dist/two-d/ui/themedText.js +0 -9
  1652. package/dist/two-d/ui/themedText.js.map +0 -1
  1653. package/dist/version.d.ts +0 -13
  1654. package/dist/version.d.ts.map +0 -1
  1655. package/dist/version.js +0 -13
  1656. package/dist/version.js.map +0 -1
  1657. package/dist/world/Encounters.d.ts +0 -32
  1658. package/dist/world/Encounters.d.ts.map +0 -1
  1659. package/dist/world/Encounters.js +0 -9
  1660. package/dist/world/Encounters.js.map +0 -1
  1661. package/dist/world/Environment.d.ts +0 -58
  1662. package/dist/world/Environment.d.ts.map +0 -1
  1663. package/dist/world/Environment.js +0 -89
  1664. package/dist/world/Environment.js.map +0 -1
  1665. package/dist/world/Overworld.d.ts +0 -39
  1666. package/dist/world/Overworld.d.ts.map +0 -1
  1667. package/dist/world/Overworld.js +0 -40
  1668. package/dist/world/Overworld.js.map +0 -1
  1669. package/dist/world/SideTurns.d.ts +0 -115
  1670. package/dist/world/SideTurns.d.ts.map +0 -1
  1671. package/dist/world/SideTurns.js +0 -138
  1672. package/dist/world/SideTurns.js.map +0 -1
  1673. package/dist/world/TurnClock.d.ts +0 -41
  1674. package/dist/world/TurnClock.d.ts.map +0 -1
  1675. package/dist/world/TurnClock.js +0 -49
  1676. package/dist/world/TurnClock.js.map +0 -1
  1677. package/dist/world/World.d.ts +0 -64
  1678. package/dist/world/World.d.ts.map +0 -1
  1679. package/dist/world/World.js +0 -91
  1680. package/dist/world/World.js.map +0 -1
  1681. package/dist/world/index.d.ts +0 -12
  1682. package/dist/world/index.d.ts.map +0 -1
  1683. package/dist/world/index.js +0 -7
  1684. package/dist/world/index.js.map +0 -1
  1685. package/sbom.cdx.json +0 -5996
  1686. package/tools/mwl.mjs +0 -466
  1687. package/tools/vendored/rgssad-wasm/LICENSE-MIT +0 -21
  1688. package/tools/vendored/rgssad-wasm/README.md +0 -15
  1689. package/tools/vendored/rgssad-wasm/package.json +0 -17
  1690. package/tools/vendored/rgssad-wasm/rgssad_wasm.d.ts +0 -41
  1691. package/tools/vendored/rgssad-wasm/rgssad_wasm.js +0 -6
  1692. package/tools/vendored/rgssad-wasm/rgssad_wasm_bg.js +0 -399
  1693. package/tools/vendored/rgssad-wasm/rgssad_wasm_bg.wasm +0 -0
  1694. package/tools/vendored/rgssad-wasm/rgssad_wasm_bg.wasm.d.ts +0 -17
  1695. package/tools.md +0 -219
@@ -1,1741 +0,0 @@
1
- import { ActionJournal } from '../core/ActionJournal.js';
2
- import { Generator } from '../core/Random.js';
3
- import { decodeSaveEnvelope, encodeSave } from './persistence.js';
4
- import { evaluateCondition } from './conditions.js';
5
- import { evaluateExpression } from './expression.js';
6
- import { booleanAttribute, booleanValue, integerAttribute, numberAttribute, requiredAttribute } from './utils.js';
7
- import { endLevelCarryover } from './carryover.js';
8
- const required = requiredAttribute;
9
- const integer = (node, attribute, fallback) => integerAttribute(node, attribute, fallback) ?? fallback;
10
- /**
11
- * A fresh, empty world: no sides, units, maps or variables, at turn 1 and `playing`.
12
- *
13
- * @example
14
- * ```ts
15
- * import { createWorld } from '@datamoc/mw_games/mwl';
16
- *
17
- * const world = createWorld();
18
- * console.log(world.turn, world.status); // 1 'playing'
19
- * ```
20
- */
21
- export function createWorld() {
22
- return {
23
- variables: {},
24
- units: {},
25
- sides: {},
26
- maps: {},
27
- gold: {},
28
- turn: 1,
29
- status: 'playing',
30
- sideStatus: {},
31
- map: null,
32
- timeOfDay: '',
33
- scheduleIndex: 0,
34
- };
35
- }
36
- /** 1024x1024: far past any hand-made map, and short of a grid that exhausts memory while filling */
37
- const MAX_TERRAIN_CELLS = 1024 * 1024;
38
- /**
39
- * Parse map text: one row per line, comma-separated codes. A token may be
40
- * `<side> <code>` to mark that side's keep/start, which is how a leader knows
41
- * where to appear.
42
- *
43
- * @example
44
- * ```ts
45
- * import { parseTerrain } from '@datamoc/mw_games/mwl';
46
- *
47
- * const map = parseTerrain('Gg,Gg\nGg,1 Kh');
48
- * console.log(map.width, map.starts['1']); // 2 [{ x: 1, y: 1 }]
49
- * ```
50
- */
51
- export function parseTerrain(text) {
52
- const rows = text
53
- .split(/\r?\n/)
54
- .filter((line) => line.trim() !== '')
55
- .map((line) => line.split(',').map((token) => token.trim()));
56
- const height = rows.length;
57
- //a reduce, not `Math.max(...rows)`: spreading a hundred thousand rows overflows the stack
58
- const width = rows.reduce((widest, row) => Math.max(widest, row.length), 0);
59
- if (width * height > MAX_TERRAIN_CELLS)
60
- throw new Error(`MWL terrain is ${width}x${height}, more than ${MAX_TERRAIN_CELLS} cells`);
61
- const codes = [];
62
- const starts = {};
63
- for (let y = 0; y < height; y++) {
64
- for (let x = 0; x < width; x++) {
65
- const token = rows[y]?.[x] ?? '_off^_usr';
66
- //`<side> <code>`: the side is the id `[side]` declares, so a named side works here too
67
- const keep = /^([A-Za-z0-9_][\w.-]*)\s+(\S.*)$/.exec(token);
68
- if (keep) {
69
- codes.push(keep[2]);
70
- (starts[keep[1]] ??= []).push({ x, y });
71
- }
72
- else
73
- codes.push(token);
74
- }
75
- }
76
- return { width, height, codes, starts };
77
- }
78
- /** The two reference forms MWL text writes: `$(expression)` and `$name`. */
79
- const expressionReference = /\$\(([^)]*)\)/g;
80
- const variableReference = /\$([A-Za-z_][A-Za-z0-9_.]*)/g;
81
- /**
82
- * Runtime for compiled MWL content. It never parses source text during play.
83
- *
84
- * The framework runtime owns what is game-agnostic: maps, sides, units, turn
85
- * order, the schedule, objectives, events, and save/load. Game rules that need
86
- * real data (pathfinding costs, combat formulas) stay in the engine adapter;
87
- * this runtime's `move` is a bounds and occupancy check, and `attack` applies
88
- * the amount the content asks for.
89
- *
90
- * @example
91
- * ```ts
92
- * import { compile, MwlRuntime } from '@datamoc/mw_games/mwl';
93
- *
94
- * const runtime = new MwlRuntime(compile("[{ tag: 'game', schema: 0.1 }]"), {
95
- * resolveMap: () => 'Gg,Gg\nGg,Gg',
96
- * });
97
- * console.log(runtime.world.turn); // 1
98
- * ```
99
- */
100
- export class MwlRuntime {
101
- constructor(game, options = {}) {
102
- this.journal = new ActionJournal();
103
- this.unitTypes = new Map();
104
- this.schedule = [];
105
- this.pendingDialogue = null;
106
- this.dialogueCounter = 0;
107
- this.traceBatch = null;
108
- this.game = game;
109
- this.world = options.world ?? createWorld();
110
- this.onMessage = options.onMessage;
111
- this.resolveMap = options.resolveMap;
112
- this.hooks = options.hooks;
113
- this.onTrace = options.onTrace;
114
- this.persistence = options.persistence ?? { version: 1 };
115
- this.random = options.random ?? new Generator();
116
- if (!options.random && this.world.random)
117
- this.random.setState(this.world.random);
118
- this.loadUnitTypes();
119
- this.loadSchedule();
120
- this.loadInitialContent();
121
- this.loadInitialUnits();
122
- this.loadLeaders();
123
- //roles filter over the units, so this runs once they and the leaders are in the world
124
- this.loadScenarioExtras();
125
- }
126
- run(trigger) {
127
- this.recordAction({ type: 'run', trigger }, () => this.runInternal(trigger));
128
- }
129
- runInternal(trigger) {
130
- for (const event of this.nodes('event')) {
131
- if ((event.attributes.on ?? event.attributes.trigger) !== trigger)
132
- continue;
133
- if (!this.eventFiltersMatch(event))
134
- continue;
135
- if (!this.claimEvent(event))
136
- continue;
137
- this.executeTracedEvent(event, trigger);
138
- }
139
- this.checkObjectives();
140
- }
141
- /** Fire one named event through the same filter, claim, and execution path as a trigger. */
142
- fireEvent(id) {
143
- return this.recordAction({ type: 'fire_event', id }, () => this.fireEventInternal(id));
144
- }
145
- fireEventInternal(id) {
146
- const event = this.nodes('event').find((candidate) => candidate.attributes.id === id);
147
- if (!event || !this.eventFiltersMatch(event) || !this.claimEvent(event))
148
- return false;
149
- this.executeTracedEvent(event, 'fireEvent');
150
- this.checkObjectives();
151
- return true;
152
- }
153
- /**
154
- * Fire the `on=moveto` events for a unit that has just arrived somewhere.
155
- * The runtime's own `[move]` command calls this, and so does a game whose
156
- * engine moved the unit: write the new position into `world.units` first,
157
- * then call this with the unit id.
158
- *
159
- * An event matches when `x`/`y` (when given) are the unit's position, and
160
- * `unit`/`side` (when given) are the unit's. A moveto event fires once by
161
- * default; pass `once=false` on the event to let it fire every time.
162
- */
163
- fireMoveto(id) {
164
- this.recordAction({ type: 'fire_moveto', unit: id }, () => this.fireMovetoInternal(id));
165
- }
166
- fireMovetoInternal(id) {
167
- const unit = this.world.units[id];
168
- if (!unit || !unit.alive)
169
- return;
170
- for (const event of this.nodes('event')) {
171
- if ((event.attributes.on ?? event.attributes.trigger) !== 'moveto')
172
- continue;
173
- if (event.attributes.x !== undefined && !coordinateMatches(event.attributes.x, unit.x))
174
- continue;
175
- if (event.attributes.y !== undefined && !coordinateMatches(event.attributes.y, unit.y))
176
- continue;
177
- if (event.attributes.unit !== undefined && event.attributes.unit !== id)
178
- continue;
179
- if (event.attributes.side !== undefined && event.attributes.side !== unit.side)
180
- continue;
181
- if (!this.eventFiltersMatch(event))
182
- continue;
183
- if (!this.claimEvent(event))
184
- continue;
185
- this.executeTracedEvent(event, 'moveto');
186
- }
187
- this.checkObjectives();
188
- }
189
- /** A `moveto` event is a story beat: it fires once unless told otherwise. */
190
- claimEvent(event) {
191
- const once = event.attributes.once === undefined ? event.attributes.on === 'moveto' : event.attributes.once !== 'false';
192
- if (!once)
193
- return true;
194
- const key = event.attributes.id ??
195
- `${event.attributes.on ?? event.attributes.trigger ?? 'event'}@${event.location?.line ?? 0}`;
196
- const fired = (this.world.firedEvents ??= []);
197
- if (fired.includes(key))
198
- return false;
199
- fired.push(key);
200
- return true;
201
- }
202
- eventFiltersMatch(event) {
203
- if (!this.conditionMatches(event))
204
- return false;
205
- if (!this.filterConditionMatches(event))
206
- return false;
207
- const filter = event.children.find((child) => child.tag === 'filter');
208
- return !filter || this.filterMatches(filter);
209
- }
210
- executeEvent(event) {
211
- this.runBlock(this.commandChildren(event));
212
- }
213
- /**
214
- * Runs a sequence of commands, with `say` and `dialogue` taking the message path rather
215
- * than `executeNode`. Shared by an event's top level, an `[if]`/`[else]` body and a
216
- * dialogue branch, so all three treat a nested pair the same way.
217
- */
218
- runBlock(children) {
219
- for (let index = 0; index < children.length; index++) {
220
- const child = children[index];
221
- if (this.isConsumedElse(children, index))
222
- continue;
223
- if (child.tag === 'say') {
224
- this.showSay(child);
225
- continue;
226
- }
227
- if (child.tag === 'dialogue') {
228
- this.showDialogue(child);
229
- continue;
230
- }
231
- this.executeNode(child);
232
- }
233
- }
234
- /**
235
- * Whether an `[else]` at `index` is the branch its immediately preceding `[if]` already ran.
236
- * A taken `[if]` runs its own body and owns the `[else]`, so the loop skips that `[else]`;
237
- * a false `[if]` ran nothing, so the `[else]` is left for the loop to run as its fallback.
238
- * A free-standing `[else]` with no `[if]` before it is never consumed.
239
- */
240
- isConsumedElse(children, index) {
241
- const previous = children[index - 1];
242
- return children[index]?.tag === 'else' && previous?.tag === 'if' && this.nodeConditionMatches(previous);
243
- }
244
- executeTracedEvent(event, trigger) {
245
- const id = event.attributes.id ??
246
- `${event.attributes.on ?? event.attributes.trigger ?? 'event'}@${event.location?.line ?? 0}`;
247
- this.trace({ type: 'event', phase: 'claimed', id, trigger });
248
- try {
249
- this.executeEvent(event);
250
- this.trace({ type: 'event', phase: 'completed', id, trigger });
251
- }
252
- catch (error) {
253
- this.trace({ type: 'error', message: String(error), event: id });
254
- throw error;
255
- }
256
- }
257
- /**
258
- * Deliver a `dialogue`: its `message`/`say` lines first, then one message
259
- * carrying the offered `choice`s. A choice names the event answering runs;
260
- * the game answers later with `answerDialogue`, so content keeps any
261
- * follow-up commands inside the referenced events rather than after the
262
- * dialogue. Choices gated by `variable`/`equals` are skipped unless the
263
- * world variable matches.
264
- */
265
- showDialogue(node) {
266
- let last = null;
267
- for (const child of node.children) {
268
- if (child.tag === 'message') {
269
- this.showMessage(child.attributes);
270
- last = {
271
- text: child.attributes.text ?? child.attributes.value ?? '',
272
- ...(child.attributes.speaker === undefined ? {} : { speaker: child.attributes.speaker }),
273
- ...(child.attributes.portrait === undefined ? {} : { portrait: child.attributes.portrait }),
274
- ...(child.attributes.side === undefined || child.attributes.side === ''
275
- ? {}
276
- : { side: child.attributes.side }),
277
- };
278
- }
279
- else if (child.tag === 'say') {
280
- this.showSay(child);
281
- last = { text: child.attributes.text ?? '', speaker: child.attributes.speaker };
282
- }
283
- }
284
- const choices = [];
285
- for (const child of node.children) {
286
- if (child.tag !== 'choice' || !child.attributes.text)
287
- continue;
288
- if (child.attributes.variable !== undefined &&
289
- !sameValue(this.variableAt(child.attributes.variable), child.attributes.equals))
290
- continue;
291
- const branches = child.children.filter((branch) => branch.tag === 'branch');
292
- if (branches.length) {
293
- for (const branch of branches) {
294
- choices.push({
295
- text: branch.attributes.text ?? child.attributes.text,
296
- branch: branch.children,
297
- });
298
- }
299
- }
300
- else if (child.attributes.event)
301
- choices.push({ text: child.attributes.text, event: child.attributes.event });
302
- }
303
- if (choices.length === 0)
304
- return;
305
- this.dialogueCounter += 1;
306
- const id = `dialogue-${this.dialogueCounter}`;
307
- this.pendingDialogue = { id, choices };
308
- this.world.pendingDialogue = { id, choices };
309
- this.onMessage?.({
310
- text: last?.text ?? '',
311
- ...(last?.speaker === undefined ? {} : { speaker: last.speaker }),
312
- choices,
313
- dialogueId: id,
314
- });
315
- }
316
- showSay(node) {
317
- if (!this.onMessage)
318
- return;
319
- this.onMessage({
320
- text: node.attributes.text ?? '',
321
- ...(node.attributes.speaker === undefined ? {} : { speaker: node.attributes.speaker }),
322
- });
323
- }
324
- /**
325
- * Answer a pending dialogue: run the chosen choice's event and clear the
326
- * pending state. Returns false when there is no such pending dialogue or
327
- * choice; throws when the referenced event does not exist (content error).
328
- */
329
- answerDialogue(dialogueId, choiceIndex) {
330
- return this.recordAction({ type: 'answer_dialogue', dialogueId, choiceIndex }, () => this.answerDialogueInternal(dialogueId, choiceIndex));
331
- }
332
- answerDialogueInternal(dialogueId, choiceIndex) {
333
- const pending = this.pendingDialogue;
334
- if (!pending || pending.id !== dialogueId)
335
- return false;
336
- const choice = pending.choices[choiceIndex];
337
- if (!choice)
338
- return false;
339
- this.pendingDialogue = null;
340
- delete this.world.pendingDialogue;
341
- if (choice.event) {
342
- const event = this.nodes('event').find((candidate) => candidate.attributes.id === choice.event);
343
- if (!event)
344
- throw new Error(`MWL dialogue choice points at unknown event: ${choice.event}`);
345
- if (!this.claimEvent(event))
346
- return true;
347
- this.executeEvent(event);
348
- }
349
- else {
350
- this.runBlock(choice.branch ?? []);
351
- }
352
- this.checkObjectives();
353
- return true;
354
- }
355
- /**
356
- * Evaluate `[objectives]` now and return the resulting status. A game whose
357
- * own engine resolved the actions (real movement, combat) calls this after
358
- * writing the results into `world`; `run` already calls it itself.
359
- */
360
- evaluate() {
361
- this.checkObjectives();
362
- return this.world.status;
363
- }
364
- save() {
365
- const state = this.hooks?.saveable;
366
- const hookState = state
367
- ? Object.fromEntries(Object.entries(state).map(([id, hook]) => [id, hook.save()]))
368
- : undefined;
369
- return encodeSave(this.world, this.persistence, hookState, this.journal.toJSON());
370
- }
371
- snapshot() {
372
- return JSON.stringify(this.world);
373
- }
374
- restore(snapshot) {
375
- const envelope = decodeSaveEnvelope(snapshot, this.persistence);
376
- const restored = envelope.world;
377
- Object.assign(this.world.variables, restored.variables);
378
- Object.assign(this.world.units, restored.units);
379
- Object.assign(this.world.sides, restored.sides ?? {});
380
- Object.assign(this.world.maps, restored.maps ?? {});
381
- Object.assign(this.world.gold, restored.gold ?? {});
382
- this.world.turn = restored.turn;
383
- this.world.status = restored.status;
384
- this.world.sideStatus = { ...(restored.sideStatus ?? {}) };
385
- this.world.map = restored.map ?? null;
386
- this.world.timeOfDay = restored.timeOfDay ?? this.schedule[0] ?? '';
387
- this.world.scheduleIndex = restored.scheduleIndex ?? 0;
388
- // A save predating this field, or one from a game that never drew hook randomness, has
389
- // nothing to resume: reseed fresh rather than let a hook's first post-restore draw depend
390
- // on wherever this runtime's own generator happened to be before the load.
391
- this.world.random = restored.random;
392
- this.random.setState(restored.random ?? new Generator().getState());
393
- // One-shot events stay spent across a load.
394
- this.world.firedEvents = [...(restored.firedEvents ?? [])];
395
- // Scenario data a command may have changed, restored wholesale rather than merged: a load
396
- // is that save's world, not this scenario's with a few fields over it.
397
- this.world.villages = restored.villages ? structuredClone(restored.villages) : undefined;
398
- this.world.clearedShroud = restored.clearedShroud ? structuredClone(restored.clearedShroud) : undefined;
399
- this.world.roles = restored.roles ? structuredClone(restored.roles) : undefined;
400
- this.world.objects = restored.objects ? structuredClone(restored.objects) : undefined;
401
- this.world.story = restored.story ? structuredClone(restored.story) : undefined;
402
- this.world.pendingDialogue = restored.pendingDialogue;
403
- this.pendingDialogue = restored.pendingDialogue
404
- ? { id: restored.pendingDialogue.id, choices: [...restored.pendingDialogue.choices] }
405
- : null;
406
- const dialogueNumber = restored.pendingDialogue?.id.match(/^dialogue-(\d+)$/);
407
- if (dialogueNumber)
408
- this.dialogueCounter = Math.max(this.dialogueCounter, Number(dialogueNumber[1]));
409
- for (const [id, state] of Object.entries(envelope.hookState ?? {}))
410
- this.hooks?.saveable?.[id]?.restore(state);
411
- this.journal.replace((envelope.journal ?? []));
412
- }
413
- recordAction(action, body) {
414
- const outer = this.traceBatch === null;
415
- if (outer)
416
- this.traceBatch = [];
417
- try {
418
- const result = body();
419
- if (outer)
420
- this.journal.append(action, this.traceBatch ?? []);
421
- return result;
422
- }
423
- finally {
424
- if (outer)
425
- this.traceBatch = null;
426
- }
427
- }
428
- trace(event) {
429
- this.traceBatch?.push(event);
430
- this.onTrace?.(event);
431
- }
432
- loadUnitTypes() {
433
- for (const node of this.nodes('unit_type')) {
434
- const id = node.attributes.id;
435
- if (id)
436
- this.unitTypes.set(id, {
437
- hitpoints: integer(node, 'hitpoints', 1),
438
- movement: integer(node, 'movement', 0),
439
- });
440
- }
441
- }
442
- loadSchedule() {
443
- this.schedule = this.nodes('schedule').flatMap((schedule) => schedule.children
444
- .filter((child) => child.tag === 'time')
445
- .map((child) => child.attributes.id)
446
- .filter((id) => Boolean(id)));
447
- this.world.scheduleIndex = 0;
448
- this.world.timeOfDay = this.schedule[0] ?? '';
449
- }
450
- loadInitialContent() {
451
- for (const side of this.nodes('side')) {
452
- const entry = {
453
- gold: integer(side, 'gold', 0),
454
- income: integer(side, 'income', 0),
455
- };
456
- if (side.attributes.leader !== undefined)
457
- entry.leader = side.attributes.leader;
458
- if (side.attributes.controller !== undefined)
459
- entry.controller = side.attributes.controller;
460
- if (side.attributes.recruit !== undefined)
461
- entry.recruit = side.attributes.recruit;
462
- //only what was written, so a world stays as small as the content that made it
463
- if (side.attributes.team_name !== undefined)
464
- entry.teamName = side.attributes.team_name;
465
- if (side.attributes.user_team_name !== undefined)
466
- entry.userTeamName = side.attributes.user_team_name;
467
- if (side.attributes.share_vision !== undefined)
468
- entry.shareVision = side.attributes.share_vision;
469
- if (side.attributes.flag !== undefined)
470
- entry.flag = side.attributes.flag;
471
- if (side.attributes.village_gold !== undefined)
472
- entry.villageGold = integer(side, 'village_gold', 0);
473
- for (const key of ['heal', 'fog', 'shroud', 'hidden']) {
474
- const written = side.attributes[key];
475
- if (written !== undefined)
476
- entry[key] = written === 'yes' || written === 'true';
477
- }
478
- this.world.sides[required(side, 'id')] = entry;
479
- }
480
- for (const map of this.nodes('map')) {
481
- const id = map.attributes.id ?? map.attributes.name ?? 'map';
482
- this.world.maps[id] = { terrain: map.attributes.terrain ?? '', file: map.attributes.file };
483
- if (!this.world.map)
484
- this.world.map = this.buildMap(id, map);
485
- }
486
- }
487
- /** Direct children of `[game]` with a tag, as opposed to `nodes` which searches the whole tree. */
488
- topLevelNodes(tag) {
489
- const game = this.game.roots.find((root) => root.tag === 'game');
490
- return (game?.children ?? this.game.roots).filter((root) => root.tag === tag);
491
- }
492
- /**
493
- * Scenario-level data that is not a side, a map or a unit: `[object]` placements, the `[story]`
494
- * beats, and the `[role]` table. Kept as plain data on the world - the framework sequences and
495
- * serialises it, and the game decides what an object does, what a story beat looks like, and
496
- * what a role is for.
497
- */
498
- loadScenarioExtras() {
499
- for (const object of this.topLevelNodes('object')) {
500
- const x = integer(object, 'x', 0);
501
- const y = integer(object, 'y', 0);
502
- const entry = { x, y };
503
- if (object.attributes.id !== undefined)
504
- entry.id = object.attributes.id;
505
- if (object.attributes.name !== undefined)
506
- entry.name = object.attributes.name;
507
- if (object.attributes.image !== undefined)
508
- entry.image = object.attributes.image;
509
- if (object.attributes.side !== undefined)
510
- entry.side = object.attributes.side;
511
- (this.world.objects ??= []).push(entry);
512
- }
513
- for (const story of this.topLevelNodes('story')) {
514
- const text = story.attributes.text ?? story.attributes.value;
515
- if (text === undefined)
516
- continue;
517
- const entry = { text };
518
- if (story.attributes.title !== undefined)
519
- entry.title = story.attributes.title;
520
- if (story.attributes.image !== undefined)
521
- entry.image = story.attributes.image;
522
- if (story.attributes.music !== undefined)
523
- entry.music = story.attributes.music;
524
- (this.world.story ??= []).push(entry);
525
- }
526
- for (const role of this.topLevelNodes('role')) {
527
- const name = role.attributes.role ?? role.attributes.name;
528
- if (name === undefined)
529
- continue;
530
- //`role`/`name` on this tag name the role being assigned, not a unit to match, so the
531
- //filter must not read either back as one - the same double duty `[store_unit]`'s
532
- //`variable`/`name` has
533
- const filter = withoutAttributes(role.attributes, 'role', 'name');
534
- const matched = Object.entries(this.world.units).filter(([id, unit]) => unit.alive && unitMatchesFilter(unit, id, filter));
535
- //a unit learns the role it was assigned, so a later `[filter] role=courier` finds it
536
- for (const [, unit] of matched)
537
- unit.role = name;
538
- (this.world.roles ??= {})[name] = matched.map(([id]) => id);
539
- }
540
- }
541
- buildMap(id, node) {
542
- let text = node.attributes.terrain;
543
- if (!text && node.attributes.file && this.resolveMap)
544
- text = this.resolveMap(node.attributes.file);
545
- if (!text)
546
- return null;
547
- const parsed = parseTerrain(text);
548
- for (const start of node.children) {
549
- if (start.tag !== 'start')
550
- continue;
551
- const side = start.attributes.side;
552
- const x = optionalInteger(start, 'x');
553
- const y = optionalInteger(start, 'y');
554
- if (side !== undefined && x !== undefined && y !== undefined)
555
- (parsed.starts[side] ??= []).push({ x, y });
556
- }
557
- return { id, ...parsed };
558
- }
559
- loadInitialUnits() {
560
- for (const unit of this.nodes('unit')) {
561
- const id = required(unit, 'id');
562
- const entry = {
563
- hp: integer(unit, 'hp', 1),
564
- x: integer(unit, 'x', 0),
565
- y: integer(unit, 'y', 0),
566
- alive: true,
567
- };
568
- if (unit.attributes.type !== undefined) {
569
- entry.type = unit.attributes.type;
570
- const stats = this.unitTypes.get(unit.attributes.type);
571
- if (stats)
572
- entry.moves = stats.movement;
573
- }
574
- if (unit.attributes.side !== undefined)
575
- entry.side = unit.attributes.side;
576
- if (unit.attributes.name !== undefined)
577
- entry.name = unit.attributes.name;
578
- if (unit.attributes.role !== undefined)
579
- entry.role = unit.attributes.role;
580
- const can_recruit = booleanAttribute(unit, 'can_recruit');
581
- if (can_recruit !== undefined)
582
- entry.can_recruit = can_recruit;
583
- this.world.units[id] = entry;
584
- }
585
- }
586
- loadLeaders() {
587
- for (const side of this.nodes('side')) {
588
- const leader = side.attributes.leader;
589
- if (!leader)
590
- continue;
591
- const sideId = side.attributes.id;
592
- if (!sideId)
593
- continue;
594
- const starts = this.world.map?.starts[sideId];
595
- if (!starts?.length)
596
- continue;
597
- //a leader naming a declared [unit] is that unit, not a type to spawn a second one of
598
- if (this.world.units[leader])
599
- continue;
600
- const stats = this.unitTypes.get(leader);
601
- if (!stats)
602
- throw new Error(`MWL side ${sideId} leader "${leader}" is neither a unit nor a unit type`);
603
- for (const start of starts) {
604
- if (this.unitAt(start.x, start.y))
605
- continue;
606
- const id = `${leader} ${sideId} (${start.x},${start.y})`;
607
- this.world.units[id] = {
608
- hp: stats.hitpoints,
609
- x: start.x,
610
- y: start.y,
611
- alive: true,
612
- type: leader,
613
- side: sideId,
614
- moves: stats.movement,
615
- can_recruit: true,
616
- leader: true,
617
- };
618
- }
619
- }
620
- }
621
- unitAt(x, y) {
622
- return Object.values(this.world.units).find((unit) => unit.alive && unit.x === x && unit.y === y);
623
- }
624
- /**
625
- * One entry per MWL command tag, keyed exactly as `executeNode` used to switch on. Each
626
- * handler is a small, independently-named method below rather than a case body, so a
627
- * command's own logic is a search away instead of one branch inside a 200-line function -
628
- * the decomposition this project's own review flagged `mwl/runtime.ts`'s size for for,
629
- * done for the one function that was actually a single undifferentiated dispatch. State
630
- * (`this.world` and the rest) still lives on the instance; only the dispatch itself moved.
631
- */
632
- static { this.commandHandlers = {
633
- message: (self, node) => self.showMessage(node.attributes),
634
- spawn: (self, node) => self.cmdSpawn(node),
635
- move: (self, node) => self.cmdMove(node),
636
- kill: (self, node) => self.cmdKill(node),
637
- fire_event: (self, node) => self.cmdFireEvent(node),
638
- store_unit: (self, node) => self.cmdStoreUnit(node),
639
- unstore_unit: (self, node) => self.cmdUnstoreUnit(node),
640
- recall: (self, node) => self.cmdRecall(node),
641
- modify_unit: (self, node) => self.cmdModifyUnit(node),
642
- heal_unit: (self, node) => self.cmdHealUnit(node),
643
- set_terrain: (self, node) => self.setTerrain(integer(node, 'x', 0), integer(node, 'y', 0), required(node, 'terrain')),
644
- capture_village: (self, node) => self.cmdCaptureVillage(node),
645
- clear_shroud: (self, node) => self.cmdClearShroud(node),
646
- role: (self, node) => self.cmdRole(node),
647
- attack: (self, node) => self.attack(node.attributes.defender ?? node.attributes.target ?? required(node, 'target'), integer(node, 'amount', 0)),
648
- modify_gold: (self, node) => self.addGold(node.attributes.side ?? required(node, 'target'), integer(node, 'delta', integer(node, 'amount', 0))),
649
- gold: (self, node) => self.addGold(required(node, 'side'), integer(node, 'delta', integer(node, 'amount', 0))),
650
- set_variable: (self, node) => self.cmdSetVariable(node),
651
- while: (self, node) => self.cmdWhile(node),
652
- foreach: (self, node) => self.cmdForeach(node),
653
- switch: (self, node) => self.cmdSwitch(node),
654
- end_turn: (self) => self.endTurn(),
655
- win: (self, node) => self.cmdWin(node),
656
- lose: (self, node) => self.cmdLose(node),
657
- endlevel: (self, node) => self.cmdEndlevel(node),
658
- if: (self, node) => self.cmdIf(node),
659
- //reachable at top level for a free-standing [else]; a paired one is run by its [if]
660
- else: (self, node) => self.runBlock(self.commandChildren(node)),
661
- hook: (self, node) => self.runHook(node),
662
- }; }
663
- executeNode(node) {
664
- const name = node.tag === 'command' ? node.attributes.name : node.tag;
665
- if (!name)
666
- throw new Error('MWL command is missing name');
667
- const handler = MwlRuntime.commandHandlers[name];
668
- if (!handler)
669
- throw new Error(`unknown MWL command: ${name}`);
670
- handler(this, node);
671
- }
672
- cmdSpawn(node) {
673
- this.spawnUnit(node.attributes.type ?? '', node.attributes.side, integer(node, 'x', 0), integer(node, 'y', 0), node.attributes.id ?? node.attributes.target, node.attributes.hp === undefined ? undefined : integer(node, 'hp', 1));
674
- }
675
- cmdMove(node) {
676
- this.applyMove(node.attributes.unit ?? required(node, 'target'), integer(node, 'x', 0), integer(node, 'y', 0));
677
- }
678
- cmdKill(node) {
679
- //a named unit that is not there is a content error; a filter that matches nobody is not,
680
- //which is what WML's own `[kill]` does. An empty filter matches every unit, there as
681
- //here, which is worth knowing before writing one.
682
- const named = node.attributes.unit ?? node.attributes.target;
683
- if (named === undefined)
684
- killMatching(this.world, node.attributes);
685
- else
686
- this.killUnit(named);
687
- }
688
- cmdFireEvent(node) {
689
- const id = node.attributes.id ?? node.attributes.name;
690
- if (!id)
691
- throw new Error('[fire_event] requires id');
692
- this.fireEvent(id);
693
- }
694
- cmdStoreUnit(node) {
695
- const variable = node.attributes.variable ?? node.attributes.name ?? required(node, 'variable');
696
- this.setVariableAt(variable, this.matchingUnits(node, ['variable', 'name']).map(([id, unit]) => ({ id, ...unitSnapshot(unit) })));
697
- }
698
- cmdUnstoreUnit(node) {
699
- const variable = required(node, 'variable');
700
- for (const entry of this.storedUnits(variable))
701
- this.restoreUnit(entry, {});
702
- }
703
- cmdRecall(node) {
704
- const stored = this.storedUnits(required(node, 'variable'));
705
- const wanted = node.attributes.id ?? node.attributes.unit;
706
- const entry = wanted === undefined ? stored[0] : stored.find((candidate) => candidate.id === wanted);
707
- if (!entry)
708
- throw new Error(`[recall] found no stored unit${wanted === undefined ? '' : ` named ${wanted}`}`);
709
- const placement = {};
710
- if (node.attributes.x !== undefined)
711
- placement.x = integer(node, 'x', 0);
712
- if (node.attributes.y !== undefined)
713
- placement.y = integer(node, 'y', 0);
714
- if (node.attributes.side !== undefined)
715
- placement.side = node.attributes.side;
716
- this.restoreUnit(entry, placement);
717
- }
718
- cmdModifyUnit(node) {
719
- //WML separates which units (`[filter]`) from what changes (`[set]`); a bare
720
- //`[modify_unit] hp=5` with no `[set]` changes every unit it matches
721
- const changes = node.children.find((child) => child.tag === 'set')?.attributes ?? node.attributes;
722
- for (const [, unit] of this.matchingUnits(node))
723
- applyUnitChanges(unit, changes);
724
- }
725
- cmdHealUnit(node) {
726
- const amount = optionalInteger(node, 'amount');
727
- const absolute = optionalInteger(node, 'hp');
728
- if (amount === undefined && absolute === undefined)
729
- throw new Error('[heal_unit] requires amount or hp');
730
- for (const [, unit] of this.matchingUnits(node))
731
- unit.hp = absolute ?? unit.hp + (amount ?? 0);
732
- }
733
- cmdCaptureVillage(node) {
734
- const x = integer(node, 'x', 0);
735
- const y = integer(node, 'y', 0);
736
- const entry = { x, y, side: required(node, 'side') };
737
- if (node.attributes.name !== undefined)
738
- entry.name = node.attributes.name;
739
- (this.world.villages ??= {})[`${x},${y}`] = entry;
740
- }
741
- cmdClearShroud(node) {
742
- const side = required(node, 'side');
743
- const x = integer(node, 'x', 0);
744
- const y = integer(node, 'y', 0);
745
- const radius = integer(node, 'radius', 1);
746
- const cleared = new Set(this.world.clearedShroud?.[side] ?? []);
747
- for (let dy = -radius; dy <= radius; dy++)
748
- for (let dx = -radius; dx <= radius; dx++)
749
- cleared.add(`${x + dx},${y + dy}`);
750
- (this.world.clearedShroud ??= {})[side] = [...cleared];
751
- }
752
- cmdRole(node) {
753
- const name = node.attributes.role ?? node.attributes.name;
754
- if (!name)
755
- throw new Error('[role] requires role');
756
- //`role`/`name` here name the role being assigned, not a unit to match, so the filter
757
- //must not read either back as one - the same exclusion the scenario-level role uses
758
- const matched = this.matchingUnits(node, ['role', 'name']);
759
- for (const [, unit] of matched)
760
- unit.role = name;
761
- (this.world.roles ??= {})[name] = matched.map(([id]) => id);
762
- }
763
- cmdSetVariable(node) {
764
- // `name`/`target` is a path written out, `path` is one content builds from
765
- // variables. Only the second goes through expansion: a `$` in `name` is not
766
- // a reference today, and reading it as one would change what content means.
767
- const computed = node.attributes.path;
768
- this.setVariable(computed === undefined
769
- ? node.tag === 'command'
770
- ? required(node, 'target')
771
- : required(node, 'name')
772
- : this.expandPath(computed), node.attributes.value ?? '', node.attributes.mode);
773
- }
774
- cmdWhile(node) {
775
- const limit = integer(node, 'max_iterations', 1000);
776
- if (limit < 1 || limit > 100_000)
777
- throw new Error('MWL while max_iterations must be between 1 and 100000');
778
- let iteration = 0;
779
- while (iteration < limit && this.nodeConditionMatches(node)) {
780
- this.runBlock(this.commandChildren(node));
781
- iteration++;
782
- }
783
- //the cap is observable: reaching it with the condition still true traces a
784
- //while_limit, and on_limit=error turns that into a hard failure instead
785
- if (iteration === limit && this.nodeConditionMatches(node)) {
786
- if (node.attributes.on_limit === 'error')
787
- throw new Error(`MWL while reached its max_iterations cap of ${limit}`);
788
- this.onTrace?.({ type: 'while_limit', iterations: limit });
789
- }
790
- }
791
- cmdForeach(node) {
792
- const source = this.variableAt(required(node, 'variable'));
793
- const entries = Array.isArray(source)
794
- ? source.map((value, index) => [String(index), value])
795
- : typeof source === 'string'
796
- ? source
797
- .split(',')
798
- .map((value, index) => [String(index), value.trim()])
799
- .filter(([, value]) => value !== '')
800
- : source && typeof source === 'object'
801
- ? Object.entries(source)
802
- : [];
803
- const item = node.attributes.item ?? 'item';
804
- const indexName = node.attributes.index ?? 'index';
805
- for (let index = 0; index < entries.length; index++) {
806
- this.setVariableAt(item, entries[index][1]);
807
- this.setVariableAt(indexName, index);
808
- this.runBlock(this.commandChildren(node));
809
- }
810
- }
811
- cmdSwitch(node) {
812
- const value = this.variableAt(required(node, 'variable'));
813
- const selected = node.children.find((child) => child.tag === 'case' &&
814
- child.attributes.equals !== undefined &&
815
- sameValue(value, child.attributes.equals));
816
- const fallback = node.children.find((child) => child.tag === 'default');
817
- this.runBlock((selected ?? fallback)?.children ?? []);
818
- }
819
- cmdWin(node) {
820
- this.markSideResult(node.attributes.side, 'won');
821
- this.world.status = 'won';
822
- }
823
- cmdLose(node) {
824
- this.markSideResult(node.attributes.side, 'lost');
825
- this.world.status = 'lost';
826
- }
827
- cmdEndlevel(node) {
828
- const result = node.attributes.result === 'defeat' ? 'defeat' : 'victory';
829
- this.world.status = result === 'defeat' ? 'lost' : 'won';
830
- this.world.carryover = endLevelCarryover(this.world, endLevelSide(this.world, node.attributes.side), {
831
- result,
832
- bonus: integerAttribute(node, 'bonus'),
833
- carryoverPercentage: numberAttribute(node, 'carryover_percentage'),
834
- carryoverAdd: booleanAttribute(node, 'carryover_add'),
835
- nextScenario: node.attributes.next_scenario ?? null,
836
- });
837
- }
838
- cmdIf(node) {
839
- //an immediately following [else] is this branch's other half, not a separate
840
- //command: the condition picks one body, and runBlock skips the [else] itself
841
- const fallback = node.children.find((child) => child.tag === 'else');
842
- const taken = this.nodeConditionMatches(node) ? node : fallback;
843
- this.runBlock(taken ? this.commandChildren(taken) : []);
844
- }
845
- /**
846
- * A node's children that are commands to run, dropping the condition children the schema
847
- * allows a branch to carry. A `[condition]` is read by the branch itself, never executed:
848
- * `[if]`/`[while]` evaluate one through `nodeConditionMatches`, where running it as a command
849
- * would be an unknown tag.
850
- */
851
- commandChildren(node) {
852
- return node.children.filter((child) => child.tag !== 'condition' && child.tag !== 'filter' && child.tag !== 'filter_condition');
853
- }
854
- runHook(node) {
855
- const reference = node.attributes.name ?? '';
856
- const hook = this.hooks?.command?.[reference];
857
- if (!hook)
858
- throw new Error(`MWL hook ${reference} is not implemented`);
859
- const { name: _name, ...context } = node.attributes;
860
- hook(this.worldView(), this.emit(), context);
861
- }
862
- applyMove(id, x, y) {
863
- const unit = this.world.units[id];
864
- if (!unit || !unit.alive)
865
- throw new Error(`MWL unit is not alive: ${id}`);
866
- const map = this.world.map ?? null;
867
- if (map) {
868
- if (x < 0 || y < 0 || x >= map.width || y >= map.height)
869
- throw new Error(`MWL move out of bounds: ${x},${y}`);
870
- const occupant = this.unitAt(x, y);
871
- if (occupant && occupant !== unit)
872
- throw new Error(`MWL move onto an occupied cell: ${x},${y}`);
873
- }
874
- if (typeof unit.moves === 'number') {
875
- if (unit.moves <= 0)
876
- throw new Error(`MWL unit has no moves left: ${id}`);
877
- unit.moves -= 1;
878
- }
879
- unit.x = x;
880
- unit.y = y;
881
- this.fireMoveto(id);
882
- }
883
- /** Deliver a `[message]` to the game, with speaker and portrait when given. */
884
- showMessage(attributes) {
885
- if (!this.onMessage)
886
- return;
887
- const message = {
888
- text: this.interpolate(attributes.text ?? attributes.value ?? ''),
889
- ...(attributes.speaker === undefined ? {} : { speaker: attributes.speaker }),
890
- ...(attributes.portrait === undefined ? {} : { portrait: attributes.portrait }),
891
- ...(attributes.side === undefined || attributes.side === '' ? {} : { side: attributes.side }),
892
- };
893
- this.onMessage(message);
894
- }
895
- /**
896
- * Substitute `$name` and `$(expression)` references in message text from
897
- * the world variables (numbers evaluate, missing reads as empty), the
898
- * same interpolation WML authors expect in story and dialogue strings.
899
- */
900
- interpolate(text) {
901
- const numeric = this.numericVariables();
902
- const expanded = text.replace(expressionReference, (_whole, expression) => {
903
- try {
904
- return String(evaluateExpression(expression, numeric));
905
- }
906
- catch {
907
- return '';
908
- }
909
- });
910
- return expanded.replace(variableReference, (_whole, name) => {
911
- const value = this.variableAt(name);
912
- return value === undefined || typeof value === 'boolean' ? '' : String(value);
913
- });
914
- }
915
- /**
916
- * Expands the references a computed variable path is built from, so content can write
917
- * `zombies[$index].allow_recruit` or `$target` (a variable holding a path) the way an author
918
- * expects. Unlike a message, a reference here may not resolve to nothing: an empty segment
919
- * would name a different variable than the one the content meant.
920
- */
921
- expandPath(path) {
922
- const expanded = path.replace(expressionReference, (_whole, expression) => String(evaluateExpression(expression, this.numericVariables())));
923
- return expanded.replace(variableReference, (_whole, name) => {
924
- const value = this.variableAt(name);
925
- if (value === undefined)
926
- throw new Error(`MWL variable path reference "$${name}" names no variable`);
927
- if (typeof value === 'boolean' || typeof value === 'object')
928
- throw new Error(`MWL variable path reference "$${name}" is not a name or number`);
929
- return String(value);
930
- });
931
- }
932
- setVariable(name, raw, mode) {
933
- // `mode` is content declaring what its own text means. A compiler target always
934
- // knows, so it never has to rely on the shape-guessing below: a literal containing
935
- // `+` or `(` stays text, and a literal that spells a numeric variable's name stays
936
- // text rather than reading that variable.
937
- if (mode === 'literal') {
938
- this.setVariableAt(name, raw);
939
- return;
940
- }
941
- if (mode === 'number') {
942
- const value = Number(raw);
943
- if (raw.trim() === '' || !Number.isFinite(value))
944
- throw new Error(`MWL set_variable mode="number" needs a number, got "${raw}"`);
945
- this.setVariableAt(name, value);
946
- return;
947
- }
948
- if (mode === 'expression') {
949
- this.setVariableAt(name, evaluateExpression(raw, this.numericVariables()));
950
- return;
951
- }
952
- if (mode !== undefined)
953
- throw new Error(`unknown MWL set_variable mode "${mode}"`);
954
- const numeric = Number(raw);
955
- if (raw.trim() !== '' && Number.isFinite(numeric)) {
956
- this.setVariableAt(name, numeric);
957
- return;
958
- }
959
- // A bare `$name` copies another variable (missing reads as empty),
960
- // so content can alias changing values without arithmetic.
961
- const reference = /^\$([A-Za-z_][A-Za-z0-9_.]*)$/.exec(raw.trim());
962
- if (reference) {
963
- const value = this.variableAt(reference[1]);
964
- this.setVariableAt(name, value === undefined ? '' : value);
965
- return;
966
- }
967
- const context = this.numericVariables();
968
- if (/[+*/^()]|\s-\s/.test(raw) || Object.prototype.hasOwnProperty.call(context, raw.trim())) {
969
- this.setVariableAt(name, evaluateExpression(raw, context));
970
- return;
971
- }
972
- this.setVariableAt(name, raw);
973
- }
974
- /** The numeric half of the world variables: the context every MWL expression evaluates in. */
975
- numericVariables() {
976
- return Object.fromEntries(Object.entries(this.world.variables).filter((entry) => typeof entry[1] === 'number'));
977
- }
978
- variableAt(path) {
979
- return variableAtPath(this.world.variables, path);
980
- }
981
- setVariableAt(path, value) {
982
- const previous = this.variableAt(path);
983
- setVariableAtPath(this.world.variables, path, value);
984
- this.trace({ type: 'variable', name: path, ...(previous === undefined ? {} : { previous }), value });
985
- }
986
- spawnUnit(type, side, x, y, id, hp) {
987
- const stats = type ? this.unitTypes.get(type) : undefined;
988
- const key = id ?? `${type || 'unit'}#${side ?? ''}@${x},${y}`;
989
- this.world.units[key] = {
990
- hp: hp ?? stats?.hitpoints ?? 1,
991
- x,
992
- y,
993
- alive: true,
994
- ...(type ? { type } : {}),
995
- ...(side === undefined ? {} : { side }),
996
- ...(stats ? { moves: stats.movement } : {}),
997
- };
998
- }
999
- killUnit(id) {
1000
- const unit = this.world.units[id];
1001
- if (!unit || !unit.alive)
1002
- throw new Error(`MWL unit is not alive: ${id}`);
1003
- unit.alive = false;
1004
- }
1005
- /**
1006
- * Live units a command's filter selects: its `[filter]` child when it has one, otherwise its
1007
- * own attributes, read by the same `unitMatchesFilter` an event filter and `[kill]` use. An
1008
- * empty filter matches every live unit, the rule `[kill]` already documents.
1009
- */
1010
- matchingUnits(node, exclude = []) {
1011
- const filter = node.children.find((child) => child.tag === 'filter');
1012
- //a `[filter]` child is a real unit filter and keeps every attribute; the node's own
1013
- //attributes are the fallback, minus whatever they mean to this command instead of a unit
1014
- const attributes = filter ? filter.attributes : withoutAttributes(node.attributes, ...exclude);
1015
- return Object.entries(this.world.units).filter(([id, unit]) => unit.alive && unitMatchesFilter(unit, id, attributes));
1016
- }
1017
- /** The unit snapshots `[store_unit]` wrote into a world variable, or a named content error. */
1018
- storedUnits(variable) {
1019
- const stored = this.variableAt(variable);
1020
- if (!Array.isArray(stored))
1021
- throw new Error(`MWL variable ${variable} is not a stored unit list; store one first`);
1022
- return stored.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry));
1023
- }
1024
- /** Writes a stored snapshot back into the world, applying any placement overrides. */
1025
- restoreUnit(entry, placement) {
1026
- const id = typeof entry.id === 'string' ? entry.id : undefined;
1027
- if (!id)
1028
- throw new Error('a stored unit snapshot is missing its id');
1029
- const unit = {
1030
- hp: typeof entry.hp === 'number' ? entry.hp : 1,
1031
- x: placement.x ?? (typeof entry.x === 'number' ? entry.x : 0),
1032
- y: placement.y ?? (typeof entry.y === 'number' ? entry.y : 0),
1033
- alive: entry.alive !== false,
1034
- };
1035
- if (typeof entry.type === 'string')
1036
- unit.type = entry.type;
1037
- const side = placement.side ?? (typeof entry.side === 'string' ? entry.side : undefined);
1038
- if (side !== undefined)
1039
- unit.side = side;
1040
- if (typeof entry.moves === 'number')
1041
- unit.moves = entry.moves;
1042
- if (typeof entry.name === 'string')
1043
- unit.name = entry.name;
1044
- if (typeof entry.role === 'string')
1045
- unit.role = entry.role;
1046
- if (typeof entry.can_recruit === 'boolean')
1047
- unit.can_recruit = entry.can_recruit;
1048
- if (typeof entry.leader === 'boolean')
1049
- unit.leader = entry.leader;
1050
- this.world.units[id] = unit;
1051
- }
1052
- /** Changes one cell of the primary map, keeping the parsed grid and its size in step. */
1053
- setTerrain(x, y, terrain) {
1054
- const map = this.world.map;
1055
- if (!map)
1056
- throw new Error('[set_terrain] needs a loaded map');
1057
- if (x < 0 || y < 0 || x >= map.width || y >= map.height)
1058
- throw new Error(`[set_terrain] is outside the map: ${x},${y}`);
1059
- const codes = [...map.codes];
1060
- codes[y * map.width + x] = terrain;
1061
- this.world.map = { ...map, codes };
1062
- }
1063
- addGold(side, delta) {
1064
- this.world.gold[side] = (this.world.gold[side] ?? 0) + delta;
1065
- }
1066
- endTurn() {
1067
- this.world.turn += 1;
1068
- this.advanceSchedule();
1069
- this.resetMoves();
1070
- this.run('turn');
1071
- this.checkTimeOver();
1072
- }
1073
- /**
1074
- * Wesnoth's "time over", as a framework native: once the scenario's `turn_limit` has passed,
1075
- * `time_over` becomes a variable content can test and an event trigger it can answer. The
1076
- * framework reports it rather than ending anything, because a turn limit is usually a defeat and
1077
- * occasionally the whole point of the scenario ("hold out until then"), so what it means is
1078
- * content's business - `[endlevel]` is right there for it. Fired once, and derived from the turn
1079
- * counter rather than kept in step with it.
1080
- */
1081
- checkTimeOver() {
1082
- const limit = integerAttribute(this.game.roots[0], 'turn_limit');
1083
- if (limit === undefined || this.world.turn <= limit || this.world.variables.time_over === 'yes')
1084
- return;
1085
- this.world.variables.time_over = 'yes';
1086
- this.run('time_over');
1087
- }
1088
- advanceSchedule() {
1089
- if (!this.schedule.length)
1090
- return;
1091
- const index = ((this.world.scheduleIndex ?? 0) + 1) % this.schedule.length;
1092
- this.world.scheduleIndex = index;
1093
- this.world.timeOfDay = this.schedule[index];
1094
- }
1095
- resetMoves() {
1096
- for (const unit of Object.values(this.world.units)) {
1097
- if (!unit.alive)
1098
- continue;
1099
- const stats = unit.type ? this.unitTypes.get(unit.type) : undefined;
1100
- if (stats)
1101
- unit.moves = stats.movement;
1102
- }
1103
- }
1104
- filterMatches(node) {
1105
- return Object.entries(this.world.units).some(([id, unit]) => unit.alive && unitMatchesFilter(unit, id, node.attributes));
1106
- }
1107
- /**
1108
- * Every `condition` child must match (conjunction). Each child names a
1109
- * world variable and states one comparison: `equals` (the default, numeric
1110
- * aware), `not_equals`, comma-list `in`/`not_in`, or the numeric
1111
- * `less_than`/`greater_than`/`less_than_or_equal_to`/
1112
- * `greater_than_or_equal_to` (false when either side is not a number).
1113
- */
1114
- conditionMatches(node) {
1115
- return node.children
1116
- .filter((child) => child.tag === 'condition')
1117
- .every((condition) => {
1118
- if (condition.attributes.condition === 'hook') {
1119
- const hookName = condition.attributes.hook;
1120
- const predicateName = hookName?.startsWith('predicate:')
1121
- ? hookName.slice('predicate:'.length)
1122
- : undefined;
1123
- const predicate = predicateName ? this.hooks?.predicate?.[predicateName] : undefined;
1124
- if (!predicate)
1125
- throw new Error(`MWL predicate ${predicateName ?? '<missing>'} is not implemented`);
1126
- const { condition: _condition, hook: _hook, ...context } = condition.attributes;
1127
- return Boolean(predicate(this.worldView(), context));
1128
- }
1129
- return variableMatches(this.variableAt(condition.attributes.variable), condition.attributes, resolveVariable(this.world.variables));
1130
- });
1131
- }
1132
- nodeConditionMatches(node) {
1133
- if (node.attributes.test !== undefined)
1134
- return evaluateCondition(node.attributes.test, primitiveVariables(this.world.variables), {
1135
- helpers: this.conditionHelpers(),
1136
- });
1137
- return this.conditionMatches(node);
1138
- }
1139
- /**
1140
- * The helpers a `test=` expression may call (item 406): the built-in `have_unit` and
1141
- * `have_location` queries over this world, plus one entry per registered predicate
1142
- * hook, so a compound predicate no longer has to detour through `condition=hook` with
1143
- * a `[condition]` tree. Each argument is one `key=value` pair (a bare argument names
1144
- * `value`), matching the string-shaped context predicates already receive.
1145
- */
1146
- conditionHelpers() {
1147
- if (this.testHelpers)
1148
- return this.testHelpers;
1149
- const filterFromArgs = (args) => {
1150
- const filter = {};
1151
- for (const arg of args) {
1152
- const text = String(arg);
1153
- const split = text.indexOf('=');
1154
- if (split <= 0)
1155
- filter.value = text;
1156
- else
1157
- filter[text.slice(0, split)] = text.slice(split + 1);
1158
- }
1159
- return filter;
1160
- };
1161
- const helpers = {
1162
- have_unit: (...args) => {
1163
- const filter = filterFromArgs(args);
1164
- return Object.entries(this.world.units).some(([id, unit]) => unit.alive &&
1165
- (filter.id === undefined || id === filter.id) &&
1166
- unitMatchesFilter(unit, id, filter));
1167
- },
1168
- have_location: (...args) => {
1169
- const filter = filterFromArgs(args);
1170
- const map = this.world.map;
1171
- const x = Number(filter.x);
1172
- const y = Number(filter.y);
1173
- if (!map ||
1174
- !Number.isInteger(x) ||
1175
- !Number.isInteger(y) ||
1176
- x < 0 ||
1177
- y < 0 ||
1178
- x >= map.width ||
1179
- y >= map.height)
1180
- return false;
1181
- const code = map.codes[y * map.width + x];
1182
- return filter.terrain === undefined || code === filter.terrain;
1183
- },
1184
- };
1185
- for (const [name, predicate] of Object.entries(this.hooks?.predicate ?? {}))
1186
- helpers[name] = (...args) => Boolean(predicate(this.worldView(), filterFromArgs(args)));
1187
- this.testHelpers = helpers;
1188
- return helpers;
1189
- }
1190
- /**
1191
- * A `filter_condition` child holds `variable` comparisons (same operators
1192
- * as `condition`) and `have_unit` existence checks (an alive unit matching
1193
- * the given id/type/side/x/y, reusing the `filter` semantics). All must
1194
- * hold for the event to fire.
1195
- */
1196
- filterConditionMatches(node) {
1197
- const wrapper = node.children.find((child) => child.tag === 'filter_condition');
1198
- if (!wrapper)
1199
- return true;
1200
- return wrapper.children.every((child) => {
1201
- if (child.tag === 'variable') {
1202
- const name = child.attributes.name;
1203
- if (name === undefined)
1204
- return false;
1205
- return variableMatches(this.variableAt(name), child.attributes, resolveVariable(this.world.variables));
1206
- }
1207
- if (child.tag === 'predicate') {
1208
- const name = child.attributes.name;
1209
- const predicate = name ? this.hooks?.predicate?.[name] : undefined;
1210
- if (!predicate)
1211
- throw new Error(`MWL predicate ${name ?? '<missing>'} is not implemented`);
1212
- const { name: _name, ...context } = child.attributes;
1213
- return Boolean(predicate(this.worldView(), context));
1214
- }
1215
- // `have_unit` names the world key with `id` where a `filter`
1216
- // would say `unit`; everything else matches `filter` semantics.
1217
- if (child.tag === 'have_unit')
1218
- return Object.entries(this.world.units).some(([id, unit]) => unit.alive &&
1219
- (child.attributes.id === undefined || id === child.attributes.id) &&
1220
- unitMatchesFilter(unit, id, child.attributes));
1221
- return true;
1222
- });
1223
- }
1224
- /**
1225
- * Whether one objective's condition holds. `defaultSide` is the side whose own
1226
- * `[victory]`/`[defeat]` node this is, so a condition that names no side (a side losing
1227
- * when its own units are gone) reads as that side rather than as nobody.
1228
- */
1229
- conditionMet(node, defaultSide) {
1230
- const condition = node.attributes.condition ?? '';
1231
- const side = node.attributes.side ?? defaultSide;
1232
- switch (condition) {
1233
- case 'units_dead': {
1234
- const target = node.attributes.side_filter ?? side;
1235
- if (target === undefined)
1236
- return false;
1237
- return !Object.values(this.world.units).some((unit) => unit.alive && unit.side === target);
1238
- }
1239
- case 'turns_elapsed': {
1240
- const turns = optionalInteger(node, 'turns');
1241
- return turns !== undefined && this.world.turn >= turns;
1242
- }
1243
- case 'gold_at_least': {
1244
- const gold = optionalInteger(node, 'gold');
1245
- const goldSide = node.attributes.side ?? defaultSide;
1246
- return gold !== undefined && goldSide !== undefined && (this.world.gold[goldSide] ?? 0) >= gold;
1247
- }
1248
- case 'unit_at': {
1249
- const x = optionalInteger(node, 'x');
1250
- const y = optionalInteger(node, 'y');
1251
- const targetSide = node.attributes.side_filter ?? side;
1252
- return Object.values(this.world.units).some((unit) => unit.alive &&
1253
- (targetSide === undefined || unit.side === targetSide) &&
1254
- (node.attributes.type === undefined || unit.type === node.attributes.type) &&
1255
- unit.x === x &&
1256
- unit.y === y);
1257
- }
1258
- case 'hook': {
1259
- const reference = node.attributes.hook ?? '';
1260
- const hook = this.hooks?.predicate?.[reference];
1261
- if (!hook)
1262
- throw new Error(`MWL hook ${reference} is not implemented`);
1263
- // The predicate receives the objective's other attributes as its
1264
- // context, so content can parameterize an engine predicate.
1265
- const { hook: _hook, condition: _condition, ...context } = node.attributes;
1266
- return Boolean(hook(this.worldView(), context));
1267
- }
1268
- default:
1269
- return false;
1270
- }
1271
- }
1272
- /**
1273
- * Evaluates the scenario-wide `[objectives]` conditions first, exactly as before, then each
1274
- * side's own `[victory]`/`[defeat]` children. The scenario ends on the first side whose own
1275
- * condition fires, recording that side in `world.sideStatus`; a side's victory outranks
1276
- * another side's defeat when both fire in the same evaluation, which is the same precedence
1277
- * the scenario-wide pair has always had. A side condition with no `side`/`side_filter` reads
1278
- * as that side's own, so "this side loses when it has no units left" is written without
1279
- * repeating the id.
1280
- */
1281
- checkObjectives() {
1282
- if (this.world.status !== 'playing')
1283
- return;
1284
- // a `[victory]`/`[defeat]` under a `[side]` is that side's own, never the scenario's
1285
- const sideConditions = new Set();
1286
- const sides = this.nodes('side');
1287
- for (const side of sides) {
1288
- for (const child of side.children) {
1289
- if (child.tag === 'victory' || child.tag === 'defeat')
1290
- sideConditions.add(child);
1291
- }
1292
- }
1293
- if (this.nodes('victory').some((node) => !sideConditions.has(node) && this.conditionMet(node))) {
1294
- this.world.status = 'won';
1295
- return;
1296
- }
1297
- if (this.nodes('defeat').some((node) => !sideConditions.has(node) && this.conditionMet(node))) {
1298
- this.world.status = 'lost';
1299
- return;
1300
- }
1301
- let sideWon = false;
1302
- let sideLost = false;
1303
- for (const side of sides) {
1304
- const id = side.attributes.id;
1305
- if (!id || (this.world.sideStatus?.[id] ?? 'playing') !== 'playing')
1306
- continue;
1307
- if (side.children.some((child) => child.tag === 'victory' && this.conditionMet(child, id))) {
1308
- this.markSideResult(id, 'won');
1309
- sideWon = true;
1310
- }
1311
- else if (side.children.some((child) => child.tag === 'defeat' && this.conditionMet(child, id))) {
1312
- this.markSideResult(id, 'lost');
1313
- sideLost = true;
1314
- }
1315
- }
1316
- if (sideWon)
1317
- this.world.status = 'won';
1318
- else if (sideLost)
1319
- this.world.status = 'lost';
1320
- }
1321
- /** Records one side's own result; the scenario status is set by whichever side fired first. */
1322
- markSideResult(side, result) {
1323
- if (side === undefined || side === '')
1324
- return;
1325
- (this.world.sideStatus ??= {})[side] = result;
1326
- }
1327
- worldView() {
1328
- return {
1329
- variables: this.world.variables,
1330
- variableAt: (path) => this.variableAt(path),
1331
- units: this.world.units,
1332
- sides: this.world.sides,
1333
- turn: this.world.turn,
1334
- random: {
1335
- float: () => this.drawRandom((random) => random.float()),
1336
- int: (bound) => this.drawRandom((random) => random.int(bound)),
1337
- },
1338
- };
1339
- }
1340
- /** Draws from the hook-facing stream and immediately persists its new position onto
1341
- * `world`, so a snapshot taken at any point after a draw resumes the same stream. */
1342
- drawRandom(draw) {
1343
- const value = draw(this.random);
1344
- this.world.random = this.random.getState();
1345
- return value;
1346
- }
1347
- emit() {
1348
- return {
1349
- move: (unit, x, y) => this.applyMove(unit, x, y),
1350
- attack: (_attacker, _defender, _weapon) => {
1351
- throw new Error('MWL hook attack is not available in the framework runtime; the engine adapter owns combat');
1352
- },
1353
- spawn: (type, side, x, y) => this.spawnUnit(type, side, x, y),
1354
- kill: (unit) => this.killUnit(unit),
1355
- gold: (side, delta) => this.addGold(side, delta),
1356
- setVariable: (name, value) => {
1357
- setVariableAtPath(this.world.variables, name, value);
1358
- },
1359
- message: (speaker, text) => this.onMessage?.({ text, ...(speaker ? { speaker } : {}) }),
1360
- endTurn: () => this.endTurn(),
1361
- win: (side) => {
1362
- this.markSideResult(side, 'won');
1363
- this.world.status = 'won';
1364
- },
1365
- lose: (side) => {
1366
- this.markSideResult(side, 'lost');
1367
- this.world.status = 'lost';
1368
- },
1369
- };
1370
- }
1371
- attack(target, amount) {
1372
- const unit = this.world.units[target];
1373
- if (!unit || !unit.alive)
1374
- throw new Error(`MWL unit is not alive: ${target}`);
1375
- unit.hp = Math.max(0, unit.hp - amount);
1376
- if (unit.hp === 0)
1377
- unit.alive = false;
1378
- }
1379
- nodes(tag) {
1380
- const result = [];
1381
- const visit = (node) => {
1382
- if (node.tag === tag)
1383
- result.push(node);
1384
- node.children.forEach(visit);
1385
- };
1386
- this.game.roots.forEach(visit);
1387
- return result;
1388
- }
1389
- }
1390
- /**
1391
- * Applies one already-validated `MwlCommand` to a world, without a runtime around it.
1392
- *
1393
- * @example
1394
- * ```ts
1395
- * import { createWorld, execute } from '@datamoc/mw_games/mwl';
1396
- *
1397
- * const world = createWorld();
1398
- * execute(world, { name: 'set_variable', target: 'gold', value: 50 });
1399
- * console.log(world.variables.gold); // 50
1400
- * ```
1401
- */
1402
- export function execute(world, command) {
1403
- if (world.status !== 'playing' && command.name !== 'win' && command.name !== 'lose')
1404
- return;
1405
- switch (command.name) {
1406
- case 'set_variable':
1407
- setVariableAtPath(world.variables, command.target, command.value);
1408
- break;
1409
- case 'modify_gold':
1410
- world.gold[command.target] = (world.gold[command.target] ?? 0) + command.amount;
1411
- break;
1412
- case 'move': {
1413
- const unit = requireUnit(world, command.target);
1414
- unit.x = command.x;
1415
- unit.y = command.y;
1416
- break;
1417
- }
1418
- case 'spawn':
1419
- world.units[command.target] = { hp: command.hp, x: command.x, y: command.y, alive: true };
1420
- break;
1421
- case 'kill':
1422
- if (command.target !== undefined)
1423
- requireUnit(world, command.target).alive = false;
1424
- else
1425
- killMatching(world, command.filter ?? {});
1426
- break;
1427
- case 'end_turn':
1428
- world.turn++;
1429
- break;
1430
- case 'win':
1431
- if (command.side !== undefined && command.side !== '')
1432
- (world.sideStatus ??= {})[command.side] = 'won';
1433
- world.status = 'won';
1434
- break;
1435
- case 'lose':
1436
- if (command.side !== undefined && command.side !== '')
1437
- (world.sideStatus ??= {})[command.side] = 'lost';
1438
- world.status = 'lost';
1439
- break;
1440
- case 'endlevel':
1441
- world.status = command.result === 'defeat' ? 'lost' : 'won';
1442
- world.carryover = endLevelCarryover(world, command.side ?? null, command);
1443
- break;
1444
- }
1445
- }
1446
- /**
1447
- * Which side an `[endlevel]` carries: the one it names, or the human-controlled side when it names
1448
- * none. `null` when there is no such side, which is not an error - a scenario can end with nobody
1449
- * to carry.
1450
- */
1451
- function endLevelSide(world, named) {
1452
- const id = named ?? Object.entries(world.sides).find(([, side]) => side.controller === 'human')?.[0];
1453
- if (!id || !(id in world.sides))
1454
- return null;
1455
- return { id };
1456
- }
1457
- /**
1458
- * The sides a scenario's content says see together, as groups ready for `FactionFog.share`.
1459
- *
1460
- * Wesnoth groups sides into teams with `[side] team_name`, and `share_vision` says whether a side
1461
- * shares what it sees with its team. `none` does not; `all` and `shroud` are treated alike here
1462
- * because `FactionFog` shares sight and memory as one thing rather than keeping them apart, and a
1463
- * fog that separated them would be the place to tell the two apart. A side with no `team_name`
1464
- * shares with nobody, and a team of one is not returned, since sharing with nobody is what it
1465
- * already does.
1466
- *
1467
- * @example
1468
- * ```ts
1469
- * import { sideVisionGroups, type MwlWorld } from '@datamoc/mw_games/mwl';
1470
- *
1471
- * declare const world: MwlWorld;
1472
- *
1473
- * // sides 1 and 2 both wrote team_name=north, and side 3 asked for share_vision=none
1474
- * console.log(sideVisionGroups(world)); // [['1', '2']]
1475
- * ```
1476
- */
1477
- export function sideVisionGroups(world) {
1478
- const teams = new Map();
1479
- for (const [id, side] of Object.entries(world.sides)) {
1480
- if (!side.teamName || side.shareVision === 'none')
1481
- continue;
1482
- const group = teams.get(side.teamName);
1483
- if (group)
1484
- group.push(id);
1485
- else
1486
- teams.set(side.teamName, [id]);
1487
- }
1488
- return [...teams.values()].filter((group) => group.length > 1);
1489
- }
1490
- function requireUnit(world, id) {
1491
- const unit = world.units[id];
1492
- if (!unit || !unit.alive)
1493
- throw new Error(`MWL unit is not alive: ${id}`);
1494
- return unit;
1495
- }
1496
- /** Kills every alive unit a `[kill]` filter matches, and says how many it killed. */
1497
- function killMatching(world, attributes) {
1498
- let killed = 0;
1499
- for (const [id, unit] of Object.entries(world.units)) {
1500
- if (!unit.alive || !unitMatchesFilter(unit, id, attributes))
1501
- continue;
1502
- unit.alive = false;
1503
- killed++;
1504
- }
1505
- return killed;
1506
- }
1507
- /** One unit as `[store_unit]` writes it: only the fields it has, so a variable stays small. */
1508
- function unitSnapshot(unit) {
1509
- const snapshot = { hp: unit.hp, x: unit.x, y: unit.y, alive: unit.alive };
1510
- if (unit.type !== undefined)
1511
- snapshot.type = unit.type;
1512
- if (unit.side !== undefined)
1513
- snapshot.side = unit.side;
1514
- if (unit.moves !== undefined)
1515
- snapshot.moves = unit.moves;
1516
- if (unit.name !== undefined)
1517
- snapshot.name = unit.name;
1518
- if (unit.role !== undefined)
1519
- snapshot.role = unit.role;
1520
- if (unit.can_recruit !== undefined)
1521
- snapshot.can_recruit = unit.can_recruit;
1522
- if (unit.leader !== undefined)
1523
- snapshot.leader = unit.leader;
1524
- return snapshot;
1525
- }
1526
- /** Applies `[modify_unit]`'s chosen attributes to one unit, ignoring anything it did not name. */
1527
- function applyUnitChanges(unit, changes) {
1528
- const hp = finiteNumber(changes.hp);
1529
- if (hp !== undefined)
1530
- unit.hp = hp;
1531
- const moves = finiteNumber(changes.moves);
1532
- if (moves !== undefined)
1533
- unit.moves = moves;
1534
- if (changes.type !== undefined)
1535
- unit.type = changes.type;
1536
- if (changes.side !== undefined)
1537
- unit.side = changes.side;
1538
- const alive = booleanValue(changes.alive);
1539
- if (alive !== undefined)
1540
- unit.alive = alive;
1541
- if (changes.name !== undefined)
1542
- unit.name = changes.name;
1543
- if (changes.role !== undefined)
1544
- unit.role = changes.role;
1545
- const canRecruit = booleanValue(changes.can_recruit);
1546
- if (canRecruit !== undefined)
1547
- unit.can_recruit = canRecruit;
1548
- }
1549
- function finiteNumber(value) {
1550
- if (value === undefined || value === '')
1551
- return undefined;
1552
- const parsed = Number(value);
1553
- return Number.isFinite(parsed) ? parsed : undefined;
1554
- }
1555
- function optionalInteger(node, attribute) {
1556
- const value = node.attributes[attribute];
1557
- if (value === undefined || value === '')
1558
- return undefined;
1559
- const parsed = Number.parseInt(value, 10);
1560
- return Number.isFinite(parsed) ? parsed : undefined;
1561
- }
1562
- /**
1563
- * One variable comparison for `condition`/`variable` nodes. `equals` keeps
1564
- * the historical numeric-aware match; the rest are strict about shape:
1565
- * lists split on commas, comparisons coerce both sides with `Number` and
1566
- * fail on anything non-numeric.
1567
- */
1568
- function variableMatches(value, attributes, resolve) {
1569
- const expected = (text) => {
1570
- if (!text.startsWith('$'))
1571
- return text;
1572
- const resolved = resolve(text.slice(1));
1573
- return typeof resolved === 'string' || typeof resolved === 'number' || typeof resolved === 'boolean'
1574
- ? resolved
1575
- : undefined;
1576
- };
1577
- if (attributes.equals !== undefined)
1578
- return sameValue(value, expected(attributes.equals));
1579
- if (attributes.not_equals !== undefined)
1580
- return !sameValue(value, expected(attributes.not_equals));
1581
- if (attributes.in !== undefined) {
1582
- const options = attributes.in.split(',').map((entry) => entry.trim());
1583
- return options.some((option) => sameValue(value, option));
1584
- }
1585
- if (attributes.not_in !== undefined) {
1586
- const options = attributes.not_in.split(',').map((entry) => entry.trim());
1587
- return !options.some((option) => sameValue(value, option));
1588
- }
1589
- const actual = typeof value === 'number' ? value : Number(value);
1590
- const wanted = (name) => Number(attributes[name]);
1591
- if (attributes.less_than !== undefined ||
1592
- attributes.greater_than !== undefined ||
1593
- attributes.less_than_or_equal_to !== undefined ||
1594
- attributes.greater_than_or_equal_to !== undefined) {
1595
- if (typeof value === 'boolean' || !Number.isFinite(actual))
1596
- return false;
1597
- if (attributes.less_than !== undefined && !(actual < wanted('less_than')))
1598
- return false;
1599
- if (attributes.greater_than !== undefined && !(actual > wanted('greater_than')))
1600
- return false;
1601
- if (attributes.less_than_or_equal_to !== undefined && !(actual <= wanted('less_than_or_equal_to')))
1602
- return false;
1603
- if (attributes.greater_than_or_equal_to !== undefined && !(actual >= wanted('greater_than_or_equal_to')))
1604
- return false;
1605
- return true;
1606
- }
1607
- return value !== undefined;
1608
- }
1609
- /**
1610
- * One alive unit against `filter`/`have_unit` attributes: side, type (with
1611
- * comma-list `not_type` exclusion), the unit's own name and role, whether it
1612
- * can recruit, whether it is its side's leader, world key (`unit`, or `id`
1613
- * on `have_unit`), and coordinates all have to match when present.
1614
- */
1615
- function unitMatchesFilter(unit, id, attributes) {
1616
- const excluded = (attributes.not_type ?? '')
1617
- .split(',')
1618
- .map((entry) => entry.trim())
1619
- .filter(Boolean);
1620
- const wantedCanRecruit = booleanValue(attributes.can_recruit);
1621
- const wantedLeader = booleanValue(attributes.leader);
1622
- const key = attributes.unit ?? attributes.id;
1623
- return ((key === undefined || id === key) &&
1624
- (attributes.side === undefined || unit.side === attributes.side) &&
1625
- (attributes.type === undefined || unit.type === attributes.type) &&
1626
- (excluded.length === 0 || !excluded.includes(unit.type ?? '')) &&
1627
- (attributes.name === undefined || unit.name === attributes.name) &&
1628
- (attributes.role === undefined || unit.role === attributes.role) &&
1629
- (wantedCanRecruit === undefined || (unit.can_recruit ?? false) === wantedCanRecruit) &&
1630
- (wantedLeader === undefined || (unit.leader ?? false) === wantedLeader) &&
1631
- (attributes.x === undefined || coordinateMatches(attributes.x, unit.x)) &&
1632
- (attributes.y === undefined || coordinateMatches(attributes.y, unit.y)));
1633
- }
1634
- /** a copy of `attributes` without the given keys, for a command whose own attribute names are not a unit filter */
1635
- function withoutAttributes(attributes, ...excluded) {
1636
- if (excluded.length === 0)
1637
- return { ...attributes };
1638
- const copy = { ...attributes };
1639
- for (const key of excluded)
1640
- delete copy[key];
1641
- return copy;
1642
- }
1643
- function sameValue(value, expected) {
1644
- if (value === undefined || expected === undefined)
1645
- return value === expected;
1646
- if (typeof expected !== 'string')
1647
- return value === expected;
1648
- const numeric = Number(expected);
1649
- return typeof value === 'number' && expected.trim() !== '' && Number.isFinite(numeric)
1650
- ? value === numeric
1651
- : value === expected;
1652
- }
1653
- function primitiveVariables(variables) {
1654
- return Object.fromEntries(Object.entries(variables).filter((entry) => typeof entry[1] === 'string' || typeof entry[1] === 'number' || typeof entry[1] === 'boolean'));
1655
- }
1656
- /** `a.b[0].c` -> `['a', 'b', { index: 0 }, 'c']`. */
1657
- function variablePathParts(path) {
1658
- return path
1659
- .split('.')
1660
- .flatMap((segment) => {
1661
- const name = /^([^[\]]*)((?:\[[^\]]*\])*)$/.exec(segment);
1662
- if (!name)
1663
- return [segment];
1664
- const parts = name[1] === '' ? [] : [name[1]];
1665
- for (const bracket of name[2].matchAll(/\[([^\]]*)\]/g)) {
1666
- const index = Number(bracket[1]);
1667
- parts.push({ index: /^\d+$/.test(bracket[1].trim()) ? index : undefined });
1668
- }
1669
- return parts;
1670
- })
1671
- .filter((part) => typeof part !== 'string' || part !== '');
1672
- }
1673
- /** The path parts of a write, with any bracketed index that is not a whole number refused by name. */
1674
- function validVariablePathParts(path) {
1675
- const parts = variablePathParts(path);
1676
- if (parts.some((part) => typeof part !== 'string' && part.index === undefined))
1677
- throw new Error(`invalid variable path: ${path}`);
1678
- return parts;
1679
- }
1680
- function isIndexedStep(step) {
1681
- return typeof step !== 'string';
1682
- }
1683
- /**
1684
- * The one write of a variable path, so `execute()`, the hook host and the runtime's own
1685
- * `set_variable` all place a value at the same node a read walks to. A step after an index
1686
- * grows an array, so `a[0]`/`a[1]` build a real list rather than an object with numbered keys.
1687
- */
1688
- function setVariableAtPath(variables, path, value) {
1689
- const parts = validVariablePathParts(path);
1690
- const key = (step) => (typeof step === 'string' ? step : step.index);
1691
- let current = variables;
1692
- for (let index = 0; index < parts.length - 1; index++) {
1693
- const step = key(parts[index]);
1694
- const child = current[step];
1695
- if (!child || typeof child !== 'object') {
1696
- current[step] = isIndexedStep(parts[index + 1]) ? [] : {};
1697
- }
1698
- current = current[step];
1699
- }
1700
- current[key(parts[parts.length - 1])] = value;
1701
- }
1702
- /** The one read of a variable path, used by every reader that takes a name. */
1703
- function variableAtPath(variables, path) {
1704
- let value = variables;
1705
- for (const part of variablePathParts(path)) {
1706
- if (typeof part === 'string') {
1707
- if (!value || typeof value !== 'object' || Array.isArray(value))
1708
- return undefined;
1709
- value = value[part];
1710
- }
1711
- else {
1712
- if (!Array.isArray(value) || part.index === undefined)
1713
- return undefined;
1714
- value = value[part.index];
1715
- }
1716
- }
1717
- return value;
1718
- }
1719
- /** Resolves a `$name` reference (a path, not only a top-level key) from a variable tree. */
1720
- function resolveVariable(variables) {
1721
- return (reference) => variableAtPath(variables, reference);
1722
- }
1723
- /**
1724
- * Whether a coordinate satisfies a filter value: a whole number, an `A-B` range, or a
1725
- * comma-separated list of either (`x=10-99,13-99`). Wesnoth spells both a moveto event's
1726
- * position and a unit filter's `x`/`y` this way, so a plain `Number()` comparison would
1727
- * drop every event or filter a real scenario gates on a coordinate range.
1728
- */
1729
- function coordinateMatches(specification, coordinate) {
1730
- return specification.split(',').some((part) => {
1731
- const value = part.trim();
1732
- const range = value.match(/^(-?\d+)\s*-\s*(-?\d+)$/);
1733
- if (range) {
1734
- const from = Number(range[1]);
1735
- const to = Number(range[2]);
1736
- return coordinate >= Math.min(from, to) && coordinate <= Math.max(from, to);
1737
- }
1738
- return /^-?\d+$/.test(value) && Number(value) === coordinate;
1739
- });
1740
- }
1741
- //# sourceMappingURL=runtime.js.map