@datamoc/mw_games 0.3.1 → 0.4.1

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 (770) hide show
  1. package/README.md +401 -395
  2. package/dist/actors/Advancement.d.ts +17 -0
  3. package/dist/actors/Advancement.d.ts.map +1 -1
  4. package/dist/actors/Advancement.js +17 -0
  5. package/dist/actors/Advancement.js.map +1 -1
  6. package/dist/actors/Affix.d.ts +46 -0
  7. package/dist/actors/Affix.d.ts.map +1 -1
  8. package/dist/actors/Affix.js +32 -1
  9. package/dist/actors/Affix.js.map +1 -1
  10. package/dist/actors/Appearances.d.ts +12 -0
  11. package/dist/actors/Appearances.d.ts.map +1 -1
  12. package/dist/actors/Appearances.js +12 -0
  13. package/dist/actors/Appearances.js.map +1 -1
  14. package/dist/actors/Aura.d.ts +16 -0
  15. package/dist/actors/Aura.d.ts.map +1 -1
  16. package/dist/actors/Aura.js +16 -0
  17. package/dist/actors/Aura.js.map +1 -1
  18. package/dist/actors/Barrier.d.ts +60 -0
  19. package/dist/actors/Barrier.d.ts.map +1 -0
  20. package/dist/actors/Barrier.js +70 -0
  21. package/dist/actors/Barrier.js.map +1 -0
  22. package/dist/actors/Charges.d.ts +35 -0
  23. package/dist/actors/Charges.d.ts.map +1 -1
  24. package/dist/actors/Charges.js +26 -0
  25. package/dist/actors/Charges.js.map +1 -1
  26. package/dist/actors/Equipment.d.ts +48 -0
  27. package/dist/actors/Equipment.d.ts.map +1 -1
  28. package/dist/actors/Equipment.js +51 -1
  29. package/dist/actors/Equipment.js.map +1 -1
  30. package/dist/actors/Inventory.d.ts +70 -3
  31. package/dist/actors/Inventory.d.ts.map +1 -1
  32. package/dist/actors/Inventory.js +109 -5
  33. package/dist/actors/Inventory.js.map +1 -1
  34. package/dist/actors/ItemState.d.ts +24 -2
  35. package/dist/actors/ItemState.d.ts.map +1 -1
  36. package/dist/actors/ItemState.js +31 -2
  37. package/dist/actors/ItemState.js.map +1 -1
  38. package/dist/actors/ItemStatusEffect.d.ts +13 -0
  39. package/dist/actors/ItemStatusEffect.d.ts.map +1 -1
  40. package/dist/actors/ItemStatusEffect.js +13 -0
  41. package/dist/actors/ItemStatusEffect.js.map +1 -1
  42. package/dist/actors/Loot.d.ts +15 -1
  43. package/dist/actors/Loot.d.ts.map +1 -1
  44. package/dist/actors/Loot.js +16 -2
  45. package/dist/actors/Loot.js.map +1 -1
  46. package/dist/actors/Progression.d.ts +23 -1
  47. package/dist/actors/Progression.d.ts.map +1 -1
  48. package/dist/actors/Progression.js +21 -1
  49. package/dist/actors/Progression.js.map +1 -1
  50. package/dist/actors/Resource.d.ts +30 -0
  51. package/dist/actors/Resource.d.ts.map +1 -1
  52. package/dist/actors/Resource.js +22 -0
  53. package/dist/actors/Resource.js.map +1 -1
  54. package/dist/actors/Scaling.d.ts +8 -0
  55. package/dist/actors/Scaling.d.ts.map +1 -1
  56. package/dist/actors/Scaling.js.map +1 -1
  57. package/dist/actors/Shop.d.ts +15 -0
  58. package/dist/actors/Shop.d.ts.map +1 -1
  59. package/dist/actors/Shop.js.map +1 -1
  60. package/dist/actors/SkillPoints.d.ts +27 -0
  61. package/dist/actors/SkillPoints.d.ts.map +1 -1
  62. package/dist/actors/SkillPoints.js +29 -0
  63. package/dist/actors/SkillPoints.js.map +1 -1
  64. package/dist/actors/StatBlock.d.ts +16 -0
  65. package/dist/actors/StatBlock.d.ts.map +1 -1
  66. package/dist/actors/StatBlock.js +21 -0
  67. package/dist/actors/StatBlock.js.map +1 -1
  68. package/dist/actors/StatusEffect.d.ts +18 -0
  69. package/dist/actors/StatusEffect.d.ts.map +1 -1
  70. package/dist/actors/StatusEffect.js +18 -0
  71. package/dist/actors/StatusEffect.js.map +1 -1
  72. package/dist/actors/Support.d.ts +13 -2
  73. package/dist/actors/Support.d.ts.map +1 -1
  74. package/dist/actors/Support.js +13 -2
  75. package/dist/actors/Support.js.map +1 -1
  76. package/dist/actors/Traits.d.ts +14 -0
  77. package/dist/actors/Traits.d.ts.map +1 -1
  78. package/dist/actors/Traits.js +14 -0
  79. package/dist/actors/Traits.js.map +1 -1
  80. package/dist/actors/craft.d.ts +16 -0
  81. package/dist/actors/craft.d.ts.map +1 -1
  82. package/dist/actors/craft.js +16 -0
  83. package/dist/actors/craft.js.map +1 -1
  84. package/dist/actors/index.d.ts +8 -5
  85. package/dist/actors/index.d.ts.map +1 -1
  86. package/dist/actors/index.js +3 -2
  87. package/dist/actors/index.js.map +1 -1
  88. package/dist/actors/skillCheck.d.ts +8 -0
  89. package/dist/actors/skillCheck.d.ts.map +1 -1
  90. package/dist/actors/skillCheck.js +8 -0
  91. package/dist/actors/skillCheck.js.map +1 -1
  92. package/dist/assets/ByteProgress.d.ts +37 -0
  93. package/dist/assets/ByteProgress.d.ts.map +1 -0
  94. package/dist/assets/ByteProgress.js +54 -0
  95. package/dist/assets/ByteProgress.js.map +1 -0
  96. package/dist/assets/Streaming.d.ts +11 -1
  97. package/dist/assets/Streaming.d.ts.map +1 -1
  98. package/dist/assets/Streaming.js +11 -1
  99. package/dist/assets/Streaming.js.map +1 -1
  100. package/dist/assets/index.d.ts +11 -52
  101. package/dist/assets/index.d.ts.map +1 -1
  102. package/dist/assets/index.js +9 -80
  103. package/dist/assets/index.js.map +1 -1
  104. package/dist/assets/loader.d.ts +45 -0
  105. package/dist/assets/loader.d.ts.map +1 -0
  106. package/dist/assets/loader.js +72 -0
  107. package/dist/assets/loader.js.map +1 -0
  108. package/dist/assets/paths.d.ts +50 -0
  109. package/dist/assets/paths.d.ts.map +1 -0
  110. package/dist/assets/paths.js +59 -0
  111. package/dist/assets/paths.js.map +1 -0
  112. package/dist/audio/Captions.d.ts +13 -1
  113. package/dist/audio/Captions.d.ts.map +1 -1
  114. package/dist/audio/Captions.js +13 -1
  115. package/dist/audio/Captions.js.map +1 -1
  116. package/dist/audio/Midi.d.ts +19 -1
  117. package/dist/audio/Midi.d.ts.map +1 -1
  118. package/dist/audio/Midi.js +19 -1
  119. package/dist/audio/Midi.js.map +1 -1
  120. package/dist/audio/Music.d.ts +11 -0
  121. package/dist/audio/Music.d.ts.map +1 -1
  122. package/dist/audio/Music.js +11 -0
  123. package/dist/audio/Music.js.map +1 -1
  124. package/dist/audio/Orchestrator.d.ts +14 -0
  125. package/dist/audio/Orchestrator.d.ts.map +1 -1
  126. package/dist/audio/Orchestrator.js +14 -0
  127. package/dist/audio/Orchestrator.js.map +1 -1
  128. package/dist/audio/Playable.d.ts +11 -1
  129. package/dist/audio/Playable.d.ts.map +1 -1
  130. package/dist/audio/Playable.js +12 -2
  131. package/dist/audio/Playable.js.map +1 -1
  132. package/dist/audio/Sound.d.ts +8 -0
  133. package/dist/audio/Sound.d.ts.map +1 -1
  134. package/dist/audio/Sound.js +8 -0
  135. package/dist/audio/Sound.js.map +1 -1
  136. package/dist/audio/Synth.d.ts +15 -0
  137. package/dist/audio/Synth.d.ts.map +1 -1
  138. package/dist/audio/Synth.js +15 -0
  139. package/dist/audio/Synth.js.map +1 -1
  140. package/dist/battle/BattleAI.d.ts +18 -2
  141. package/dist/battle/BattleAI.d.ts.map +1 -1
  142. package/dist/battle/BattleAI.js +18 -2
  143. package/dist/battle/BattleAI.js.map +1 -1
  144. package/dist/battle/Evolution.d.ts +12 -0
  145. package/dist/battle/Evolution.d.ts.map +1 -1
  146. package/dist/battle/Evolution.js +12 -0
  147. package/dist/battle/Evolution.js.map +1 -1
  148. package/dist/battle/Field.d.ts +13 -2
  149. package/dist/battle/Field.d.ts.map +1 -1
  150. package/dist/battle/Field.js +3 -3
  151. package/dist/battle/Field.js.map +1 -1
  152. package/dist/battle/Hooks.d.ts +23 -13
  153. package/dist/battle/Hooks.d.ts.map +1 -1
  154. package/dist/battle/Hooks.js +36 -18
  155. package/dist/battle/Hooks.js.map +1 -1
  156. package/dist/battle/Move.d.ts +13 -0
  157. package/dist/battle/Move.d.ts.map +1 -1
  158. package/dist/battle/Move.js +13 -0
  159. package/dist/battle/Move.js.map +1 -1
  160. package/dist/battle/Party.d.ts +11 -0
  161. package/dist/battle/Party.d.ts.map +1 -1
  162. package/dist/battle/Party.js +11 -0
  163. package/dist/battle/Party.js.map +1 -1
  164. package/dist/battle/Species.d.ts +10 -0
  165. package/dist/battle/Species.d.ts.map +1 -1
  166. package/dist/battle/Species.js +10 -0
  167. package/dist/battle/Species.js.map +1 -1
  168. package/dist/battle/StatStages.d.ts +14 -0
  169. package/dist/battle/StatStages.d.ts.map +1 -1
  170. package/dist/battle/StatStages.js.map +1 -1
  171. package/dist/battle/TypeMatrix.d.ts +11 -0
  172. package/dist/battle/TypeMatrix.d.ts.map +1 -1
  173. package/dist/battle/TypeMatrix.js +11 -0
  174. package/dist/battle/TypeMatrix.js.map +1 -1
  175. package/dist/core/Achievements.d.ts +15 -0
  176. package/dist/core/Achievements.d.ts.map +1 -1
  177. package/dist/core/Achievements.js +15 -0
  178. package/dist/core/Achievements.js.map +1 -1
  179. package/dist/core/Collection.d.ts +12 -0
  180. package/dist/core/Collection.d.ts.map +1 -1
  181. package/dist/core/Collection.js +12 -0
  182. package/dist/core/Collection.js.map +1 -1
  183. package/dist/core/Entity.d.ts +42 -0
  184. package/dist/core/Entity.d.ts.map +1 -0
  185. package/dist/core/Entity.js +47 -0
  186. package/dist/core/Entity.js.map +1 -0
  187. package/dist/core/Feedback.d.ts +11 -1
  188. package/dist/core/Feedback.d.ts.map +1 -1
  189. package/dist/core/Feedback.js +11 -1
  190. package/dist/core/Feedback.js.map +1 -1
  191. package/dist/core/Hex.d.ts +14 -0
  192. package/dist/core/Hex.d.ts.map +1 -1
  193. package/dist/core/Hex.js +14 -0
  194. package/dist/core/Hex.js.map +1 -1
  195. package/dist/core/Hooks.d.ts +48 -0
  196. package/dist/core/Hooks.d.ts.map +1 -0
  197. package/dist/core/Hooks.js +33 -0
  198. package/dist/core/Hooks.js.map +1 -0
  199. package/dist/core/Input.d.ts +53 -0
  200. package/dist/core/Input.d.ts.map +1 -1
  201. package/dist/core/Input.js +126 -21
  202. package/dist/core/Input.js.map +1 -1
  203. package/dist/core/Loading.d.ts +17 -0
  204. package/dist/core/Loading.d.ts.map +1 -1
  205. package/dist/core/Loading.js +17 -0
  206. package/dist/core/Loading.js.map +1 -1
  207. package/dist/core/Log.d.ts +9 -0
  208. package/dist/core/Log.d.ts.map +1 -1
  209. package/dist/core/Log.js +9 -0
  210. package/dist/core/Log.js.map +1 -1
  211. package/dist/core/Multiplayer.d.ts +12 -0
  212. package/dist/core/Multiplayer.d.ts.map +1 -1
  213. package/dist/core/Multiplayer.js +12 -0
  214. package/dist/core/Multiplayer.js.map +1 -1
  215. package/dist/core/News.d.ts +12 -0
  216. package/dist/core/News.d.ts.map +1 -1
  217. package/dist/core/News.js.map +1 -1
  218. package/dist/core/PlayerInput.d.ts +19 -0
  219. package/dist/core/PlayerInput.d.ts.map +1 -1
  220. package/dist/core/PlayerInput.js +25 -0
  221. package/dist/core/PlayerInput.js.map +1 -1
  222. package/dist/core/Presentation.d.ts +56 -0
  223. package/dist/core/Presentation.d.ts.map +1 -0
  224. package/dist/core/Presentation.js +78 -0
  225. package/dist/core/Presentation.js.map +1 -0
  226. package/dist/core/Random.d.ts +38 -5
  227. package/dist/core/Random.d.ts.map +1 -1
  228. package/dist/core/Random.js +38 -5
  229. package/dist/core/Random.js.map +1 -1
  230. package/dist/core/Replay.d.ts +31 -0
  231. package/dist/core/Replay.d.ts.map +1 -1
  232. package/dist/core/Replay.js +31 -0
  233. package/dist/core/Replay.js.map +1 -1
  234. package/dist/core/RunHistory.d.ts +12 -0
  235. package/dist/core/RunHistory.d.ts.map +1 -1
  236. package/dist/core/RunHistory.js.map +1 -1
  237. package/dist/core/Sanitize.d.ts +18 -0
  238. package/dist/core/Sanitize.d.ts.map +1 -1
  239. package/dist/core/Sanitize.js +18 -0
  240. package/dist/core/Sanitize.js.map +1 -1
  241. package/dist/core/Save.d.ts.map +1 -1
  242. package/dist/core/Save.js +13 -0
  243. package/dist/core/Save.js.map +1 -1
  244. package/dist/core/SaveSync.d.ts +14 -0
  245. package/dist/core/SaveSync.d.ts.map +1 -1
  246. package/dist/core/SaveSync.js.map +1 -1
  247. package/dist/core/Scene.d.ts +29 -6
  248. package/dist/core/Scene.d.ts.map +1 -1
  249. package/dist/core/Scene.js +31 -6
  250. package/dist/core/Scene.js.map +1 -1
  251. package/dist/core/SceneStack.d.ts +28 -4
  252. package/dist/core/SceneStack.d.ts.map +1 -1
  253. package/dist/core/SceneStack.js +24 -0
  254. package/dist/core/SceneStack.js.map +1 -1
  255. package/dist/core/Scramble.d.ts +8 -0
  256. package/dist/core/Scramble.d.ts.map +1 -1
  257. package/dist/core/Scramble.js +8 -0
  258. package/dist/core/Scramble.js.map +1 -1
  259. package/dist/core/Session.d.ts +10 -0
  260. package/dist/core/Session.d.ts.map +1 -1
  261. package/dist/core/Session.js.map +1 -1
  262. package/dist/core/Signal.d.ts +11 -0
  263. package/dist/core/Signal.d.ts.map +1 -1
  264. package/dist/core/Signal.js.map +1 -1
  265. package/dist/core/Spawner.d.ts +17 -0
  266. package/dist/core/Spawner.d.ts.map +1 -1
  267. package/dist/core/Spawner.js +17 -0
  268. package/dist/core/Spawner.js.map +1 -1
  269. package/dist/core/Stats.d.ts +14 -0
  270. package/dist/core/Stats.d.ts.map +1 -1
  271. package/dist/core/Stats.js +14 -0
  272. package/dist/core/Stats.js.map +1 -1
  273. package/dist/core/Telemetry.d.ts +11 -0
  274. package/dist/core/Telemetry.d.ts.map +1 -1
  275. package/dist/core/Telemetry.js +11 -0
  276. package/dist/core/Telemetry.js.map +1 -1
  277. package/dist/core/Tween.d.ts +16 -1
  278. package/dist/core/Tween.d.ts.map +1 -1
  279. package/dist/core/Tween.js +16 -1
  280. package/dist/core/Tween.js.map +1 -1
  281. package/dist/core/UndoHistory.d.ts +15 -0
  282. package/dist/core/UndoHistory.d.ts.map +1 -1
  283. package/dist/core/UndoHistory.js.map +1 -1
  284. package/dist/core/index.d.ts +7 -2
  285. package/dist/core/index.d.ts.map +1 -1
  286. package/dist/core/index.js +3 -1
  287. package/dist/core/index.js.map +1 -1
  288. package/dist/i18n/Format.d.ts +25 -0
  289. package/dist/i18n/Format.d.ts.map +1 -0
  290. package/dist/i18n/Format.js +32 -0
  291. package/dist/i18n/Format.js.map +1 -0
  292. package/dist/i18n/SemanticMessage.d.ts +71 -0
  293. package/dist/i18n/SemanticMessage.d.ts.map +1 -0
  294. package/dist/i18n/SemanticMessage.js +40 -0
  295. package/dist/i18n/SemanticMessage.js.map +1 -0
  296. package/dist/i18n/Validate.d.ts +56 -0
  297. package/dist/i18n/Validate.d.ts.map +1 -0
  298. package/dist/i18n/Validate.js +65 -0
  299. package/dist/i18n/Validate.js.map +1 -0
  300. package/dist/i18n/index.d.ts +39 -0
  301. package/dist/i18n/index.d.ts.map +1 -1
  302. package/dist/i18n/index.js +48 -1
  303. package/dist/i18n/index.js.map +1 -1
  304. package/dist/index.d.ts +4 -5
  305. package/dist/index.d.ts.map +1 -1
  306. package/dist/index.js +4 -5
  307. package/dist/index.js.map +1 -1
  308. package/dist/mw_games.global.js +153 -88
  309. package/dist/roguelike/Blob.d.ts +11 -0
  310. package/dist/roguelike/Blob.d.ts.map +1 -1
  311. package/dist/roguelike/Blob.js +11 -0
  312. package/dist/roguelike/Blob.js.map +1 -1
  313. package/dist/roguelike/Boss.d.ts +16 -4
  314. package/dist/roguelike/Boss.d.ts.map +1 -1
  315. package/dist/roguelike/Boss.js +18 -6
  316. package/dist/roguelike/Boss.js.map +1 -1
  317. package/dist/roguelike/Combat.d.ts +23 -11
  318. package/dist/roguelike/Combat.d.ts.map +1 -1
  319. package/dist/roguelike/Combat.js +22 -16
  320. package/dist/roguelike/Combat.js.map +1 -1
  321. package/dist/roguelike/ContentRoll.d.ts +53 -0
  322. package/dist/roguelike/ContentRoll.d.ts.map +1 -0
  323. package/dist/roguelike/ContentRoll.js +48 -0
  324. package/dist/roguelike/ContentRoll.js.map +1 -0
  325. package/dist/roguelike/Doors.d.ts +13 -0
  326. package/dist/roguelike/Doors.d.ts.map +1 -1
  327. package/dist/roguelike/Doors.js +13 -0
  328. package/dist/roguelike/Doors.js.map +1 -1
  329. package/dist/roguelike/DungeonParity.d.ts +57 -0
  330. package/dist/roguelike/DungeonParity.d.ts.map +1 -0
  331. package/dist/roguelike/DungeonParity.js +78 -0
  332. package/dist/roguelike/DungeonParity.js.map +1 -0
  333. package/dist/roguelike/Elevation.d.ts +15 -0
  334. package/dist/roguelike/Elevation.d.ts.map +1 -1
  335. package/dist/roguelike/Elevation.js +15 -0
  336. package/dist/roguelike/Elevation.js.map +1 -1
  337. package/dist/roguelike/Features.d.ts +59 -0
  338. package/dist/roguelike/Features.d.ts.map +1 -0
  339. package/dist/roguelike/Features.js +76 -0
  340. package/dist/roguelike/Features.js.map +1 -0
  341. package/dist/roguelike/FieldOfView.d.ts +13 -0
  342. package/dist/roguelike/FieldOfView.d.ts.map +1 -1
  343. package/dist/roguelike/FieldOfView.js +13 -0
  344. package/dist/roguelike/FieldOfView.js.map +1 -1
  345. package/dist/roguelike/Level.d.ts +26 -1
  346. package/dist/roguelike/Level.d.ts.map +1 -1
  347. package/dist/roguelike/Level.js +26 -1
  348. package/dist/roguelike/Level.js.map +1 -1
  349. package/dist/roguelike/MonsterAI.d.ts +14 -0
  350. package/dist/roguelike/MonsterAI.d.ts.map +1 -1
  351. package/dist/roguelike/MonsterAI.js +15 -1
  352. package/dist/roguelike/MonsterAI.js.map +1 -1
  353. package/dist/roguelike/MultiStageAbility.d.ts +59 -0
  354. package/dist/roguelike/MultiStageAbility.d.ts.map +1 -0
  355. package/dist/roguelike/MultiStageAbility.js +76 -0
  356. package/dist/roguelike/MultiStageAbility.js.map +1 -0
  357. package/dist/roguelike/Pathfinder.d.ts +23 -2
  358. package/dist/roguelike/Pathfinder.d.ts.map +1 -1
  359. package/dist/roguelike/Pathfinder.js +23 -2
  360. package/dist/roguelike/Pathfinder.js.map +1 -1
  361. package/dist/roguelike/RoomBuilders.d.ts +60 -0
  362. package/dist/roguelike/RoomBuilders.d.ts.map +1 -0
  363. package/dist/roguelike/RoomBuilders.js +57 -0
  364. package/dist/roguelike/RoomBuilders.js.map +1 -0
  365. package/dist/roguelike/Scheduler.d.ts +48 -1
  366. package/dist/roguelike/Scheduler.d.ts.map +1 -1
  367. package/dist/roguelike/Scheduler.js +58 -1
  368. package/dist/roguelike/Scheduler.js.map +1 -1
  369. package/dist/roguelike/Secrets.d.ts +13 -0
  370. package/dist/roguelike/Secrets.d.ts.map +1 -1
  371. package/dist/roguelike/Secrets.js +13 -0
  372. package/dist/roguelike/Secrets.js.map +1 -1
  373. package/dist/roguelike/Stealth.d.ts +13 -0
  374. package/dist/roguelike/Stealth.d.ts.map +1 -1
  375. package/dist/roguelike/Stealth.js +13 -0
  376. package/dist/roguelike/Stealth.js.map +1 -1
  377. package/dist/roguelike/Targeting.d.ts +67 -1
  378. package/dist/roguelike/Targeting.d.ts.map +1 -1
  379. package/dist/roguelike/Targeting.js +53 -1
  380. package/dist/roguelike/Targeting.js.map +1 -1
  381. package/dist/roguelike/TriggerTracker.d.ts +46 -0
  382. package/dist/roguelike/TriggerTracker.d.ts.map +1 -0
  383. package/dist/roguelike/TriggerTracker.js +59 -0
  384. package/dist/roguelike/TriggerTracker.js.map +1 -0
  385. package/dist/roguelike/generate.d.ts +90 -1
  386. package/dist/roguelike/generate.d.ts.map +1 -1
  387. package/dist/roguelike/generate.js +79 -11
  388. package/dist/roguelike/generate.js.map +1 -1
  389. package/dist/roguelike/index.d.ts +17 -5
  390. package/dist/roguelike/index.d.ts.map +1 -1
  391. package/dist/roguelike/index.js +8 -2
  392. package/dist/roguelike/index.js.map +1 -1
  393. package/dist/rpg/Collision.d.ts +19 -0
  394. package/dist/rpg/Collision.d.ts.map +1 -1
  395. package/dist/rpg/Collision.js +19 -0
  396. package/dist/rpg/Collision.js.map +1 -1
  397. package/dist/rpg/Event.d.ts +17 -0
  398. package/dist/rpg/Event.d.ts.map +1 -1
  399. package/dist/rpg/Event.js +17 -0
  400. package/dist/rpg/Event.js.map +1 -1
  401. package/dist/rpg/EventRunner.d.ts +44 -8
  402. package/dist/rpg/EventRunner.d.ts.map +1 -1
  403. package/dist/rpg/EventRunner.js +15 -13
  404. package/dist/rpg/EventRunner.js.map +1 -1
  405. package/dist/rpg/FreeMover.d.ts +16 -2
  406. package/dist/rpg/FreeMover.d.ts.map +1 -1
  407. package/dist/rpg/FreeMover.js +19 -5
  408. package/dist/rpg/FreeMover.js.map +1 -1
  409. package/dist/rpg/GameState.d.ts +14 -0
  410. package/dist/rpg/GameState.d.ts.map +1 -1
  411. package/dist/rpg/GameState.js +14 -0
  412. package/dist/rpg/GameState.js.map +1 -1
  413. package/dist/rpg/GridMover.d.ts +16 -2
  414. package/dist/rpg/GridMover.d.ts.map +1 -1
  415. package/dist/rpg/GridMover.js +19 -5
  416. package/dist/rpg/GridMover.js.map +1 -1
  417. package/dist/rpg/Marshal.d.ts +16 -0
  418. package/dist/rpg/Marshal.d.ts.map +1 -1
  419. package/dist/rpg/Marshal.js +16 -0
  420. package/dist/rpg/Marshal.js.map +1 -1
  421. package/dist/rpg/MovableSprite.d.ts +25 -0
  422. package/dist/rpg/MovableSprite.d.ts.map +1 -0
  423. package/dist/rpg/MovableSprite.js +2 -0
  424. package/dist/rpg/MovableSprite.js.map +1 -0
  425. package/dist/rpg/Quest.d.ts +21 -1
  426. package/dist/rpg/Quest.d.ts.map +1 -1
  427. package/dist/rpg/Quest.js +21 -1
  428. package/dist/rpg/Quest.js.map +1 -1
  429. package/dist/rpg/automap.d.ts +39 -2
  430. package/dist/rpg/automap.d.ts.map +1 -1
  431. package/dist/rpg/automap.js +24 -1
  432. package/dist/rpg/automap.js.map +1 -1
  433. package/dist/rpg/index.d.ts +4 -4
  434. package/dist/rpg/index.d.ts.map +1 -1
  435. package/dist/rpg/index.js +1 -1
  436. package/dist/rpg/index.js.map +1 -1
  437. package/dist/simulation/Runtime.d.ts +98 -0
  438. package/dist/simulation/Runtime.d.ts.map +1 -0
  439. package/dist/simulation/Runtime.js +91 -0
  440. package/dist/simulation/Runtime.js.map +1 -0
  441. package/dist/simulation/Scenario.d.ts +15 -0
  442. package/dist/simulation/Scenario.d.ts.map +1 -1
  443. package/dist/simulation/Scenario.js +15 -0
  444. package/dist/simulation/Scenario.js.map +1 -1
  445. package/dist/simulation/Turns.d.ts +11 -0
  446. package/dist/simulation/Turns.d.ts.map +1 -1
  447. package/dist/simulation/Turns.js +11 -0
  448. package/dist/simulation/Turns.js.map +1 -1
  449. package/dist/simulation/index.d.ts +10 -0
  450. package/dist/simulation/index.d.ts.map +1 -1
  451. package/dist/simulation/index.js +8 -0
  452. package/dist/simulation/index.js.map +1 -1
  453. package/dist/three-d/Character3D.d.ts +26 -1
  454. package/dist/three-d/Character3D.d.ts.map +1 -1
  455. package/dist/three-d/Character3D.js +31 -14
  456. package/dist/three-d/Character3D.js.map +1 -1
  457. package/dist/three-d/Collision3D.d.ts +63 -0
  458. package/dist/three-d/Collision3D.d.ts.map +1 -0
  459. package/dist/three-d/Collision3D.js +75 -0
  460. package/dist/three-d/Collision3D.js.map +1 -0
  461. package/dist/three-d/Models.js +1 -1
  462. package/dist/three-d/index.d.ts +3 -1
  463. package/dist/three-d/index.d.ts.map +1 -1
  464. package/dist/three-d/index.js +1 -0
  465. package/dist/three-d/index.js.map +1 -1
  466. package/dist/{core → two-d}/Game.d.ts +15 -17
  467. package/dist/two-d/Game.d.ts.map +1 -0
  468. package/dist/{core → two-d}/Game.js +3 -3
  469. package/dist/two-d/Game.js.map +1 -0
  470. package/dist/two-d/Scene2D.d.ts +19 -0
  471. package/dist/two-d/Scene2D.d.ts.map +1 -0
  472. package/dist/two-d/Scene2D.js +23 -0
  473. package/dist/two-d/Scene2D.js.map +1 -0
  474. package/dist/two-d/index.d.ts +20 -0
  475. package/dist/two-d/index.d.ts.map +1 -0
  476. package/dist/two-d/index.js +18 -0
  477. package/dist/two-d/index.js.map +1 -0
  478. package/dist/two-d/pixi-interop.d.ts +13 -0
  479. package/dist/two-d/pixi-interop.d.ts.map +1 -0
  480. package/dist/two-d/pixi-interop.js +12 -0
  481. package/dist/two-d/pixi-interop.js.map +1 -0
  482. package/dist/two-d/render/ActorAnimator.d.ts.map +1 -0
  483. package/dist/two-d/render/ActorAnimator.js.map +1 -0
  484. package/dist/{render → two-d/render}/AnimatedSprite.d.ts +4 -4
  485. package/dist/two-d/render/AnimatedSprite.d.ts.map +1 -0
  486. package/dist/two-d/render/AnimatedSprite.js.map +1 -0
  487. package/dist/two-d/render/Autotile.d.ts.map +1 -0
  488. package/dist/two-d/render/Autotile.js.map +1 -0
  489. package/dist/two-d/render/Camera.d.ts.map +1 -0
  490. package/dist/{render → two-d/render}/Camera.js +2 -2
  491. package/dist/two-d/render/Camera.js.map +1 -0
  492. package/dist/two-d/render/Capabilities.d.ts.map +1 -0
  493. package/dist/two-d/render/Capabilities.js.map +1 -0
  494. package/dist/two-d/render/ColorBlindness.d.ts.map +1 -0
  495. package/dist/two-d/render/ColorBlindness.js.map +1 -0
  496. package/dist/{render → two-d/render}/ColorTransformBatcher.d.ts +8 -3
  497. package/dist/two-d/render/ColorTransformBatcher.d.ts.map +1 -0
  498. package/dist/{render → two-d/render}/ColorTransformBatcher.js +11 -5
  499. package/dist/two-d/render/ColorTransformBatcher.js.map +1 -0
  500. package/dist/{render → two-d/render}/LayeredSprite.d.ts +3 -3
  501. package/dist/two-d/render/LayeredSprite.d.ts.map +1 -0
  502. package/dist/two-d/render/LayeredSprite.js.map +1 -0
  503. package/dist/two-d/render/Minimap.d.ts.map +1 -0
  504. package/dist/{render → two-d/render}/Minimap.js +1 -1
  505. package/dist/two-d/render/Minimap.js.map +1 -0
  506. package/dist/two-d/render/Particles.d.ts +109 -0
  507. package/dist/two-d/render/Particles.d.ts.map +1 -0
  508. package/dist/two-d/render/Particles.js +178 -0
  509. package/dist/two-d/render/Particles.js.map +1 -0
  510. package/dist/two-d/render/Projectile.d.ts.map +1 -0
  511. package/dist/two-d/render/Projectile.js.map +1 -0
  512. package/dist/two-d/render/ScreenEffects.d.ts +71 -0
  513. package/dist/two-d/render/ScreenEffects.d.ts.map +1 -0
  514. package/dist/two-d/render/ScreenEffects.js +133 -0
  515. package/dist/two-d/render/ScreenEffects.js.map +1 -0
  516. package/dist/two-d/render/Shape2D.d.ts +40 -0
  517. package/dist/two-d/render/Shape2D.d.ts.map +1 -0
  518. package/dist/two-d/render/Shape2D.js +40 -0
  519. package/dist/two-d/render/Shape2D.js.map +1 -0
  520. package/dist/{render → two-d/render}/SpriteSheet.d.ts +9 -6
  521. package/dist/two-d/render/SpriteSheet.d.ts.map +1 -0
  522. package/dist/{render → two-d/render}/SpriteSheet.js +8 -1
  523. package/dist/two-d/render/SpriteSheet.js.map +1 -0
  524. package/dist/two-d/render/StatusVisuals.d.ts.map +1 -0
  525. package/dist/two-d/render/StatusVisuals.js.map +1 -0
  526. package/dist/two-d/render/TileMap.d.ts.map +1 -0
  527. package/dist/{render → two-d/render}/TileMap.js +1 -1
  528. package/dist/two-d/render/TileMap.js.map +1 -0
  529. package/dist/{rpg → two-d/render}/TiledMap.d.ts +2 -2
  530. package/dist/two-d/render/TiledMap.d.ts.map +1 -0
  531. package/dist/{rpg → two-d/render}/TiledMap.js +2 -2
  532. package/dist/two-d/render/TiledMap.js.map +1 -0
  533. package/dist/{render → two-d/render}/TintedSprite.d.ts +3 -2
  534. package/dist/two-d/render/TintedSprite.d.ts.map +1 -0
  535. package/dist/{render → two-d/render}/TintedSprite.js +5 -1
  536. package/dist/two-d/render/TintedSprite.js.map +1 -0
  537. package/dist/two-d/render/Types2D.d.ts +27 -0
  538. package/dist/two-d/render/Types2D.d.ts.map +1 -0
  539. package/dist/two-d/render/Types2D.js +6 -0
  540. package/dist/two-d/render/Types2D.js.map +1 -0
  541. package/dist/two-d/render/Viewport.d.ts.map +1 -0
  542. package/dist/two-d/render/Viewport.js.map +1 -0
  543. package/dist/{render → two-d/render}/index.d.ts +9 -0
  544. package/dist/two-d/render/index.d.ts.map +1 -0
  545. package/dist/{render → two-d/render}/index.js +5 -0
  546. package/dist/two-d/render/index.js.map +1 -0
  547. package/dist/{stage → two-d/stage}/DialogueStage.d.ts +16 -0
  548. package/dist/two-d/stage/DialogueStage.d.ts.map +1 -0
  549. package/dist/{stage → two-d/stage}/DialogueStage.js +17 -1
  550. package/dist/two-d/stage/DialogueStage.js.map +1 -0
  551. package/dist/two-d/stage/index.d.ts.map +1 -0
  552. package/dist/two-d/stage/index.js.map +1 -0
  553. package/dist/{stage → two-d/stage}/script.d.ts +20 -0
  554. package/dist/two-d/stage/script.d.ts.map +1 -0
  555. package/dist/{stage → two-d/stage}/script.js +0 -0
  556. package/dist/two-d/stage/script.js.map +1 -0
  557. package/dist/{stage → two-d/stage}/twee.d.ts +11 -0
  558. package/dist/two-d/stage/twee.d.ts.map +1 -0
  559. package/dist/{stage → two-d/stage}/twee.js +11 -0
  560. package/dist/two-d/stage/twee.js.map +1 -0
  561. package/dist/two-d/ui/Bar.d.ts.map +1 -0
  562. package/dist/two-d/ui/Bar.js.map +1 -0
  563. package/dist/two-d/ui/BitmapLabel.d.ts.map +1 -0
  564. package/dist/two-d/ui/BitmapLabel.js.map +1 -0
  565. package/dist/{ui → two-d/ui}/Button.d.ts +11 -4
  566. package/dist/two-d/ui/Button.d.ts.map +1 -0
  567. package/dist/{ui → two-d/ui}/Button.js +20 -4
  568. package/dist/two-d/ui/Button.js.map +1 -0
  569. package/dist/two-d/ui/EventDialogue.d.ts +23 -0
  570. package/dist/two-d/ui/EventDialogue.d.ts.map +1 -0
  571. package/dist/two-d/ui/EventDialogue.js +27 -0
  572. package/dist/two-d/ui/EventDialogue.js.map +1 -0
  573. package/dist/two-d/ui/FloatingText.d.ts.map +1 -0
  574. package/dist/two-d/ui/FloatingText.js.map +1 -0
  575. package/dist/{ui → two-d/ui}/HelpScreen.d.ts +1 -1
  576. package/dist/two-d/ui/HelpScreen.d.ts.map +1 -0
  577. package/dist/two-d/ui/HelpScreen.js.map +1 -0
  578. package/dist/{ui → two-d/ui}/IconGrid.d.ts +3 -2
  579. package/dist/two-d/ui/IconGrid.d.ts.map +1 -0
  580. package/dist/two-d/ui/IconGrid.js.map +1 -0
  581. package/dist/two-d/ui/Label.d.ts.map +1 -0
  582. package/dist/two-d/ui/Label.js.map +1 -0
  583. package/dist/{ui → two-d/ui}/ListView.d.ts +3 -2
  584. package/dist/two-d/ui/ListView.d.ts.map +1 -0
  585. package/dist/two-d/ui/ListView.js.map +1 -0
  586. package/dist/{ui → two-d/ui}/LoadingScreen.d.ts +1 -1
  587. package/dist/two-d/ui/LoadingScreen.d.ts.map +1 -0
  588. package/dist/two-d/ui/LoadingScreen.js.map +1 -0
  589. package/dist/{ui → two-d/ui}/MessageBox.d.ts +1 -1
  590. package/dist/two-d/ui/MessageBox.d.ts.map +1 -0
  591. package/dist/two-d/ui/MessageBox.js.map +1 -0
  592. package/dist/{ui → two-d/ui}/NinePatch.d.ts +3 -2
  593. package/dist/two-d/ui/NinePatch.d.ts.map +1 -0
  594. package/dist/{ui → two-d/ui}/NinePatch.js +1 -1
  595. package/dist/two-d/ui/NinePatch.js.map +1 -0
  596. package/dist/{ui → two-d/ui}/RebindScreen.d.ts +1 -1
  597. package/dist/two-d/ui/RebindScreen.d.ts.map +1 -0
  598. package/dist/{ui → two-d/ui}/RebindScreen.js +1 -1
  599. package/dist/two-d/ui/RebindScreen.js.map +1 -0
  600. package/dist/two-d/ui/StatsScreen.d.ts.map +1 -0
  601. package/dist/two-d/ui/StatsScreen.js.map +1 -0
  602. package/dist/{ui → two-d/ui}/Toast.d.ts +2 -1
  603. package/dist/two-d/ui/Toast.d.ts.map +1 -0
  604. package/dist/{ui → two-d/ui}/Toast.js +1 -1
  605. package/dist/two-d/ui/Toast.js.map +1 -0
  606. package/dist/two-d/ui/Tooltip.d.ts +94 -0
  607. package/dist/two-d/ui/Tooltip.d.ts.map +1 -0
  608. package/dist/two-d/ui/Tooltip.js +149 -0
  609. package/dist/two-d/ui/Tooltip.js.map +1 -0
  610. package/dist/two-d/ui/VerticalLabel.d.ts.map +1 -0
  611. package/dist/two-d/ui/VerticalLabel.js.map +1 -0
  612. package/dist/{ui → two-d/ui}/Window.d.ts +2 -2
  613. package/dist/two-d/ui/Window.d.ts.map +1 -0
  614. package/dist/{ui → two-d/ui}/Window.js +1 -1
  615. package/dist/two-d/ui/Window.js.map +1 -0
  616. package/dist/two-d/ui/WindowStack.d.ts.map +1 -0
  617. package/dist/{ui → two-d/ui}/WindowStack.js +1 -1
  618. package/dist/two-d/ui/WindowStack.js.map +1 -0
  619. package/dist/{ui → two-d/ui}/index.d.ts +4 -0
  620. package/dist/two-d/ui/index.d.ts.map +1 -0
  621. package/dist/{ui → two-d/ui}/index.js +2 -0
  622. package/dist/two-d/ui/index.js.map +1 -0
  623. package/dist/{ui → two-d/ui}/theme.d.ts +4 -4
  624. package/dist/two-d/ui/theme.d.ts.map +1 -0
  625. package/dist/{ui → two-d/ui}/theme.js +1 -1
  626. package/dist/two-d/ui/theme.js.map +1 -0
  627. package/dist/version.d.ts +1 -1
  628. package/dist/version.js +1 -1
  629. package/dist/world/Encounters.d.ts +12 -0
  630. package/dist/world/Encounters.d.ts.map +1 -1
  631. package/dist/world/Encounters.js +1 -1
  632. package/dist/world/Encounters.js.map +1 -1
  633. package/dist/world/Environment.d.ts +27 -4
  634. package/dist/world/Environment.d.ts.map +1 -1
  635. package/dist/world/Environment.js +33 -10
  636. package/dist/world/Environment.js.map +1 -1
  637. package/dist/world/Overworld.d.ts +14 -0
  638. package/dist/world/Overworld.d.ts.map +1 -1
  639. package/dist/world/Overworld.js +14 -0
  640. package/dist/world/Overworld.js.map +1 -1
  641. package/dist/world/TurnClock.d.ts +16 -0
  642. package/dist/world/TurnClock.d.ts.map +1 -1
  643. package/dist/world/TurnClock.js +16 -0
  644. package/dist/world/TurnClock.js.map +1 -1
  645. package/dist/world/World.d.ts +14 -0
  646. package/dist/world/World.d.ts.map +1 -1
  647. package/dist/world/World.js +14 -0
  648. package/dist/world/World.js.map +1 -1
  649. package/package.json +228 -147
  650. package/dist/core/Game.d.ts.map +0 -1
  651. package/dist/core/Game.js.map +0 -1
  652. package/dist/render/ActorAnimator.d.ts.map +0 -1
  653. package/dist/render/ActorAnimator.js.map +0 -1
  654. package/dist/render/AnimatedSprite.d.ts.map +0 -1
  655. package/dist/render/AnimatedSprite.js.map +0 -1
  656. package/dist/render/Autotile.d.ts.map +0 -1
  657. package/dist/render/Autotile.js.map +0 -1
  658. package/dist/render/Camera.d.ts.map +0 -1
  659. package/dist/render/Camera.js.map +0 -1
  660. package/dist/render/Capabilities.d.ts.map +0 -1
  661. package/dist/render/Capabilities.js.map +0 -1
  662. package/dist/render/ColorBlindness.d.ts.map +0 -1
  663. package/dist/render/ColorBlindness.js.map +0 -1
  664. package/dist/render/ColorTransformBatcher.d.ts.map +0 -1
  665. package/dist/render/ColorTransformBatcher.js.map +0 -1
  666. package/dist/render/LayeredSprite.d.ts.map +0 -1
  667. package/dist/render/LayeredSprite.js.map +0 -1
  668. package/dist/render/Minimap.d.ts.map +0 -1
  669. package/dist/render/Minimap.js.map +0 -1
  670. package/dist/render/Projectile.d.ts.map +0 -1
  671. package/dist/render/Projectile.js.map +0 -1
  672. package/dist/render/SpriteSheet.d.ts.map +0 -1
  673. package/dist/render/SpriteSheet.js.map +0 -1
  674. package/dist/render/StatusVisuals.d.ts.map +0 -1
  675. package/dist/render/StatusVisuals.js.map +0 -1
  676. package/dist/render/TileMap.d.ts.map +0 -1
  677. package/dist/render/TileMap.js.map +0 -1
  678. package/dist/render/TintedSprite.d.ts.map +0 -1
  679. package/dist/render/TintedSprite.js.map +0 -1
  680. package/dist/render/Viewport.d.ts.map +0 -1
  681. package/dist/render/Viewport.js.map +0 -1
  682. package/dist/render/index.d.ts.map +0 -1
  683. package/dist/render/index.js.map +0 -1
  684. package/dist/rpg/TiledMap.d.ts.map +0 -1
  685. package/dist/rpg/TiledMap.js.map +0 -1
  686. package/dist/stage/DialogueStage.d.ts.map +0 -1
  687. package/dist/stage/DialogueStage.js.map +0 -1
  688. package/dist/stage/index.d.ts.map +0 -1
  689. package/dist/stage/index.js.map +0 -1
  690. package/dist/stage/script.d.ts.map +0 -1
  691. package/dist/stage/script.js.map +0 -1
  692. package/dist/stage/twee.d.ts.map +0 -1
  693. package/dist/stage/twee.js.map +0 -1
  694. package/dist/ui/Bar.d.ts.map +0 -1
  695. package/dist/ui/Bar.js.map +0 -1
  696. package/dist/ui/BitmapLabel.d.ts.map +0 -1
  697. package/dist/ui/BitmapLabel.js.map +0 -1
  698. package/dist/ui/Button.d.ts.map +0 -1
  699. package/dist/ui/Button.js.map +0 -1
  700. package/dist/ui/FloatingText.d.ts.map +0 -1
  701. package/dist/ui/FloatingText.js.map +0 -1
  702. package/dist/ui/HelpScreen.d.ts.map +0 -1
  703. package/dist/ui/HelpScreen.js.map +0 -1
  704. package/dist/ui/IconGrid.d.ts.map +0 -1
  705. package/dist/ui/IconGrid.js.map +0 -1
  706. package/dist/ui/Label.d.ts.map +0 -1
  707. package/dist/ui/Label.js.map +0 -1
  708. package/dist/ui/ListView.d.ts.map +0 -1
  709. package/dist/ui/ListView.js.map +0 -1
  710. package/dist/ui/LoadingScreen.d.ts.map +0 -1
  711. package/dist/ui/LoadingScreen.js.map +0 -1
  712. package/dist/ui/MessageBox.d.ts.map +0 -1
  713. package/dist/ui/MessageBox.js.map +0 -1
  714. package/dist/ui/NinePatch.d.ts.map +0 -1
  715. package/dist/ui/NinePatch.js.map +0 -1
  716. package/dist/ui/RebindScreen.d.ts.map +0 -1
  717. package/dist/ui/RebindScreen.js.map +0 -1
  718. package/dist/ui/StatsScreen.d.ts.map +0 -1
  719. package/dist/ui/StatsScreen.js.map +0 -1
  720. package/dist/ui/Toast.d.ts.map +0 -1
  721. package/dist/ui/Toast.js.map +0 -1
  722. package/dist/ui/VerticalLabel.d.ts.map +0 -1
  723. package/dist/ui/VerticalLabel.js.map +0 -1
  724. package/dist/ui/Window.d.ts.map +0 -1
  725. package/dist/ui/Window.js.map +0 -1
  726. package/dist/ui/WindowStack.d.ts.map +0 -1
  727. package/dist/ui/WindowStack.js.map +0 -1
  728. package/dist/ui/index.d.ts.map +0 -1
  729. package/dist/ui/index.js.map +0 -1
  730. package/dist/ui/theme.d.ts.map +0 -1
  731. package/dist/ui/theme.js.map +0 -1
  732. /package/dist/{render → two-d/render}/ActorAnimator.d.ts +0 -0
  733. /package/dist/{render → two-d/render}/ActorAnimator.js +0 -0
  734. /package/dist/{render → two-d/render}/AnimatedSprite.js +0 -0
  735. /package/dist/{render → two-d/render}/Autotile.d.ts +0 -0
  736. /package/dist/{render → two-d/render}/Autotile.js +0 -0
  737. /package/dist/{render → two-d/render}/Camera.d.ts +0 -0
  738. /package/dist/{render → two-d/render}/Capabilities.d.ts +0 -0
  739. /package/dist/{render → two-d/render}/Capabilities.js +0 -0
  740. /package/dist/{render → two-d/render}/ColorBlindness.d.ts +0 -0
  741. /package/dist/{render → two-d/render}/ColorBlindness.js +0 -0
  742. /package/dist/{render → two-d/render}/LayeredSprite.js +0 -0
  743. /package/dist/{render → two-d/render}/Minimap.d.ts +0 -0
  744. /package/dist/{render → two-d/render}/Projectile.d.ts +0 -0
  745. /package/dist/{render → two-d/render}/Projectile.js +0 -0
  746. /package/dist/{render → two-d/render}/StatusVisuals.d.ts +0 -0
  747. /package/dist/{render → two-d/render}/StatusVisuals.js +0 -0
  748. /package/dist/{render → two-d/render}/TileMap.d.ts +0 -0
  749. /package/dist/{render → two-d/render}/Viewport.d.ts +0 -0
  750. /package/dist/{render → two-d/render}/Viewport.js +0 -0
  751. /package/dist/{stage → two-d/stage}/index.d.ts +0 -0
  752. /package/dist/{stage → two-d/stage}/index.js +0 -0
  753. /package/dist/{ui → two-d/ui}/Bar.d.ts +0 -0
  754. /package/dist/{ui → two-d/ui}/Bar.js +0 -0
  755. /package/dist/{ui → two-d/ui}/BitmapLabel.d.ts +0 -0
  756. /package/dist/{ui → two-d/ui}/BitmapLabel.js +0 -0
  757. /package/dist/{ui → two-d/ui}/FloatingText.d.ts +0 -0
  758. /package/dist/{ui → two-d/ui}/FloatingText.js +0 -0
  759. /package/dist/{ui → two-d/ui}/HelpScreen.js +0 -0
  760. /package/dist/{ui → two-d/ui}/IconGrid.js +0 -0
  761. /package/dist/{ui → two-d/ui}/Label.d.ts +0 -0
  762. /package/dist/{ui → two-d/ui}/Label.js +0 -0
  763. /package/dist/{ui → two-d/ui}/ListView.js +0 -0
  764. /package/dist/{ui → two-d/ui}/LoadingScreen.js +0 -0
  765. /package/dist/{ui → two-d/ui}/MessageBox.js +0 -0
  766. /package/dist/{ui → two-d/ui}/StatsScreen.d.ts +0 -0
  767. /package/dist/{ui → two-d/ui}/StatsScreen.js +0 -0
  768. /package/dist/{ui → two-d/ui}/VerticalLabel.d.ts +0 -0
  769. /package/dist/{ui → two-d/ui}/VerticalLabel.js +0 -0
  770. /package/dist/{ui → two-d/ui}/WindowStack.d.ts +0 -0
package/README.md CHANGED
@@ -1,395 +1,401 @@
1
- # mwg
2
-
3
- A framework for building primarily 2D top-down games that run **from a local file**: no
4
- server, no install, no runtime to download. An optional Babylon.js module supports 3D maps.
5
-
6
- Licensed under the [MPL-2.0](LICENSE): games built with `mwg` carry no licence obligation
7
- of their own; improvements to `mwg`'s own files are shared back.
8
-
9
- **[Live examples and API docs](https://datamoc.github.io/mwg/)**: every example below,
10
- playable in the browser with no download, plus the generated API reference.
11
-
12
- > **Status: early release (v0.3.1).** Every module in the shared floor below, plus optional
13
- > 3D, mobile (Capacitor) and desktop (WebView2) packaging, is built and tested - see
14
- > [ROADMAP.md](ROADMAP.md) for the full, numbered history. Still `0.y.z`: the "public API"
15
- > can still change between minor versions, and the wider genre-specific modules keep growing.
16
-
17
- ## What it is for
18
-
19
- Tile-based games with a camera over a grid. Nine existing games mark out the corners of
20
- what that has to cover:
21
-
22
- | reference | what it demands that the others do not |
23
- | --- | --- |
24
- | **[Shattered Pixel Dungeon](https://shatteredpixel.com/shatteredpd/)** | generated dungeons, field of view, energy-cost turn scheduling, permadeath, dense inventory UI |
25
- | **[ADOM](https://www.adom.de/)** | many persistent maps joined by a world map, hunger and long-running effects, skills and attributes, quests inside a roguelike |
26
- | **[RPG Maker](https://www.rpgmakerweb.com/) projects** | hand-authored maps, events on tiles, dialogue and cutscenes, a party, menu combat, save slots |
27
- | **[Pokémon](https://www.pokemon.com/), in its traditional form** | encounter tables by terrain, a roster of creatures with derived stats, an effectiveness matrix, speed-ordered battles, capture and storage |
28
- | **[Ren'Py](https://www.renpy.org/), and the conversation scenes every RPG borrows from it** | a backdrop with characters standing in front of it, expressions, whoever speaks picked out from the rest, branching written as data |
29
- | **[The Battle for Wesnoth](https://www.wesnoth.org/)** | hexagonal tactical maps, movement cost and defense by terrain, zone of control, turn-based unit combat with recruiting and upkeep |
30
- | **[Flare](https://flarerpg.org/)'s Empyrean Campaign** | isometric tile maps, loaded straight from Tiled's own isometric export |
31
- | **[Dungeon Crawl Stone Soup](https://crawl.develz.org/) (Tiles)** | a branching dungeon of many interconnected levels, and autoexplore pathing to the nearest unseen tile |
32
- | **[Twine](https://twinery.org/)** | a story as named passages, not one linear list - a choice jumps to another passage by name, which can loop back or braid together, entirely on state and no visual stage at all |
33
-
34
- Underneath they share almost everything: a grid, a camera following someone across it,
35
- sprites that need tinting, turn-taking, characters with stats and equipment, an inventory,
36
- and a great many windows. The differences are narrower than the genre labels suggest: one
37
- generates its maps and another authors them; one schedules monsters and another schedules
38
- events; one rolls encounters from the terrain and another places them by hand; one puts its
39
- conversations in a corner of the map and another gives them the whole screen; one moves in
40
- four directions on a square grid and another in six on a hex grid.
41
-
42
- `mwg` provides that shared floor plus each specialism, on top of
43
- [PixiJS](https://pixijs.com) for rendering and [rot.js](https://ondras.github.io/rot.js/)
44
- for the classic roguelike algorithms. Optional 3D scenes use Babylon.js. See
45
- [Capability spec](#capability-spec).
46
-
47
- These are references for *what a finished game of each kind has to do*, and nothing more.
48
- No code, asset, data table or file format is taken from any of them: see
49
- [Licence and provenance](#licence-and-provenance).
50
-
51
- ### On being "like RPG Maker"
52
-
53
- Worth being precise, because RPG Maker is two things and `mwg` is only aiming at one of
54
- them for now.
55
-
56
- It is a **runtime**: a tile engine, an event interpreter, a battle system, a message box.
57
- That is what the capability spec below commits to.
58
-
59
- It is also an **editor**, and that is what most people actually mean by RPG Maker: drawing
60
- maps and wiring events without writing code. `mwg` does not have one. What it does instead
61
- is keep maps, events and dialogue as **plain data** rather than code, so an editor can be
62
- built against that data later without reworking the runtime, and so that in the meantime
63
- the data can be written by hand, generated by a script, or exported from
64
- [Tiled](https://www.mapeditor.org/), which is free and already good at this.
65
-
66
- That data is loaded exactly like any other asset, which means the `file://` story covers it
67
- for free: a finished game is still a folder you double-click.
68
-
69
- ## Two ways to use it
70
-
71
- **With a toolchain**, if you already use a bundler:
72
-
73
- ```
74
- npm install @datamoc/mw_games
75
- ```
76
- ```ts
77
- import { Game, Scene } from '@datamoc/mw_games/core';
78
- import { Sprite } from '@datamoc/mw_games/render';
79
- ```
80
-
81
- No npm registry access (an offline machine, a pinned artifact for reproducible builds)?
82
- `npm pack @datamoc/mw_games` downloads the exact published tarball; install it by path
83
- instead of by name:
84
-
85
- ```
86
- npm install ./datamoc-mw_games-0.1.1.tgz
87
- ```
88
-
89
- **Without either.** Drop one file next to your page and open it: this path exists because
90
- the framework's own target is a game you can run by double-clicking it. Download
91
- `mw_games.global.js` from a [release](https://github.com/datamoc/mwg/releases) (no `npm`,
92
- no `node_modules`, nothing to install):
93
-
94
- ```html
95
- <script src="mw_games.global.js"></script>
96
- <script>
97
- const game = new mw_games.Game(document.getElementById('game'));
98
- </script>
99
- ```
100
-
101
- Node and npm are developer tools here, in the same sense that a compiler is. Nothing from
102
- them is present when the game runs: the output is HTML, JavaScript and assets.
103
-
104
- ## Running from `file://`
105
-
106
- Opening a page from disk takes three capabilities away, and the framework is shaped around
107
- them rather than pretending otherwise:
108
-
109
- | what is blocked | consequence | how `mwg` handles it |
110
- | --- | --- | --- |
111
- | ES modules (CORS) | `<script type="module">` will not run | the standalone build is a classic IIFE |
112
- | `fetch()` / XHR | no asset can be loaded on demand, no directory can be listed | `tools/compile-resources` turns assets into scripts loaded before the game |
113
- | cross-origin images | an `<img>` from a sibling file taints a WebGL texture in Chrome | assets travel as `data:` URIs inside those scripts |
114
-
115
- The practical effect: resources are **compiled at build time**, so at runtime every lookup
116
- is synchronous. Game code never awaits an asset.
117
-
118
- ## Capability spec
119
-
120
- The definition of done for 1.0, drawn from what each of the nine references actually
121
- demands. The shared floor is what all of them need; the sections after it are the parts
122
- only some do.
123
-
124
- ### Shared floor
125
-
126
- | area | capability | provided by |
127
- | --- | --- | --- |
128
- | **core** | fixed-step game loop, scenes, timing | `mwg/core` |
129
- | | signals and listeners | `mwg/core` |
130
- | | deterministic seeded RNG, reproducible across machines | `mwg/core` |
131
- | | named, versioned save slots with a preview | `mwg/core` |
132
- | **render** | sprite batching at thousands of tiles | PixiJS |
133
- | | per-sprite colour transform: multiply **and** add | `mwg/render` |
134
- | | animated sprites driven by named frame sets | `mwg/render` |
135
- | | dense tile maps, multi-layer, with per-cell visibility | `mwg/render` |
136
- | | hexagonal tile maps, alongside square, as a second grid shape | `mwg/render` |
137
- | | camera with follow, pan, shake and zoom | `mwg/render` |
138
- | | particle effects | `mwg/render` |
139
- | | screen transitions: fade, flash, tint | `mwg/render` |
140
- | **ui** | windows, lists, tooltips | `mwg/ui` |
141
- | | text and fonts, including non-latin fallback | PixiJS |
142
- | | pointer, keyboard and gamepad input with rebinding | `mwg/core` |
143
- | **text** | message tables per language, compiled at build time | `mwg/i18n` |
144
- | | plurals, gendered forms and interpolation | `mwg/i18n` |
145
- | | Fluent-style FTL catalogs with locale-aware fallback and variants | `mwg/i18n` |
146
- | | left-to-right, right-to-left and vertical writing | `mwg/i18n` |
147
- | | interface mirrored for right-to-left languages | `mwg/ui` |
148
- | | a missing translation falls back rather than showing a key | `mwg/i18n` |
149
- | **audio** | sound effects with pooling, music with crossfade | `mwg/audio` |
150
-
151
- ### World
152
-
153
- Shared by everything past a single screen, and the thing ADOM needs most.
154
-
155
- | capability | provided by |
156
- | --- | --- |
157
- | many maps in one world, joined by transitions | `mwg/world` |
158
- | maps that persist when left and returned to | `mwg/world` |
159
- | an overworld map with locations on it | `mwg/world` |
160
- | a turn clock driving hunger, poison and other long effects | `mwg/world` |
161
-
162
- ### Roguelike
163
-
164
- | capability | provided by |
165
- | --- | --- |
166
- | field of view and lighting | rot.js + `mwg/roguelike` |
167
- | pathfinding over a passability map | rot.js + `mwg/roguelike` |
168
- | turn scheduling by energy cost | `mwg/roguelike` |
169
- | level generation from composable room builders | `mwg/roguelike` |
170
- | autoexplore: pathing to the nearest unexplored cell | `mwg/roguelike` |
171
-
172
- ### Tactical maps (hex)
173
-
174
- The Wesnoth-shaped half: a grid whose shape is a parameter, not a parallel implementation.
175
-
176
- | capability | provided by |
177
- | --- | --- |
178
- | hexagonal tile maps, addressed by axial or offset coordinates | `mwg/render` |
179
- | movement cost and defense bonus by terrain, hex or square alike | `mwg/roguelike` |
180
- | field of view and pathfinding over a hex grid, not just square | `mwg/roguelike` |
181
- | isometric (and staggered) projection, alongside orthogonal and hex | `mwg/render` |
182
- | zone of control: a hex a unit can only move into, not through, unless already engaged | `mwg/board` |
183
- | an army economy: recruiting against a currency, recalling from a pool, per-turn upkeep | `mwg/board` |
184
-
185
- A game picks a grid shape once; the camera, field of view, pathfinding and turn scheduler
186
- work the same way over either, rather than a hex game needing its own copy of each. Between
187
- them, orthogonal, isometric and hex cover every map orientation
188
- [Tiled](https://www.mapeditor.org/) itself supports: a Tiled map loads and renders through
189
- the same `TileMap`, whichever orientation it was drawn in, rather than mwg reading only the
190
- one shape it happens to render natively. Flare's Empyrean Campaign is the isometric-shaped
191
- reference, the same way Wesnoth is the hex-shaped one.
192
-
193
- ### RPG
194
-
195
- | capability | provided by |
196
- | --- | --- |
197
- | maps loaded as data, in any of Tiled's map orientations | `mwg/rpg` |
198
- | events placed on tiles, with pages selected by conditions | `mwg/rpg` |
199
- | event triggers: action, touch, autorun, parallel | `mwg/rpg` |
200
- | a command interpreter for cutscenes: move routes, waits, branches, calls | `mwg/rpg` |
201
- | global switches and variables, saved with the game | `mwg/rpg` |
202
- | message box with portraits, choices and typewriter reveal | `mwg/rpg` + `mwg/ui` |
203
- | grid movement tweened between tiles, with a walk cycle | `mwg/rpg` |
204
- | a dialogue stage: backdrop, characters, expressions, speaker focus | `mwg/stage` |
205
- | scenes written as a list of commands, awaited as one call | `mwg/stage` |
206
- | named passages a choice can jump between, for a story that is a graph, not a line | `mwg/stage` |
207
- | named save slots with a preview | `mwg/core` |
208
-
209
- ### Characters, equipment and stats
210
-
211
- All four references have these, and they are what a game changes most, so they are data
212
- rather than classes.
213
-
214
- | capability | provided by |
215
- | --- | --- |
216
- | a stat block: base attributes, derived values, and the rules that derive them | `mwg/actors` |
217
- | levels, experience and growth curves, all replaceable | `mwg/actors` |
218
- | skills and proficiencies, checked against a difficulty | `mwg/actors` |
219
- | equipment slots defined per game, not fixed by the framework | `mwg/actors` |
220
- | modifiers from equipment, buffs and states, resolved in a stated order | `mwg/actors` |
221
- | an inventory with stacking, weight and containers | `mwg/actors` |
222
- | item identification, and cursed or blessed states | `mwg/actors` |
223
- | a layered character sprite, so worn equipment is visible | `mwg/render` |
224
-
225
- That last row is why `tools/make-example-assets.mjs` draws its character in parts. A figure
226
- assembled from skin, eyes, hair and garments is one palette away from being a second
227
- character, and one *layer* away from showing the armour it just put on. A single flat
228
- sprite per character can do neither.
229
-
230
- ### Creatures and battles
231
-
232
- The Pokémon-shaped half, and the part `mwg` deliberately keeps generic.
233
-
234
- | capability | provided by |
235
- | --- | --- |
236
- | species defined as data, with per-individual stats derived from them | `mwg/battle` |
237
- | a party with a roster and off-party storage | `mwg/battle` |
238
- | an effectiveness matrix between arbitrary types | `mwg/battle` |
239
- | turn order by speed, with move priority overriding it | `mwg/battle` |
240
- | moves as data: cost, target shape, effects | `mwg/battle` |
241
- | encounter tables per map region, weighted, with a rate per step | `mwg/world` |
242
- | capture, experience, levelling and evolution as replaceable rules | `mwg/battle` |
243
-
244
- `mwg` supplies the *shape*: a stat block, a type matrix, a turn queue. It supplies no
245
- formulas, no type chart and no species: those are a game's own design, and copying any
246
- particular game's would be both wrong and useless to anyone else.
247
-
248
- All of these specialisms share the tile map, the camera, the windows, the turn clock and
249
- the save system, which is why they sit in one framework rather than four.
250
-
251
- ### Why per-sprite "multiply and add"
252
-
253
- The single most load-bearing rendering feature in either genre is the colour transform
254
- `texel × M + A`. Darkness outside the field of view, tinting a poisoned enemy, flashing
255
- white on a hit, a room lit by a fireplace, a screen-wide tint for a night scene: all of it
256
- is that one operation.
257
-
258
- Pixi's built-in `tint` is multiply-only, which can only ever darken. The additive term is
259
- what `mwg/render` adds, in the batch shader rather than as a per-object filter, so it costs
260
- nothing per sprite. See `examples/colour-transform`.
261
-
262
- ### Why maps and events are data, not code
263
-
264
- An RPG's content is enormous and repetitive, and almost none of it deserves to be written
265
- by hand in TypeScript. Keeping maps, events, dialogue and item tables as data means they
266
- can be authored in a spreadsheet, generated by a script, exported from Tiled, or eventually
267
- edited in a proper editor, without any of those options requiring changes to the runtime.
268
-
269
- It also keeps the content out of the bundle: `tools/compile-resources` treats a map file
270
- exactly like a sprite sheet, so adding a hundred maps does not touch the build at all.
271
-
272
- ### On writing direction
273
-
274
- Supporting more than one language is mostly bookkeeping. Supporting more than one writing
275
- *direction* is not, and the three cases are genuinely different work:
276
-
277
- - **Left-to-right** is what everything assumes by default.
278
- - **Right-to-left** (Arabic, Hebrew) is two problems at once. The text itself the browser
279
- can handle: canvas applies the Unicode bidirectional algorithm and shapes the glyphs, so
280
- a label mostly comes out right once its direction is declared. The *interface* is the
281
- harder half, because a right-to-left reader expects it mirrored: lists indent from the
282
- right, a back arrow points the other way, a progress bar fills the other way. `mwg/ui`
283
- lays widgets out against a direction rather than against "left" so this can be flipped,
284
- and a game only has to mark which of its own icons must not be mirrored.
285
- - **Vertical**, top to bottom (traditional Chinese, Japanese, Mongolian), gets no help at
286
- all. Canvas has no vertical writing mode, so the text has to be laid out glyph by glyph,
287
- with its own rules for which characters rotate and which stand upright. This is real work
288
- and it is scheduled as such, not assumed to fall out of the other two.
289
-
290
- Message tables are compiled at build time, the same way every other resource is, so adding
291
- a language costs nothing at runtime and a missing string falls back to the base language
292
- rather than showing a raw key to the player.
293
-
294
- ## Optional Babylon.js 3D
295
-
296
- `@babylonjs/core`/`@babylonjs/loaders` are peer dependencies, not installed automatically -
297
- a game that never imports `mwg/3d` never downloads Babylon.js. Add them yourself
298
- (`npm install @babylonjs/core @babylonjs/loaders`) once a game imports 3D support:
299
-
300
- ```ts
301
- import { Engine3D, createTileGrid3D } from '@datamoc/mw_games/3d';
302
- import { loadModel3D } from '@datamoc/mw_games/3d/models';
303
- ```
304
-
305
- `Engine3D` owns a WebGL scene, orbit camera, light, resize handling, and render loop.
306
- `createTileGrid3D` batches square or flat-top hex tiles and elevation columns with thin
307
- instances; `createHeightmapTerrain3D` builds continuous terrain from decoded RGBA heightmap
308
- pixels. `Character3D` moves imported meshes or camera-facing sprites continuously, and can
309
- play imported animation clips. `parseVox` and `createVoxModel3D` load one MagicaVoxel model;
310
- `loadModel3D` handles glTF/GLB.
311
- Run `npm run example:3d` for the live example or `npm run benchmark:3d` for its FPS gate.
312
-
313
- ## Headless simulation
314
-
315
- `@datamoc/mw_games/simulation` has no rendering or browser imports. It provides two
316
- small runners while games keep their state, commands, rules, and event types:
317
-
318
- - `advanceToInput(rules, budget)` runs automatic scheduled actions until an actor needs
319
- input, the game finishes, the queue is empty, or the action budget is reached. Rules
320
- supply `scheduler`, `finished`, `needsInput`, and `act`. `act` returns the cost to
321
- charge to the current queue entry after the action, or `null` when it handled its own
322
- scheduling. A `limit` result does not grant input; the caller chooses how to resume.
323
- - `runScenario({ state, commands, random, step, status? })` applies a finite command
324
- sequence, preserving event order and stopping when a rule returns `finished`. Each
325
- rule returns `{ state, events, status: 'ready' | 'finished' }`. Results also report
326
- `processedCommands`; a command need not consume a game turn.
327
-
328
- ```ts
329
- import { runScenario } from '@datamoc/mw_games/simulation';
330
-
331
- const result = runScenario({
332
- state: { position: 0 },
333
- commands: [1, 2, -1],
334
- random: null, // This example has no randomness; supply a generator when needed.
335
- step: (state, distance, _random) => ({
336
- state: { position: state.position + distance },
337
- events: [{ moved: distance }],
338
- status: 'ready',
339
- }),
340
- });
341
- // result.state.position === 2; result.processedCommands === 3
342
- ```
343
-
344
- The root/standalone build also exposes these as `Simulation`. The dungeon example uses
345
- the scheduled runner and shares its own damage rule between the scene and headless
346
- scenario tests. Neither runner implements a game's combat, inventory, or movement rules.
347
-
348
- For reproducibility, supply the same initial state, commands, and random state, and keep
349
- rules independent of wall-clock time and ambient randomness. Existing `Generator`
350
- instances expose `getState()`/`setState()`; store that state alongside a game's snapshot.
351
- The runners do not clone state, serialize arbitrary graphs, or roll back a throwing rule.
352
- Frame-based `core.Recorder`/`Player` remains available for UI replay; command scenarios do
353
- not need a frame loop. Callers must bound automatic work inside each rule, for example
354
- with `advanceToInput`.
355
-
356
- ## Roadmap
357
-
358
- See [ROADMAP.md](ROADMAP.md) for the full, numbered build order and implementation notes.
359
- The optional 3D group is now implemented without changing the existing 2D entry point.
360
-
361
- ## Licence and provenance
362
-
363
- `mwg` is MPL-2.0. Its dependencies are permissive and compatible: PixiJS and Babylon.js are
364
- MIT, and rot.js is BSD-3-Clause.
365
-
366
- `tools/vendored/rgssad-wasm` is a build of the `rgssad-wasm` crate from
367
- <https://github.com/nathaniel-daniel/rgssad-rs>, used under its MIT licence
368
- option (© 2022 Nathaniel Daniel); see `tools/vendored/rgssad-wasm/README.md`.
369
- It is a developer-side archive tool only, not part of the framework or any game.
370
-
371
- Shattered Pixel Dungeon (GPL-3, © Oleg Dolya and Evan Debenham), The Battle for Wesnoth
372
- (GPL-2.0-or-later, © the Battle for Wesnoth contributors), Flare's Empyrean Campaign
373
- (GPL-3, © the Flare project), and Dungeon Crawl Stone Soup (GPL-2.0, © the Dungeon Crawl
374
- Stone Soup development team) are referenced only as design studies: a list of what a
375
- finished roguelike, a finished hex-based tactical game, a finished isometric one, and a
376
- finished branching dungeon each have to do. None of their code, assets, maps, unit
377
- definitions or text is included here, and `mwg` is not a derivative work of any of them.
378
-
379
- ADOM, RPG Maker, Pokémon, Ren'Py and Twine are likewise references for a *shape of game*, not
380
- sources of anything. `mwg` includes none of their runtimes, assets, text or data tables: no
381
- type chart, no species list, no stat formula, no map, no line of dialogue. Those are each
382
- game's own design work. A loader or writer for one of their file formats is a different
383
- matter and is not off limits on its own: a format is a container, understood the same way
384
- any published format is, by reading real files in it to learn its shape; what stays out is
385
- the media that container holds, someone else's actual assets, text or data tables. Where a
386
- format already exists and needs no reverse-engineering, `mwg` uses Tiled's, which is open
387
- and documented.
388
-
389
- Game mechanics are not themselves protected, which is why a framework may offer "a turn
390
- queue ordered by speed" or "an effectiveness matrix". Particular numbers, names and
391
- artwork are another matter, and none appear here.
392
-
393
- The assets under `examples/assets` are generated by `tools/make-example-assets.mjs` and
394
- carry the project's own licence. Nothing else in this repository was downloaded from
395
- anywhere, with the sole exception of `tools/vendored/rgssad-wasm` above.
1
+ # mwg
2
+
3
+ A framework for building tile games that run **from a local file**: no server, no install,
4
+ no runtime to download. The game logic depends on no renderer at all, so a game draws through
5
+ PixiJS in 2D (`mwg/two-d`) or Babylon.js in 3D (`mwg/3d`), and the dungeon generation, map
6
+ events, quests, stats and turn order underneath are the same either way.
7
+
8
+ Licensed under the [MPL-2.0](LICENSE): games built with `mwg` carry no licence obligation
9
+ of their own; improvements to `mwg`'s own files are shared back.
10
+
11
+ **[Live examples and API docs](https://datamoc.github.io/mwg/)**: every example below,
12
+ playable in the browser with no download, plus the generated API reference.
13
+
14
+ > **Status: early release (v0.4.1).** Every module in the shared floor below, plus optional
15
+ > 3D, mobile (Capacitor) and desktop (WebView2) packaging, is built and tested - see
16
+ > [ROADMAP.md](ROADMAP.md) for the full, numbered history.
17
+ >
18
+ > 0.4.0 is the reshaping release: the renderer moved out of `mwg/core`, `render`/`ui`/`stage`
19
+ > became `mwg/two-d`, and a set of names that meant several things each were made to mean one.
20
+ > It is deliberately the last such release planned before 1.0. Still `0.y.z` until then, but
21
+ > the intent from here is additions rather than renames.
22
+
23
+ ## What it is for
24
+
25
+ Tile-based games with a camera over a grid. Nine existing games mark out the corners of
26
+ what that has to cover:
27
+
28
+ | reference | what it demands that the others do not |
29
+ | --- | --- |
30
+ | **[Shattered Pixel Dungeon](https://shatteredpixel.com/shatteredpd/)** | generated dungeons, field of view, energy-cost turn scheduling, permadeath, dense inventory UI |
31
+ | **[ADOM](https://www.adom.de/)** | many persistent maps joined by a world map, hunger and long-running effects, skills and attributes, quests inside a roguelike |
32
+ | **[RPG Maker](https://www.rpgmakerweb.com/) projects** | hand-authored maps, events on tiles, dialogue and cutscenes, a party, menu combat, save slots |
33
+ | **[Pokémon](https://www.pokemon.com/), in its traditional form** | encounter tables by terrain, a roster of creatures with derived stats, an effectiveness matrix, speed-ordered battles, capture and storage |
34
+ | **[Ren'Py](https://www.renpy.org/), and the conversation scenes every RPG borrows from it** | a backdrop with characters standing in front of it, expressions, whoever speaks picked out from the rest, branching written as data |
35
+ | **[The Battle for Wesnoth](https://www.wesnoth.org/)** | hexagonal tactical maps, movement cost and defense by terrain, zone of control, turn-based unit combat with recruiting and upkeep |
36
+ | **[Flare](https://flarerpg.org/)'s Empyrean Campaign** | isometric tile maps, loaded straight from Tiled's own isometric export |
37
+ | **[Dungeon Crawl Stone Soup](https://crawl.develz.org/) (Tiles)** | a branching dungeon of many interconnected levels, and autoexplore pathing to the nearest unseen tile |
38
+ | **[Twine](https://twinery.org/)** | a story as named passages, not one linear list - a choice jumps to another passage by name, which can loop back or braid together, entirely on state and no visual stage at all |
39
+
40
+ Underneath they share almost everything: a grid, a camera following someone across it,
41
+ sprites that need tinting, turn-taking, characters with stats and equipment, an inventory,
42
+ and a great many windows. The differences are narrower than the genre labels suggest: one
43
+ generates its maps and another authors them; one schedules monsters and another schedules
44
+ events; one rolls encounters from the terrain and another places them by hand; one puts its
45
+ conversations in a corner of the map and another gives them the whole screen; one moves in
46
+ four directions on a square grid and another in six on a hex grid.
47
+
48
+ `mwg` provides that shared floor plus each specialism, on top of
49
+ [PixiJS](https://pixijs.com) for rendering and [rot.js](https://ondras.github.io/rot.js/)
50
+ for the classic roguelike algorithms. Optional 3D scenes use Babylon.js. See
51
+ [Capability spec](#capability-spec).
52
+
53
+ These are references for *what a finished game of each kind has to do*, and nothing more.
54
+ No code, asset, data table or file format is taken from any of them: see
55
+ [Licence and provenance](#licence-and-provenance).
56
+
57
+ ### On being "like RPG Maker"
58
+
59
+ Worth being precise, because RPG Maker is two things and `mwg` is only aiming at one of
60
+ them for now.
61
+
62
+ It is a **runtime**: a tile engine, an event interpreter, a battle system, a message box.
63
+ That is what the capability spec below commits to.
64
+
65
+ It is also an **editor**, and that is what most people actually mean by RPG Maker: drawing
66
+ maps and wiring events without writing code. `mwg` does not have one. What it does instead
67
+ is keep maps, events and dialogue as **plain data** rather than code, so an editor can be
68
+ built against that data later without reworking the runtime, and so that in the meantime
69
+ the data can be written by hand, generated by a script, or exported from
70
+ [Tiled](https://www.mapeditor.org/), which is free and already good at this.
71
+
72
+ That data is loaded exactly like any other asset, which means the `file://` story covers it
73
+ for free: a finished game is still a folder you double-click.
74
+
75
+ ## Two ways to use it
76
+
77
+ **With a toolchain**, if you already use a bundler:
78
+
79
+ ```
80
+ npm install @datamoc/mw_games
81
+ ```
82
+ ```ts
83
+ import { Game, Scene } from '@datamoc/mw_games/core';
84
+ import { Sprite } from '@datamoc/mw_games/two-d/render';
85
+ ```
86
+
87
+ No npm registry access (an offline machine, a pinned artifact for reproducible builds)?
88
+ `npm pack @datamoc/mw_games` downloads the exact published tarball; install it by path
89
+ instead of by name:
90
+
91
+ ```
92
+ npm install ./datamoc-mw_games-0.1.1.tgz
93
+ ```
94
+
95
+ **Without either.** Drop one file next to your page and open it: this path exists because
96
+ the framework's own target is a game you can run by double-clicking it. Download
97
+ `mw_games.global.js` from a [release](https://github.com/datamoc/mwg/releases) (no `npm`,
98
+ no `node_modules`, nothing to install):
99
+
100
+ ```html
101
+ <script src="mw_games.global.js"></script>
102
+ <script>
103
+ const game = new mw_games.Game(document.getElementById('game'));
104
+ </script>
105
+ ```
106
+
107
+ Node and npm are developer tools here, in the same sense that a compiler is. Nothing from
108
+ them is present when the game runs: the output is HTML, JavaScript and assets.
109
+
110
+ ## Running from `file://`
111
+
112
+ Opening a page from disk takes three capabilities away, and the framework is shaped around
113
+ them rather than pretending otherwise:
114
+
115
+ | what is blocked | consequence | how `mwg` handles it |
116
+ | --- | --- | --- |
117
+ | ES modules (CORS) | `<script type="module">` will not run | the standalone build is a classic IIFE |
118
+ | `fetch()` / XHR | no asset can be loaded on demand, no directory can be listed | `tools/compile-resources` turns assets into scripts loaded before the game |
119
+ | cross-origin images | an `<img>` from a sibling file taints a WebGL texture in Chrome | assets travel as `data:` URIs inside those scripts |
120
+
121
+ The practical effect: resources are **compiled at build time**, so at runtime every lookup
122
+ is synchronous. Game code never awaits an asset.
123
+
124
+ ## Capability spec
125
+
126
+ The definition of done for 1.0, drawn from what each of the nine references actually
127
+ demands. The shared floor is what all of them need; the sections after it are the parts
128
+ only some do.
129
+
130
+ ### Shared floor
131
+
132
+ | area | capability | provided by |
133
+ | --- | --- | --- |
134
+ | **core** | fixed-step game loop, scenes, timing | `mwg/core` |
135
+ | | signals and listeners | `mwg/core` |
136
+ | | deterministic seeded RNG, reproducible across machines | `mwg/core` |
137
+ | | named, versioned save slots with a preview | `mwg/core` |
138
+ | **render** | sprite batching at thousands of tiles | PixiJS |
139
+ | | per-sprite colour transform: multiply **and** add | `mwg/two-d/render` |
140
+ | | animated sprites driven by named frame sets | `mwg/two-d/render` |
141
+ | | dense tile maps, multi-layer, with per-cell visibility | `mwg/two-d/render` |
142
+ | | hexagonal tile maps, alongside square, as a second grid shape | `mwg/two-d/render` |
143
+ | | camera with follow, pan, shake and zoom | `mwg/two-d/render` |
144
+ | | particle effects | `mwg/two-d/render` |
145
+ | | screen transitions: fade, flash, tint | `mwg/two-d/render` |
146
+ | **ui** | windows, lists, tooltips | `mwg/two-d/ui` |
147
+ | | text and fonts, including non-latin fallback | PixiJS |
148
+ | | pointer, keyboard and gamepad input with rebinding | `mwg/core` |
149
+ | **text** | message tables per language, compiled at build time | `mwg/i18n` |
150
+ | | plurals, gendered forms and interpolation | `mwg/i18n` |
151
+ | | Fluent-style FTL catalogs with locale-aware fallback and variants | `mwg/i18n` |
152
+ | | left-to-right, right-to-left and vertical writing | `mwg/i18n` |
153
+ | | interface mirrored for right-to-left languages | `mwg/two-d/ui` |
154
+ | | a missing translation falls back rather than showing a key | `mwg/i18n` |
155
+ | **audio** | sound effects with pooling, music with crossfade | `mwg/audio` |
156
+
157
+ ### World
158
+
159
+ Shared by everything past a single screen, and the thing ADOM needs most.
160
+
161
+ | capability | provided by |
162
+ | --- | --- |
163
+ | many maps in one world, joined by transitions | `mwg/world` |
164
+ | maps that persist when left and returned to | `mwg/world` |
165
+ | an overworld map with locations on it | `mwg/world` |
166
+ | a turn clock driving hunger, poison and other long effects | `mwg/world` |
167
+
168
+ ### Roguelike
169
+
170
+ | capability | provided by |
171
+ | --- | --- |
172
+ | field of view and lighting | rot.js + `mwg/roguelike` |
173
+ | pathfinding over a passability map | rot.js + `mwg/roguelike` |
174
+ | turn scheduling by energy cost | `mwg/roguelike` |
175
+ | level generation from composable room builders | `mwg/roguelike` |
176
+ | autoexplore: pathing to the nearest unexplored cell | `mwg/roguelike` |
177
+
178
+ ### Tactical maps (hex)
179
+
180
+ The Wesnoth-shaped half: a grid whose shape is a parameter, not a parallel implementation.
181
+
182
+ | capability | provided by |
183
+ | --- | --- |
184
+ | hexagonal tile maps, addressed by axial or offset coordinates | `mwg/two-d/render` |
185
+ | movement cost and defense bonus by terrain, hex or square alike | `mwg/roguelike` |
186
+ | field of view and pathfinding over a hex grid, not just square | `mwg/roguelike` |
187
+ | isometric (and staggered) projection, alongside orthogonal and hex | `mwg/two-d/render` |
188
+ | zone of control: a hex a unit can only move into, not through, unless already engaged | `mwg/board` |
189
+ | an army economy: recruiting against a currency, recalling from a pool, per-turn upkeep | `mwg/board` |
190
+
191
+ A game picks a grid shape once; the camera, field of view, pathfinding and turn scheduler
192
+ work the same way over either, rather than a hex game needing its own copy of each. Between
193
+ them, orthogonal, isometric and hex cover every map orientation
194
+ [Tiled](https://www.mapeditor.org/) itself supports: a Tiled map loads and renders through
195
+ the same `TileMap`, whichever orientation it was drawn in, rather than mwg reading only the
196
+ one shape it happens to render natively. Flare's Empyrean Campaign is the isometric-shaped
197
+ reference, the same way Wesnoth is the hex-shaped one.
198
+
199
+ ### RPG
200
+
201
+ | capability | provided by |
202
+ | --- | --- |
203
+ | maps loaded as data, in any of Tiled's map orientations | `mwg/rpg` |
204
+ | events placed on tiles, with pages selected by conditions | `mwg/rpg` |
205
+ | event triggers: action, touch, autorun, parallel | `mwg/rpg` |
206
+ | a command interpreter for cutscenes: move routes, waits, branches, calls | `mwg/rpg` |
207
+ | global switches and variables, saved with the game | `mwg/rpg` |
208
+ | message box with portraits, choices and typewriter reveal | `mwg/rpg` + `mwg/two-d/ui` |
209
+ | grid movement tweened between tiles, with a walk cycle | `mwg/rpg` |
210
+ | a dialogue stage: backdrop, characters, expressions, speaker focus | `mwg/two-d/stage` |
211
+ | scenes written as a list of commands, awaited as one call | `mwg/two-d/stage` |
212
+ | named passages a choice can jump between, for a story that is a graph, not a line | `mwg/two-d/stage` |
213
+ | named save slots with a preview | `mwg/core` |
214
+
215
+ ### Characters, equipment and stats
216
+
217
+ All four references have these, and they are what a game changes most, so they are data
218
+ rather than classes.
219
+
220
+ | capability | provided by |
221
+ | --- | --- |
222
+ | a stat block: base attributes, derived values, and the rules that derive them | `mwg/actors` |
223
+ | levels, experience and growth curves, all replaceable | `mwg/actors` |
224
+ | skills and proficiencies, checked against a difficulty | `mwg/actors` |
225
+ | equipment slots defined per game, not fixed by the framework | `mwg/actors` |
226
+ | modifiers from equipment, buffs and states, resolved in a stated order | `mwg/actors` |
227
+ | an inventory with stacking, weight and containers | `mwg/actors` |
228
+ | item identification, and cursed or blessed states | `mwg/actors` |
229
+ | a layered character sprite, so worn equipment is visible | `mwg/two-d/render` |
230
+
231
+ That last row is why `tools/make-example-assets.mjs` draws its character in parts. A figure
232
+ assembled from skin, eyes, hair and garments is one palette away from being a second
233
+ character, and one *layer* away from showing the armour it just put on. A single flat
234
+ sprite per character can do neither.
235
+
236
+ ### Creatures and battles
237
+
238
+ The Pokémon-shaped half, and the part `mwg` deliberately keeps generic.
239
+
240
+ | capability | provided by |
241
+ | --- | --- |
242
+ | species defined as data, with per-individual stats derived from them | `mwg/battle` |
243
+ | a party with a roster and off-party storage | `mwg/battle` |
244
+ | an effectiveness matrix between arbitrary types | `mwg/battle` |
245
+ | turn order by speed, with move priority overriding it | `mwg/battle` |
246
+ | moves as data: cost, target shape, effects | `mwg/battle` |
247
+ | encounter tables per map region, weighted, with a rate per step | `mwg/world` |
248
+ | capture, experience, levelling and evolution as replaceable rules | `mwg/battle` |
249
+
250
+ `mwg` supplies the *shape*: a stat block, a type matrix, a turn queue. It supplies no
251
+ formulas, no type chart and no species: those are a game's own design, and copying any
252
+ particular game's would be both wrong and useless to anyone else.
253
+
254
+ All of these specialisms share the tile map, the camera, the windows, the turn clock and
255
+ the save system, which is why they sit in one framework rather than four.
256
+
257
+ ### Why per-sprite "multiply and add"
258
+
259
+ The single most load-bearing rendering feature in either genre is the colour transform
260
+ `texel × M + A`. Darkness outside the field of view, tinting a poisoned enemy, flashing
261
+ white on a hit, a room lit by a fireplace, a screen-wide tint for a night scene: all of it
262
+ is that one operation.
263
+
264
+ Pixi's built-in `tint` is multiply-only, which can only ever darken. The additive term is
265
+ what `mwg/two-d/render` adds, in the batch shader rather than as a per-object filter, so it costs
266
+ nothing per sprite. See `examples/colour-transform`.
267
+
268
+ ### Why maps and events are data, not code
269
+
270
+ An RPG's content is enormous and repetitive, and almost none of it deserves to be written
271
+ by hand in TypeScript. Keeping maps, events, dialogue and item tables as data means they
272
+ can be authored in a spreadsheet, generated by a script, exported from Tiled, or eventually
273
+ edited in a proper editor, without any of those options requiring changes to the runtime.
274
+
275
+ It also keeps the content out of the bundle: `tools/compile-resources` treats a map file
276
+ exactly like a sprite sheet, so adding a hundred maps does not touch the build at all.
277
+
278
+ ### On writing direction
279
+
280
+ Supporting more than one language is mostly bookkeeping. Supporting more than one writing
281
+ *direction* is not, and the three cases are genuinely different work:
282
+
283
+ - **Left-to-right** is what everything assumes by default.
284
+ - **Right-to-left** (Arabic, Hebrew) is two problems at once. The text itself the browser
285
+ can handle: canvas applies the Unicode bidirectional algorithm and shapes the glyphs, so
286
+ a label mostly comes out right once its direction is declared. The *interface* is the
287
+ harder half, because a right-to-left reader expects it mirrored: lists indent from the
288
+ right, a back arrow points the other way, a progress bar fills the other way. `mwg/two-d/ui`
289
+ lays widgets out against a direction rather than against "left" so this can be flipped,
290
+ and a game only has to mark which of its own icons must not be mirrored.
291
+ - **Vertical**, top to bottom (traditional Chinese, Japanese, Mongolian), gets no help at
292
+ all. Canvas has no vertical writing mode, so the text has to be laid out glyph by glyph,
293
+ with its own rules for which characters rotate and which stand upright. This is real work
294
+ and it is scheduled as such, not assumed to fall out of the other two.
295
+
296
+ Message tables are compiled at build time, the same way every other resource is, so adding
297
+ a language costs nothing at runtime and a missing string falls back to the base language
298
+ rather than showing a raw key to the player.
299
+
300
+ ## Optional Babylon.js 3D
301
+
302
+ `@babylonjs/core`/`@babylonjs/loaders` are peer dependencies, not installed automatically -
303
+ a game that never imports `mwg/3d` never downloads Babylon.js. Add them yourself
304
+ (`npm install @babylonjs/core @babylonjs/loaders`) once a game imports 3D support:
305
+
306
+ ```ts
307
+ import { Engine3D, createTileGrid3D } from '@datamoc/mw_games/3d';
308
+ import { loadModel3D } from '@datamoc/mw_games/3d/models';
309
+ ```
310
+
311
+ `Engine3D` owns a WebGL scene, orbit camera, light, resize handling, and render loop.
312
+ `createTileGrid3D` batches square or flat-top hex tiles and elevation columns with thin
313
+ instances; `createHeightmapTerrain3D` builds continuous terrain from decoded RGBA heightmap
314
+ pixels. `Character3D` moves imported meshes or camera-facing sprites continuously, and can
315
+ play imported animation clips. `parseVox` and `createVoxModel3D` load one MagicaVoxel model;
316
+ `loadModel3D` handles glTF/GLB.
317
+ Run `npm run example:3d` for the live example or `npm run benchmark:3d` for its FPS gate.
318
+
319
+ ## Headless simulation
320
+
321
+ `@datamoc/mw_games/simulation` has no rendering or browser imports. It provides two
322
+ small runners while games keep their state, commands, rules, and event types:
323
+
324
+ - `advanceToInput(rules, budget)` runs automatic scheduled actions until an actor needs
325
+ input, the game finishes, the queue is empty, or the action budget is reached. Rules
326
+ supply `scheduler`, `finished`, `needsInput`, and `act`. `act` returns the cost to
327
+ charge to the current queue entry after the action, or `null` when it handled its own
328
+ scheduling. A `limit` result does not grant input; the caller chooses how to resume.
329
+ - `runScenario({ state, commands, random, step, status? })` applies a finite command
330
+ sequence, preserving event order and stopping when a rule returns `finished`. Each
331
+ rule returns `{ state, events, status: 'ready' | 'finished' }`. Results also report
332
+ `processedCommands`; a command need not consume a game turn.
333
+
334
+ ```ts
335
+ import { runScenario } from '@datamoc/mw_games/simulation';
336
+
337
+ const result = runScenario({
338
+ state: { position: 0 },
339
+ commands: [1, 2, -1],
340
+ random: null, // This example has no randomness; supply a generator when needed.
341
+ step: (state, distance, _random) => ({
342
+ state: { position: state.position + distance },
343
+ events: [{ moved: distance }],
344
+ status: 'ready',
345
+ }),
346
+ });
347
+ // result.state.position === 2; result.processedCommands === 3
348
+ ```
349
+
350
+ The root/standalone build also exposes these as `Simulation`. The dungeon example uses
351
+ the scheduled runner and shares its own damage rule between the scene and headless
352
+ scenario tests. Neither runner implements a game's combat, inventory, or movement rules.
353
+
354
+ For reproducibility, supply the same initial state, commands, and random state, and keep
355
+ rules independent of wall-clock time and ambient randomness. Existing `Generator`
356
+ instances expose `getState()`/`setState()`; store that state alongside a game's snapshot.
357
+ The runners do not clone state, serialize arbitrary graphs, or roll back a throwing rule.
358
+ Frame-based `core.Recorder`/`Player` remains available for UI replay; command scenarios do
359
+ not need a frame loop. Callers must bound automatic work inside each rule, for example
360
+ with `advanceToInput`.
361
+
362
+ ## Roadmap
363
+
364
+ See [ROADMAP.md](ROADMAP.md) for the full, numbered build order and implementation notes.
365
+ The optional 3D group is now implemented without changing the existing 2D entry point.
366
+
367
+ ## Licence and provenance
368
+
369
+ `mwg` is MPL-2.0. Its dependencies are permissive and compatible: PixiJS and Babylon.js are
370
+ MIT, and rot.js is BSD-3-Clause.
371
+
372
+ `tools/vendored/rgssad-wasm` is a build of the `rgssad-wasm` crate from
373
+ <https://github.com/nathaniel-daniel/rgssad-rs>, used under its MIT licence
374
+ option (© 2022 Nathaniel Daniel); see `tools/vendored/rgssad-wasm/README.md`.
375
+ It is a developer-side archive tool only, not part of the framework or any game.
376
+
377
+ Shattered Pixel Dungeon (GPL-3, © Oleg Dolya and Evan Debenham), The Battle for Wesnoth
378
+ (GPL-2.0-or-later, © the Battle for Wesnoth contributors), Flare's Empyrean Campaign
379
+ (GPL-3, © the Flare project), and Dungeon Crawl Stone Soup (GPL-2.0, © the Dungeon Crawl
380
+ Stone Soup development team) are referenced only as design studies: a list of what a
381
+ finished roguelike, a finished hex-based tactical game, a finished isometric one, and a
382
+ finished branching dungeon each have to do. None of their code, assets, maps, unit
383
+ definitions or text is included here, and `mwg` is not a derivative work of any of them.
384
+
385
+ ADOM, RPG Maker, Pokémon, Ren'Py and Twine are likewise references for a *shape of game*, not
386
+ sources of anything. `mwg` includes none of their runtimes, assets, text or data tables: no
387
+ type chart, no species list, no stat formula, no map, no line of dialogue. Those are each
388
+ game's own design work. A loader or writer for one of their file formats is a different
389
+ matter and is not off limits on its own: a format is a container, understood the same way
390
+ any published format is, by reading real files in it to learn its shape; what stays out is
391
+ the media that container holds, someone else's actual assets, text or data tables. Where a
392
+ format already exists and needs no reverse-engineering, `mwg` uses Tiled's, which is open
393
+ and documented.
394
+
395
+ Game mechanics are not themselves protected, which is why a framework may offer "a turn
396
+ queue ordered by speed" or "an effectiveness matrix". Particular numbers, names and
397
+ artwork are another matter, and none appear here.
398
+
399
+ The assets under `examples/assets` are generated by `tools/make-example-assets.mjs` and
400
+ carry the project's own licence. Nothing else in this repository was downloaded from
401
+ anywhere, with the sole exception of `tools/vendored/rgssad-wasm` above.