@datamoc/mw_games 0.43.0 → 0.45.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.
- package/3d/models.d.ts +1 -0
- package/3d/models.js +1 -0
- package/3d.d.ts +1 -0
- package/3d.js +1 -0
- package/README.md +5 -710
- package/actors.d.ts +1 -0
- package/actors.js +1 -0
- package/ai/lua.d.ts +1 -0
- package/ai/lua.js +1 -0
- package/ai.d.ts +1 -0
- package/ai.js +1 -0
- package/assets/binary.d.ts +1 -0
- package/assets/binary.js +1 -0
- package/assets/paths.d.ts +1 -0
- package/assets/paths.js +1 -0
- package/assets.d.ts +1 -0
- package/assets.js +1 -0
- package/audio.d.ts +1 -0
- package/audio.js +1 -0
- package/battle.d.ts +1 -0
- package/battle.js +1 -0
- package/board.d.ts +1 -0
- package/board.js +1 -0
- package/core.d.ts +1 -0
- package/core.js +1 -0
- package/headless.d.ts +1 -0
- package/headless.js +1 -0
- package/i18n.d.ts +1 -0
- package/i18n.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/mwl/presentation.d.ts +1 -0
- package/mwl/presentation.js +1 -0
- package/mwl/pyroeis.d.ts +1 -0
- package/mwl/pyroeis.js +1 -0
- package/mwl.d.ts +1 -0
- package/mwl.js +1 -0
- package/package.json +212 -387
- package/physics/xpbd.d.ts +1 -0
- package/physics/xpbd.js +1 -0
- package/physics.d.ts +1 -0
- package/physics.js +1 -0
- package/roguelike.d.ts +1 -0
- package/roguelike.js +1 -0
- package/rpg.d.ts +1 -0
- package/rpg.js +1 -0
- package/simulation.d.ts +1 -0
- package/simulation.js +1 -0
- package/skeleton.d.ts +1 -0
- package/skeleton.js +1 -0
- package/testing.d.ts +1 -0
- package/testing.js +1 -0
- package/threads.d.ts +1 -0
- package/threads.js +1 -0
- package/tools/asset-report.d.mts +1 -37
- package/tools/asset-report.mjs +1 -157
- package/tools/audio.d.mts +1 -0
- package/tools/audio.mjs +1 -0
- package/tools/audit-adoptions.d.mts +1 -65
- package/tools/audit-adoptions.mjs +1 -252
- package/tools/benchmark-browser.d.mts +1 -33
- package/tools/benchmark-browser.mjs +1 -169
- package/tools/benchmark-history.d.mts +1 -8
- package/tools/benchmark-history.mjs +1 -31
- package/tools/browser-driver.d.mts +1 -122
- package/tools/browser-driver.mjs +1 -861
- package/tools/browser-smoke.d.mts +1 -30
- package/tools/browser-smoke.mjs +1 -184
- package/tools/build-tablebases.d.mts +1 -22
- package/tools/build-tablebases.mjs +1 -557
- package/tools/bundle-size.d.mts +1 -11
- package/tools/bundle-size.mjs +1 -142
- package/tools/classic-html.d.mts +1 -6
- package/tools/classic-html.mjs +1 -69
- package/tools/compile-openings.d.mts +1 -20
- package/tools/compile-openings.mjs +1 -138
- package/tools/compile-resources.d.mts +1 -66
- package/tools/compile-resources.mjs +1 -406
- package/tools/compress-dist.d.mts +1 -42
- package/tools/compress-dist.mjs +1 -193
- package/tools/csp.d.mts +1 -7
- package/tools/csp.mjs +1 -65
- package/tools/emit-page.d.mts +1 -61
- package/tools/emit-page.mjs +1 -273
- package/tools/extract-html.d.mts +1 -18
- package/tools/extract-html.mjs +1 -235
- package/tools/extract-rgssad.d.mts +1 -5
- package/tools/extract-rgssad.mjs +1 -64
- package/tools/find-chrome.d.mts +1 -7
- package/tools/find-chrome.mjs +1 -106
- package/tools/i18n-edit.d.mts +1 -29
- package/tools/i18n-edit.mjs +1 -748
- package/tools/init.d.mts +1 -5
- package/tools/init.mjs +1 -155
- package/tools/make-example-assets.d.mts +1 -2
- package/tools/make-example-assets.mjs +1 -731
- package/tools/multiplayer-server.d.mts +1 -27
- package/tools/multiplayer-server.mjs +1 -199
- package/tools/play-uci.d.mts +1 -26
- package/tools/play-uci.mjs +1 -205
- package/tools/sbom.d.mts +1 -83
- package/tools/sbom.mjs +1 -340
- package/tools/single-file.d.mts +1 -33
- package/tools/single-file.mjs +1 -239
- package/tools/soundfonts.d.mts +1 -79
- package/tools/soundfonts.mjs +1 -301
- package/tools/svg-optimise.d.mts +1 -8
- package/tools/svg-optimise.mjs +1 -45
- package/tools/verify-scenarios.d.mts +1 -15
- package/tools/verify-scenarios.mjs +1 -133
- package/tools/vite.d.mts +1 -17
- package/tools/vite.mjs +1 -102
- package/tools/webp-convert.d.mts +1 -8
- package/tools/webp-convert.mjs +1 -98
- package/two-d/pixi-interop.d.ts +1 -0
- package/two-d/pixi-interop.js +1 -0
- package/two-d/presentation.d.ts +1 -0
- package/two-d/presentation.js +1 -0
- package/two-d/render.d.ts +1 -0
- package/two-d/render.js +1 -0
- package/two-d/stage.d.ts +1 -0
- package/two-d/stage.js +1 -0
- package/two-d/ui.d.ts +1 -0
- package/two-d/ui.js +1 -0
- package/two-d.d.ts +1 -0
- package/two-d.js +1 -0
- package/world.d.ts +1 -0
- package/world.js +1 -0
- package/CHANGELOG.md +0 -3129
- package/LICENSE +0 -373
- package/MWG - Best Practices.md +0 -97
- package/MWG - Deep Code and Architecture Review.md +0 -238
- package/REFERENCE.md +0 -2180
- package/api-surface.json +0 -17102
- package/data/microgm-essential.PROVENANCE.md +0 -13
- package/data/microgm-essential.sf2 +0 -0
- package/data/microgm-opt.PROVENANCE.md +0 -23
- package/data/microgm-opt.sf2 +0 -0
- package/data/soundfont-catalog.json +0 -191
- package/dist/actors/Advancement.d.ts +0 -90
- package/dist/actors/Advancement.d.ts.map +0 -1
- package/dist/actors/Advancement.js +0 -115
- package/dist/actors/Advancement.js.map +0 -1
- package/dist/actors/Affix.d.ts +0 -96
- package/dist/actors/Affix.d.ts.map +0 -1
- package/dist/actors/Affix.js +0 -68
- package/dist/actors/Affix.js.map +0 -1
- package/dist/actors/Appearances.d.ts +0 -48
- package/dist/actors/Appearances.d.ts.map +0 -1
- package/dist/actors/Appearances.js +0 -62
- package/dist/actors/Appearances.js.map +0 -1
- package/dist/actors/Aura.d.ts +0 -45
- package/dist/actors/Aura.d.ts.map +0 -1
- package/dist/actors/Aura.js +0 -85
- package/dist/actors/Aura.js.map +0 -1
- package/dist/actors/Barrier.d.ts +0 -60
- package/dist/actors/Barrier.d.ts.map +0 -1
- package/dist/actors/Barrier.js +0 -70
- package/dist/actors/Barrier.js.map +0 -1
- package/dist/actors/Charges.d.ts +0 -66
- package/dist/actors/Charges.d.ts.map +0 -1
- package/dist/actors/Charges.js +0 -61
- package/dist/actors/Charges.js.map +0 -1
- package/dist/actors/EntityTemplate.d.ts +0 -127
- package/dist/actors/EntityTemplate.d.ts.map +0 -1
- package/dist/actors/EntityTemplate.js +0 -117
- package/dist/actors/EntityTemplate.js.map +0 -1
- package/dist/actors/Equipment.d.ts +0 -88
- package/dist/actors/Equipment.d.ts.map +0 -1
- package/dist/actors/Equipment.js +0 -107
- package/dist/actors/Equipment.js.map +0 -1
- package/dist/actors/Inventory.d.ts +0 -123
- package/dist/actors/Inventory.d.ts.map +0 -1
- package/dist/actors/Inventory.js +0 -165
- package/dist/actors/Inventory.js.map +0 -1
- package/dist/actors/ItemState.d.ts +0 -43
- package/dist/actors/ItemState.d.ts.map +0 -1
- package/dist/actors/ItemState.js +0 -63
- package/dist/actors/ItemState.js.map +0 -1
- package/dist/actors/ItemStatusEffect.d.ts +0 -40
- package/dist/actors/ItemStatusEffect.d.ts.map +0 -1
- package/dist/actors/ItemStatusEffect.js +0 -39
- package/dist/actors/ItemStatusEffect.js.map +0 -1
- package/dist/actors/Loot.d.ts +0 -38
- package/dist/actors/Loot.d.ts.map +0 -1
- package/dist/actors/Loot.js +0 -28
- package/dist/actors/Loot.js.map +0 -1
- package/dist/actors/Progression.d.ts +0 -52
- package/dist/actors/Progression.d.ts.map +0 -1
- package/dist/actors/Progression.js +0 -59
- package/dist/actors/Progression.js.map +0 -1
- package/dist/actors/Resource.d.ts +0 -53
- package/dist/actors/Resource.d.ts.map +0 -1
- package/dist/actors/Resource.js +0 -58
- package/dist/actors/Resource.js.map +0 -1
- package/dist/actors/Scaling.d.ts +0 -30
- package/dist/actors/Scaling.d.ts.map +0 -1
- package/dist/actors/Scaling.js +0 -9
- package/dist/actors/Scaling.js.map +0 -1
- package/dist/actors/Shop.d.ts +0 -40
- package/dist/actors/Shop.d.ts.map +0 -1
- package/dist/actors/Shop.js +0 -36
- package/dist/actors/Shop.js.map +0 -1
- package/dist/actors/SkillPoints.d.ts +0 -72
- package/dist/actors/SkillPoints.d.ts.map +0 -1
- package/dist/actors/SkillPoints.js +0 -87
- package/dist/actors/SkillPoints.js.map +0 -1
- package/dist/actors/StatBlock.d.ts +0 -86
- package/dist/actors/StatBlock.d.ts.map +0 -1
- package/dist/actors/StatBlock.js +0 -110
- package/dist/actors/StatBlock.js.map +0 -1
- package/dist/actors/StatusEffect.d.ts +0 -67
- package/dist/actors/StatusEffect.d.ts.map +0 -1
- package/dist/actors/StatusEffect.js +0 -59
- package/dist/actors/StatusEffect.js.map +0 -1
- package/dist/actors/Support.d.ts +0 -43
- package/dist/actors/Support.d.ts.map +0 -1
- package/dist/actors/Support.js +0 -71
- package/dist/actors/Support.js.map +0 -1
- package/dist/actors/Traits.d.ts +0 -43
- package/dist/actors/Traits.d.ts.map +0 -1
- package/dist/actors/Traits.js +0 -35
- package/dist/actors/Traits.js.map +0 -1
- package/dist/actors/craft.d.ts +0 -63
- package/dist/actors/craft.d.ts.map +0 -1
- package/dist/actors/craft.js +0 -86
- package/dist/actors/craft.js.map +0 -1
- package/dist/actors/index.d.ts +0 -46
- package/dist/actors/index.d.ts.map +0 -1
- package/dist/actors/index.js +0 -24
- package/dist/actors/index.js.map +0 -1
- package/dist/actors/skillCheck.d.ts +0 -21
- package/dist/actors/skillCheck.d.ts.map +0 -1
- package/dist/actors/skillCheck.js +0 -24
- package/dist/actors/skillCheck.js.map +0 -1
- package/dist/ai/Heuristics.d.ts +0 -240
- package/dist/ai/Heuristics.d.ts.map +0 -1
- package/dist/ai/Heuristics.js +0 -298
- package/dist/ai/Heuristics.js.map +0 -1
- package/dist/ai/Neural.d.ts +0 -65
- package/dist/ai/Neural.d.ts.map +0 -1
- package/dist/ai/Neural.js +0 -169
- package/dist/ai/Neural.js.map +0 -1
- package/dist/ai/Suggest.d.ts +0 -54
- package/dist/ai/Suggest.d.ts.map +0 -1
- package/dist/ai/Suggest.js +0 -48
- package/dist/ai/Suggest.js.map +0 -1
- package/dist/ai/index.d.ts +0 -136
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -207
- package/dist/ai/index.js.map +0 -1
- package/dist/ai/lua.d.ts +0 -74
- package/dist/ai/lua.d.ts.map +0 -1
- package/dist/ai/lua.js +0 -217
- package/dist/ai/lua.js.map +0 -1
- package/dist/ai/score.d.ts +0 -162
- package/dist/ai/score.d.ts.map +0 -1
- package/dist/ai/score.js +0 -147
- package/dist/ai/score.js.map +0 -1
- package/dist/ai/search.d.ts +0 -108
- package/dist/ai/search.d.ts.map +0 -1
- package/dist/ai/search.js +0 -148
- package/dist/ai/search.js.map +0 -1
- package/dist/assets/ByteProgress.d.ts +0 -37
- package/dist/assets/ByteProgress.d.ts.map +0 -1
- package/dist/assets/ByteProgress.js +0 -54
- package/dist/assets/ByteProgress.js.map +0 -1
- package/dist/assets/Streaming.d.ts +0 -56
- package/dist/assets/Streaming.d.ts.map +0 -1
- package/dist/assets/Streaming.js +0 -100
- package/dist/assets/Streaming.js.map +0 -1
- package/dist/assets/SvgParts.d.ts +0 -31
- package/dist/assets/SvgParts.d.ts.map +0 -1
- package/dist/assets/SvgParts.js +0 -54
- package/dist/assets/SvgParts.js.map +0 -1
- package/dist/assets/SvgSource.d.ts +0 -3
- package/dist/assets/SvgSource.d.ts.map +0 -1
- package/dist/assets/SvgSource.js +0 -22
- package/dist/assets/SvgSource.js.map +0 -1
- package/dist/assets/binary.d.ts +0 -52
- package/dist/assets/binary.d.ts.map +0 -1
- package/dist/assets/binary.js +0 -57
- package/dist/assets/binary.js.map +0 -1
- package/dist/assets/index.d.ts +0 -27
- package/dist/assets/index.d.ts.map +0 -1
- package/dist/assets/index.js +0 -20
- package/dist/assets/index.js.map +0 -1
- package/dist/assets/loader.d.ts +0 -70
- package/dist/assets/loader.d.ts.map +0 -1
- package/dist/assets/loader.js +0 -115
- package/dist/assets/loader.js.map +0 -1
- package/dist/assets/paths.d.ts +0 -73
- package/dist/assets/paths.d.ts.map +0 -1
- package/dist/assets/paths.js +0 -91
- package/dist/assets/paths.js.map +0 -1
- package/dist/assets/svg.d.ts +0 -87
- package/dist/assets/svg.d.ts.map +0 -1
- package/dist/assets/svg.js +0 -166
- package/dist/assets/svg.js.map +0 -1
- package/dist/audio/AudioLoader.d.ts +0 -28
- package/dist/audio/AudioLoader.d.ts.map +0 -1
- package/dist/audio/AudioLoader.js +0 -53
- package/dist/audio/AudioLoader.js.map +0 -1
- package/dist/audio/Captions.d.ts +0 -27
- package/dist/audio/Captions.d.ts.map +0 -1
- package/dist/audio/Captions.js +0 -16
- package/dist/audio/Captions.js.map +0 -1
- package/dist/audio/Channels.d.ts +0 -218
- package/dist/audio/Channels.d.ts.map +0 -1
- package/dist/audio/Channels.js +0 -486
- package/dist/audio/Channels.js.map +0 -1
- package/dist/audio/LoopTags.d.ts +0 -37
- package/dist/audio/LoopTags.d.ts.map +0 -1
- package/dist/audio/LoopTags.js +0 -116
- package/dist/audio/LoopTags.js.map +0 -1
- package/dist/audio/Midi.d.ts +0 -184
- package/dist/audio/Midi.d.ts.map +0 -1
- package/dist/audio/Midi.js +0 -339
- package/dist/audio/Midi.js.map +0 -1
- package/dist/audio/MidiRender.d.ts +0 -113
- package/dist/audio/MidiRender.d.ts.map +0 -1
- package/dist/audio/MidiRender.js +0 -371
- package/dist/audio/MidiRender.js.map +0 -1
- package/dist/audio/Music.d.ts +0 -70
- package/dist/audio/Music.d.ts.map +0 -1
- package/dist/audio/Music.js +0 -191
- package/dist/audio/Music.js.map +0 -1
- package/dist/audio/MusicPlayer.d.ts +0 -80
- package/dist/audio/MusicPlayer.d.ts.map +0 -1
- package/dist/audio/MusicPlayer.js +0 -147
- package/dist/audio/MusicPlayer.js.map +0 -1
- package/dist/audio/Orchestrator.d.ts +0 -58
- package/dist/audio/Orchestrator.d.ts.map +0 -1
- package/dist/audio/Orchestrator.js +0 -74
- package/dist/audio/Orchestrator.js.map +0 -1
- package/dist/audio/Playable.d.ts +0 -31
- package/dist/audio/Playable.d.ts.map +0 -1
- package/dist/audio/Playable.js +0 -29
- package/dist/audio/Playable.js.map +0 -1
- package/dist/audio/Positional.d.ts +0 -125
- package/dist/audio/Positional.d.ts.map +0 -1
- package/dist/audio/Positional.js +0 -135
- package/dist/audio/Positional.js.map +0 -1
- package/dist/audio/SampleDecoder.d.ts +0 -55
- package/dist/audio/SampleDecoder.d.ts.map +0 -1
- package/dist/audio/SampleDecoder.js +0 -74
- package/dist/audio/SampleDecoder.js.map +0 -1
- package/dist/audio/Sound.d.ts +0 -57
- package/dist/audio/Sound.d.ts.map +0 -1
- package/dist/audio/Sound.js +0 -79
- package/dist/audio/Sound.js.map +0 -1
- package/dist/audio/SoundFont.d.ts +0 -192
- package/dist/audio/SoundFont.d.ts.map +0 -1
- package/dist/audio/SoundFont.js +0 -862
- package/dist/audio/SoundFont.js.map +0 -1
- package/dist/audio/Synth.d.ts +0 -64
- package/dist/audio/Synth.d.ts.map +0 -1
- package/dist/audio/Synth.js +0 -133
- package/dist/audio/Synth.js.map +0 -1
- package/dist/audio/humanize/Groove.d.ts +0 -80
- package/dist/audio/humanize/Groove.d.ts.map +0 -1
- package/dist/audio/humanize/Groove.js +0 -102
- package/dist/audio/humanize/Groove.js.map +0 -1
- package/dist/audio/humanize/GrooveConverter.d.ts +0 -49
- package/dist/audio/humanize/GrooveConverter.d.ts.map +0 -1
- package/dist/audio/humanize/GrooveConverter.js +0 -344
- package/dist/audio/humanize/GrooveConverter.js.map +0 -1
- package/dist/audio/humanize/GrooveExtractor.d.ts +0 -49
- package/dist/audio/humanize/GrooveExtractor.d.ts.map +0 -1
- package/dist/audio/humanize/GrooveExtractor.js +0 -179
- package/dist/audio/humanize/GrooveExtractor.js.map +0 -1
- package/dist/audio/humanize/GrooveHumanizer.d.ts +0 -34
- package/dist/audio/humanize/GrooveHumanizer.d.ts.map +0 -1
- package/dist/audio/humanize/GrooveHumanizer.js +0 -37
- package/dist/audio/humanize/GrooveHumanizer.js.map +0 -1
- package/dist/audio/humanize/Humanize.d.ts +0 -54
- package/dist/audio/humanize/Humanize.d.ts.map +0 -1
- package/dist/audio/humanize/Humanize.js +0 -239
- package/dist/audio/humanize/Humanize.js.map +0 -1
- package/dist/audio/humanize/HumanizerFactory.d.ts +0 -68
- package/dist/audio/humanize/HumanizerFactory.d.ts.map +0 -1
- package/dist/audio/humanize/HumanizerFactory.js +0 -84
- package/dist/audio/humanize/HumanizerFactory.js.map +0 -1
- package/dist/audio/humanize/LiteHumanizer.d.ts +0 -30
- package/dist/audio/humanize/LiteHumanizer.d.ts.map +0 -1
- package/dist/audio/humanize/LiteHumanizer.js +0 -35
- package/dist/audio/humanize/LiteHumanizer.js.map +0 -1
- package/dist/audio/humanize/Onsets.d.ts +0 -26
- package/dist/audio/humanize/Onsets.d.ts.map +0 -1
- package/dist/audio/humanize/Onsets.js +0 -164
- package/dist/audio/humanize/Onsets.js.map +0 -1
- package/dist/audio/index.d.ts +0 -43
- package/dist/audio/index.d.ts.map +0 -1
- package/dist/audio/index.js +0 -22
- package/dist/audio/index.js.map +0 -1
- package/dist/battle/AttackDialog.d.ts +0 -75
- package/dist/battle/AttackDialog.d.ts.map +0 -1
- package/dist/battle/AttackDialog.js +0 -115
- package/dist/battle/AttackDialog.js.map +0 -1
- package/dist/battle/AttackPreview.d.ts +0 -70
- package/dist/battle/AttackPreview.d.ts.map +0 -1
- package/dist/battle/AttackPreview.js +0 -78
- package/dist/battle/AttackPreview.js.map +0 -1
- package/dist/battle/BattleAI.d.ts +0 -40
- package/dist/battle/BattleAI.d.ts.map +0 -1
- package/dist/battle/BattleAI.js +0 -63
- package/dist/battle/BattleAI.js.map +0 -1
- package/dist/battle/BattleStats.d.ts +0 -45
- package/dist/battle/BattleStats.d.ts.map +0 -1
- package/dist/battle/BattleStats.js +0 -63
- package/dist/battle/BattleStats.js.map +0 -1
- package/dist/battle/Evolution.d.ts +0 -34
- package/dist/battle/Evolution.d.ts.map +0 -1
- package/dist/battle/Evolution.js +0 -37
- package/dist/battle/Evolution.js.map +0 -1
- package/dist/battle/Field.d.ts +0 -36
- package/dist/battle/Field.d.ts.map +0 -1
- package/dist/battle/Field.js +0 -31
- package/dist/battle/Field.js.map +0 -1
- package/dist/battle/Hooks.d.ts +0 -39
- package/dist/battle/Hooks.d.ts.map +0 -1
- package/dist/battle/Hooks.js +0 -38
- package/dist/battle/Hooks.js.map +0 -1
- package/dist/battle/Move.d.ts +0 -45
- package/dist/battle/Move.d.ts.map +0 -1
- package/dist/battle/Move.js +0 -23
- package/dist/battle/Move.js.map +0 -1
- package/dist/battle/Party.d.ts +0 -32
- package/dist/battle/Party.d.ts.map +0 -1
- package/dist/battle/Party.js +0 -62
- package/dist/battle/Party.js.map +0 -1
- package/dist/battle/Species.d.ts +0 -50
- package/dist/battle/Species.d.ts.map +0 -1
- package/dist/battle/Species.js +0 -41
- package/dist/battle/Species.js.map +0 -1
- package/dist/battle/StatStages.d.ts +0 -52
- package/dist/battle/StatStages.d.ts.map +0 -1
- package/dist/battle/StatStages.js +0 -50
- package/dist/battle/StatStages.js.map +0 -1
- package/dist/battle/TypeMatrix.d.ts +0 -25
- package/dist/battle/TypeMatrix.d.ts.map +0 -1
- package/dist/battle/TypeMatrix.js +0 -35
- package/dist/battle/TypeMatrix.js.map +0 -1
- package/dist/battle/UnitSelector.d.ts +0 -72
- package/dist/battle/UnitSelector.d.ts.map +0 -1
- package/dist/battle/UnitSelector.js +0 -117
- package/dist/battle/UnitSelector.js.map +0 -1
- package/dist/battle/Whiteboard.d.ts +0 -50
- package/dist/battle/Whiteboard.d.ts.map +0 -1
- package/dist/battle/Whiteboard.js +0 -94
- package/dist/battle/Whiteboard.js.map +0 -1
- package/dist/battle/index.d.ts +0 -26
- package/dist/battle/index.d.ts.map +0 -1
- package/dist/battle/index.js +0 -15
- package/dist/battle/index.js.map +0 -1
- package/dist/board/Army.d.ts +0 -92
- package/dist/board/Army.d.ts.map +0 -1
- package/dist/board/Army.js +0 -123
- package/dist/board/Army.js.map +0 -1
- package/dist/board/Classics.d.ts +0 -419
- package/dist/board/Classics.d.ts.map +0 -1
- package/dist/board/Classics.js +0 -754
- package/dist/board/Classics.js.map +0 -1
- package/dist/board/Engine.d.ts +0 -93
- package/dist/board/Engine.d.ts.map +0 -1
- package/dist/board/Engine.js +0 -545
- package/dist/board/Engine.js.map +0 -1
- package/dist/board/FogOfWar.d.ts +0 -79
- package/dist/board/FogOfWar.d.ts.map +0 -1
- package/dist/board/FogOfWar.js +0 -150
- package/dist/board/FogOfWar.js.map +0 -1
- package/dist/board/HexSkirmish.d.ts +0 -213
- package/dist/board/HexSkirmish.d.ts.map +0 -1
- package/dist/board/HexSkirmish.js +0 -329
- package/dist/board/HexSkirmish.js.map +0 -1
- package/dist/board/Tactics.d.ts +0 -212
- package/dist/board/Tactics.d.ts.map +0 -1
- package/dist/board/Tactics.js +0 -305
- package/dist/board/Tactics.js.map +0 -1
- package/dist/board/bitboard.d.ts +0 -132
- package/dist/board/bitboard.d.ts.map +0 -1
- package/dist/board/bitboard.js +0 -495
- package/dist/board/bitboard.js.map +0 -1
- package/dist/board/chess.d.ts +0 -167
- package/dist/board/chess.d.ts.map +0 -1
- package/dist/board/chess.js +0 -578
- package/dist/board/chess.js.map +0 -1
- package/dist/board/index.d.ts +0 -23
- package/dist/board/index.d.ts.map +0 -1
- package/dist/board/index.js +0 -12
- package/dist/board/index.js.map +0 -1
- package/dist/board/openings.d.ts +0 -58
- package/dist/board/openings.d.ts.map +0 -1
- package/dist/board/openings.js +0 -45
- package/dist/board/openings.js.map +0 -1
- package/dist/board/tablebase.d.ts +0 -118
- package/dist/board/tablebase.d.ts.map +0 -1
- package/dist/board/tablebase.js +0 -414
- package/dist/board/tablebase.js.map +0 -1
- package/dist/board/tourney.d.ts +0 -97
- package/dist/board/tourney.d.ts.map +0 -1
- package/dist/board/tourney.js +0 -1019
- package/dist/board/tourney.js.map +0 -1
- package/dist/core/Achievements.d.ts +0 -101
- package/dist/core/Achievements.d.ts.map +0 -1
- package/dist/core/Achievements.js +0 -141
- package/dist/core/Achievements.js.map +0 -1
- package/dist/core/ActionJournal.d.ts +0 -43
- package/dist/core/ActionJournal.d.ts.map +0 -1
- package/dist/core/ActionJournal.js +0 -77
- package/dist/core/ActionJournal.js.map +0 -1
- package/dist/core/Blob.d.ts +0 -79
- package/dist/core/Blob.d.ts.map +0 -1
- package/dist/core/Blob.js +0 -140
- package/dist/core/Blob.js.map +0 -1
- package/dist/core/Clone.d.ts +0 -31
- package/dist/core/Clone.d.ts.map +0 -1
- package/dist/core/Clone.js +0 -84
- package/dist/core/Clone.js.map +0 -1
- package/dist/core/Collection.d.ts +0 -59
- package/dist/core/Collection.d.ts.map +0 -1
- package/dist/core/Collection.js +0 -77
- package/dist/core/Collection.js.map +0 -1
- package/dist/core/Csv.d.ts +0 -74
- package/dist/core/Csv.d.ts.map +0 -1
- package/dist/core/Csv.js +0 -201
- package/dist/core/Csv.js.map +0 -1
- package/dist/core/DialogueText.d.ts +0 -72
- package/dist/core/DialogueText.d.ts.map +0 -1
- package/dist/core/DialogueText.js +0 -68
- package/dist/core/DialogueText.js.map +0 -1
- package/dist/core/Entity.d.ts +0 -42
- package/dist/core/Entity.d.ts.map +0 -1
- package/dist/core/Entity.js +0 -61
- package/dist/core/Entity.js.map +0 -1
- package/dist/core/Feedback.d.ts +0 -27
- package/dist/core/Feedback.d.ts.map +0 -1
- package/dist/core/Feedback.js +0 -33
- package/dist/core/Feedback.js.map +0 -1
- package/dist/core/FixedStepper.d.ts +0 -38
- package/dist/core/FixedStepper.d.ts.map +0 -1
- package/dist/core/FixedStepper.js +0 -56
- package/dist/core/FixedStepper.js.map +0 -1
- package/dist/core/Grid.d.ts +0 -179
- package/dist/core/Grid.d.ts.map +0 -1
- package/dist/core/Grid.js +0 -201
- package/dist/core/Grid.js.map +0 -1
- package/dist/core/Handles.d.ts +0 -42
- package/dist/core/Handles.d.ts.map +0 -1
- package/dist/core/Handles.js +0 -38
- package/dist/core/Handles.js.map +0 -1
- package/dist/core/Hex.d.ts +0 -79
- package/dist/core/Hex.d.ts.map +0 -1
- package/dist/core/Hex.js +0 -161
- package/dist/core/Hex.js.map +0 -1
- package/dist/core/Hooks.d.ts +0 -48
- package/dist/core/Hooks.d.ts.map +0 -1
- package/dist/core/Hooks.js +0 -33
- package/dist/core/Hooks.js.map +0 -1
- package/dist/core/HttpTransport.d.ts +0 -53
- package/dist/core/HttpTransport.d.ts.map +0 -1
- package/dist/core/HttpTransport.js +0 -108
- package/dist/core/HttpTransport.js.map +0 -1
- package/dist/core/Input.d.ts +0 -256
- package/dist/core/Input.d.ts.map +0 -1
- package/dist/core/Input.js +0 -557
- package/dist/core/Input.js.map +0 -1
- package/dist/core/JavaRandom.d.ts +0 -55
- package/dist/core/JavaRandom.d.ts.map +0 -1
- package/dist/core/JavaRandom.js +0 -81
- package/dist/core/JavaRandom.js.map +0 -1
- package/dist/core/Loading.d.ts +0 -65
- package/dist/core/Loading.d.ts.map +0 -1
- package/dist/core/Loading.js +0 -119
- package/dist/core/Loading.js.map +0 -1
- package/dist/core/Log.d.ts +0 -48
- package/dist/core/Log.d.ts.map +0 -1
- package/dist/core/Log.js +0 -59
- package/dist/core/Log.js.map +0 -1
- package/dist/core/Math.d.ts +0 -14
- package/dist/core/Math.d.ts.map +0 -1
- package/dist/core/Math.js +0 -16
- package/dist/core/Math.js.map +0 -1
- package/dist/core/Motion.d.ts +0 -47
- package/dist/core/Motion.d.ts.map +0 -1
- package/dist/core/Motion.js +0 -122
- package/dist/core/Motion.js.map +0 -1
- package/dist/core/Multiplayer.d.ts +0 -101
- package/dist/core/Multiplayer.d.ts.map +0 -1
- package/dist/core/Multiplayer.js +0 -156
- package/dist/core/Multiplayer.js.map +0 -1
- package/dist/core/News.d.ts +0 -51
- package/dist/core/News.d.ts.map +0 -1
- package/dist/core/News.js +0 -65
- package/dist/core/News.js.map +0 -1
- package/dist/core/Pathfinding.d.ts +0 -41
- package/dist/core/Pathfinding.d.ts.map +0 -1
- package/dist/core/Pathfinding.js +0 -86
- package/dist/core/Pathfinding.js.map +0 -1
- package/dist/core/PlayerInput.d.ts +0 -57
- package/dist/core/PlayerInput.d.ts.map +0 -1
- package/dist/core/PlayerInput.js +0 -82
- package/dist/core/PlayerInput.js.map +0 -1
- package/dist/core/Presentation.d.ts +0 -56
- package/dist/core/Presentation.d.ts.map +0 -1
- package/dist/core/Presentation.js +0 -78
- package/dist/core/Presentation.js.map +0 -1
- package/dist/core/Random.d.ts +0 -259
- package/dist/core/Random.d.ts.map +0 -1
- package/dist/core/Random.js +0 -408
- package/dist/core/Random.js.map +0 -1
- package/dist/core/Reactions.d.ts +0 -67
- package/dist/core/Reactions.d.ts.map +0 -1
- package/dist/core/Reactions.js +0 -92
- package/dist/core/Reactions.js.map +0 -1
- package/dist/core/Registry.d.ts +0 -31
- package/dist/core/Registry.d.ts.map +0 -1
- package/dist/core/Registry.js +0 -46
- package/dist/core/Registry.js.map +0 -1
- package/dist/core/Replay.d.ts +0 -126
- package/dist/core/Replay.d.ts.map +0 -1
- package/dist/core/Replay.js +0 -162
- package/dist/core/Replay.js.map +0 -1
- package/dist/core/ReplayFile.d.ts +0 -197
- package/dist/core/ReplayFile.d.ts.map +0 -1
- package/dist/core/ReplayFile.js +0 -257
- package/dist/core/ReplayFile.js.map +0 -1
- package/dist/core/RunHistory.d.ts +0 -54
- package/dist/core/RunHistory.d.ts.map +0 -1
- package/dist/core/RunHistory.js +0 -40
- package/dist/core/RunHistory.js.map +0 -1
- package/dist/core/Sanitize.d.ts +0 -101
- package/dist/core/Sanitize.d.ts.map +0 -1
- package/dist/core/Sanitize.js +0 -162
- package/dist/core/Sanitize.js.map +0 -1
- package/dist/core/Save.d.ts +0 -123
- package/dist/core/Save.d.ts.map +0 -1
- package/dist/core/Save.js +0 -216
- package/dist/core/Save.js.map +0 -1
- package/dist/core/SaveSync.d.ts +0 -43
- package/dist/core/SaveSync.d.ts.map +0 -1
- package/dist/core/SaveSync.js +0 -56
- package/dist/core/SaveSync.js.map +0 -1
- package/dist/core/Scene.d.ts +0 -63
- package/dist/core/Scene.d.ts.map +0 -1
- package/dist/core/Scene.js +0 -81
- package/dist/core/Scene.js.map +0 -1
- package/dist/core/SceneComponents.d.ts +0 -67
- package/dist/core/SceneComponents.d.ts.map +0 -1
- package/dist/core/SceneComponents.js +0 -76
- package/dist/core/SceneComponents.js.map +0 -1
- package/dist/core/SceneStack.d.ts +0 -61
- package/dist/core/SceneStack.d.ts.map +0 -1
- package/dist/core/SceneStack.js +0 -91
- package/dist/core/SceneStack.js.map +0 -1
- package/dist/core/Scramble.d.ts +0 -21
- package/dist/core/Scramble.d.ts.map +0 -1
- package/dist/core/Scramble.js +0 -52
- package/dist/core/Scramble.js.map +0 -1
- package/dist/core/Session.d.ts +0 -31
- package/dist/core/Session.d.ts.map +0 -1
- package/dist/core/Session.js +0 -11
- package/dist/core/Session.js.map +0 -1
- package/dist/core/Settings.d.ts +0 -96
- package/dist/core/Settings.d.ts.map +0 -1
- package/dist/core/Settings.js +0 -190
- package/dist/core/Settings.js.map +0 -1
- package/dist/core/Signal.d.ts +0 -35
- package/dist/core/Signal.d.ts.map +0 -1
- package/dist/core/Signal.js +0 -41
- package/dist/core/Signal.js.map +0 -1
- package/dist/core/Spawner.d.ts +0 -65
- package/dist/core/Spawner.d.ts.map +0 -1
- package/dist/core/Spawner.js +0 -82
- package/dist/core/Spawner.js.map +0 -1
- package/dist/core/State.d.ts +0 -97
- package/dist/core/State.d.ts.map +0 -1
- package/dist/core/State.js +0 -177
- package/dist/core/State.js.map +0 -1
- package/dist/core/Stats.d.ts +0 -46
- package/dist/core/Stats.d.ts.map +0 -1
- package/dist/core/Stats.js +0 -47
- package/dist/core/Stats.js.map +0 -1
- package/dist/core/StoredValue.d.ts +0 -30
- package/dist/core/StoredValue.d.ts.map +0 -1
- package/dist/core/StoredValue.js +0 -38
- package/dist/core/StoredValue.js.map +0 -1
- package/dist/core/SyncGuard.d.ts +0 -57
- package/dist/core/SyncGuard.d.ts.map +0 -1
- package/dist/core/SyncGuard.js +0 -116
- package/dist/core/SyncGuard.js.map +0 -1
- package/dist/core/Telemetry.d.ts +0 -63
- package/dist/core/Telemetry.d.ts.map +0 -1
- package/dist/core/Telemetry.js +0 -83
- package/dist/core/Telemetry.js.map +0 -1
- package/dist/core/Twee.d.ts +0 -101
- package/dist/core/Twee.d.ts.map +0 -1
- package/dist/core/Twee.js +0 -174
- package/dist/core/Twee.js.map +0 -1
- package/dist/core/Tween.d.ts +0 -60
- package/dist/core/Tween.d.ts.map +0 -1
- package/dist/core/Tween.js +0 -98
- package/dist/core/Tween.js.map +0 -1
- package/dist/core/UndoHistory.d.ts +0 -52
- package/dist/core/UndoHistory.d.ts.map +0 -1
- package/dist/core/UndoHistory.js +0 -49
- package/dist/core/UndoHistory.js.map +0 -1
- package/dist/core/index.d.ts +0 -94
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -53
- package/dist/core/index.js.map +0 -1
- package/dist/headless/index.d.ts +0 -87
- package/dist/headless/index.d.ts.map +0 -1
- package/dist/headless/index.js +0 -87
- package/dist/headless/index.js.map +0 -1
- package/dist/i18n/Content.d.ts +0 -151
- package/dist/i18n/Content.d.ts.map +0 -1
- package/dist/i18n/Content.js +0 -218
- package/dist/i18n/Content.js.map +0 -1
- package/dist/i18n/EditSession.d.ts +0 -101
- package/dist/i18n/EditSession.d.ts.map +0 -1
- package/dist/i18n/EditSession.js +0 -150
- package/dist/i18n/EditSession.js.map +0 -1
- package/dist/i18n/Fluent.d.ts +0 -7
- package/dist/i18n/Fluent.d.ts.map +0 -1
- package/dist/i18n/Fluent.js +0 -98
- package/dist/i18n/Fluent.js.map +0 -1
- package/dist/i18n/Format.d.ts +0 -25
- package/dist/i18n/Format.d.ts.map +0 -1
- package/dist/i18n/Format.js +0 -32
- package/dist/i18n/Format.js.map +0 -1
- package/dist/i18n/FormatSpec.d.ts +0 -76
- package/dist/i18n/FormatSpec.d.ts.map +0 -1
- package/dist/i18n/FormatSpec.js +0 -306
- package/dist/i18n/FormatSpec.js.map +0 -1
- package/dist/i18n/Po.d.ts +0 -54
- package/dist/i18n/Po.d.ts.map +0 -1
- package/dist/i18n/Po.js +0 -192
- package/dist/i18n/Po.js.map +0 -1
- package/dist/i18n/SemanticMessage.d.ts +0 -84
- package/dist/i18n/SemanticMessage.d.ts.map +0 -1
- package/dist/i18n/SemanticMessage.js +0 -54
- package/dist/i18n/SemanticMessage.js.map +0 -1
- package/dist/i18n/SoundMarkers.d.ts +0 -38
- package/dist/i18n/SoundMarkers.d.ts.map +0 -1
- package/dist/i18n/SoundMarkers.js +0 -48
- package/dist/i18n/SoundMarkers.js.map +0 -1
- package/dist/i18n/Validate.d.ts +0 -82
- package/dist/i18n/Validate.d.ts.map +0 -1
- package/dist/i18n/Validate.js +0 -106
- package/dist/i18n/Validate.js.map +0 -1
- package/dist/i18n/index.d.ts +0 -177
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/index.js +0 -331
- package/dist/i18n/index.js.map +0 -1
- package/dist/index.d.ts +0 -26
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -26
- package/dist/index.js.map +0 -1
- package/dist/mw_games.global.js +0 -1407
- package/dist/mwl/MapFile.d.ts +0 -41
- package/dist/mwl/MapFile.d.ts.map +0 -1
- package/dist/mwl/MapFile.js +0 -53
- package/dist/mwl/MapFile.js.map +0 -1
- package/dist/mwl/actors.d.ts +0 -62
- package/dist/mwl/actors.d.ts.map +0 -1
- package/dist/mwl/actors.js +0 -82
- package/dist/mwl/actors.js.map +0 -1
- package/dist/mwl/campaign.d.ts +0 -51
- package/dist/mwl/campaign.d.ts.map +0 -1
- package/dist/mwl/campaign.js +0 -58
- package/dist/mwl/campaign.js.map +0 -1
- package/dist/mwl/carryover.d.ts +0 -86
- package/dist/mwl/carryover.d.ts.map +0 -1
- package/dist/mwl/carryover.js +0 -70
- package/dist/mwl/carryover.js.map +0 -1
- package/dist/mwl/catalog.d.ts +0 -98
- package/dist/mwl/catalog.d.ts.map +0 -1
- package/dist/mwl/catalog.js +0 -259
- package/dist/mwl/catalog.js.map +0 -1
- package/dist/mwl/compiler.d.ts +0 -135
- package/dist/mwl/compiler.d.ts.map +0 -1
- package/dist/mwl/compiler.js +0 -216
- package/dist/mwl/compiler.js.map +0 -1
- package/dist/mwl/conditions.d.ts +0 -18
- package/dist/mwl/conditions.d.ts.map +0 -1
- package/dist/mwl/conditions.js +0 -171
- package/dist/mwl/conditions.js.map +0 -1
- package/dist/mwl/content.d.ts +0 -140
- package/dist/mwl/content.d.ts.map +0 -1
- package/dist/mwl/content.js +0 -179
- package/dist/mwl/content.js.map +0 -1
- package/dist/mwl/expression.d.ts +0 -42
- package/dist/mwl/expression.d.ts.map +0 -1
- package/dist/mwl/expression.js +0 -164
- package/dist/mwl/expression.js.map +0 -1
- package/dist/mwl/grammar.d.ts +0 -100
- package/dist/mwl/grammar.d.ts.map +0 -1
- package/dist/mwl/grammar.js +0 -588
- package/dist/mwl/grammar.js.map +0 -1
- package/dist/mwl/hooks.d.ts +0 -201
- package/dist/mwl/hooks.d.ts.map +0 -1
- package/dist/mwl/hooks.js +0 -165
- package/dist/mwl/hooks.js.map +0 -1
- package/dist/mwl/index.d.ts +0 -40
- package/dist/mwl/index.d.ts.map +0 -1
- package/dist/mwl/index.js +0 -20
- package/dist/mwl/index.js.map +0 -1
- package/dist/mwl/objects.d.ts +0 -31
- package/dist/mwl/objects.d.ts.map +0 -1
- package/dist/mwl/objects.js +0 -83
- package/dist/mwl/objects.js.map +0 -1
- package/dist/mwl/persistence.d.ts +0 -67
- package/dist/mwl/persistence.d.ts.map +0 -1
- package/dist/mwl/persistence.js +0 -135
- package/dist/mwl/persistence.js.map +0 -1
- package/dist/mwl/presentation.d.ts +0 -86
- package/dist/mwl/presentation.d.ts.map +0 -1
- package/dist/mwl/presentation.js +0 -419
- package/dist/mwl/presentation.js.map +0 -1
- package/dist/mwl/pyroeis-runtime.d.ts +0 -82
- package/dist/mwl/pyroeis-runtime.d.ts.map +0 -1
- package/dist/mwl/pyroeis-runtime.js +0 -535
- package/dist/mwl/pyroeis-runtime.js.map +0 -1
- package/dist/mwl/pyroeis.d.ts +0 -54
- package/dist/mwl/pyroeis.d.ts.map +0 -1
- package/dist/mwl/pyroeis.js +0 -189
- package/dist/mwl/pyroeis.js.map +0 -1
- package/dist/mwl/readers.d.ts +0 -77
- package/dist/mwl/readers.d.ts.map +0 -1
- package/dist/mwl/readers.js +0 -150
- package/dist/mwl/readers.js.map +0 -1
- package/dist/mwl/report.d.ts +0 -44
- package/dist/mwl/report.d.ts.map +0 -1
- package/dist/mwl/report.js +0 -88
- package/dist/mwl/report.js.map +0 -1
- package/dist/mwl/runtime.d.ts +0 -577
- package/dist/mwl/runtime.d.ts.map +0 -1
- package/dist/mwl/runtime.js +0 -1741
- package/dist/mwl/runtime.js.map +0 -1
- package/dist/mwl/schema.d.ts +0 -151
- package/dist/mwl/schema.d.ts.map +0 -1
- package/dist/mwl/schema.js +0 -979
- package/dist/mwl/schema.js.map +0 -1
- package/dist/mwl/scripts.d.ts +0 -26
- package/dist/mwl/scripts.d.ts.map +0 -1
- package/dist/mwl/scripts.js +0 -34
- package/dist/mwl/scripts.js.map +0 -1
- package/dist/mwl/tables.d.ts +0 -95
- package/dist/mwl/tables.d.ts.map +0 -1
- package/dist/mwl/tables.js +0 -100
- package/dist/mwl/tables.js.map +0 -1
- package/dist/mwl/utils.d.ts +0 -10
- package/dist/mwl/utils.d.ts.map +0 -1
- package/dist/mwl/utils.js +0 -40
- package/dist/mwl/utils.js.map +0 -1
- package/dist/physics/PhysicsWorld.d.ts +0 -158
- package/dist/physics/PhysicsWorld.d.ts.map +0 -1
- package/dist/physics/PhysicsWorld.js +0 -375
- package/dist/physics/PhysicsWorld.js.map +0 -1
- package/dist/physics/XpbdWorld.d.ts +0 -213
- package/dist/physics/XpbdWorld.d.ts.map +0 -1
- package/dist/physics/XpbdWorld.js +0 -336
- package/dist/physics/XpbdWorld.js.map +0 -1
- package/dist/physics/cloth/index.d.ts +0 -99
- package/dist/physics/cloth/index.d.ts.map +0 -1
- package/dist/physics/cloth/index.js +0 -226
- package/dist/physics/cloth/index.js.map +0 -1
- package/dist/physics/index.d.ts +0 -7
- package/dist/physics/index.d.ts.map +0 -1
- package/dist/physics/index.js +0 -4
- package/dist/physics/index.js.map +0 -1
- package/dist/physics/spring/index.d.ts +0 -91
- package/dist/physics/spring/index.d.ts.map +0 -1
- package/dist/physics/spring/index.js +0 -120
- package/dist/physics/spring/index.js.map +0 -1
- package/dist/physics/xpbd.d.ts +0 -3
- package/dist/physics/xpbd.d.ts.map +0 -1
- package/dist/physics/xpbd.js +0 -2
- package/dist/physics/xpbd.js.map +0 -1
- package/dist/roguelike/Boss.d.ts +0 -79
- package/dist/roguelike/Boss.d.ts.map +0 -1
- package/dist/roguelike/Boss.js +0 -126
- package/dist/roguelike/Boss.js.map +0 -1
- package/dist/roguelike/Cave.d.ts +0 -124
- package/dist/roguelike/Cave.d.ts.map +0 -1
- package/dist/roguelike/Cave.js +0 -216
- package/dist/roguelike/Cave.js.map +0 -1
- package/dist/roguelike/Combat.d.ts +0 -35
- package/dist/roguelike/Combat.d.ts.map +0 -1
- package/dist/roguelike/Combat.js +0 -33
- package/dist/roguelike/Combat.js.map +0 -1
- package/dist/roguelike/ContentRoll.d.ts +0 -53
- package/dist/roguelike/ContentRoll.d.ts.map +0 -1
- package/dist/roguelike/ContentRoll.js +0 -48
- package/dist/roguelike/ContentRoll.js.map +0 -1
- package/dist/roguelike/Doors.d.ts +0 -73
- package/dist/roguelike/Doors.d.ts.map +0 -1
- package/dist/roguelike/Doors.js +0 -115
- package/dist/roguelike/Doors.js.map +0 -1
- package/dist/roguelike/DungeonParity.d.ts +0 -57
- package/dist/roguelike/DungeonParity.d.ts.map +0 -1
- package/dist/roguelike/DungeonParity.js +0 -87
- package/dist/roguelike/DungeonParity.js.map +0 -1
- package/dist/roguelike/Elevation.d.ts +0 -41
- package/dist/roguelike/Elevation.d.ts.map +0 -1
- package/dist/roguelike/Elevation.js +0 -52
- package/dist/roguelike/Elevation.js.map +0 -1
- package/dist/roguelike/Features.d.ts +0 -59
- package/dist/roguelike/Features.d.ts.map +0 -1
- package/dist/roguelike/Features.js +0 -76
- package/dist/roguelike/Features.js.map +0 -1
- package/dist/roguelike/FieldOfView.d.ts +0 -86
- package/dist/roguelike/FieldOfView.d.ts.map +0 -1
- package/dist/roguelike/FieldOfView.js +0 -148
- package/dist/roguelike/FieldOfView.js.map +0 -1
- package/dist/roguelike/Level.d.ts +0 -139
- package/dist/roguelike/Level.d.ts.map +0 -1
- package/dist/roguelike/Level.js +0 -189
- package/dist/roguelike/Level.js.map +0 -1
- package/dist/roguelike/MonsterAI.d.ts +0 -54
- package/dist/roguelike/MonsterAI.d.ts.map +0 -1
- package/dist/roguelike/MonsterAI.js +0 -83
- package/dist/roguelike/MonsterAI.js.map +0 -1
- package/dist/roguelike/MultiStageAbility.d.ts +0 -59
- package/dist/roguelike/MultiStageAbility.d.ts.map +0 -1
- package/dist/roguelike/MultiStageAbility.js +0 -76
- package/dist/roguelike/MultiStageAbility.js.map +0 -1
- package/dist/roguelike/MultiTurnBeam.d.ts +0 -108
- package/dist/roguelike/MultiTurnBeam.d.ts.map +0 -1
- package/dist/roguelike/MultiTurnBeam.js +0 -164
- package/dist/roguelike/MultiTurnBeam.js.map +0 -1
- package/dist/roguelike/Overworld.d.ts +0 -89
- package/dist/roguelike/Overworld.d.ts.map +0 -1
- package/dist/roguelike/Overworld.js +0 -325
- package/dist/roguelike/Overworld.js.map +0 -1
- package/dist/roguelike/Pathfinder.d.ts +0 -103
- package/dist/roguelike/Pathfinder.d.ts.map +0 -1
- package/dist/roguelike/Pathfinder.js +0 -213
- package/dist/roguelike/Pathfinder.js.map +0 -1
- package/dist/roguelike/Placement.d.ts +0 -62
- package/dist/roguelike/Placement.d.ts.map +0 -1
- package/dist/roguelike/Placement.js +0 -79
- package/dist/roguelike/Placement.js.map +0 -1
- package/dist/roguelike/RoomBuilders.d.ts +0 -60
- package/dist/roguelike/RoomBuilders.d.ts.map +0 -1
- package/dist/roguelike/RoomBuilders.js +0 -57
- package/dist/roguelike/RoomBuilders.js.map +0 -1
- package/dist/roguelike/Scheduler.d.ts +0 -96
- package/dist/roguelike/Scheduler.d.ts.map +0 -1
- package/dist/roguelike/Scheduler.js +0 -154
- package/dist/roguelike/Scheduler.js.map +0 -1
- package/dist/roguelike/Secrets.d.ts +0 -57
- package/dist/roguelike/Secrets.d.ts.map +0 -1
- package/dist/roguelike/Secrets.js +0 -77
- package/dist/roguelike/Secrets.js.map +0 -1
- package/dist/roguelike/Stealth.d.ts +0 -47
- package/dist/roguelike/Stealth.d.ts.map +0 -1
- package/dist/roguelike/Stealth.js +0 -48
- package/dist/roguelike/Stealth.js.map +0 -1
- package/dist/roguelike/Targeting.d.ts +0 -312
- package/dist/roguelike/Targeting.d.ts.map +0 -1
- package/dist/roguelike/Targeting.js +0 -483
- package/dist/roguelike/Targeting.js.map +0 -1
- package/dist/roguelike/TriggerTracker.d.ts +0 -46
- package/dist/roguelike/TriggerTracker.d.ts.map +0 -1
- package/dist/roguelike/TriggerTracker.js +0 -59
- package/dist/roguelike/TriggerTracker.js.map +0 -1
- package/dist/roguelike/generate.d.ts +0 -139
- package/dist/roguelike/generate.d.ts.map +0 -1
- package/dist/roguelike/generate.js +0 -166
- package/dist/roguelike/generate.js.map +0 -1
- package/dist/roguelike/index.d.ts +0 -48
- package/dist/roguelike/index.d.ts.map +0 -1
- package/dist/roguelike/index.js +0 -27
- package/dist/roguelike/index.js.map +0 -1
- package/dist/rpg/Collision.d.ts +0 -61
- package/dist/rpg/Collision.d.ts.map +0 -1
- package/dist/rpg/Collision.js +0 -94
- package/dist/rpg/Collision.js.map +0 -1
- package/dist/rpg/Event.d.ts +0 -50
- package/dist/rpg/Event.d.ts.map +0 -1
- package/dist/rpg/Event.js +0 -36
- package/dist/rpg/Event.js.map +0 -1
- package/dist/rpg/EventRunner.d.ts +0 -139
- package/dist/rpg/EventRunner.d.ts.map +0 -1
- package/dist/rpg/EventRunner.js +0 -125
- package/dist/rpg/EventRunner.js.map +0 -1
- package/dist/rpg/FreeMover.d.ts +0 -59
- package/dist/rpg/FreeMover.d.ts.map +0 -1
- package/dist/rpg/FreeMover.js +0 -79
- package/dist/rpg/FreeMover.js.map +0 -1
- package/dist/rpg/GameState.d.ts +0 -36
- package/dist/rpg/GameState.d.ts.map +0 -1
- package/dist/rpg/GameState.js +0 -49
- package/dist/rpg/GameState.js.map +0 -1
- package/dist/rpg/GridMover.d.ts +0 -71
- package/dist/rpg/GridMover.d.ts.map +0 -1
- package/dist/rpg/GridMover.js +0 -119
- package/dist/rpg/GridMover.js.map +0 -1
- package/dist/rpg/Marshal.d.ts +0 -81
- package/dist/rpg/Marshal.d.ts.map +0 -1
- package/dist/rpg/Marshal.js +0 -422
- package/dist/rpg/Marshal.js.map +0 -1
- package/dist/rpg/MovableSprite.d.ts +0 -31
- package/dist/rpg/MovableSprite.d.ts.map +0 -1
- package/dist/rpg/MovableSprite.js +0 -10
- package/dist/rpg/MovableSprite.js.map +0 -1
- package/dist/rpg/MoveRoute.d.ts +0 -118
- package/dist/rpg/MoveRoute.d.ts.map +0 -1
- package/dist/rpg/MoveRoute.js +0 -139
- package/dist/rpg/MoveRoute.js.map +0 -1
- package/dist/rpg/Quest.d.ts +0 -173
- package/dist/rpg/Quest.d.ts.map +0 -1
- package/dist/rpg/Quest.js +0 -221
- package/dist/rpg/Quest.js.map +0 -1
- package/dist/rpg/automap.d.ts +0 -81
- package/dist/rpg/automap.d.ts.map +0 -1
- package/dist/rpg/automap.js +0 -107
- package/dist/rpg/automap.js.map +0 -1
- package/dist/rpg/dialogue-text.d.ts +0 -81
- package/dist/rpg/dialogue-text.d.ts.map +0 -1
- package/dist/rpg/dialogue-text.js +0 -88
- package/dist/rpg/dialogue-text.js.map +0 -1
- package/dist/rpg/index.d.ts +0 -25
- package/dist/rpg/index.d.ts.map +0 -1
- package/dist/rpg/index.js +0 -14
- package/dist/rpg/index.js.map +0 -1
- package/dist/rpg/twee-events.d.ts +0 -48
- package/dist/rpg/twee-events.d.ts.map +0 -1
- package/dist/rpg/twee-events.js +0 -35
- package/dist/rpg/twee-events.js.map +0 -1
- package/dist/simulation/Campaign.d.ts +0 -60
- package/dist/simulation/Campaign.d.ts.map +0 -1
- package/dist/simulation/Campaign.js +0 -89
- package/dist/simulation/Campaign.js.map +0 -1
- package/dist/simulation/CampaignSave.d.ts +0 -68
- package/dist/simulation/CampaignSave.d.ts.map +0 -1
- package/dist/simulation/CampaignSave.js +0 -54
- package/dist/simulation/CampaignSave.js.map +0 -1
- package/dist/simulation/EventPresentation.d.ts +0 -111
- package/dist/simulation/EventPresentation.d.ts.map +0 -1
- package/dist/simulation/EventPresentation.js +0 -120
- package/dist/simulation/EventPresentation.js.map +0 -1
- package/dist/simulation/Harness.d.ts +0 -26
- package/dist/simulation/Harness.d.ts.map +0 -1
- package/dist/simulation/Harness.js +0 -26
- package/dist/simulation/Harness.js.map +0 -1
- package/dist/simulation/Runtime.d.ts +0 -189
- package/dist/simulation/Runtime.d.ts.map +0 -1
- package/dist/simulation/Runtime.js +0 -244
- package/dist/simulation/Runtime.js.map +0 -1
- package/dist/simulation/Scenario.d.ts +0 -44
- package/dist/simulation/Scenario.d.ts.map +0 -1
- package/dist/simulation/Scenario.js +0 -40
- package/dist/simulation/Scenario.js.map +0 -1
- package/dist/simulation/Training.d.ts +0 -220
- package/dist/simulation/Training.d.ts.map +0 -1
- package/dist/simulation/Training.js +0 -366
- package/dist/simulation/Training.js.map +0 -1
- package/dist/simulation/Turns.d.ts +0 -40
- package/dist/simulation/Turns.d.ts.map +0 -1
- package/dist/simulation/Turns.js +0 -41
- package/dist/simulation/Turns.js.map +0 -1
- package/dist/simulation/index.d.ts +0 -25
- package/dist/simulation/index.d.ts.map +0 -1
- package/dist/simulation/index.js +0 -16
- package/dist/simulation/index.js.map +0 -1
- package/dist/skeleton/index.d.ts +0 -212
- package/dist/skeleton/index.d.ts.map +0 -1
- package/dist/skeleton/index.js +0 -325
- package/dist/skeleton/index.js.map +0 -1
- package/dist/testing/SceneControls.d.ts +0 -35
- package/dist/testing/SceneControls.d.ts.map +0 -1
- package/dist/testing/SceneControls.js +0 -49
- package/dist/testing/SceneControls.js.map +0 -1
- package/dist/testing/index.d.ts +0 -123
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -156
- package/dist/testing/index.js.map +0 -1
- package/dist/threads/index.d.ts +0 -3
- package/dist/threads/index.d.ts.map +0 -1
- package/dist/threads/index.js +0 -2
- package/dist/threads/index.js.map +0 -1
- package/dist/threads/spawn.d.ts +0 -41
- package/dist/threads/spawn.d.ts.map +0 -1
- package/dist/threads/spawn.js +0 -143
- package/dist/threads/spawn.js.map +0 -1
- package/dist/threads/worker.d.ts +0 -51
- package/dist/threads/worker.d.ts.map +0 -1
- package/dist/threads/worker.js +0 -84
- package/dist/threads/worker.js.map +0 -1
- package/dist/three-d/Character3D.d.ts +0 -74
- package/dist/three-d/Character3D.d.ts.map +0 -1
- package/dist/three-d/Character3D.js +0 -122
- package/dist/three-d/Character3D.js.map +0 -1
- package/dist/three-d/Collision3D.d.ts +0 -111
- package/dist/three-d/Collision3D.d.ts.map +0 -1
- package/dist/three-d/Collision3D.js +0 -119
- package/dist/three-d/Collision3D.js.map +0 -1
- package/dist/three-d/Engine3D.d.ts +0 -25
- package/dist/three-d/Engine3D.d.ts.map +0 -1
- package/dist/three-d/Engine3D.js +0 -45
- package/dist/three-d/Engine3D.js.map +0 -1
- package/dist/three-d/Grid.d.ts +0 -30
- package/dist/three-d/Grid.d.ts.map +0 -1
- package/dist/three-d/Grid.js +0 -24
- package/dist/three-d/Grid.js.map +0 -1
- package/dist/three-d/Heightmap.d.ts +0 -38
- package/dist/three-d/Heightmap.d.ts.map +0 -1
- package/dist/three-d/Heightmap.js +0 -29
- package/dist/three-d/Heightmap.js.map +0 -1
- package/dist/three-d/Models.d.ts +0 -49
- package/dist/three-d/Models.d.ts.map +0 -1
- package/dist/three-d/Models.js +0 -77
- package/dist/three-d/Models.js.map +0 -1
- package/dist/three-d/TileGrid3D.d.ts +0 -27
- package/dist/three-d/TileGrid3D.d.ts.map +0 -1
- package/dist/three-d/TileGrid3D.js +0 -66
- package/dist/three-d/TileGrid3D.js.map +0 -1
- package/dist/three-d/Vox.d.ts +0 -43
- package/dist/three-d/Vox.d.ts.map +0 -1
- package/dist/three-d/Vox.js +0 -108
- package/dist/three-d/Vox.js.map +0 -1
- package/dist/three-d/index.d.ts +0 -15
- package/dist/three-d/index.d.ts.map +0 -1
- package/dist/three-d/index.js +0 -8
- package/dist/three-d/index.js.map +0 -1
- package/dist/two-d/Game.d.ts +0 -229
- package/dist/two-d/Game.d.ts.map +0 -1
- package/dist/two-d/Game.js +0 -463
- package/dist/two-d/Game.js.map +0 -1
- package/dist/two-d/QualityScaler.d.ts +0 -63
- package/dist/two-d/QualityScaler.d.ts.map +0 -1
- package/dist/two-d/QualityScaler.js +0 -92
- package/dist/two-d/QualityScaler.js.map +0 -1
- package/dist/two-d/ResolutionFit.d.ts +0 -28
- package/dist/two-d/ResolutionFit.d.ts.map +0 -1
- package/dist/two-d/ResolutionFit.js +0 -39
- package/dist/two-d/ResolutionFit.js.map +0 -1
- package/dist/two-d/Scene2D.d.ts +0 -43
- package/dist/two-d/Scene2D.d.ts.map +0 -1
- package/dist/two-d/Scene2D.js +0 -53
- package/dist/two-d/Scene2D.js.map +0 -1
- package/dist/two-d/index.d.ts +0 -22
- package/dist/two-d/index.d.ts.map +0 -1
- package/dist/two-d/index.js +0 -19
- package/dist/two-d/index.js.map +0 -1
- package/dist/two-d/pixi-interop.d.ts +0 -66
- package/dist/two-d/pixi-interop.d.ts.map +0 -1
- package/dist/two-d/pixi-interop.js +0 -72
- package/dist/two-d/pixi-interop.js.map +0 -1
- package/dist/two-d/presentation/MwlPresentation.d.ts +0 -117
- package/dist/two-d/presentation/MwlPresentation.d.ts.map +0 -1
- package/dist/two-d/presentation/MwlPresentation.js +0 -755
- package/dist/two-d/presentation/MwlPresentation.js.map +0 -1
- package/dist/two-d/presentation/index.d.ts +0 -3
- package/dist/two-d/presentation/index.d.ts.map +0 -1
- package/dist/two-d/presentation/index.js +0 -2
- package/dist/two-d/presentation/index.js.map +0 -1
- package/dist/two-d/render/ActorAnimator.d.ts +0 -92
- package/dist/two-d/render/ActorAnimator.d.ts.map +0 -1
- package/dist/two-d/render/ActorAnimator.js +0 -97
- package/dist/two-d/render/ActorAnimator.js.map +0 -1
- package/dist/two-d/render/AnimatedSprite.d.ts +0 -154
- package/dist/two-d/render/AnimatedSprite.d.ts.map +0 -1
- package/dist/two-d/render/AnimatedSprite.js +0 -197
- package/dist/two-d/render/AnimatedSprite.js.map +0 -1
- package/dist/two-d/render/Autotile.d.ts +0 -74
- package/dist/two-d/render/Autotile.d.ts.map +0 -1
- package/dist/two-d/render/Autotile.js +0 -149
- package/dist/two-d/render/Autotile.js.map +0 -1
- package/dist/two-d/render/Beam.d.ts +0 -136
- package/dist/two-d/render/Beam.d.ts.map +0 -1
- package/dist/two-d/render/Beam.js +0 -203
- package/dist/two-d/render/Beam.js.map +0 -1
- package/dist/two-d/render/Camera.d.ts +0 -255
- package/dist/two-d/render/Camera.d.ts.map +0 -1
- package/dist/two-d/render/Camera.js +0 -376
- package/dist/two-d/render/Camera.js.map +0 -1
- package/dist/two-d/render/Capabilities.d.ts +0 -84
- package/dist/two-d/render/Capabilities.d.ts.map +0 -1
- package/dist/two-d/render/Capabilities.js +0 -129
- package/dist/two-d/render/Capabilities.js.map +0 -1
- package/dist/two-d/render/ClothSprite.d.ts +0 -83
- package/dist/two-d/render/ClothSprite.d.ts.map +0 -1
- package/dist/two-d/render/ClothSprite.js +0 -105
- package/dist/two-d/render/ClothSprite.js.map +0 -1
- package/dist/two-d/render/ColorBlindness.d.ts +0 -39
- package/dist/two-d/render/ColorBlindness.d.ts.map +0 -1
- package/dist/two-d/render/ColorBlindness.js +0 -45
- package/dist/two-d/render/ColorBlindness.js.map +0 -1
- package/dist/two-d/render/ColorTransformBatcher.d.ts +0 -143
- package/dist/two-d/render/ColorTransformBatcher.d.ts.map +0 -1
- package/dist/two-d/render/ColorTransformBatcher.js +0 -395
- package/dist/two-d/render/ColorTransformBatcher.js.map +0 -1
- package/dist/two-d/render/Flights.d.ts +0 -90
- package/dist/two-d/render/Flights.d.ts.map +0 -1
- package/dist/two-d/render/Flights.js +0 -135
- package/dist/two-d/render/Flights.js.map +0 -1
- package/dist/two-d/render/FogLayer.d.ts +0 -68
- package/dist/two-d/render/FogLayer.d.ts.map +0 -1
- package/dist/two-d/render/FogLayer.js +0 -83
- package/dist/two-d/render/FogLayer.js.map +0 -1
- package/dist/two-d/render/Halo.d.ts +0 -58
- package/dist/two-d/render/Halo.d.ts.map +0 -1
- package/dist/two-d/render/Halo.js +0 -48
- package/dist/two-d/render/Halo.js.map +0 -1
- package/dist/two-d/render/HazeLayer.d.ts +0 -112
- package/dist/two-d/render/HazeLayer.d.ts.map +0 -1
- package/dist/two-d/render/HazeLayer.js +0 -185
- package/dist/two-d/render/HazeLayer.js.map +0 -1
- package/dist/two-d/render/ImageModifiers.d.ts +0 -310
- package/dist/two-d/render/ImageModifiers.d.ts.map +0 -1
- package/dist/two-d/render/ImageModifiers.js +0 -723
- package/dist/two-d/render/ImageModifiers.js.map +0 -1
- package/dist/two-d/render/LayeredSprite.d.ts +0 -54
- package/dist/two-d/render/LayeredSprite.d.ts.map +0 -1
- package/dist/two-d/render/LayeredSprite.js +0 -80
- package/dist/two-d/render/LayeredSprite.js.map +0 -1
- package/dist/two-d/render/LightningArc.d.ts +0 -57
- package/dist/two-d/render/LightningArc.d.ts.map +0 -1
- package/dist/two-d/render/LightningArc.js +0 -91
- package/dist/two-d/render/LightningArc.js.map +0 -1
- package/dist/two-d/render/LiquidLayer.d.ts +0 -62
- package/dist/two-d/render/LiquidLayer.d.ts.map +0 -1
- package/dist/two-d/render/LiquidLayer.js +0 -102
- package/dist/two-d/render/LiquidLayer.js.map +0 -1
- package/dist/two-d/render/Minimap.d.ts +0 -100
- package/dist/two-d/render/Minimap.d.ts.map +0 -1
- package/dist/two-d/render/Minimap.js +0 -157
- package/dist/two-d/render/Minimap.js.map +0 -1
- package/dist/two-d/render/NeonGlow.d.ts +0 -100
- package/dist/two-d/render/NeonGlow.d.ts.map +0 -1
- package/dist/two-d/render/NeonGlow.js +0 -183
- package/dist/two-d/render/NeonGlow.js.map +0 -1
- package/dist/two-d/render/PaletteRemap.d.ts +0 -154
- package/dist/two-d/render/PaletteRemap.d.ts.map +0 -1
- package/dist/two-d/render/PaletteRemap.js +0 -217
- package/dist/two-d/render/PaletteRemap.js.map +0 -1
- package/dist/two-d/render/Particles.d.ts +0 -262
- package/dist/two-d/render/Particles.d.ts.map +0 -1
- package/dist/two-d/render/Particles.js +0 -370
- package/dist/two-d/render/Particles.js.map +0 -1
- package/dist/two-d/render/Projectile.d.ts +0 -67
- package/dist/two-d/render/Projectile.d.ts.map +0 -1
- package/dist/two-d/render/Projectile.js +0 -78
- package/dist/two-d/render/Projectile.js.map +0 -1
- package/dist/two-d/render/RpgmAutotile.d.ts +0 -324
- package/dist/two-d/render/RpgmAutotile.d.ts.map +0 -1
- package/dist/two-d/render/RpgmAutotile.js +0 -933
- package/dist/two-d/render/RpgmAutotile.js.map +0 -1
- package/dist/two-d/render/SceneTransition.d.ts +0 -272
- package/dist/two-d/render/SceneTransition.d.ts.map +0 -1
- package/dist/two-d/render/SceneTransition.js +0 -431
- package/dist/two-d/render/SceneTransition.js.map +0 -1
- package/dist/two-d/render/ScreenEffects.d.ts +0 -124
- package/dist/two-d/render/ScreenEffects.d.ts.map +0 -1
- package/dist/two-d/render/ScreenEffects.js +0 -214
- package/dist/two-d/render/ScreenEffects.js.map +0 -1
- package/dist/two-d/render/Shape2D.d.ts +0 -146
- package/dist/two-d/render/Shape2D.d.ts.map +0 -1
- package/dist/two-d/render/Shape2D.js +0 -166
- package/dist/two-d/render/Shape2D.js.map +0 -1
- package/dist/two-d/render/SkeletalSprite.d.ts +0 -121
- package/dist/two-d/render/SkeletalSprite.d.ts.map +0 -1
- package/dist/two-d/render/SkeletalSprite.js +0 -213
- package/dist/two-d/render/SkeletalSprite.js.map +0 -1
- package/dist/two-d/render/SpringSprite.d.ts +0 -40
- package/dist/two-d/render/SpringSprite.d.ts.map +0 -1
- package/dist/two-d/render/SpringSprite.js +0 -39
- package/dist/two-d/render/SpringSprite.js.map +0 -1
- package/dist/two-d/render/SpriteAttachment.d.ts +0 -55
- package/dist/two-d/render/SpriteAttachment.d.ts.map +0 -1
- package/dist/two-d/render/SpriteAttachment.js +0 -60
- package/dist/two-d/render/SpriteAttachment.js.map +0 -1
- package/dist/two-d/render/SpriteDeform.d.ts +0 -156
- package/dist/two-d/render/SpriteDeform.d.ts.map +0 -1
- package/dist/two-d/render/SpriteDeform.js +0 -278
- package/dist/two-d/render/SpriteDeform.js.map +0 -1
- package/dist/two-d/render/SpriteGroup.d.ts +0 -83
- package/dist/two-d/render/SpriteGroup.d.ts.map +0 -1
- package/dist/two-d/render/SpriteGroup.js +0 -107
- package/dist/two-d/render/SpriteGroup.js.map +0 -1
- package/dist/two-d/render/SpriteMotion.d.ts +0 -121
- package/dist/two-d/render/SpriteMotion.d.ts.map +0 -1
- package/dist/two-d/render/SpriteMotion.js +0 -193
- package/dist/two-d/render/SpriteMotion.js.map +0 -1
- package/dist/two-d/render/SpriteSheet.d.ts +0 -62
- package/dist/two-d/render/SpriteSheet.d.ts.map +0 -1
- package/dist/two-d/render/SpriteSheet.js +0 -122
- package/dist/two-d/render/SpriteSheet.js.map +0 -1
- package/dist/two-d/render/StatusVisuals.d.ts +0 -86
- package/dist/two-d/render/StatusVisuals.d.ts.map +0 -1
- package/dist/two-d/render/StatusVisuals.js +0 -111
- package/dist/two-d/render/StatusVisuals.js.map +0 -1
- package/dist/two-d/render/SvgSkeleton.d.ts +0 -54
- package/dist/two-d/render/SvgSkeleton.d.ts.map +0 -1
- package/dist/two-d/render/SvgSkeleton.js +0 -112
- package/dist/two-d/render/SvgSkeleton.js.map +0 -1
- package/dist/two-d/render/TerrainGraphics.d.ts +0 -142
- package/dist/two-d/render/TerrainGraphics.d.ts.map +0 -1
- package/dist/two-d/render/TerrainGraphics.js +0 -161
- package/dist/two-d/render/TerrainGraphics.js.map +0 -1
- package/dist/two-d/render/TerrainGraphicsLayer.d.ts +0 -55
- package/dist/two-d/render/TerrainGraphicsLayer.d.ts.map +0 -1
- package/dist/two-d/render/TerrainGraphicsLayer.js +0 -54
- package/dist/two-d/render/TerrainGraphicsLayer.js.map +0 -1
- package/dist/two-d/render/TileMap.d.ts +0 -395
- package/dist/two-d/render/TileMap.d.ts.map +0 -1
- package/dist/two-d/render/TileMap.js +0 -967
- package/dist/two-d/render/TileMap.js.map +0 -1
- package/dist/two-d/render/TiledMap.d.ts +0 -113
- package/dist/two-d/render/TiledMap.d.ts.map +0 -1
- package/dist/two-d/render/TiledMap.js +0 -129
- package/dist/two-d/render/TiledMap.js.map +0 -1
- package/dist/two-d/render/TintedSprite.d.ts +0 -60
- package/dist/two-d/render/TintedSprite.d.ts.map +0 -1
- package/dist/two-d/render/TintedSprite.js +0 -88
- package/dist/two-d/render/TintedSprite.js.map +0 -1
- package/dist/two-d/render/Types2D.d.ts +0 -56
- package/dist/two-d/render/Types2D.d.ts.map +0 -1
- package/dist/two-d/render/Types2D.js +0 -45
- package/dist/two-d/render/Types2D.js.map +0 -1
- package/dist/two-d/render/Viewport.d.ts +0 -68
- package/dist/two-d/render/Viewport.d.ts.map +0 -1
- package/dist/two-d/render/Viewport.js +0 -74
- package/dist/two-d/render/Viewport.js.map +0 -1
- package/dist/two-d/render/index.d.ts +0 -81
- package/dist/two-d/render/index.d.ts.map +0 -1
- package/dist/two-d/render/index.js +0 -43
- package/dist/two-d/render/index.js.map +0 -1
- package/dist/two-d/stage/DialogueStage.d.ts +0 -90
- package/dist/two-d/stage/DialogueStage.d.ts.map +0 -1
- package/dist/two-d/stage/DialogueStage.js +0 -218
- package/dist/two-d/stage/DialogueStage.js.map +0 -1
- package/dist/two-d/stage/StoryScreen.d.ts +0 -110
- package/dist/two-d/stage/StoryScreen.d.ts.map +0 -1
- package/dist/two-d/stage/StoryScreen.js +0 -178
- package/dist/two-d/stage/StoryScreen.js.map +0 -1
- package/dist/two-d/stage/dialogue-text.d.ts +0 -81
- package/dist/two-d/stage/dialogue-text.d.ts.map +0 -1
- package/dist/two-d/stage/dialogue-text.js +0 -95
- package/dist/two-d/stage/dialogue-text.js.map +0 -1
- package/dist/two-d/stage/index.d.ts +0 -10
- package/dist/two-d/stage/index.d.ts.map +0 -1
- package/dist/two-d/stage/index.js +0 -6
- package/dist/two-d/stage/index.js.map +0 -1
- package/dist/two-d/stage/script.d.ts +0 -160
- package/dist/two-d/stage/script.d.ts.map +0 -1
- package/dist/two-d/stage/script.js +0 -207
- package/dist/two-d/stage/script.js.map +0 -1
- package/dist/two-d/stage/twee.d.ts +0 -35
- package/dist/two-d/stage/twee.d.ts.map +0 -1
- package/dist/two-d/stage/twee.js +0 -28
- package/dist/two-d/stage/twee.js.map +0 -1
- package/dist/two-d/ui/Bar.d.ts +0 -83
- package/dist/two-d/ui/Bar.d.ts.map +0 -1
- package/dist/two-d/ui/Bar.js +0 -112
- package/dist/two-d/ui/Bar.js.map +0 -1
- package/dist/two-d/ui/BitmapLabel.d.ts +0 -58
- package/dist/two-d/ui/BitmapLabel.d.ts.map +0 -1
- package/dist/two-d/ui/BitmapLabel.js +0 -82
- package/dist/two-d/ui/BitmapLabel.js.map +0 -1
- package/dist/two-d/ui/Button.d.ts +0 -133
- package/dist/two-d/ui/Button.d.ts.map +0 -1
- package/dist/two-d/ui/Button.js +0 -254
- package/dist/two-d/ui/Button.js.map +0 -1
- package/dist/two-d/ui/Checkbox.d.ts +0 -44
- package/dist/two-d/ui/Checkbox.d.ts.map +0 -1
- package/dist/two-d/ui/Checkbox.js +0 -89
- package/dist/two-d/ui/Checkbox.js.map +0 -1
- package/dist/two-d/ui/DataTable.d.ts +0 -79
- package/dist/two-d/ui/DataTable.d.ts.map +0 -1
- package/dist/two-d/ui/DataTable.js +0 -164
- package/dist/two-d/ui/DataTable.js.map +0 -1
- package/dist/two-d/ui/Dropdown.d.ts +0 -75
- package/dist/two-d/ui/Dropdown.d.ts.map +0 -1
- package/dist/two-d/ui/Dropdown.js +0 -129
- package/dist/two-d/ui/Dropdown.js.map +0 -1
- package/dist/two-d/ui/DropdownView.d.ts +0 -86
- package/dist/two-d/ui/DropdownView.d.ts.map +0 -1
- package/dist/two-d/ui/DropdownView.js +0 -216
- package/dist/two-d/ui/DropdownView.js.map +0 -1
- package/dist/two-d/ui/EventDialogue.d.ts +0 -23
- package/dist/two-d/ui/EventDialogue.d.ts.map +0 -1
- package/dist/two-d/ui/EventDialogue.js +0 -33
- package/dist/two-d/ui/EventDialogue.js.map +0 -1
- package/dist/two-d/ui/FloatingText.d.ts +0 -123
- package/dist/two-d/ui/FloatingText.d.ts.map +0 -1
- package/dist/two-d/ui/FloatingText.js +0 -152
- package/dist/two-d/ui/FloatingText.js.map +0 -1
- package/dist/two-d/ui/FloatingTextStack.d.ts +0 -150
- package/dist/two-d/ui/FloatingTextStack.d.ts.map +0 -1
- package/dist/two-d/ui/FloatingTextStack.js +0 -170
- package/dist/two-d/ui/FloatingTextStack.js.map +0 -1
- package/dist/two-d/ui/HelpScreen.d.ts +0 -45
- package/dist/two-d/ui/HelpScreen.d.ts.map +0 -1
- package/dist/two-d/ui/HelpScreen.js +0 -59
- package/dist/two-d/ui/HelpScreen.js.map +0 -1
- package/dist/two-d/ui/IconGrid.d.ts +0 -143
- package/dist/two-d/ui/IconGrid.d.ts.map +0 -1
- package/dist/two-d/ui/IconGrid.js +0 -326
- package/dist/two-d/ui/IconGrid.js.map +0 -1
- package/dist/two-d/ui/Label.d.ts +0 -63
- package/dist/two-d/ui/Label.d.ts.map +0 -1
- package/dist/two-d/ui/Label.js +0 -134
- package/dist/two-d/ui/Label.js.map +0 -1
- package/dist/two-d/ui/Layout.d.ts +0 -139
- package/dist/two-d/ui/Layout.d.ts.map +0 -1
- package/dist/two-d/ui/Layout.js +0 -221
- package/dist/two-d/ui/Layout.js.map +0 -1
- package/dist/two-d/ui/ListView.d.ts +0 -130
- package/dist/two-d/ui/ListView.d.ts.map +0 -1
- package/dist/two-d/ui/ListView.js +0 -325
- package/dist/two-d/ui/ListView.js.map +0 -1
- package/dist/two-d/ui/LoadingScreen.d.ts +0 -54
- package/dist/two-d/ui/LoadingScreen.d.ts.map +0 -1
- package/dist/two-d/ui/LoadingScreen.js +0 -87
- package/dist/two-d/ui/LoadingScreen.js.map +0 -1
- package/dist/two-d/ui/MarkupText.d.ts +0 -66
- package/dist/two-d/ui/MarkupText.d.ts.map +0 -1
- package/dist/two-d/ui/MarkupText.js +0 -156
- package/dist/two-d/ui/MarkupText.js.map +0 -1
- package/dist/two-d/ui/MessageBox.d.ts +0 -134
- package/dist/two-d/ui/MessageBox.d.ts.map +0 -1
- package/dist/two-d/ui/MessageBox.js +0 -263
- package/dist/two-d/ui/MessageBox.js.map +0 -1
- package/dist/two-d/ui/MessageLog.d.ts +0 -90
- package/dist/two-d/ui/MessageLog.d.ts.map +0 -1
- package/dist/two-d/ui/MessageLog.js +0 -131
- package/dist/two-d/ui/MessageLog.js.map +0 -1
- package/dist/two-d/ui/Meter.d.ts +0 -76
- package/dist/two-d/ui/Meter.d.ts.map +0 -1
- package/dist/two-d/ui/Meter.js +0 -134
- package/dist/two-d/ui/Meter.js.map +0 -1
- package/dist/two-d/ui/NinePatch.d.ts +0 -49
- package/dist/two-d/ui/NinePatch.d.ts.map +0 -1
- package/dist/two-d/ui/NinePatch.js +0 -59
- package/dist/two-d/ui/NinePatch.js.map +0 -1
- package/dist/two-d/ui/OnScreenKeyboard.d.ts +0 -91
- package/dist/two-d/ui/OnScreenKeyboard.d.ts.map +0 -1
- package/dist/two-d/ui/OnScreenKeyboard.js +0 -109
- package/dist/two-d/ui/OnScreenKeyboard.js.map +0 -1
- package/dist/two-d/ui/RadioGroup.d.ts +0 -68
- package/dist/two-d/ui/RadioGroup.d.ts.map +0 -1
- package/dist/two-d/ui/RadioGroup.js +0 -177
- package/dist/two-d/ui/RadioGroup.js.map +0 -1
- package/dist/two-d/ui/RebindScreen.d.ts +0 -70
- package/dist/two-d/ui/RebindScreen.d.ts.map +0 -1
- package/dist/two-d/ui/RebindScreen.js +0 -129
- package/dist/two-d/ui/RebindScreen.js.map +0 -1
- package/dist/two-d/ui/RichLabel.d.ts +0 -62
- package/dist/two-d/ui/RichLabel.d.ts.map +0 -1
- package/dist/two-d/ui/RichLabel.js +0 -146
- package/dist/two-d/ui/RichLabel.js.map +0 -1
- package/dist/two-d/ui/ScrollBox.d.ts +0 -157
- package/dist/two-d/ui/ScrollBox.d.ts.map +0 -1
- package/dist/two-d/ui/ScrollBox.js +0 -329
- package/dist/two-d/ui/ScrollBox.js.map +0 -1
- package/dist/two-d/ui/ScrollText.d.ts +0 -122
- package/dist/two-d/ui/ScrollText.d.ts.map +0 -1
- package/dist/two-d/ui/ScrollText.js +0 -202
- package/dist/two-d/ui/ScrollText.js.map +0 -1
- package/dist/two-d/ui/SelectionModel.d.ts +0 -50
- package/dist/two-d/ui/SelectionModel.d.ts.map +0 -1
- package/dist/two-d/ui/SelectionModel.js +0 -73
- package/dist/two-d/ui/SelectionModel.js.map +0 -1
- package/dist/two-d/ui/SettingsScreen.d.ts +0 -112
- package/dist/two-d/ui/SettingsScreen.d.ts.map +0 -1
- package/dist/two-d/ui/SettingsScreen.js +0 -338
- package/dist/two-d/ui/SettingsScreen.js.map +0 -1
- package/dist/two-d/ui/Skins.d.ts +0 -59
- package/dist/two-d/ui/Skins.d.ts.map +0 -1
- package/dist/two-d/ui/Skins.js +0 -77
- package/dist/two-d/ui/Skins.js.map +0 -1
- package/dist/two-d/ui/Slider.d.ts +0 -91
- package/dist/two-d/ui/Slider.d.ts.map +0 -1
- package/dist/two-d/ui/Slider.js +0 -170
- package/dist/two-d/ui/Slider.js.map +0 -1
- package/dist/two-d/ui/Spinner.d.ts +0 -67
- package/dist/two-d/ui/Spinner.d.ts.map +0 -1
- package/dist/two-d/ui/Spinner.js +0 -137
- package/dist/two-d/ui/Spinner.js.map +0 -1
- package/dist/two-d/ui/StatsScreen.d.ts +0 -40
- package/dist/two-d/ui/StatsScreen.d.ts.map +0 -1
- package/dist/two-d/ui/StatsScreen.js +0 -42
- package/dist/two-d/ui/StatsScreen.js.map +0 -1
- package/dist/two-d/ui/TabbedList.d.ts +0 -118
- package/dist/two-d/ui/TabbedList.d.ts.map +0 -1
- package/dist/two-d/ui/TabbedList.js +0 -221
- package/dist/two-d/ui/TabbedList.js.map +0 -1
- package/dist/two-d/ui/TextModel.d.ts +0 -90
- package/dist/two-d/ui/TextModel.d.ts.map +0 -1
- package/dist/two-d/ui/TextModel.js +0 -175
- package/dist/two-d/ui/TextModel.js.map +0 -1
- package/dist/two-d/ui/TextPrompt.d.ts +0 -122
- package/dist/two-d/ui/TextPrompt.d.ts.map +0 -1
- package/dist/two-d/ui/TextPrompt.js +0 -236
- package/dist/two-d/ui/TextPrompt.js.map +0 -1
- package/dist/two-d/ui/TextSharpness.d.ts +0 -33
- package/dist/two-d/ui/TextSharpness.d.ts.map +0 -1
- package/dist/two-d/ui/TextSharpness.js +0 -56
- package/dist/two-d/ui/TextSharpness.js.map +0 -1
- package/dist/two-d/ui/Toast.d.ts +0 -57
- package/dist/two-d/ui/Toast.d.ts.map +0 -1
- package/dist/two-d/ui/Toast.js +0 -101
- package/dist/two-d/ui/Toast.js.map +0 -1
- package/dist/two-d/ui/Tooltip.d.ts +0 -177
- package/dist/two-d/ui/Tooltip.d.ts.map +0 -1
- package/dist/two-d/ui/Tooltip.js +0 -275
- package/dist/two-d/ui/Tooltip.js.map +0 -1
- package/dist/two-d/ui/TreeView.d.ts +0 -68
- package/dist/two-d/ui/TreeView.d.ts.map +0 -1
- package/dist/two-d/ui/TreeView.js +0 -133
- package/dist/two-d/ui/TreeView.js.map +0 -1
- package/dist/two-d/ui/VerticalLabel.d.ts +0 -69
- package/dist/two-d/ui/VerticalLabel.d.ts.map +0 -1
- package/dist/two-d/ui/VerticalLabel.js +0 -110
- package/dist/two-d/ui/VerticalLabel.js.map +0 -1
- package/dist/two-d/ui/Window.d.ts +0 -188
- package/dist/two-d/ui/Window.d.ts.map +0 -1
- package/dist/two-d/ui/Window.js +0 -311
- package/dist/two-d/ui/Window.js.map +0 -1
- package/dist/two-d/ui/WindowStack.d.ts +0 -63
- package/dist/two-d/ui/WindowStack.d.ts.map +0 -1
- package/dist/two-d/ui/WindowStack.js +0 -132
- package/dist/two-d/ui/WindowStack.js.map +0 -1
- package/dist/two-d/ui/a11y.d.ts +0 -43
- package/dist/two-d/ui/a11y.d.ts.map +0 -1
- package/dist/two-d/ui/a11y.js +0 -79
- package/dist/two-d/ui/a11y.js.map +0 -1
- package/dist/two-d/ui/contrast.d.ts +0 -30
- package/dist/two-d/ui/contrast.d.ts.map +0 -1
- package/dist/two-d/ui/contrast.js +0 -42
- package/dist/two-d/ui/contrast.js.map +0 -1
- package/dist/two-d/ui/index.d.ts +0 -96
- package/dist/two-d/ui/index.d.ts.map +0 -1
- package/dist/two-d/ui/index.js +0 -49
- package/dist/two-d/ui/index.js.map +0 -1
- package/dist/two-d/ui/markdown.d.ts +0 -55
- package/dist/two-d/ui/markdown.d.ts.map +0 -1
- package/dist/two-d/ui/markdown.js +0 -147
- package/dist/two-d/ui/markdown.js.map +0 -1
- package/dist/two-d/ui/markup.d.ts +0 -189
- package/dist/two-d/ui/markup.d.ts.map +0 -1
- package/dist/two-d/ui/markup.js +0 -387
- package/dist/two-d/ui/markup.js.map +0 -1
- package/dist/two-d/ui/reveal.d.ts +0 -41
- package/dist/two-d/ui/reveal.d.ts.map +0 -1
- package/dist/two-d/ui/reveal.js +0 -22
- package/dist/two-d/ui/reveal.js.map +0 -1
- package/dist/two-d/ui/theme.d.ts +0 -133
- package/dist/two-d/ui/theme.d.ts.map +0 -1
- package/dist/two-d/ui/theme.js +0 -122
- package/dist/two-d/ui/theme.js.map +0 -1
- package/dist/two-d/ui/themedText.d.ts +0 -20
- package/dist/two-d/ui/themedText.d.ts.map +0 -1
- package/dist/two-d/ui/themedText.js +0 -9
- package/dist/two-d/ui/themedText.js.map +0 -1
- package/dist/version.d.ts +0 -13
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -13
- package/dist/version.js.map +0 -1
- package/dist/world/Encounters.d.ts +0 -32
- package/dist/world/Encounters.d.ts.map +0 -1
- package/dist/world/Encounters.js +0 -9
- package/dist/world/Encounters.js.map +0 -1
- package/dist/world/Environment.d.ts +0 -58
- package/dist/world/Environment.d.ts.map +0 -1
- package/dist/world/Environment.js +0 -89
- package/dist/world/Environment.js.map +0 -1
- package/dist/world/Overworld.d.ts +0 -39
- package/dist/world/Overworld.d.ts.map +0 -1
- package/dist/world/Overworld.js +0 -40
- package/dist/world/Overworld.js.map +0 -1
- package/dist/world/SideTurns.d.ts +0 -115
- package/dist/world/SideTurns.d.ts.map +0 -1
- package/dist/world/SideTurns.js +0 -138
- package/dist/world/SideTurns.js.map +0 -1
- package/dist/world/TurnClock.d.ts +0 -41
- package/dist/world/TurnClock.d.ts.map +0 -1
- package/dist/world/TurnClock.js +0 -49
- package/dist/world/TurnClock.js.map +0 -1
- package/dist/world/World.d.ts +0 -64
- package/dist/world/World.d.ts.map +0 -1
- package/dist/world/World.js +0 -91
- package/dist/world/World.js.map +0 -1
- package/dist/world/index.d.ts +0 -12
- package/dist/world/index.d.ts.map +0 -1
- package/dist/world/index.js +0 -7
- package/dist/world/index.js.map +0 -1
- package/sbom.cdx.json +0 -5996
- package/tools/mwl.mjs +0 -324
- package/tools/vendored/rgssad-wasm/LICENSE-MIT +0 -21
- package/tools/vendored/rgssad-wasm/README.md +0 -15
- package/tools/vendored/rgssad-wasm/package.json +0 -17
- package/tools/vendored/rgssad-wasm/rgssad_wasm.d.ts +0 -41
- package/tools/vendored/rgssad-wasm/rgssad_wasm.js +0 -6
- package/tools/vendored/rgssad-wasm/rgssad_wasm_bg.js +0 -399
- package/tools/vendored/rgssad-wasm/rgssad_wasm_bg.wasm +0 -0
- package/tools/vendored/rgssad-wasm/rgssad_wasm_bg.wasm.d.ts +0 -17
- package/tools.md +0 -219
|
@@ -1,967 +0,0 @@
|
|
|
1
|
-
import { Container, Graphics, Rectangle, Texture } from 'pixi.js';
|
|
2
|
-
import { TintedSprite } from './TintedSprite.js';
|
|
3
|
-
import { hexToPixel, pixelToHex } from '../../core/Hex.js';
|
|
4
|
-
import { assertAutotileLayout, autotileCellParts, rpgmAutotileSlot, xpAutotileRef, RPGM_FLOOR_AUTOTILE_TABLE, RPGM_WALL_AUTOTILE_TABLE, } from './RpgmAutotile.js';
|
|
5
|
-
/**
|
|
6
|
-
* The frame value meaning "nothing here"; a cell holding it gets no sprite at all.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* import { EMPTY, TileMap, SpriteSheet } from '@datamoc/mw_games/two-d/render';
|
|
11
|
-
*
|
|
12
|
-
* declare const sheet: SpriteSheet;
|
|
13
|
-
*
|
|
14
|
-
* const map = new TileMap({ width: 10, height: 10, sheet });
|
|
15
|
-
* map.addLayer('ground');
|
|
16
|
-
* console.log(map.getTile('ground', 0, 0)); // EMPTY - nothing set there yet
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export const EMPTY = -1;
|
|
20
|
-
/** the faces of a raised block are shaded, the way light falls on the classic block look */
|
|
21
|
-
const LEFT_FACE_FILL = 0x6e6e6e;
|
|
22
|
-
const RIGHT_FACE_FILL = 0x9a9a9a;
|
|
23
|
-
/**
|
|
24
|
-
* Packs a (sheet, frame) pair into one cell value, for a `TileMap` built over
|
|
25
|
-
* several sheets - a map whose tiles come from more than one Tiled tileset.
|
|
26
|
-
*
|
|
27
|
-
* Single-sheet maps never need this: a plain frame index already decodes as
|
|
28
|
-
* sheet 0, so every existing call site keeps working unchanged.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```ts
|
|
32
|
-
* import { tileFrame, tileFrameSheet, tileFrameIndex } from '@datamoc/mw_games/two-d/render';
|
|
33
|
-
*
|
|
34
|
-
* const packed = tileFrame(1, 42); // frame 42 of the second sheet (index 1)
|
|
35
|
-
* console.log(tileFrameSheet(packed)); // 1
|
|
36
|
-
* console.log(tileFrameIndex(packed)); // 42
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export function tileFrame(sheet, frame) {
|
|
40
|
-
if (!Number.isInteger(sheet) || sheet < 0 || sheet >= 1 << 12) {
|
|
41
|
-
throw new Error(`tileFrame needs a sheet index from 0 to ${(1 << 12) - 1}, got ${sheet}`);
|
|
42
|
-
}
|
|
43
|
-
if (!Number.isInteger(frame) || frame < 0 || frame >= 1 << 20) {
|
|
44
|
-
throw new Error(`tileFrame needs a frame index from 0 to ${(1 << 20) - 1}, got ${frame}`);
|
|
45
|
-
}
|
|
46
|
-
return (sheet << 20) | frame;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The sheet half of a `tileFrame` pack, or 0 for a plain frame index.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* import { tileFrame, tileFrameSheet } from '@datamoc/mw_games/two-d/render';
|
|
54
|
-
*
|
|
55
|
-
* console.log(tileFrameSheet(tileFrame(2, 5))); // 2
|
|
56
|
-
* console.log(tileFrameSheet(5)); // 0 - a plain frame index reads as sheet 0
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export function tileFrameSheet(packed) {
|
|
60
|
-
return packed >>> 20;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* The frame half of a `tileFrame` pack, or the value itself for a plain index.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* import { tileFrame, tileFrameIndex } from '@datamoc/mw_games/two-d/render';
|
|
68
|
-
*
|
|
69
|
-
* console.log(tileFrameIndex(tileFrame(2, 5))); // 5
|
|
70
|
-
* console.log(tileFrameIndex(5)); // 5 - a plain frame index passes through unchanged
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
export function tileFrameIndex(packed) {
|
|
74
|
-
return packed & ((1 << 20) - 1);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* A grid of tiles, drawn as sprites.
|
|
78
|
-
*
|
|
79
|
-
* Layers stack in the order they are added: a floor, then whatever stands on it, then a
|
|
80
|
-
* roof. Every layer shares one grid, so a cell's lighting applies to all of them at once,
|
|
81
|
-
* which is what fog of war needs, since an unseen floor and the wall on it have to dim
|
|
82
|
-
* together.
|
|
83
|
-
*
|
|
84
|
-
* The map is chunked and culled against the camera, so its cost tracks what is on screen
|
|
85
|
-
* rather than how large the map is.
|
|
86
|
-
*
|
|
87
|
-
* Cells can also carry an elevation (`setCellHeight`): the top tile moves up by one
|
|
88
|
-
* `heightStep` per level, and on the diamond projections (isometric, staggered) each
|
|
89
|
-
* level grows two shaded side faces, the classic raised-block look. `tileCenter`
|
|
90
|
-
* rides along, so whoever stands on the cell stands on top of it.
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```ts
|
|
94
|
-
* import { TileMap, EMPTY, SpriteSheet, createCamera } from '@datamoc/mw_games/two-d/render';
|
|
95
|
-
*
|
|
96
|
-
* const sheet = SpriteSheet.grid('tiles/ground.png', 16);
|
|
97
|
-
*
|
|
98
|
-
* const map = new TileMap({ width: 20, height: 20, sheet });
|
|
99
|
-
* map.addLayer('ground', new Array(400).fill(0)); // frame 0 everywhere
|
|
100
|
-
* map.addLayer('objects'); // an empty layer, filled in with setTile later
|
|
101
|
-
*
|
|
102
|
-
* map.setTile('objects', 3, 3, 5);
|
|
103
|
-
* console.log(map.getTile('objects', 3, 3)); // 5
|
|
104
|
-
* console.log(map.getTile('objects', 0, 0)); // EMPTY - never set
|
|
105
|
-
*
|
|
106
|
-
* map.setCellColor(3, 3, 0x888888); // half-lit, remembered-but-not-visible fog of war
|
|
107
|
-
*
|
|
108
|
-
* const camera = createCamera();
|
|
109
|
-
* map.cull(camera); // once per frame, switches off chunks the camera cannot see
|
|
110
|
-
* ```
|
|
111
|
-
*
|
|
112
|
-
* `TileMap` is a `Container` of layer `Container`s of `TintedSprite` tiles, not a sprite
|
|
113
|
-
* itself: setting `map.alpha` still fades the whole map, since Pixi composes a container's
|
|
114
|
-
* alpha into every descendant's when rendering. There is no per-cell alpha alongside
|
|
115
|
-
* `setCellColor`'s tint/add - a see-through *tile* (as opposed to a translucent creature
|
|
116
|
-
* standing on one, which is `TintedSprite`'s own case) is not something any reference game
|
|
117
|
-
* has asked for yet.
|
|
118
|
-
*/
|
|
119
|
-
export class TileMap extends Container {
|
|
120
|
-
constructor(options) {
|
|
121
|
-
super();
|
|
122
|
-
this.layers = [];
|
|
123
|
-
this.layersByName = new Map();
|
|
124
|
-
//one container per chunk per layer, so culling toggles a single flag per chunk
|
|
125
|
-
this.chunks = [];
|
|
126
|
-
this.widthInTiles = options.width;
|
|
127
|
-
this.heightInTiles = options.height;
|
|
128
|
-
this.sheets = Array.isArray(options.sheet) ? [...options.sheet] : [options.sheet];
|
|
129
|
-
if (this.sheets.length === 0)
|
|
130
|
-
throw new Error('a TileMap needs at least one sheet');
|
|
131
|
-
this.tileWidth = options.tileWidth ?? this.sheets[0].frameWidth;
|
|
132
|
-
this.tileHeight = options.tileHeight ?? this.sheets[0].frameHeight;
|
|
133
|
-
this.shape = options.shape ?? 'square';
|
|
134
|
-
this.heightStep = options.heightStep ?? this.tileHeight / 2;
|
|
135
|
-
if (!(this.heightStep > 0)) {
|
|
136
|
-
throw new Error(`a TileMap's heightStep must be a positive number, got ${options.heightStep}`);
|
|
137
|
-
}
|
|
138
|
-
this.chunkSize = options.chunkSize ?? 16;
|
|
139
|
-
this.chunkColumns = Math.ceil(this.widthInTiles / this.chunkSize);
|
|
140
|
-
this.chunkRows = Math.ceil(this.heightInTiles / this.chunkSize);
|
|
141
|
-
const cells = this.widthInTiles * this.heightInTiles;
|
|
142
|
-
this.cellTint = new Uint32Array(cells).fill(0xffffff);
|
|
143
|
-
this.cellAdd = new Uint32Array(cells);
|
|
144
|
-
this.cellHeight = new Int32Array(cells);
|
|
145
|
-
this.faces = new Array(cells).fill(null);
|
|
146
|
-
}
|
|
147
|
-
get layerCount() {
|
|
148
|
-
return this.layers.length;
|
|
149
|
-
}
|
|
150
|
-
/** world size, for setting camera bounds */
|
|
151
|
-
get worldWidth() {
|
|
152
|
-
switch (this.shape) {
|
|
153
|
-
case 'square':
|
|
154
|
-
return this.widthInTiles * this.tileWidth;
|
|
155
|
-
case 'hex':
|
|
156
|
-
//columns overlap three-quarters of a tile each; the last column still needs
|
|
157
|
-
//its full width past where the previous one started
|
|
158
|
-
return this.widthInTiles <= 0 ? 0 : (this.widthInTiles - 1) * this.tileWidth * 0.75 + this.tileWidth;
|
|
159
|
-
case 'isometric':
|
|
160
|
-
//a diamond spanning every row and column, at their combined width
|
|
161
|
-
return (this.widthInTiles + this.heightInTiles) * (this.tileWidth / 2);
|
|
162
|
-
case 'staggered':
|
|
163
|
-
//every other row is pushed half a tile right, so the map is that much wider
|
|
164
|
-
return this.widthInTiles * this.tileWidth + this.tileWidth / 2;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
get worldHeight() {
|
|
168
|
-
switch (this.shape) {
|
|
169
|
-
case 'square':
|
|
170
|
-
return this.heightInTiles * this.tileHeight;
|
|
171
|
-
case 'hex':
|
|
172
|
-
//odd columns sit half a tile lower, so the map is that much taller than the
|
|
173
|
-
//rows alone
|
|
174
|
-
return this.heightInTiles * this.tileHeight + this.tileHeight / 2;
|
|
175
|
-
case 'isometric':
|
|
176
|
-
return (this.widthInTiles + this.heightInTiles) * (this.tileHeight / 2);
|
|
177
|
-
case 'staggered':
|
|
178
|
-
//rows are packed at half height, staggered brick-fashion
|
|
179
|
-
return this.heightInTiles * (this.tileHeight / 2) + this.tileHeight / 2;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
inside(x, y) {
|
|
183
|
-
return x >= 0 && y >= 0 && x < this.widthInTiles && y < this.heightInTiles;
|
|
184
|
-
}
|
|
185
|
-
index(x, y) {
|
|
186
|
-
return y * this.widthInTiles + x;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Adds a layer on top of the existing ones.
|
|
190
|
-
*
|
|
191
|
-
* @param data one frame index per cell, row-major, `EMPTY` for a blank cell. A missing
|
|
192
|
-
* array makes an empty layer to fill in later. On a multi-sheet map the values are
|
|
193
|
-
* `tileFrame` packs rather than plain indices.
|
|
194
|
-
*/
|
|
195
|
-
addLayer(name, data) {
|
|
196
|
-
const { cells, container, chunks } = this.beginLayer(name, data?.length);
|
|
197
|
-
const layer = {
|
|
198
|
-
kind: 'tiles',
|
|
199
|
-
name,
|
|
200
|
-
data: data ? Int32Array.from(data) : new Int32Array(cells).fill(EMPTY),
|
|
201
|
-
sprites: new Array(cells).fill(null),
|
|
202
|
-
container,
|
|
203
|
-
};
|
|
204
|
-
this.layers.push(layer);
|
|
205
|
-
this.layersByName.set(name, layer);
|
|
206
|
-
this.chunks.push(chunks);
|
|
207
|
-
this.addChild(container);
|
|
208
|
-
//sprites are built after registration so setTile can find the layer
|
|
209
|
-
const isBottom = this.layers.length === 1;
|
|
210
|
-
for (let y = 0; y < this.heightInTiles; y++) {
|
|
211
|
-
for (let x = 0; x < this.widthInTiles; x++) {
|
|
212
|
-
const frame = layer.data[this.index(x, y)];
|
|
213
|
-
if (frame !== EMPTY)
|
|
214
|
-
this.buildSprite(layer, x, y, frame);
|
|
215
|
-
//faces belong to the block, which the bottom layer defines; upper
|
|
216
|
-
//layers ride the same lift through buildSprite but draw no faces
|
|
217
|
-
if (isBottom)
|
|
218
|
-
this.syncFaces(x, y);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return this;
|
|
222
|
-
}
|
|
223
|
-
beginLayer(name, length) {
|
|
224
|
-
if (this.layersByName.has(name))
|
|
225
|
-
throw new Error(`this map already has a layer named "${name}"`);
|
|
226
|
-
const cells = this.widthInTiles * this.heightInTiles;
|
|
227
|
-
if (length !== undefined && length !== cells) {
|
|
228
|
-
throw new Error(`layer "${name}" has ${length} cells, but the map has ${cells}`);
|
|
229
|
-
}
|
|
230
|
-
const container = new Container();
|
|
231
|
-
const chunks = [];
|
|
232
|
-
for (let i = 0; i < this.chunkColumns * this.chunkRows; i++) {
|
|
233
|
-
const chunk = new Container();
|
|
234
|
-
chunks.push(chunk);
|
|
235
|
-
container.addChild(chunk);
|
|
236
|
-
}
|
|
237
|
-
return { cells, container, chunks };
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Adds an autotile layer on top of the existing ones: each non-blank cell
|
|
241
|
-
* holds a raw MV tile id or XP tile value, and the map assembles that
|
|
242
|
-
* cell's quadrant halves straight from the source sheet - no prebuilt
|
|
243
|
-
* atlas canvas in between. Cells route to the set claiming their id, so
|
|
244
|
-
* one layer can span every A-sheet (or every autotile image) the same way
|
|
245
|
-
* one plain layer can span several sheets.
|
|
246
|
-
*
|
|
247
|
-
* @param cells one raw id per cell, row-major; EMPTY (or at/below zero)
|
|
248
|
-
* for a blank cell. Every other value must fall in one of the sets'
|
|
249
|
-
* ranges, or the call throws naming it.
|
|
250
|
-
* @param set one source, or one per family slot (MV) or image index (XP).
|
|
251
|
-
*
|
|
252
|
-
* @example
|
|
253
|
-
* ```ts
|
|
254
|
-
* import { TileMap, SpriteSheet, type AutotileSet } from '@datamoc/mw_games/two-d/render';
|
|
255
|
-
*
|
|
256
|
-
* declare const sheet: SpriteSheet; // a raw MV A1 sheet: 48px cells, slot 0
|
|
257
|
-
*
|
|
258
|
-
* const map = new TileMap({ width: 4, height: 4, sheet });
|
|
259
|
-
* const sea: AutotileSet = { sheet, slot: 0, animation: [[0, 1, 2]] };
|
|
260
|
-
* map.addAutotileLayer('sea', new Array(16).fill(2048), sea);
|
|
261
|
-
* map.setAutotileFrame('sea', 1);
|
|
262
|
-
* console.log(map.getAutotileFrame('sea')); // 1
|
|
263
|
-
* console.log(map.getTile('sea', 0, 0)); // 2048 - raw MV ids, EMPTY where blank
|
|
264
|
-
* ```
|
|
265
|
-
*/
|
|
266
|
-
addAutotileLayer(name, cells, set) {
|
|
267
|
-
const entries = Array.isArray(set) ? set : [set];
|
|
268
|
-
if (entries.length === 0)
|
|
269
|
-
throw new Error(`autotile layer "${name}" needs at least one set`);
|
|
270
|
-
const { cells: total, container, chunks } = this.beginLayer(name, cells.length);
|
|
271
|
-
const sets = entries.map((entry, position) => this.resolveAutotileSet(name, entry, position));
|
|
272
|
-
const claimed = new Set();
|
|
273
|
-
for (const resolved of sets) {
|
|
274
|
-
const key = resolved.layout.format === 'rpgm-mv'
|
|
275
|
-
? `slot ${resolved.layout.slot}`
|
|
276
|
-
: `autotile ${resolved.layout.index}`;
|
|
277
|
-
if (claimed.has(key))
|
|
278
|
-
throw new Error(`autotile layer "${name}" has two sets for ${key}`);
|
|
279
|
-
claimed.add(key);
|
|
280
|
-
}
|
|
281
|
-
let frame = 0;
|
|
282
|
-
entries.forEach((entry, position) => {
|
|
283
|
-
const initial = entry.animationFrame ?? 0;
|
|
284
|
-
if (!Number.isInteger(initial) || initial < 0) {
|
|
285
|
-
throw new Error(`autotile layer "${name}" set ${position} starts at an invalid animation frame, got ${entry.animationFrame}`);
|
|
286
|
-
}
|
|
287
|
-
if (position === 0)
|
|
288
|
-
frame = initial;
|
|
289
|
-
else if (initial !== frame) {
|
|
290
|
-
throw new Error(`autotile layer "${name}" sets disagree on their initial animation frame (${frame} vs ${initial})`);
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
const data = Int32Array.from(cells);
|
|
294
|
-
for (let cell = 0; cell < total; cell++) {
|
|
295
|
-
if (data[cell] > 0)
|
|
296
|
-
this.claimAutotileSets(sets, name, data[cell]);
|
|
297
|
-
}
|
|
298
|
-
const layer = {
|
|
299
|
-
kind: 'autotile',
|
|
300
|
-
name,
|
|
301
|
-
data,
|
|
302
|
-
sprites: new Array(total).fill(null),
|
|
303
|
-
container,
|
|
304
|
-
sets,
|
|
305
|
-
frame,
|
|
306
|
-
};
|
|
307
|
-
this.layers.push(layer);
|
|
308
|
-
this.layersByName.set(name, layer);
|
|
309
|
-
this.chunks.push(chunks);
|
|
310
|
-
this.addChild(container);
|
|
311
|
-
//sprites are built after registration so the claim above stays the only check
|
|
312
|
-
const isBottom = this.layers.length === 1;
|
|
313
|
-
for (let y = 0; y < this.heightInTiles; y++) {
|
|
314
|
-
for (let x = 0; x < this.widthInTiles; x++) {
|
|
315
|
-
const at = this.index(x, y);
|
|
316
|
-
const tile = data[at];
|
|
317
|
-
if (tile <= 0)
|
|
318
|
-
continue;
|
|
319
|
-
layer.sprites[at] = this.makeAutotileSprites(layer, this.claimAutotileSets(sets, name, tile), x, y, tile);
|
|
320
|
-
if (isBottom)
|
|
321
|
-
this.syncFaces(x, y);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
return this;
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Advances an autotile layer's animation frame: every animated cell
|
|
328
|
-
* re-points its quadrant textures (MV kind cycles, XP frame stripes)
|
|
329
|
-
* while cells outside any cycle stay on frame zero's art. A repeated
|
|
330
|
-
* frame is a no-op.
|
|
331
|
-
*/
|
|
332
|
-
setAutotileFrame(layer, frame) {
|
|
333
|
-
const target = this.layerAt(layer);
|
|
334
|
-
if (target.kind !== 'autotile')
|
|
335
|
-
throw new Error(`layer "${target.name}" is not an autotile layer`);
|
|
336
|
-
if (!Number.isInteger(frame) || frame < 0) {
|
|
337
|
-
throw new Error(`an autotile animation frame must be an integer at or above zero, got ${frame}`);
|
|
338
|
-
}
|
|
339
|
-
if (target.frame === frame)
|
|
340
|
-
return;
|
|
341
|
-
target.frame = frame;
|
|
342
|
-
for (let y = 0; y < this.heightInTiles; y++) {
|
|
343
|
-
for (let x = 0; x < this.widthInTiles; x++) {
|
|
344
|
-
const cell = this.index(x, y);
|
|
345
|
-
const tile = target.data[cell];
|
|
346
|
-
if (tile <= 0)
|
|
347
|
-
continue;
|
|
348
|
-
const set = this.claimAutotileSets(target.sets, target.name, tile);
|
|
349
|
-
const pieces = this.autotilePieces(set, tile, frame);
|
|
350
|
-
const sprites = target.sprites[cell];
|
|
351
|
-
if (!sprites)
|
|
352
|
-
continue;
|
|
353
|
-
for (let i = 0; i < sprites.length; i++)
|
|
354
|
-
sprites[i].texture = pieces.textures[i];
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Adds a shadow layer: RPG Maker's per-cell shadow bits, drawn as translucent quarter-tile
|
|
360
|
-
* quads. Bit 0 is the top-left quadrant, 1 top-right, 2 bottom-left, 3 bottom-right (the
|
|
361
|
-
* engine's map layer 4). A cell holding 0 (or EMPTY) is clear. Shadow quads keep their own
|
|
362
|
-
* colour whatever `setCellColor` does to the cell under them.
|
|
363
|
-
*
|
|
364
|
-
* @param bits one bit set (0-15) per cell, row-major.
|
|
365
|
-
* @param options `color` (default black) and `alpha` (default 0.5, the engine's shadow).
|
|
366
|
-
*
|
|
367
|
-
* @example
|
|
368
|
-
* ```ts
|
|
369
|
-
* import { TileMap, SpriteSheet } from '@datamoc/mw_games/two-d/render';
|
|
370
|
-
*
|
|
371
|
-
* declare const sheet: SpriteSheet;
|
|
372
|
-
*
|
|
373
|
-
* const map = new TileMap({ width: 2, height: 1, sheet });
|
|
374
|
-
* map.addShadowLayer('shadow', [0b0101, 0]); // the left cell's two left quadrants
|
|
375
|
-
* console.log(map.getTile('shadow', 0, 0)); // 5
|
|
376
|
-
* ```
|
|
377
|
-
*/
|
|
378
|
-
addShadowLayer(name, bits, options = {}) {
|
|
379
|
-
const { cells: total, container, chunks } = this.beginLayer(name, bits.length);
|
|
380
|
-
const color = options.color ?? 0x000000;
|
|
381
|
-
const alpha = options.alpha ?? 0.5;
|
|
382
|
-
if (!Number.isFinite(alpha) || alpha < 0 || alpha > 1) {
|
|
383
|
-
throw new Error(`shadow layer "${name}" alpha must be between 0 and 1, got ${options.alpha}`);
|
|
384
|
-
}
|
|
385
|
-
const data = Int32Array.from(bits, (value) => (value > 0 ? value & 0x0f : 0));
|
|
386
|
-
const layer = {
|
|
387
|
-
kind: 'shadow',
|
|
388
|
-
name,
|
|
389
|
-
data,
|
|
390
|
-
sprites: new Array(total).fill(null),
|
|
391
|
-
container,
|
|
392
|
-
color,
|
|
393
|
-
alpha,
|
|
394
|
-
};
|
|
395
|
-
this.layers.push(layer);
|
|
396
|
-
this.layersByName.set(name, layer);
|
|
397
|
-
this.chunks.push(chunks);
|
|
398
|
-
this.addChild(container);
|
|
399
|
-
for (let y = 0; y < this.heightInTiles; y++) {
|
|
400
|
-
for (let x = 0; x < this.widthInTiles; x++) {
|
|
401
|
-
if (data[this.index(x, y)] > 0)
|
|
402
|
-
this.buildShadowSprites(layer, x, y);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return this;
|
|
406
|
-
}
|
|
407
|
-
buildShadowSprites(layer, x, y) {
|
|
408
|
-
const cell = this.index(x, y);
|
|
409
|
-
const origin = this.cellOrigin(x, y);
|
|
410
|
-
const lift = this.cellHeight[cell] * this.heightStep;
|
|
411
|
-
const width = this.tileWidth / 2;
|
|
412
|
-
const height = this.tileHeight / 2;
|
|
413
|
-
const chunk = this.chunks[this.layers.indexOf(layer)][this.chunkIndex(x, y)];
|
|
414
|
-
const made = [];
|
|
415
|
-
for (let quadrant = 0; quadrant < 4; quadrant++) {
|
|
416
|
-
if (!(layer.data[cell] & (1 << quadrant)))
|
|
417
|
-
continue;
|
|
418
|
-
const sprite = new TintedSprite(Texture.WHITE);
|
|
419
|
-
sprite.x = origin.x + (quadrant % 2) * width;
|
|
420
|
-
sprite.y = origin.y - lift + Math.floor(quadrant / 2) * height;
|
|
421
|
-
sprite.width = width;
|
|
422
|
-
sprite.height = height;
|
|
423
|
-
sprite.tint = layer.color;
|
|
424
|
-
sprite.alpha = layer.alpha;
|
|
425
|
-
chunk.addChild(sprite);
|
|
426
|
-
made.push(sprite);
|
|
427
|
-
}
|
|
428
|
-
layer.sprites[cell] = made;
|
|
429
|
-
}
|
|
430
|
-
setShadowCell(layer, x, y, bits) {
|
|
431
|
-
const cell = this.index(x, y);
|
|
432
|
-
layer.data[cell] = bits > 0 ? bits & 0x0f : 0;
|
|
433
|
-
for (const sprite of layer.sprites[cell] ?? [])
|
|
434
|
-
sprite.destroy();
|
|
435
|
-
layer.sprites[cell] = null;
|
|
436
|
-
if (layer.data[cell] > 0)
|
|
437
|
-
this.buildShadowSprites(layer, x, y);
|
|
438
|
-
}
|
|
439
|
-
/** the animation frame an autotile layer currently shows */
|
|
440
|
-
getAutotileFrame(layer) {
|
|
441
|
-
const target = this.layerAt(layer);
|
|
442
|
-
if (target.kind !== 'autotile')
|
|
443
|
-
throw new Error(`layer "${target.name}" is not an autotile layer`);
|
|
444
|
-
return target.frame;
|
|
445
|
-
}
|
|
446
|
-
resolveAutotileSet(layerName, entry, position) {
|
|
447
|
-
const where = `autotile layer "${layerName}" set ${position}`;
|
|
448
|
-
if (!entry || !entry.sheet)
|
|
449
|
-
throw new Error(`${where} needs a source sheet`);
|
|
450
|
-
const format = entry.format ?? 'rpgm-mv';
|
|
451
|
-
if (format !== 'rpgm-mv' && format !== 'rpgm-xp')
|
|
452
|
-
throw new Error(`${where} has an unknown format "${entry.format}"`);
|
|
453
|
-
if (format === 'rpgm-mv')
|
|
454
|
-
return this.resolveRpgmSet(where, entry);
|
|
455
|
-
return this.resolveXpSet(where, entry);
|
|
456
|
-
}
|
|
457
|
-
resolveRpgmSet(where, entry) {
|
|
458
|
-
if (entry.slot === undefined)
|
|
459
|
-
throw new Error(`${where} needs a slot (0-3) for its MV sheet`);
|
|
460
|
-
if (entry.mode !== undefined && entry.mode !== 'floor' && entry.mode !== 'wall' && entry.mode !== 'mixed') {
|
|
461
|
-
throw new Error(`${where} has an unknown mode "${entry.mode}"`);
|
|
462
|
-
}
|
|
463
|
-
if (entry.animation !== undefined && !Array.isArray(entry.animation)) {
|
|
464
|
-
throw new Error(`${where} animation must list kind runs, got ${typeof entry.animation}`);
|
|
465
|
-
}
|
|
466
|
-
const mode = entry.mode ?? (entry.slot < 2 ? 'floor' : 'wall');
|
|
467
|
-
//kind rows of eight: even rows are wall tops (floor shapes), odd rows wall faces
|
|
468
|
-
const mixedA4 = mode === 'mixed' && entry.slot === 3 && entry.table === undefined;
|
|
469
|
-
const layout = {
|
|
470
|
-
format: 'rpgm-mv',
|
|
471
|
-
slot: entry.slot,
|
|
472
|
-
table: entry.table ??
|
|
473
|
-
(mode === 'floor' || entry.tableEdge || (mode === 'mixed' && entry.slot < 2)
|
|
474
|
-
? RPGM_FLOOR_AUTOTILE_TABLE
|
|
475
|
-
: RPGM_WALL_AUTOTILE_TABLE),
|
|
476
|
-
...(mixedA4
|
|
477
|
-
? {
|
|
478
|
-
tableFor: (kind) => Math.floor(kind / 8) % 2 === 0 ? RPGM_FLOOR_AUTOTILE_TABLE : RPGM_WALL_AUTOTILE_TABLE,
|
|
479
|
-
}
|
|
480
|
-
: {}),
|
|
481
|
-
...(entry.tableEdge ? { tableEdge: true } : {}),
|
|
482
|
-
cycles: entry.animation ?? [],
|
|
483
|
-
};
|
|
484
|
-
assertAutotileLayout(layout);
|
|
485
|
-
return {
|
|
486
|
-
sheet: entry.sheet,
|
|
487
|
-
layout,
|
|
488
|
-
cache: new Map(),
|
|
489
|
-
claims: (tile) => rpgmAutotileSlot(tile) === entry.slot,
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
resolveXpSet(where, entry) {
|
|
493
|
-
const index = entry.index ?? 0;
|
|
494
|
-
const texture = entry.sheet.texture;
|
|
495
|
-
//a 32px-tall strip holds whole animated tiles rather than a quadrant
|
|
496
|
-
//template; anything else must be the 128px template (the 192px
|
|
497
|
-
//expanded-corner variant stays game-side, unsupported here)
|
|
498
|
-
const single = texture.height === 32;
|
|
499
|
-
if (texture.height !== 32 && texture.height !== 128) {
|
|
500
|
-
throw new Error(`${where} is ${texture.height}px tall - XP autotile images are 128px templates or 32px single-tile strips`);
|
|
501
|
-
}
|
|
502
|
-
const stripe = single ? 32 : 96;
|
|
503
|
-
const frames = entry.frames ?? Math.max(1, Math.floor(texture.width / stripe));
|
|
504
|
-
const layout = { format: 'rpgm-xp', index, frames, single };
|
|
505
|
-
assertAutotileLayout(layout);
|
|
506
|
-
if (frames > Math.floor(texture.width / stripe)) {
|
|
507
|
-
throw new Error(`${where} asks for ${frames} frames but its sheet fits ${Math.floor(texture.width / stripe)}`);
|
|
508
|
-
}
|
|
509
|
-
return {
|
|
510
|
-
sheet: entry.sheet,
|
|
511
|
-
layout,
|
|
512
|
-
cache: new Map(),
|
|
513
|
-
claims: (tile) => {
|
|
514
|
-
const ref = xpAutotileRef(tile);
|
|
515
|
-
return ref !== null && ref.index === index;
|
|
516
|
-
},
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
claimAutotileSets(sets, layerName, tile) {
|
|
520
|
-
for (const set of sets) {
|
|
521
|
-
if (set.claims(tile))
|
|
522
|
-
return set;
|
|
523
|
-
}
|
|
524
|
-
throw new Error(`tile ${tile} in autotile layer "${layerName}" matches none of its sets`);
|
|
525
|
-
}
|
|
526
|
-
autotilePieces(set, tile, frame) {
|
|
527
|
-
const key = `${tile}:${frame}`;
|
|
528
|
-
const cached = set.cache.get(key);
|
|
529
|
-
if (cached)
|
|
530
|
-
return cached;
|
|
531
|
-
//tile > 0 is established by every caller, so these parts exist
|
|
532
|
-
const parts = autotileCellParts(set.layout, tile, frame);
|
|
533
|
-
const textures = parts.map((part) => new Texture({
|
|
534
|
-
source: set.sheet.texture.source,
|
|
535
|
-
frame: new Rectangle(part.sourceX, part.sourceY, part.sourceWidth, part.sourceHeight),
|
|
536
|
-
}));
|
|
537
|
-
const pieces = { parts, textures };
|
|
538
|
-
set.cache.set(key, pieces);
|
|
539
|
-
return pieces;
|
|
540
|
-
}
|
|
541
|
-
makeAutotileSprites(layer, set, x, y, tile) {
|
|
542
|
-
const cell = this.index(x, y);
|
|
543
|
-
const pieces = this.autotilePieces(set, tile, layer.frame);
|
|
544
|
-
const origin = this.cellOrigin(x, y);
|
|
545
|
-
const lift = this.cellHeight[cell] * this.heightStep;
|
|
546
|
-
const made = pieces.textures.map((texture, i) => {
|
|
547
|
-
const part = pieces.parts[i];
|
|
548
|
-
const sprite = new TintedSprite(texture);
|
|
549
|
-
sprite.x = origin.x + part.destX * this.tileWidth;
|
|
550
|
-
sprite.y = origin.y - lift + part.destY * this.tileHeight;
|
|
551
|
-
sprite.scale.set((part.destWidth * this.tileWidth) / part.sourceWidth, (part.destHeight * this.tileHeight) / part.sourceHeight);
|
|
552
|
-
sprite.tint = this.cellTint[cell];
|
|
553
|
-
sprite.colorAdd = this.cellAdd[cell];
|
|
554
|
-
return sprite;
|
|
555
|
-
});
|
|
556
|
-
const chunk = this.chunks[this.layers.indexOf(layer)][this.chunkIndex(x, y)];
|
|
557
|
-
for (const sprite of made)
|
|
558
|
-
chunk.addChild(sprite);
|
|
559
|
-
return made;
|
|
560
|
-
}
|
|
561
|
-
setAutotileCell(layer, x, y, tile) {
|
|
562
|
-
const cell = this.index(x, y);
|
|
563
|
-
layer.data[cell] = tile;
|
|
564
|
-
const existing = layer.sprites[cell];
|
|
565
|
-
if (tile <= 0) {
|
|
566
|
-
if (existing)
|
|
567
|
-
for (const sprite of existing)
|
|
568
|
-
sprite.destroy();
|
|
569
|
-
layer.sprites[cell] = null;
|
|
570
|
-
return;
|
|
571
|
-
}
|
|
572
|
-
const set = this.claimAutotileSets(layer.sets, layer.name, tile);
|
|
573
|
-
const pieces = this.autotilePieces(set, tile, layer.frame);
|
|
574
|
-
if (existing && existing.length === pieces.textures.length) {
|
|
575
|
-
for (let i = 0; i < existing.length; i++)
|
|
576
|
-
existing[i].texture = pieces.textures[i];
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
if (existing)
|
|
580
|
-
for (const sprite of existing)
|
|
581
|
-
sprite.destroy();
|
|
582
|
-
layer.sprites[cell] = this.makeAutotileSprites(layer, set, x, y, tile);
|
|
583
|
-
}
|
|
584
|
-
eachCellSprite(layer, cell, apply) {
|
|
585
|
-
const entry = layer.sprites[cell];
|
|
586
|
-
if (!entry)
|
|
587
|
-
return;
|
|
588
|
-
if (Array.isArray(entry)) {
|
|
589
|
-
for (const sprite of entry)
|
|
590
|
-
apply(sprite);
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
apply(entry);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
firstCellSprite(layer, cell) {
|
|
597
|
-
const entry = layer.sprites[cell];
|
|
598
|
-
if (!entry)
|
|
599
|
-
return null;
|
|
600
|
-
return Array.isArray(entry) ? entry[0] : entry;
|
|
601
|
-
}
|
|
602
|
-
layerAt(layer) {
|
|
603
|
-
const found = typeof layer === 'number' ? this.layers[layer] : this.layersByName.get(layer);
|
|
604
|
-
if (!found)
|
|
605
|
-
throw new Error(`no such layer: ${layer}`);
|
|
606
|
-
return found;
|
|
607
|
-
}
|
|
608
|
-
chunkIndex(x, y) {
|
|
609
|
-
return Math.floor(y / this.chunkSize) * this.chunkColumns + Math.floor(x / this.chunkSize);
|
|
610
|
-
}
|
|
611
|
-
/** the centre of a cell's tile, before the projections below settle on a shared contract */
|
|
612
|
-
projectedCenter(x, y) {
|
|
613
|
-
switch (this.shape) {
|
|
614
|
-
case 'square':
|
|
615
|
-
return { x: (x + 0.5) * this.tileWidth, y: (y + 0.5) * this.tileHeight };
|
|
616
|
-
case 'hex':
|
|
617
|
-
return hexToPixel(x, y, this.tileWidth, this.tileHeight);
|
|
618
|
-
case 'isometric':
|
|
619
|
-
//the whole diamond is shifted right by the tallest possible row offset, so
|
|
620
|
-
//every tile lands at a non-negative pixel position
|
|
621
|
-
return {
|
|
622
|
-
x: (x - y + (this.heightInTiles - 1)) * (this.tileWidth / 2) + this.tileWidth / 2,
|
|
623
|
-
y: (x + y) * (this.tileHeight / 2) + this.tileHeight / 2,
|
|
624
|
-
};
|
|
625
|
-
case 'staggered':
|
|
626
|
-
//every other row (by convention, the odd ones) is pushed half a tile right;
|
|
627
|
-
//rows are packed at half height so alternating rows still tile seamlessly
|
|
628
|
-
return {
|
|
629
|
-
x: x * this.tileWidth + (y & 1) * (this.tileWidth / 2) + this.tileWidth / 2,
|
|
630
|
-
y: y * (this.tileHeight / 2) + this.tileHeight / 2,
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
/** the cell under a pixel position - the inverse of `projectedCenter` */
|
|
635
|
-
projectedTile(px, py) {
|
|
636
|
-
switch (this.shape) {
|
|
637
|
-
case 'square':
|
|
638
|
-
return { x: Math.floor(px / this.tileWidth), y: Math.floor(py / this.tileHeight) };
|
|
639
|
-
case 'hex':
|
|
640
|
-
return pixelToHex(px, py, this.tileWidth, this.tileHeight);
|
|
641
|
-
case 'isometric': {
|
|
642
|
-
const rx = (px - this.tileWidth / 2) / (this.tileWidth / 2) - (this.heightInTiles - 1);
|
|
643
|
-
const ry = (py - this.tileHeight / 2) / (this.tileHeight / 2);
|
|
644
|
-
return { x: Math.round((rx + ry) / 2), y: Math.round((ry - rx) / 2) };
|
|
645
|
-
}
|
|
646
|
-
case 'staggered': {
|
|
647
|
-
const y = Math.round((py - this.tileHeight / 2) / (this.tileHeight / 2));
|
|
648
|
-
const x = Math.round((px - this.tileWidth / 2 - (y & 1) * (this.tileWidth / 2)) / this.tileWidth);
|
|
649
|
-
return { x, y };
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
/** top-left corner of a cell, in world units - where a sprite anchored at (0,0) belongs */
|
|
654
|
-
cellOrigin(x, y) {
|
|
655
|
-
const center = this.projectedCenter(x, y);
|
|
656
|
-
return { x: center.x - this.tileWidth / 2, y: center.y - this.tileHeight / 2 };
|
|
657
|
-
}
|
|
658
|
-
/** resolves a cell value to a texture: plain indices read sheet 0, packs read their sheet */
|
|
659
|
-
textureFor(frame) {
|
|
660
|
-
const sheet = tileFrameSheet(frame);
|
|
661
|
-
if (sheet >= this.sheets.length) {
|
|
662
|
-
throw new Error(`frame ${frame} names sheet ${sheet}, but this map has ${this.sheets.length}`);
|
|
663
|
-
}
|
|
664
|
-
return this.sheets[sheet].get(tileFrameIndex(frame));
|
|
665
|
-
}
|
|
666
|
-
buildSprite(layer, x, y, frame) {
|
|
667
|
-
const sprite = new TintedSprite(this.textureFor(frame));
|
|
668
|
-
const origin = this.cellOrigin(x, y);
|
|
669
|
-
sprite.x = origin.x;
|
|
670
|
-
//raised cells draw their top higher; the bands between are the faces below
|
|
671
|
-
sprite.y = origin.y - this.cellHeight[this.index(x, y)] * this.heightStep;
|
|
672
|
-
const cell = this.index(x, y);
|
|
673
|
-
sprite.tint = this.cellTint[cell];
|
|
674
|
-
sprite.colorAdd = this.cellAdd[cell];
|
|
675
|
-
layer.sprites[cell] = sprite;
|
|
676
|
-
this.chunks[this.layers.indexOf(layer)][this.chunkIndex(x, y)].addChild(sprite);
|
|
677
|
-
return sprite;
|
|
678
|
-
}
|
|
679
|
-
getTile(layer, x, y) {
|
|
680
|
-
if (!this.inside(x, y))
|
|
681
|
-
return EMPTY;
|
|
682
|
-
return this.layerAt(layer).data[this.index(x, y)];
|
|
683
|
-
}
|
|
684
|
-
/**
|
|
685
|
-
* Replaces one cell. On an autotile layer the value is a raw autotile id
|
|
686
|
-
* rather than a frame index; EMPTY (or any value at or below zero)
|
|
687
|
-
* clears the cell there too.
|
|
688
|
-
*/
|
|
689
|
-
setTile(layer, x, y, frame) {
|
|
690
|
-
if (!this.inside(x, y))
|
|
691
|
-
return;
|
|
692
|
-
const target = this.layerAt(layer);
|
|
693
|
-
const cell = this.index(x, y);
|
|
694
|
-
if (target.data[cell] === frame)
|
|
695
|
-
return;
|
|
696
|
-
if (target.kind === 'autotile') {
|
|
697
|
-
this.setAutotileCell(target, x, y, frame);
|
|
698
|
-
}
|
|
699
|
-
else if (target.kind === 'shadow') {
|
|
700
|
-
this.setShadowCell(target, x, y, frame);
|
|
701
|
-
}
|
|
702
|
-
else {
|
|
703
|
-
target.data[cell] = frame;
|
|
704
|
-
const existing = target.sprites[cell];
|
|
705
|
-
if (frame === EMPTY) {
|
|
706
|
-
existing?.destroy();
|
|
707
|
-
target.sprites[cell] = null;
|
|
708
|
-
}
|
|
709
|
-
else if (existing) {
|
|
710
|
-
existing.texture = this.textureFor(frame);
|
|
711
|
-
}
|
|
712
|
-
else {
|
|
713
|
-
this.buildSprite(target, x, y, frame);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
//faces follow the bottom layer: no tile there, no block to side
|
|
717
|
-
if (this.layers[0] === target)
|
|
718
|
-
this.syncFaces(x, y);
|
|
719
|
-
}
|
|
720
|
-
/** fills a whole layer at once, which is what loading a map does */
|
|
721
|
-
setLayerData(layer, data) {
|
|
722
|
-
//resolved once up front so a bad layer name fails before half the map is rewritten
|
|
723
|
-
this.layerAt(layer);
|
|
724
|
-
for (let y = 0; y < this.heightInTiles; y++) {
|
|
725
|
-
for (let x = 0; x < this.widthInTiles; x++) {
|
|
726
|
-
this.setTile(layer, x, y, data[this.index(x, y)] ?? EMPTY);
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
/**
|
|
731
|
-
* Copies a `width` by `height` block of frames (row-major, `EMPTY` for a blank cell)
|
|
732
|
-
* into a layer with its top-left corner at tile (`x`, `y`), leaving every other cell
|
|
733
|
-
* alone. The block must fit inside the map: one that overflows would otherwise wrap
|
|
734
|
-
* into the next row, so it throws instead.
|
|
735
|
-
*/
|
|
736
|
-
stampRect(layer, x, y, width, height, frames) {
|
|
737
|
-
this.layerAt(layer);
|
|
738
|
-
if (frames.length !== width * height) {
|
|
739
|
-
throw new Error(`a ${width}x${height} stamp needs ${width * height} frames, got ${frames.length}`);
|
|
740
|
-
}
|
|
741
|
-
if (x < 0 || y < 0 || x + width > this.widthInTiles || y + height > this.heightInTiles) {
|
|
742
|
-
throw new Error(`a ${width}x${height} stamp at (${x},${y}) does not fit the ${this.widthInTiles}x${this.heightInTiles} map`);
|
|
743
|
-
}
|
|
744
|
-
for (let row = 0; row < height; row++) {
|
|
745
|
-
for (let column = 0; column < width; column++) {
|
|
746
|
-
this.setTile(layer, x + column, y + row, frames[row * width + column]);
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
/**
|
|
751
|
-
* Colours one cell across every layer.
|
|
752
|
-
*
|
|
753
|
-
* This is the fog-of-war and lighting hook. `tint` multiplies, so it darkens; `add` is
|
|
754
|
-
* the additive term, which is what lets an unseen-but-remembered tile wash out towards
|
|
755
|
-
* grey rather than merely going dark. Side faces take the tint but not the add -
|
|
756
|
-
* plain geometry has no batcher of its own to carry it.
|
|
757
|
-
*/
|
|
758
|
-
setCellColor(x, y, tint, add = 0) {
|
|
759
|
-
if (!this.inside(x, y))
|
|
760
|
-
return;
|
|
761
|
-
const cell = this.index(x, y);
|
|
762
|
-
if (this.cellTint[cell] === tint && this.cellAdd[cell] === add)
|
|
763
|
-
return;
|
|
764
|
-
this.cellTint[cell] = tint;
|
|
765
|
-
this.cellAdd[cell] = add;
|
|
766
|
-
for (const layer of this.layers) {
|
|
767
|
-
//a shadow keeps its own colour; the cell's light already shows through it
|
|
768
|
-
if (layer.kind === 'shadow')
|
|
769
|
-
continue;
|
|
770
|
-
this.eachCellSprite(layer, cell, (sprite) => {
|
|
771
|
-
sprite.tint = tint;
|
|
772
|
-
sprite.colorAdd = add;
|
|
773
|
-
});
|
|
774
|
-
}
|
|
775
|
-
const face = this.faces[cell];
|
|
776
|
-
if (face)
|
|
777
|
-
face.tint = tint;
|
|
778
|
-
}
|
|
779
|
-
getCellTint(x, y) {
|
|
780
|
-
return this.inside(x, y) ? this.cellTint[this.index(x, y)] : 0;
|
|
781
|
-
}
|
|
782
|
-
/** resets every cell to undimmed */
|
|
783
|
-
clearColors() {
|
|
784
|
-
for (let y = 0; y < this.heightInTiles; y++) {
|
|
785
|
-
for (let x = 0; x < this.widthInTiles; x++)
|
|
786
|
-
this.setCellColor(x, y, 0xffffff, 0);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Raises or lowers one cell, in whole levels.
|
|
791
|
-
*
|
|
792
|
-
* Every layer's top tile moves up by one `heightStep` per level, and on the
|
|
793
|
-
* diamond projections a raised cell grows two shaded side faces per level -
|
|
794
|
-
* the left and right walls of the block, drawn into the bottom layer's chunk
|
|
795
|
-
* behind the cell's own top, so rows in front still overlap correctly. Square
|
|
796
|
-
* and hex cells lift without faces. A cell with no bottom-layer tile grows no
|
|
797
|
-
* faces: nothing to be the side of. Negative heights sink the top with no
|
|
798
|
-
* faces - pits are a hole, not an inverted block.
|
|
799
|
-
*
|
|
800
|
-
* The usual source is an `Elevation`: `map.setCellHeight(x, y,
|
|
801
|
-
* elevation.heightAt(x, y))` over every cell, after the layers are added.
|
|
802
|
-
*/
|
|
803
|
-
setCellHeight(x, y, height) {
|
|
804
|
-
if (!this.inside(x, y))
|
|
805
|
-
return;
|
|
806
|
-
if (!Number.isInteger(height)) {
|
|
807
|
-
throw new Error(`a cell's height must be a whole number, got ${height}`);
|
|
808
|
-
}
|
|
809
|
-
const cell = this.index(x, y);
|
|
810
|
-
if (this.cellHeight[cell] === height)
|
|
811
|
-
return;
|
|
812
|
-
//a delta keeps each sprite's own offset inside its cell, so the four
|
|
813
|
-
//quadrant halves of an autotile ride up together with plain tiles
|
|
814
|
-
const rise = (height - this.cellHeight[cell]) * this.heightStep;
|
|
815
|
-
this.cellHeight[cell] = height;
|
|
816
|
-
for (const layer of this.layers) {
|
|
817
|
-
this.eachCellSprite(layer, cell, (sprite) => {
|
|
818
|
-
sprite.y -= rise;
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
this.syncFaces(x, y);
|
|
822
|
-
}
|
|
823
|
-
/** the elevation of a cell in whole levels; off the map reads as ground */
|
|
824
|
-
getCellHeight(x, y) {
|
|
825
|
-
return this.inside(x, y) ? this.cellHeight[this.index(x, y)] : 0;
|
|
826
|
-
}
|
|
827
|
-
/** how many cells currently draw side faces, for a debug overlay */
|
|
828
|
-
get faceCount() {
|
|
829
|
-
return this.faces.filter((face) => face !== null).length;
|
|
830
|
-
}
|
|
831
|
-
/** rebuilds or removes one cell's faces to match its height and bottom tile */
|
|
832
|
-
syncFaces(x, y) {
|
|
833
|
-
if (this.layers.length === 0)
|
|
834
|
-
return;
|
|
835
|
-
const cell = this.index(x, y);
|
|
836
|
-
const want = (this.shape === 'isometric' || this.shape === 'staggered') &&
|
|
837
|
-
this.cellHeight[cell] > 0 &&
|
|
838
|
-
this.layers[0].data[cell] !== EMPTY;
|
|
839
|
-
const have = this.faces[cell];
|
|
840
|
-
if (!want) {
|
|
841
|
-
if (have) {
|
|
842
|
-
have.destroy();
|
|
843
|
-
this.faces[cell] = null;
|
|
844
|
-
}
|
|
845
|
-
return;
|
|
846
|
-
}
|
|
847
|
-
const face = have ?? new Graphics();
|
|
848
|
-
this.drawFaces(face, x, y);
|
|
849
|
-
face.tint = this.cellTint[cell];
|
|
850
|
-
if (!have) {
|
|
851
|
-
this.faces[cell] = face;
|
|
852
|
-
//behind the cell's own top, after everything drawn above it on screen
|
|
853
|
-
const chunk = this.chunks[0][this.chunkIndex(x, y)];
|
|
854
|
-
const top = this.firstCellSprite(this.layers[0], cell);
|
|
855
|
-
if (top)
|
|
856
|
-
chunk.addChildAt(face, chunk.getChildIndex(top));
|
|
857
|
-
else
|
|
858
|
-
chunk.addChild(face);
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* Draws one raised block: per level, a left and a right rhombus band stacking
|
|
863
|
-
* from the base diamond up to the lifted top. Band `k` spans the step between
|
|
864
|
-
* `(k-1) * heightStep` and `k * heightStep` above the base, so the bands tile
|
|
865
|
-
* the whole side exactly, whatever the step is.
|
|
866
|
-
*/
|
|
867
|
-
drawFaces(face, x, y) {
|
|
868
|
-
const origin = this.cellOrigin(x, y);
|
|
869
|
-
const ox = origin.x;
|
|
870
|
-
const oy = origin.y;
|
|
871
|
-
const halfW = this.tileWidth / 2;
|
|
872
|
-
const halfH = this.tileHeight / 2;
|
|
873
|
-
const step = this.heightStep;
|
|
874
|
-
const height = this.cellHeight[this.index(x, y)];
|
|
875
|
-
face.clear();
|
|
876
|
-
for (let k = 1; k <= height; k++) {
|
|
877
|
-
const top = k * step;
|
|
878
|
-
const bottom = (k - 1) * step;
|
|
879
|
-
face.poly([
|
|
880
|
-
ox,
|
|
881
|
-
oy + halfH - top,
|
|
882
|
-
ox + halfW,
|
|
883
|
-
oy + halfH * 2 - top,
|
|
884
|
-
ox + halfW,
|
|
885
|
-
oy + halfH * 2 - bottom,
|
|
886
|
-
ox,
|
|
887
|
-
oy + halfH - bottom,
|
|
888
|
-
]).fill(LEFT_FACE_FILL);
|
|
889
|
-
face.poly([
|
|
890
|
-
ox + halfW,
|
|
891
|
-
oy + halfH * 2 - top,
|
|
892
|
-
ox + halfW * 2,
|
|
893
|
-
oy + halfH - top,
|
|
894
|
-
ox + halfW * 2,
|
|
895
|
-
oy + halfH - bottom,
|
|
896
|
-
ox + halfW,
|
|
897
|
-
oy + halfH * 2 - bottom,
|
|
898
|
-
]).fill(RIGHT_FACE_FILL);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
/** world point to tile coordinates */
|
|
902
|
-
toTile(worldX, worldY) {
|
|
903
|
-
//the base grid, not the lifted tops: a raised tile overlaps its neighbours
|
|
904
|
-
//on screen, and unpicking which one a point meant needs the heights, which
|
|
905
|
-
//this deliberately does not consult - games with raised clickable cells
|
|
906
|
-
//adjust the point by the known height first
|
|
907
|
-
return this.projectedTile(worldX, worldY);
|
|
908
|
-
}
|
|
909
|
-
/**
|
|
910
|
-
* The centre of a tile, in world units: where a character standing on it belongs.
|
|
911
|
-
*
|
|
912
|
-
* Rides the cell's elevation: a raised cell reports its lifted top, so whoever
|
|
913
|
-
* is placed there stands on the block rather than inside it.
|
|
914
|
-
*/
|
|
915
|
-
tileCenter(x, y) {
|
|
916
|
-
const center = this.projectedCenter(x, y);
|
|
917
|
-
center.y -= this.getCellHeight(x, y) * this.heightStep;
|
|
918
|
-
return center;
|
|
919
|
-
}
|
|
920
|
-
/**
|
|
921
|
-
* Switches off chunks the camera cannot see.
|
|
922
|
-
*
|
|
923
|
-
* Call it once per frame. Culling by chunk rather than by tile is the point: a 200x200
|
|
924
|
-
* map is 40 000 tiles but only 169 chunks, so the test runs a couple of hundred times
|
|
925
|
-
* instead of forty thousand.
|
|
926
|
-
*/
|
|
927
|
-
cull(camera) {
|
|
928
|
-
const view = camera.view;
|
|
929
|
-
//the screen's four corners, mapped into tile space through whichever projection this
|
|
930
|
-
//map uses. A projection is affine, so a rectangle's image (or preimage) is a
|
|
931
|
-
//parallelogram, and the axis-aligned box around those four points always fully
|
|
932
|
-
//contains it - the same reasoning works unchanged for square, hex, isometric or
|
|
933
|
-
//staggered, so nothing here needs to know which one it is
|
|
934
|
-
//scalar min/max over the four corners by hand, rather than an array + .map() + spread,
|
|
935
|
-
//since this runs once per frame
|
|
936
|
-
const topLeft = this.projectedTile(view.x, view.y);
|
|
937
|
-
const topRight = this.projectedTile(view.x + view.width, view.y);
|
|
938
|
-
const bottomLeft = this.projectedTile(view.x, view.y + view.height);
|
|
939
|
-
const bottomRight = this.projectedTile(view.x + view.width, view.y + view.height);
|
|
940
|
-
const tileMinX = Math.min(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x);
|
|
941
|
-
const tileMaxX = Math.max(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x);
|
|
942
|
-
const tileMinY = Math.min(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);
|
|
943
|
-
const tileMaxY = Math.max(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);
|
|
944
|
-
//a one-chunk margin, so a chunk is switched on slightly before it is needed
|
|
945
|
-
const minChunkX = Math.floor(tileMinX / this.chunkSize) - 1;
|
|
946
|
-
const maxChunkX = Math.floor(tileMaxX / this.chunkSize) + 1;
|
|
947
|
-
const minChunkY = Math.floor(tileMinY / this.chunkSize) - 1;
|
|
948
|
-
const maxChunkY = Math.floor(tileMaxY / this.chunkSize) + 1;
|
|
949
|
-
for (let cy = 0; cy < this.chunkRows; cy++) {
|
|
950
|
-
const rowVisible = cy >= minChunkY && cy <= maxChunkY;
|
|
951
|
-
for (let cx = 0; cx < this.chunkColumns; cx++) {
|
|
952
|
-
const visible = rowVisible && cx >= minChunkX && cx <= maxChunkX;
|
|
953
|
-
const index = cy * this.chunkColumns + cx;
|
|
954
|
-
for (const layerChunks of this.chunks) {
|
|
955
|
-
layerChunks[index].renderable = visible;
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
/** how many chunks are currently drawn, for a debug overlay */
|
|
961
|
-
get visibleChunks() {
|
|
962
|
-
if (this.chunks.length === 0)
|
|
963
|
-
return 0;
|
|
964
|
-
return this.chunks[0].filter((chunk) => chunk.renderable).length;
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
//# sourceMappingURL=TileMap.js.map
|