@lewismoten/gamemaker-sandbox-tools 3.1.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/NOTICE.md +105 -3
  3. package/README.md +301 -15
  4. package/dist/audio-files.js +82 -0
  5. package/dist/audio.js +23 -138
  6. package/dist/block-merge.js +43 -0
  7. package/dist/color-reduce.js +44 -0
  8. package/dist/colors.js +87 -0
  9. package/dist/delta.js +75 -0
  10. package/dist/disk-diff.js +220 -0
  11. package/dist/drawing.js +83 -869
  12. package/dist/embroidery/compile.js +85 -0
  13. package/dist/embroidery/dst.js +79 -0
  14. package/dist/embroidery/exp.js +26 -0
  15. package/dist/embroidery/fill.js +49 -0
  16. package/dist/embroidery/geom.js +82 -0
  17. package/dist/embroidery/pes.js +79 -0
  18. package/dist/embroidery/satin.js +29 -0
  19. package/dist/embroidery/simulate.js +30 -0
  20. package/dist/embroidery/strokeFont.js +253 -0
  21. package/dist/embroidery/svg.js +24 -0
  22. package/dist/embroidery/types.js +13 -0
  23. package/dist/embroidery/units.js +26 -0
  24. package/dist/embroidery/validate.js +15 -0
  25. package/dist/formats/blocks.js +1 -103
  26. package/dist/formats/character.js +1 -83
  27. package/dist/formats/cmf.js +1 -37
  28. package/dist/formats/fli.js +1 -296
  29. package/dist/formats/fliLimits.js +1 -54
  30. package/dist/formats/game.js +1 -193
  31. package/dist/formats/gif.js +1 -125
  32. package/dist/formats/graphicScripts.js +1 -44
  33. package/dist/formats/map.js +1 -38
  34. package/dist/formats/monster.js +1 -69
  35. package/dist/formats/palette.js +1 -58
  36. package/dist/formats/recording.js +1 -17
  37. package/dist/formats/sound.js +1 -44
  38. package/dist/formats/voc.js +1 -303
  39. package/dist/gif-shrink.js +56 -0
  40. package/dist/image/png.js +42 -0
  41. package/dist/images.js +81 -43
  42. package/dist/kit/actors.js +19 -0
  43. package/dist/kit/align.js +204 -0
  44. package/dist/kit/blit.js +45 -0
  45. package/dist/kit/blockRoles.js +97 -0
  46. package/dist/kit/clips.js +40 -0
  47. package/dist/kit/coverPaint.js +18 -0
  48. package/dist/kit/disk.js +76 -0
  49. package/dist/kit/fadeOut.js +13 -0
  50. package/dist/kit/fliClips.js +133 -0
  51. package/dist/kit/fliShrink.js +277 -0
  52. package/dist/kit/gameSim.js +235 -0
  53. package/dist/kit/hopBot.js +142 -0
  54. package/dist/kit/levelGen.js +1423 -0
  55. package/dist/kit/levelGrid.js +33 -0
  56. package/dist/kit/levelPicture.js +27 -0
  57. package/dist/kit/menuVersion.js +19 -0
  58. package/dist/kit/microText.js +35 -0
  59. package/dist/kit/mumble.js +74 -0
  60. package/dist/kit/music.js +8 -0
  61. package/dist/kit/palRamps.js +32 -0
  62. package/dist/kit/palette.js +49 -0
  63. package/dist/kit/pcText.js +72 -0
  64. package/dist/kit/photo.js +150 -0
  65. package/dist/kit/pixels.js +79 -0
  66. package/dist/kit/png.js +40 -0
  67. package/dist/kit/quantize.js +72 -0
  68. package/dist/kit/raytrace.js +379 -0
  69. package/dist/kit/recordedDemo.js +10 -0
  70. package/dist/kit/reel.js +77 -0
  71. package/dist/kit/road3d.js +67 -0
  72. package/dist/kit/routeChecks.js +8 -0
  73. package/dist/kit/saveSlots.js +11 -0
  74. package/dist/kit/sceneInit.js +13 -0
  75. package/dist/kit/sceneSim.js +112 -0
  76. package/dist/kit/screenText.js +15 -0
  77. package/dist/kit/sdftext.js +237 -0
  78. package/dist/kit/shading.js +69 -0
  79. package/dist/kit/song.js +251 -0
  80. package/dist/kit/songFx.js +179 -0
  81. package/dist/kit/sound.js +52 -0
  82. package/dist/kit/synthParts.js +20 -0
  83. package/dist/kit/tar.js +53 -0
  84. package/dist/kit/textBounds.js +84 -0
  85. package/dist/kit/textfit.js +246 -0
  86. package/dist/kit/transforms.js +57 -0
  87. package/dist/kit/tune.js +21 -0
  88. package/dist/look-alike.js +50 -0
  89. package/dist/menu-version.js +4 -0
  90. package/dist/mesh/colorBodies.js +137 -0
  91. package/dist/mesh/decimate.js +207 -0
  92. package/dist/mesh/meshCheck.js +51 -0
  93. package/dist/mesh/overhang.js +41 -0
  94. package/dist/mesh/sampledField.js +12 -0
  95. package/dist/mesh/stl.js +36 -0
  96. package/dist/mesh/surfaceNets.js +79 -0
  97. package/dist/mesh/tetraMesh.js +62 -0
  98. package/dist/mesh/threeMf.js +58 -0
  99. package/dist/mesh/zipFile.js +52 -0
  100. package/dist/microFont.js +101 -0
  101. package/dist/music/compose.js +72 -0
  102. package/dist/pack/meshPack.js +198 -0
  103. package/dist/pack/threeMfPack.js +92 -0
  104. package/dist/palette-reserve.js +116 -0
  105. package/dist/palettes.js +138 -0
  106. package/dist/release-notes.js +40 -0
  107. package/dist/simulation.js +16 -2774
  108. package/dist/text.js +74 -0
  109. package/dist/types/audio.d.ts +4 -0
  110. package/dist/types/audioFiles.d.ts +22 -0
  111. package/dist/types/audioWav.d.ts +4 -0
  112. package/dist/types/blockMerge.d.ts +24 -0
  113. package/dist/types/colorReduce.d.ts +23 -0
  114. package/dist/types/{web/packages/tools/src/colors.d.ts → colors.d.ts} +6 -0
  115. package/dist/types/delta.d.ts +32 -0
  116. package/dist/types/diskDiff.d.ts +47 -0
  117. package/dist/types/drawing.d.ts +15 -0
  118. package/dist/types/embroidery/compile.d.ts +3 -0
  119. package/dist/types/embroidery/dst.d.ts +13 -0
  120. package/dist/types/embroidery/exp.d.ts +8 -0
  121. package/dist/types/embroidery/fill.d.ts +6 -0
  122. package/dist/types/embroidery/geom.d.ts +19 -0
  123. package/dist/types/embroidery/pes.d.ts +10 -0
  124. package/dist/types/embroidery/satin.d.ts +11 -0
  125. package/dist/types/embroidery/simulate.d.ts +19 -0
  126. package/dist/types/embroidery/strokeFont.d.ts +20 -0
  127. package/dist/types/embroidery/svg.d.ts +3 -0
  128. package/dist/types/embroidery/types.d.ts +70 -0
  129. package/dist/types/embroidery/units.d.ts +10 -0
  130. package/dist/types/embroidery/validate.d.ts +22 -0
  131. package/dist/types/formats/blocks.d.ts +1 -0
  132. package/dist/types/formats/character.d.ts +1 -0
  133. package/dist/types/formats/cmf.d.ts +1 -0
  134. package/dist/types/formats/fli.d.ts +1 -0
  135. package/dist/types/formats/fliLimits.d.ts +1 -0
  136. package/dist/types/formats/game.d.ts +1 -0
  137. package/dist/types/formats/gif.d.ts +1 -0
  138. package/dist/types/formats/graphicScripts.d.ts +1 -0
  139. package/dist/types/formats/map.d.ts +1 -0
  140. package/dist/types/formats/monster.d.ts +1 -0
  141. package/dist/types/formats/palette.d.ts +1 -0
  142. package/dist/types/formats/recording.d.ts +1 -0
  143. package/dist/types/formats/sound.d.ts +1 -0
  144. package/dist/types/formats/voc.d.ts +1 -0
  145. package/dist/types/gifShrink.d.ts +8 -0
  146. package/dist/types/image/animatedGif.d.ts +9 -0
  147. package/dist/types/image/surface.d.ts +26 -0
  148. package/dist/types/images.d.ts +13 -0
  149. package/dist/types/kit/actors.d.ts +7 -0
  150. package/dist/types/kit/align.d.ts +93 -0
  151. package/dist/types/kit/audioEvents.d.ts +26 -0
  152. package/dist/types/kit/blit.d.ts +20 -0
  153. package/dist/types/kit/blockRoles.d.ts +243 -0
  154. package/dist/types/{games/kit → kit}/clips.d.ts +1 -1
  155. package/dist/types/kit/coverPaint.d.ts +7 -0
  156. package/dist/types/kit/disk.d.ts +15 -0
  157. package/dist/types/kit/fadeOut.d.ts +12 -0
  158. package/dist/types/kit/fliClips.d.ts +32 -0
  159. package/dist/types/kit/fliShrink.d.ts +149 -0
  160. package/dist/types/{games/kit → kit}/gameSim.d.ts +9 -5
  161. package/dist/types/kit/hopBot.d.ts +72 -0
  162. package/dist/types/kit/laserClearance.d.ts +16 -0
  163. package/dist/types/kit/laserJoints.d.ts +39 -0
  164. package/dist/types/kit/laserLayout.d.ts +54 -0
  165. package/dist/types/kit/laserPixels.d.ts +52 -0
  166. package/dist/types/kit/laserPreview.d.ts +9 -0
  167. package/dist/types/kit/laserSvg.d.ts +35 -0
  168. package/dist/types/kit/levelGen/castle.d.ts +17 -0
  169. package/dist/types/kit/levelGen/dungeon.d.ts +11 -0
  170. package/dist/types/kit/levelGen/forest.d.ts +17 -0
  171. package/dist/types/kit/levelGen/furnish.d.ts +31 -0
  172. package/dist/types/kit/levelGen/grid.d.ts +46 -0
  173. package/dist/types/kit/levelGen/index.d.ts +138 -0
  174. package/dist/types/kit/levelGen/interior.d.ts +18 -0
  175. package/dist/types/kit/levelGen/jumpModel.d.ts +78 -0
  176. package/dist/types/kit/levelGen/needs.d.ts +44 -0
  177. package/dist/types/kit/levelGen/overworld.d.ts +21 -0
  178. package/dist/types/kit/levelGen/platform.d.ts +59 -0
  179. package/dist/types/kit/levelGen/platformCap.d.ts +13 -0
  180. package/dist/types/kit/levelGen/platformReach.d.ts +37 -0
  181. package/dist/types/kit/levelGen/props.d.ts +37 -0
  182. package/dist/types/kit/levelGen/town.d.ts +24 -0
  183. package/dist/types/kit/levelGrid.d.ts +16 -0
  184. package/dist/types/kit/levelPicture.d.ts +9 -0
  185. package/dist/types/kit/menuVersion.d.ts +7 -0
  186. package/dist/types/kit/microText.d.ts +18 -0
  187. package/dist/types/kit/mumble.d.ts +41 -0
  188. package/dist/types/kit/music.d.ts +1 -0
  189. package/dist/types/kit/palMerge.d.ts +10 -0
  190. package/dist/types/kit/palRamps.d.ts +28 -0
  191. package/dist/types/kit/pcText.d.ts +19 -0
  192. package/dist/types/kit/photo.d.ts +69 -0
  193. package/dist/types/kit/png.d.ts +7 -0
  194. package/dist/types/kit/quantize.d.ts +20 -0
  195. package/dist/types/kit/raytrace.d.ts +169 -0
  196. package/dist/types/kit/recordedDemo.d.ts +1 -0
  197. package/dist/types/kit/road3d.d.ts +71 -0
  198. package/dist/types/kit/routeChecks.d.ts +6 -0
  199. package/dist/types/kit/saveSlots.d.ts +17 -0
  200. package/dist/types/kit/sceneInit.d.ts +11 -0
  201. package/dist/types/{games/kit → kit}/sceneSim.d.ts +5 -5
  202. package/dist/types/kit/screenText.d.ts +3 -0
  203. package/dist/types/kit/sdftext.d.ts +34 -0
  204. package/dist/types/kit/shading.d.ts +23 -0
  205. package/dist/types/kit/shareBlocks.d.ts +20 -0
  206. package/dist/types/kit/song.d.ts +89 -0
  207. package/dist/types/kit/songFx.d.ts +99 -0
  208. package/dist/types/kit/synthParts.d.ts +7 -0
  209. package/dist/types/kit/tar.d.ts +13 -0
  210. package/dist/types/kit/textfit.d.ts +74 -0
  211. package/dist/types/kit/transforms.d.ts +8 -0
  212. package/dist/types/lookAlike.d.ts +31 -0
  213. package/dist/types/menuVersionEntry.d.ts +1 -0
  214. package/dist/types/mesh/colorBodies.d.ts +18 -0
  215. package/dist/types/mesh/decimate.d.ts +10 -0
  216. package/dist/types/mesh/fieldTrinket.d.ts +40 -0
  217. package/dist/types/mesh/figureShapes.d.ts +24 -0
  218. package/dist/types/mesh/mesh.d.ts +9 -0
  219. package/dist/types/mesh/meshCheck.d.ts +22 -0
  220. package/dist/types/mesh/overhang.d.ts +24 -0
  221. package/dist/types/mesh/pixelFigure.d.ts +41 -0
  222. package/dist/types/mesh/sampledField.d.ts +3 -0
  223. package/dist/types/mesh/sdfShapes.d.ts +20 -0
  224. package/dist/types/mesh/stl.d.ts +9 -0
  225. package/dist/types/mesh/strokeText.d.ts +8 -0
  226. package/dist/types/mesh/surfaceNets.d.ts +14 -0
  227. package/dist/types/mesh/tetraMesh.d.ts +4 -0
  228. package/dist/types/mesh/threeMf.d.ts +12 -0
  229. package/dist/types/mesh/trinketKinds.d.ts +72 -0
  230. package/dist/types/mesh/trinketTool.d.ts +26 -0
  231. package/dist/types/mesh/voxel.d.ts +10 -0
  232. package/dist/types/mesh/zipFile.d.ts +13 -0
  233. package/dist/types/microFont.d.ts +6 -0
  234. package/dist/types/pack/meshPack.d.ts +26 -0
  235. package/dist/types/pack/threeMfPack.d.ts +11 -0
  236. package/dist/types/palettePresetData.d.ts +4 -0
  237. package/dist/types/palettePresets.d.ts +12 -0
  238. package/dist/types/paletteReserve.d.ts +52 -0
  239. package/dist/types/palettes.d.ts +4 -0
  240. package/dist/types/releaseNotes.d.ts +3 -0
  241. package/dist/types/simulation.d.ts +6 -0
  242. package/dist/types/{web/packages/tools/src/text.d.ts → text.d.ts} +6 -6
  243. package/package.json +145 -15
  244. package/dist/binary-D7wuaC5g.js +0 -120
  245. package/dist/pixels-DzfIIUOl.js +0 -76
  246. package/dist/types/games/kit/blit.d.ts +0 -10
  247. package/dist/types/games/kit/music.d.ts +0 -1
  248. package/dist/types/games/kit/pcText.d.ts +0 -8
  249. package/dist/types/games/kit/shading.d.ts +0 -11
  250. package/dist/types/web/packages/tools/src/audio.d.ts +0 -3
  251. package/dist/types/web/packages/tools/src/drawing.d.ts +0 -10
  252. package/dist/types/web/packages/tools/src/images.d.ts +0 -2
  253. package/dist/types/web/packages/tools/src/microFont.d.ts +0 -1
  254. package/dist/types/web/packages/tools/src/simulation.d.ts +0 -3
  255. package/dist/types/web/scripts/cdGames.d.ts +0 -103
  256. package/dist/types/web/scripts/gameShots.d.ts +0 -12
  257. package/dist/types/web/scripts/ogImage.d.ts +0 -21
  258. package/dist/types/web/src/audio/cmfLoad.d.ts +0 -7
  259. package/dist/types/web/src/audio/cmfPlayer.d.ts +0 -69
  260. package/dist/types/web/src/audio/context.d.ts +0 -12
  261. package/dist/types/web/src/audio/engine.d.ts +0 -39
  262. package/dist/types/web/src/audio/music.worklet.d.ts +0 -14
  263. package/dist/types/web/src/audio/opl.d.ts +0 -37
  264. package/dist/types/web/src/audio/output.d.ts +0 -13
  265. package/dist/types/web/src/desk/boxes/boxFacts.d.ts +0 -85
  266. package/dist/types/web/src/dosPlayer/fileExtensions.d.ts +0 -44
  267. package/dist/types/web/src/dosPlayer/patchRules.d.ts +0 -24
  268. package/dist/types/web/src/dosPlayer/patchTable.d.ts +0 -80
  269. package/dist/types/web/src/edition.d.ts +0 -6
  270. package/dist/types/web/src/eggs/eggState.d.ts +0 -26
  271. package/dist/types/web/src/eggs/eggs.d.ts +0 -31
  272. package/dist/types/web/src/engine/character.d.ts +0 -30
  273. package/dist/types/web/src/engine/funcKeys.d.ts +0 -33
  274. package/dist/types/web/src/engine/game.d.ts +0 -52
  275. package/dist/types/web/src/engine/keys.d.ts +0 -17
  276. package/dist/types/web/src/engine/machine.d.ts +0 -99
  277. package/dist/types/web/src/engine/menus.d.ts +0 -46
  278. package/dist/types/web/src/engine/monsters.d.ts +0 -19
  279. package/dist/types/web/src/engine/playGain.d.ts +0 -11
  280. package/dist/types/web/src/engine/playerLook.d.ts +0 -26
  281. package/dist/types/web/src/engine/recorder.d.ts +0 -60
  282. package/dist/types/web/src/engine/render.d.ts +0 -8
  283. package/dist/types/web/src/engine/scene.d.ts +0 -156
  284. package/dist/types/web/src/engine/scroll.d.ts +0 -16
  285. package/dist/types/web/src/engine/showGraphic.d.ts +0 -39
  286. package/dist/types/web/src/engine/slowPc.d.ts +0 -62
  287. package/dist/types/web/src/engine/touch.d.ts +0 -33
  288. package/dist/types/web/src/engine/world.d.ts +0 -215
  289. package/dist/types/web/src/export/gameAbout.d.ts +0 -15
  290. package/dist/types/web/src/formats/binary.d.ts +0 -44
  291. package/dist/types/web/src/formats/blocks.d.ts +0 -52
  292. package/dist/types/web/src/formats/character.d.ts +0 -65
  293. package/dist/types/web/src/formats/cmf.d.ts +0 -33
  294. package/dist/types/web/src/formats/fli.d.ts +0 -45
  295. package/dist/types/web/src/formats/fliLimits.d.ts +0 -13
  296. package/dist/types/web/src/formats/game.d.ts +0 -72
  297. package/dist/types/web/src/formats/gif.d.ts +0 -15
  298. package/dist/types/web/src/formats/graphicScripts.d.ts +0 -18
  299. package/dist/types/web/src/formats/highscore.d.ts +0 -10
  300. package/dist/types/web/src/formats/map.d.ts +0 -24
  301. package/dist/types/web/src/formats/monster.d.ts +0 -48
  302. package/dist/types/web/src/formats/palette.d.ts +0 -15
  303. package/dist/types/web/src/formats/recording.d.ts +0 -7
  304. package/dist/types/web/src/formats/sound.d.ts +0 -13
  305. package/dist/types/web/src/formats/voc.d.ts +0 -13
  306. package/dist/types/web/src/gfx/cp437Glyphs.d.ts +0 -2
  307. package/dist/types/web/src/gfx/font8x8.d.ts +0 -2
  308. package/dist/types/web/src/gfx/levelPicture.d.ts +0 -81
  309. package/dist/types/web/src/gfx/screen.d.ts +0 -46
  310. package/dist/types/web/src/gfx/titlePicture.d.ts +0 -21
  311. package/dist/types/web/src/input/chords.d.ts +0 -22
  312. package/dist/types/web/src/input/deskMouse.d.ts +0 -14
  313. package/dist/types/web/src/input/keyboard.d.ts +0 -39
  314. package/dist/types/web/src/input/scancodes.d.ts +0 -3
  315. package/dist/types/web/src/manual/printables/types.d.ts +0 -277
  316. package/dist/types/web/src/project/bizarre.d.ts +0 -28
  317. package/dist/types/web/src/project/companion.d.ts +0 -35
  318. package/dist/types/web/src/project/diskFacts.d.ts +0 -30
  319. package/dist/types/web/src/project/files.d.ts +0 -124
  320. package/dist/types/web/src/project/gameFiles.d.ts +0 -49
  321. package/dist/types/web/src/project/gamePack.d.ts +0 -17
  322. package/dist/types/web/src/project/health.d.ts +0 -30
  323. package/dist/types/web/src/project/secretGames.d.ts +0 -19
  324. package/dist/types/web/src/project/storage.d.ts +0 -46
  325. package/dist/types/web/src/project/streamGame.d.ts +0 -38
  326. package/dist/types/web/src/project/zip.d.ts +0 -33
  327. package/dist/types/web/src/retro/dos/disks.d.ts +0 -33
  328. package/dist/types/web/src/retro/text/cp437.d.ts +0 -4
  329. package/dist/types/web/src/seededRandom.d.ts +0 -6
  330. package/dist/types/web/src/tinHearts/deskHearts.d.ts +0 -33
  331. package/dist/types/web/src/tinHearts/manifest.d.ts +0 -30
  332. package/dist/types/web/src/tinHearts/tinHearts.d.ts +0 -84
  333. package/dist/types/web/src/walkthrough/format.d.ts +0 -92
  334. package/dist/types/web/src/walkthrough/madeUpScores.d.ts +0 -6
  335. package/dist/types/web/src/walkthrough/runtime.d.ts +0 -134
  336. /package/dist/types/{web/src/assistant → image}/png.d.ts +0 -0
  337. /package/dist/types/{games/kit → kit}/palette.d.ts +0 -0
  338. /package/dist/types/{games/kit → kit}/pixels.d.ts +0 -0
  339. /package/dist/types/{games/kit → kit}/reel.d.ts +0 -0
  340. /package/dist/types/{games/kit → kit}/sound.d.ts +0 -0
  341. /package/dist/types/{games/kit → kit}/textBounds.d.ts +0 -0
  342. /package/dist/types/{games/kit → kit}/tune.d.ts +0 -0
  343. /package/dist/types/{web/src/audio → music}/compose.d.ts +0 -0
@@ -1,33 +0,0 @@
1
- import type { Block } from '../formats/blocks.js';
2
- import { type Coord, type TouchBlocks, type World } from './world.js';
3
- export declare const KILLSOUND = 1;
4
- export declare function doSound(w: World, n: number): boolean;
5
- /** ScrnLowBnd/ScrnUpBnd ({1,1} to {SIZEX-BLEN,SIZEY-BLEN}): where a 20x20 sprite is considered on screen. */
6
- export declare function inScreenBounds(p: Coord): boolean;
7
- /**
8
- * onscrn: screen position of map block (x, y); true if inside the screen bounds.
9
- * Cells left of / above the scroll origin (mx, my) are taken as wrapped around the map.
10
- */
11
- export declare function onscrn(w: World, x: number, y: number, ret: Coord): boolean;
12
- /**
13
- * GetTouchbl: the up to 6 map cells the (two block high) character overlaps:
14
- * 0/1 the top row (only while the top half is drawn), 2/3 its own row, 4/5 the
15
- * row below, left then right. The right/lower cells count only when the pixel
16
- * offset is past 0. Unused cells keep x = MLEN and BACKBL; blknum is the
17
- * displayed variant (blkmap) of the map block.
18
- */
19
- export declare function getTouchBlocks(w: World): TouchBlocks;
20
- /** checkseq_fortie: turns on/off every sequence tied to `block` (picked up or dropped). */
21
- export declare function checkSeqForTie(w: World, block: number, setting: boolean): void;
22
- /**
23
- * DoBlockTouchChar: applies a block's (or monster block's) effects to the character.
24
- * Returns 0 when blocked by an empty counter, otherwise (sound played ? 2 : 1).
25
- * Effect 1 is lives and 3 is money; effects 3 and up are counters (ci.meter), and
26
- * 3 or 20 and up refuse the touch when they would leave the counter at 0 or less.
27
- * i16/u16 keep the C's 16-bit int wrap and its unsigned overflow checks.
28
- */
29
- export declare function doBlockTouchChar(w: World, blk: Block): number;
30
- /** really_checktouch: 2 = touch refused (counter empty), else true. x === MLEN is an unused touch cell. */
31
- export declare function reallyCheckTouch(w: World, x: number, y: number, bnum: number): number;
32
- /** CheckTouch: touches every overlapped cell except objects, which only PickupBloc takes. */
33
- export declare function checkTouch(w: World): void;
@@ -1,215 +0,0 @@
1
- import { BACKBL, BLEN, CHARBL, MONBL, type Block } from '../formats/blocks.js';
2
- import type { Character } from '../formats/character.js';
3
- import { INF_REPEAT, MAXINV, MAXSEQ } from '../formats/character.js';
4
- import { LASTMON, type Monster } from '../formats/monster.js';
5
- import { LASTMM, MLEN, MWID, type GameMap } from '../formats/map.js';
6
- import { LASTSND } from '../formats/sound.js';
7
- export { BLEN, BACKBL, MONBL, CHARBL, LASTMM, LASTMON, MLEN, MWID, MAXSEQ, MAXINV, INF_REPEAT, LASTSND };
8
- export declare const SIZEX = 320;
9
- export declare const SIZEY = 200;
10
- export declare const MAXKEYS = 20;
11
- export declare const MAXGRAV = 11;
12
- export declare const SCRNBLEN = 16;
13
- export declare const SCRNBWID = 10;
14
- export declare const GRAVSPEED = 1;
15
- export declare const MONMOVESPEED = 1;
16
- export declare const JSTICKKEY = 1;
17
- export declare const ATTACKX = 8;
18
- export declare const ATTACKY = 5;
19
- export declare const OFFSCRN = -100;
20
- export declare const SCRSPDX = 40;
21
- export declare const SCRSPDY = 40;
22
- export declare const SCROLLPERMOVE = 6;
23
- export declare const MAXMONSSHOWN = 50;
24
- export declare const CHARPOWER = 100;
25
- export declare const NEVER = 4294967295;
26
- export interface Coord {
27
- x: number;
28
- y: number;
29
- }
30
- /** cinfo: the player's state that persists across scenes. */
31
- export interface CharInfo {
32
- score: number;
33
- update: boolean;
34
- topthere: boolean;
35
- bottomthere: boolean;
36
- curtop: number;
37
- curbottom: number;
38
- /** Where the character will be on screen next; scrx/scry where it is drawn; oldx/oldy where it is erased. */
39
- nextx: number;
40
- nexty: number;
41
- scrx: number;
42
- scry: number;
43
- oldx: number;
44
- oldy: number;
45
- /** Delta of the character's last 2 moves. */
46
- netx: number;
47
- nety: number;
48
- /** Current velocity due to gravity. */
49
- gravx: number;
50
- gravy: number;
51
- hitpts: number;
52
- /** Lives left; -1 before the first scene sets it from the character's meter. */
53
- lives: number;
54
- /** Game clock tick at which the character next moves. */
55
- nextAni: number;
56
- /** Inventory block numbers (BACKBL+1 in inv[0] = not filled in yet). */
57
- inv: number[];
58
- /** Repetition counters, MAXSEQ + 10 of them; meter[0] is hit points, meter[1] lives. */
59
- meter: number[];
60
- seqon: boolean[];
61
- }
62
- /** minfo: one live monster. */
63
- export interface MonInfo {
64
- /** Born from the character, so it can't hurt the character. */
65
- fromchar: number;
66
- /** Bresenham's algorithm: dx = (curpos - dest). */
67
- delta: Coord;
68
- /** [0] map block, [1] pixel position within the block. */
69
- curx: [number, number];
70
- cury: [number, number];
71
- /** Where the monster is going when on a path. */
72
- target: Coord;
73
- /** xy ratios in Bresenham's line algorithm. */
74
- offl: number;
75
- offs: number;
76
- /** 0 normal, 1 attack pattern. */
77
- curMarch: number;
78
- /** Index into mon[].pic. */
79
- curPic: number;
80
- /** How to flip and rotate the picture. */
81
- orient: number;
82
- picDrawn: boolean;
83
- scrPos: Coord;
84
- oldPos: Coord;
85
- /** Index of the next position in the monster's path. */
86
- dest: number;
87
- /** Game clock ticks of the next animation frame, next move, and when it was born. */
88
- nextAni: number;
89
- nextMove: number;
90
- birthTime: number;
91
- }
92
- /** mm[]: monster number per slot (LASTMON = empty). */
93
- interface MonSlot {
94
- monnum: number;
95
- curx: number;
96
- cury: number;
97
- }
98
- interface KeyStackEntry {
99
- key: number;
100
- seq: number;
101
- frame: number;
102
- }
103
- export interface BresScroll {
104
- dscroll: number;
105
- ctr: number;
106
- iters: number;
107
- }
108
- interface ScrollState {
109
- /** Pixel offset of the screen edge within the edge block (mx, my). */
110
- nx: number;
111
- ny: number;
112
- /** How far to move the screen this game tick; negative is up or left. */
113
- totalx: number;
114
- totaly: number;
115
- /** Character's offset from the screen center (pixels; the C comment says blocks). */
116
- distx: number;
117
- disty: number;
118
- /** SOLLEF/SOLRIG/SOLTOP/SOLBOT flags of the directions currently scrolling. */
119
- inMotion: number;
120
- maxX: number;
121
- maxY: number;
122
- minX: number;
123
- minY: number;
124
- leftStop: number;
125
- rightStop: number;
126
- upStop: number;
127
- downStop: number;
128
- /** Pixels waiting to be scrolled; whole 4 pixel steps are taken, 0..3 remain as the pan. */
129
- movx: number;
130
- movy: number;
131
- /** 0..3 pixel hardware pan (an absolute position, not a delta). */
132
- littleShiftx: number;
133
- littleShifty: number;
134
- /** 0xff where the scene allows scrolling that way (mirrored from the .gam file). */
135
- up: number;
136
- down: number;
137
- left: number;
138
- right: number;
139
- bx: BresScroll;
140
- by: BresScroll;
141
- }
142
- export interface TouchBlocks {
143
- blks: [number, number][];
144
- blknum: number[];
145
- }
146
- interface SoundHooks {
147
- /** DoSound: returns true if a sound was started. */
148
- play(n: number): boolean;
149
- }
150
- export interface World {
151
- palette: Uint8Array;
152
- map: Uint8Array;
153
- mapMon: Uint8Array;
154
- bg: Block[];
155
- mblk: Block[];
156
- cblk: Block[];
157
- mon: Monster[];
158
- chr: Character;
159
- noMons: boolean;
160
- ci: CharInfo;
161
- mi: MonInfo[];
162
- mm: MonSlot[];
163
- firstEmptyMM: number;
164
- monsolid: number;
165
- mmSolid: number;
166
- blkMon: {
167
- blnum: number;
168
- nexttime: number;
169
- }[];
170
- /** Per-block "birth this tick" flag (bit 0x4000 of Birthtime in the original). */
171
- birthFlag: Uint8Array;
172
- nxtchg: number[];
173
- blkmap: Uint8Array;
174
- mx: number;
175
- my: number;
176
- scroll: ScrollState;
177
- clock: number;
178
- keydn: Uint8Array;
179
- keystack: KeyStackEntry[];
180
- keystkptr: number;
181
- curkey: number;
182
- gclk: number;
183
- joyOldTime: number;
184
- joyOldBut: number;
185
- sound: SoundHooks;
186
- rand: () => number;
187
- /** GetJoyPos: position 0 (center) or 1..8 clockwise from up, buttons bit 0/1. */
188
- joystick?: () => {
189
- pos: number;
190
- buttons: number;
191
- } | null;
192
- jstickOn: boolean;
193
- /**
194
- * Not PLAYGAME's: told when the character's touch did something to map cell (x, y), shown as
195
- * block `bnum` (it changed into its touch block, or was picked up). The web's tin heart
196
- * tracking listens here; nothing in play reads it.
197
- */
198
- onTouched?: (x: number, y: number, bnum: number) => void;
199
- }
200
- export declare function newCharInfo(): CharInfo;
201
- /** Pads a block list with empty blocks so out-of-range numbers are harmless. */
202
- export declare function padBlocks(list: Block[] | undefined, count: number): Block[];
203
- export declare function mapBlock(w: World, x: number, y: number): number;
204
- export declare function mapMonAt(w: World, x: number, y: number): number;
205
- export declare function setMapMon(w: World, x: number, y: number, v: number): void;
206
- /** blks[0][blkmap[n]]: the currently displayed variant of background block n. */
207
- export declare function shownBlock(w: World, n: number): Block;
208
- export declare function bgBlock(w: World, n: number): Block;
209
- export declare function createWorld(map: GameMap, sound: SoundHooks, rand?: () => number): World;
210
- export declare const random: (w: World, n: number) => number;
211
- export declare const sign: (v: number) => 0 | 1 | -1;
212
- /** C int (16-bit) wrap. */
213
- export declare const i16: (v: number) => number;
214
- /** C unsigned int (16-bit). */
215
- export declare const u16: (v: number) => number;
@@ -1,15 +0,0 @@
1
- /** A DOS text file as plain text: up to the ^Z end mark, no CRs or control characters. */
2
- export declare function dosText(bytes: Uint8Array): string;
3
- /** The game's story screen ("*s.txt", "*story*"), else its instructions ("*i.txt"), else any text screen. */
4
- export declare function storyFile(names: string[]): string | undefined;
5
- /** The first lines of a text screen joined into a sentence or two. */
6
- export declare function blurbOf(text: string, max?: number): string | undefined;
7
- interface GameAbout {
8
- /** From the game's story or instruction screen. */
9
- blurb?: string;
10
- /** Shareware: the author's notice, as text. */
11
- notice?: string;
12
- }
13
- /** What a game's own files say about it (file names are matched in lower case). */
14
- export declare function gameAbout(entries: [string, Uint8Array][]): GameAbout;
15
- export {};
@@ -1,44 +0,0 @@
1
- export declare class Reader {
2
- readonly bytes: Uint8Array;
3
- offset: number;
4
- constructor(bytes: Uint8Array, offset?: number);
5
- get length(): number;
6
- get eof(): boolean;
7
- skip(n: number): this;
8
- u8(): number;
9
- i8(): number;
10
- u16(): number;
11
- i16(): number;
12
- u32(): number;
13
- i32(): number;
14
- /** Copies n bytes (zero padded when the source is short). */
15
- bytesOf(n: number): Uint8Array;
16
- /** Reads a fixed size, NUL terminated string field. */
17
- cstr(n: number): string;
18
- }
19
- export declare class Writer {
20
- private buf;
21
- offset: number;
22
- constructor(initial?: number);
23
- private ensure;
24
- u8(v: number): this;
25
- i8(v: number): this;
26
- u16(v: number): this;
27
- i16(v: number): this;
28
- u32(v: number): this;
29
- i32(v: number): this;
30
- bytes(b: ArrayLike<number>, length?: number): this;
31
- /** Writes a string into a fixed size NUL padded field (truncated to leave room for the NUL). */
32
- cstr(s: string, length: number): this;
33
- /**
34
- * Writes a fixed size string field. When the text is unchanged the original raw
35
- * bytes (including any garbage after the NUL) are kept so files round-trip exactly.
36
- */
37
- cstrOver(s: string, original: Uint8Array | undefined, length: number): this;
38
- toBytes(): Uint8Array;
39
- }
40
- /** Decodes a NUL terminated string; the whole array when there is no NUL. */
41
- export declare function cString(bytes: Uint8Array): string;
42
- export declare function latin1Text(bytes: Uint8Array): string;
43
- /** One byte per character (low 8 bits of each UTF-16 code unit). */
44
- export declare function textBytes(text: string): Uint8Array;
@@ -1,52 +0,0 @@
1
- export declare const BLEN = 20;
2
- export declare const BLOCK_SIZE = 420;
3
- export declare const BACKBL = 150;
4
- export declare const MONBL = 100;
5
- export declare const CHARBL = 50;
6
- export declare const TRANSPARENT = 255;
7
- export declare const SOLTOP = 1;
8
- export declare const SOLRIG = 2;
9
- export declare const SOLBOT = 4;
10
- export declare const SOLLEF = 8;
11
- export type BlockKind = 'bbl' | 'mbl' | 'cbl';
12
- export declare const BLOCK_COUNTS: Record<BlockKind, number>;
13
- export interface Block {
14
- /** 20x20 palette indices, row major (y * 20 + x). 255 is transparent for sprites. */
15
- pixels: Uint8Array;
16
- /** Monster number to give birth to (background blocks). */
17
- birthMon: number;
18
- /** Clock ticks between monster births; 0 = never. */
19
- birthTime: number;
20
- xtra: Uint8Array;
21
- /** Solid sides: SOLTOP | SOLRIG | SOLBOT | SOLLEF. */
22
- solid: number;
23
- /** Sides that hurt (unused by playgame, kept for fidelity). */
24
- hitpt: number;
25
- /** Score points when touched. */
26
- scorePts: number;
27
- /** Hit points added (negative hurts) when touched. */
28
- chHitPt: number;
29
- /** Block this one animates into after ntime ticks (== self means never). */
30
- nextBl: number;
31
- ntime: number;
32
- /** Block this one becomes when touched (== self means unchanged). */
33
- touchBl: number;
34
- /** Gravity direction bits: 1 up, 2 right, 4 down, 8 left. */
35
- grav: number;
36
- /** Non-zero if the character can pick this block up. */
37
- obj: number;
38
- /** Which counter is affected: 1 lives, 3 money, 5..19 sequence counters, 20..29 extra counters. */
39
- effect: number;
40
- /** Amount the effect counter changes. */
41
- eamt: number;
42
- }
43
- export declare function emptyBlock(index: number, transparent?: boolean): Block;
44
- export declare function parseBlocks(bytes: Uint8Array, count: number): Block[];
45
- export declare function serializeBlocks(blocks: Block[]): Uint8Array;
46
- export declare function newBlockSet(kind: BlockKind): Block[];
47
- /**
48
- * Pixel lookup for a block drawn with one of the 8 orientations used by playgame
49
- * (rotations/mirrors; see Sdrawspbloc in PLAYGAME.C). Returns the source index for
50
- * destination (x, y).
51
- */
52
- export declare function orientIndex(orient: number, x: number, y: number): number;
@@ -1,65 +0,0 @@
1
- export declare const MAXSEQ = 20;
2
- export declare const MAXFRAME = 10;
3
- export declare const MAXINV = 10;
4
- export declare const METERS: number;
5
- export declare const INF_REPEAT = 32767;
6
- export declare const CHR_RECORD_SIZE = 3784;
7
- export declare const IDLESEQ = 0;
8
- export declare const DIESEQ = 1;
9
- export declare const HURTSEQ = 2;
10
- export declare const PICKUPSEQ = 3;
11
- export declare const DROPSEQ = 4;
12
- export declare const SEQUENCE_NAMES: string[];
13
- export interface Frame {
14
- /** Pixel offset from the previous frame. */
15
- x: number;
16
- y: number;
17
- /** Low nibble: orientation of top block. High nibble: orientation of bottom block. */
18
- orient: number;
19
- /** Top block number (CHARBL = none). When pic2 == MONBL, pic1 is the monster to give birth to. */
20
- pic1: number;
21
- /** Bottom block number. CHARBL+1 marks the end of the sequence. */
22
- pic2: number;
23
- /** Clock ticks (1/18.2 s) to wait before the next frame. */
24
- pause: number;
25
- extra: Uint8Array;
26
- }
27
- export interface Sequence {
28
- frames: Frame[];
29
- /** Activation key: high byte = PC scan code, low byte = ASCII. */
30
- key: number;
31
- /** Sound effect number (>= 30 means none). */
32
- sound: number;
33
- on: number;
34
- /** Background block required in inventory to use this sequence (150 = none). */
35
- bloc: number;
36
- /** Non-zero: sequence cannot be interrupted. */
37
- ground: number;
38
- /** Joystick button (0 any, 1/2 button, 4 none). */
39
- jstkBut: number;
40
- /** Joystick direction (0 none, 1-8 directions, 9 any). */
41
- jstkMov: number;
42
- /** Non-zero: one run per key press. */
43
- norepeat: number;
44
- /** Non-zero: motion adds to momentum instead of moving directly. */
45
- momentum: number;
46
- xtra: Uint8Array;
47
- }
48
- export interface Character {
49
- sequences: Sequence[];
50
- x: number[];
51
- y: number[];
52
- cframe: number;
53
- cseq: number;
54
- inv: Uint8Array;
55
- /** Repetition counters: 0 hit points, 1 lives, 3 money, 5..19 sequence counters, 20..29 extra. */
56
- meter: number[];
57
- /** Raw bytes of the unused second player record. */
58
- rest: Uint8Array;
59
- }
60
- export declare function parseCharacter(bytes: Uint8Array): Character;
61
- export declare function serializeCharacter(c: Character): Uint8Array;
62
- export declare function emptyFrame(end?: boolean): Frame;
63
- export declare function newCharacter(): Character;
64
- /** Number of frames before the end marker. */
65
- export declare function frameCount(s: Sequence): number;
@@ -1,33 +0,0 @@
1
- export declare const CMF_GAMEMAKER_CLOCK = 146;
2
- interface CmfFile {
3
- version: number;
4
- ticksPerBeat: number;
5
- /** Ticks per second the song was converted for. */
6
- clockTicks: number;
7
- channelUsed: Uint8Array;
8
- /** 16 byte SBI instrument records. */
9
- instruments: Uint8Array[];
10
- basicTempo: number;
11
- /** The event stream (music block to end of file). */
12
- music: Uint8Array;
13
- }
14
- export declare function isCmf(bytes: Uint8Array): boolean;
15
- export declare function parseCmf(bytes: Uint8Array): CmfFile;
16
- /** One event of a song: when (in ticks from the start) and its MIDI bytes. */
17
- export interface CmfEvent {
18
- tick: number;
19
- data: number[];
20
- }
21
- interface CmfSong {
22
- /** 16-byte SBI FM instruments; instrument n starts on MIDI channel n. */
23
- instruments: Uint8Array[];
24
- events: CmfEvent[];
25
- ticksPerBeat?: number;
26
- basicTempo?: number;
27
- }
28
- /**
29
- * Writes a Creative Music File at Game-Maker's 146 ticks a second (PLAYGAME refuses any
30
- * other clock). Events are sorted by tick; the song ends with an end-of-track marker.
31
- */
32
- export declare function encodeCmf(song: CmfSong): Uint8Array;
33
- export {};
@@ -1,45 +0,0 @@
1
- interface FliAnimation {
2
- width: number;
3
- height: number;
4
- frameCount: number;
5
- /** Delay per frame in 1/70 s (FLI) — FLC files are converted from milliseconds. */
6
- speed: number;
7
- /** Byte offsets of each frame record. */
8
- frames: number[];
9
- bytes: Uint8Array;
10
- }
11
- interface FliCanvas {
12
- pixels: Uint8Array;
13
- /** 6-bit palette, 768 bytes. */
14
- palette: Uint8Array;
15
- }
16
- export declare function isFli(bytes: Uint8Array): boolean;
17
- export declare function parseFli(bytes: Uint8Array): FliAnimation;
18
- export declare function newFliCanvas(anim: FliAnimation): FliCanvas;
19
- /** Applies frame n to the canvas. Returns true if the palette changed. */
20
- export declare function applyFliFrame(anim: FliAnimation, n: number, c: FliCanvas): boolean;
21
- /**
22
- * The most bytes a chunk (with its 6-byte header) may take. PLAYGAME reads an .FLI through
23
- * FileRead (code/DRV/FILECLSS.CPP): one buffer of up to 0xFFF0 bytes, 2 bytes smaller each
24
- * time `new` fails, and FrameHeader::View (code/Image/FLI/FLI.CPP) hands each chunk to its
25
- * decoder only when the whole chunk fits in that buffer (FileRead::Peek). With a game loaded
26
- * through XFERPLAY there is less memory, and a 63K chunk drew garbage where a 32.7K one
27
- * played. 16,000 bytes is under half of that 32.7K, so it fits with a quarter of the 64K
28
- * buffer PLAYGAME asks for; splitting a full 64,000-pixel frame into bands this size costs a
29
- * few dozen bytes of headers.
30
- */
31
- export declare const FLI_CHUNK_MAX = 16000;
32
- /**
33
- * Writes an Autodesk Animator .FLI (Game-Maker shows 320x200): each frame run-length coded
34
- * or as the lines that changed, the 6-bit palette in the first frame, and a closing "ring"
35
- * frame that leads back to the start. No chunk is bigger than FLI_CHUNK_MAX: a bigger frame
36
- * is split into bands of lines. `speed` is the delay after each frame in 1/70 s.
37
- */
38
- export declare function encodeFli(frames: Uint8Array[], palette: Uint8Array, opts?: {
39
- width?: number;
40
- height?: number;
41
- speed?: number;
42
- /** A palette per frame (fades, flashes); changes are stored where they happen. */ palettes?: Uint8Array[];
43
- /** Code runs of a color inside changed spans as run packets too (smaller deltas for drawn art). */ runs?: boolean;
44
- }): Uint8Array;
45
- export {};
@@ -1,13 +0,0 @@
1
- type FliFaultKind = 'big' | 'packets' | 'black' | 'type';
2
- interface FliFault {
3
- kind: FliFaultKind;
4
- /** The frame it is in (0 the first; the last is the ring frame back to the start). */
5
- frame: number;
6
- /** The chunk's size with its header ('big'), the packet count ('packets') or the chunk type ('type'). */
7
- value: number;
8
- }
9
- /** Every fault in an .FLI, the first of each kind per frame. A file that isn't an FLI has none. */
10
- export declare function fliFaults(bytes: Uint8Array): FliFault[];
11
- /** A fault in words, for a finding or a health issue. */
12
- export declare function describeFliFault(f: FliFault): string;
13
- export {};
@@ -1,72 +0,0 @@
1
- export declare const NOSCENE = 65535;
2
- export declare const STARTTYPE = 1;
3
- export declare const ENDTYPE = 2;
4
- export declare const ADVTYPE = 10;
5
- export declare const SCENEDESCLEN = 20;
6
- export declare const SCENEFILES = 20;
7
- export declare const MAXSCENELINKS = 20;
8
- export declare const GAM_VERSION = 300;
9
- /** Scene 0 (title/menu) file slots. */
10
- export declare const START_FILES: readonly ["Title graphic", "Title song", "Menu graphic", "Menu song", "Storyline graphic", "Storyline song", "Game instructions", "Beginning credits", "High score backdrop", "Load game background", "Save game background", "Demo recording"];
11
- /** Scene 1 (game over) file slots. */
12
- export declare const END_FILES: readonly ["Game won graphic", "Game won song", "Game lost graphic", "Game lost song"];
13
- /** Adventure (level) scene file slots. */
14
- export declare const ADV_FILES: readonly ["Palette", "Map", "Background block set", "Monsters", "Monster block set", "Character", "Character block set", "Sound set", "Sound Blaster music", "Level intro graphic", "Level exit graphic"];
15
- export declare const ADV_EXTS: readonly ["pal", "map", "bbl", "mon", "mbl", "chr", "cbl", "snd", "cmf", "graphic", "graphic"];
16
- export declare const GRAPHIC_EXTS: string[];
17
- export interface Point {
18
- x: number;
19
- y: number;
20
- }
21
- export interface Link {
22
- /** Scene to go to, NOSCENE = unused. */
23
- toScene: number;
24
- /** Map block that triggers the link. */
25
- from: Point;
26
- /** Map block where the character starts in the next scene. */
27
- to: Point;
28
- }
29
- interface ScrollInfo {
30
- /** 0 = no scrolling, 0xFF = scroll when the character nears the edge. */
31
- up: number;
32
- down: number;
33
- left: number;
34
- right: number;
35
- style: number;
36
- xtra: Uint8Array;
37
- }
38
- export interface Scene {
39
- gametype: number;
40
- /** Position of the scene box in the integrator's world view. */
41
- pos: Point;
42
- scroll: ScrollInfo;
43
- numLinks: number;
44
- desc: string;
45
- descRaw?: Uint8Array;
46
- /** File names by slot ('' = none). */
47
- files: string[];
48
- links: Link[];
49
- }
50
- export interface Game {
51
- version: number;
52
- /** Raw 256 byte header so unknown bytes survive a round trip. */
53
- header: Uint8Array;
54
- filesPerScene: number;
55
- linksPerScene: number;
56
- scenes: Scene[];
57
- /** Original string pool, kept to reproduce the file exactly when nothing changed. */
58
- pool?: Uint8Array;
59
- poolOffsets?: number[][];
60
- /** True when the file was converted from the pre-3.00 layout. */
61
- converted: boolean;
62
- }
63
- export declare function emptyLink(): Link;
64
- export declare function emptyScene(gametype?: number): Scene;
65
- export declare function defaultHeader(): Uint8Array;
66
- export declare function newGame(title?: string): Game;
67
- export declare function parseGame(bytes: Uint8Array): Game;
68
- export declare function serializeGame(g: Game): Uint8Array;
69
- export declare function sceneKind(s: Scene): 'start' | 'end' | 'adventure' | 'unused';
70
- export declare function fileSlotsFor(s: Scene): readonly string[];
71
- export declare function slotExtensions(s: Scene): readonly string[];
72
- export {};
@@ -1,15 +0,0 @@
1
- import { type Palette } from './palette.js';
2
- export interface IndexedImage {
3
- width: number;
4
- height: number;
5
- pixels: Uint8Array;
6
- palette: Palette;
7
- }
8
- export declare function isGif(bytes: Uint8Array): boolean;
9
- export declare function decodeGif(bytes: Uint8Array): IndexedImage;
10
- export declare function lzwDecode(data: Uint8Array, minCodeSize: number, pixelCount: number, done?: {
11
- count: number;
12
- }): Uint8Array;
13
- /** Encodes an 8-bit indexed image as GIF87a with a full 256 color table. */
14
- export declare function encodeGif(img: IndexedImage): Uint8Array;
15
- export declare function lzwEncode(pixels: Uint8Array, minCodeSize: number): Uint8Array;
@@ -1,18 +0,0 @@
1
- interface Backdrop {
2
- x: number;
3
- y: number;
4
- gif: string;
5
- }
6
- export declare function parseBackdrop(bytes: Uint8Array): Backdrop;
7
- export declare function serializeBackdrop(b: Backdrop): Uint8Array;
8
- export interface SlideEntry {
9
- name: string;
10
- /** Seconds to wait; undefined = the caller's default. */
11
- pause?: number;
12
- }
13
- /** Port of FileEntry/FileListClass: "name [pause]" per line, names up to 15 chars. */
14
- export declare function parseSlideList(bytes: Uint8Array): SlideEntry[];
15
- export declare function serializeSlideList(entries: SlideEntry[]): Uint8Array;
16
- /** Splits a .txt file into the 31 character lines Display_File shows (fgets with a 32 byte buffer). */
17
- export declare function textLines(bytes: Uint8Array): string[];
18
- export {};
@@ -1,10 +0,0 @@
1
- export interface HighScore {
2
- score: number;
3
- name: string;
4
- }
5
- export declare const HIGH_SCORES = 10;
6
- export declare function parseHighScores(bytes: Uint8Array): HighScore[];
7
- export declare function serializeHighScores(list: HighScore[]): Uint8Array;
8
- /** Port of CheckHighScores' ranking: returns the 0-based place, or -1 if not in the top ten. */
9
- export declare function placeFor(list: HighScore[], score: number): number;
10
- export declare function insertHighScore(list: HighScore[], place: number, entry: HighScore): HighScore[];
@@ -1,24 +0,0 @@
1
- export declare const MLEN = 100;
2
- export declare const MWID = 100;
3
- export declare const LASTMM = 200;
4
- export interface PlacedMonster {
5
- /** Monster number in the .mon file; LASTMON (64) or more = empty slot. */
6
- monnum: number;
7
- status: number;
8
- xtra: number;
9
- curx: number;
10
- cury: number;
11
- extra: number;
12
- }
13
- export interface GameMap {
14
- /** Background block per cell (index = y * 100 + x). */
15
- blocks: Uint8Array;
16
- /** Placed monster index per cell (LASTMM = none). */
17
- mons: Uint8Array;
18
- monsters: PlacedMonster[];
19
- }
20
- export declare function parseMap(bytes: Uint8Array): GameMap;
21
- export declare function serializeMap(m: GameMap): Uint8Array;
22
- export declare function newMap(): GameMap;
23
- /** Rebuilds the per-cell monster index from the placed monster list (as the map editor does). */
24
- export declare function reindexMonsters(m: GameMap): void;