@rpgm-tools/neo-angband-core 0.18.0 → 0.19.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/README.md +1 -1
- package/dist/agent/perceive.d.ts.map +1 -1
- package/dist/agent/perceive.js +2 -2
- package/dist/agent/perceive.js.map +1 -1
- package/dist/combat/blow-vectors.d.ts +78 -0
- package/dist/combat/blow-vectors.d.ts.map +1 -0
- package/dist/combat/blow-vectors.fixtures.d.ts +19 -0
- package/dist/combat/blow-vectors.fixtures.d.ts.map +1 -0
- package/dist/combat/blow-vectors.fixtures.js +81 -0
- package/dist/combat/blow-vectors.fixtures.js.map +1 -0
- package/dist/combat/blow-vectors.js +195 -0
- package/dist/combat/blow-vectors.js.map +1 -0
- package/dist/combat/brand-slay.d.ts +22 -9
- package/dist/combat/brand-slay.d.ts.map +1 -1
- package/dist/combat/brand-slay.js +37 -10
- package/dist/combat/brand-slay.js.map +1 -1
- package/dist/combat/index.d.ts +1 -1
- package/dist/combat/index.js +1 -1
- package/dist/combat/melee.d.ts +25 -13
- package/dist/combat/melee.d.ts.map +1 -1
- package/dist/combat/melee.js +23 -19
- package/dist/combat/melee.js.map +1 -1
- package/dist/combat/mon-melee.d.ts +166 -7
- package/dist/combat/mon-melee.d.ts.map +1 -1
- package/dist/combat/mon-melee.js +469 -338
- package/dist/combat/mon-melee.js.map +1 -1
- package/dist/combat/ranged.d.ts +15 -13
- package/dist/combat/ranged.d.ts.map +1 -1
- package/dist/combat/ranged.js +31 -29
- package/dist/combat/ranged.js.map +1 -1
- package/dist/constants.d.ts +14 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +14 -0
- package/dist/constants.js.map +1 -1
- package/dist/datafile.d.ts +48 -0
- package/dist/datafile.d.ts.map +1 -0
- package/dist/datafile.js +102 -0
- package/dist/datafile.js.map +1 -0
- package/dist/effects/effect-info-registry.d.ts +237 -0
- package/dist/effects/effect-info-registry.d.ts.map +1 -0
- package/dist/effects/effect-info-registry.js +138 -0
- package/dist/effects/effect-info-registry.js.map +1 -0
- package/dist/effects/effect-info-vectors.d.ts +92 -0
- package/dist/effects/effect-info-vectors.d.ts.map +1 -0
- package/dist/effects/effect-info-vectors.fixtures.d.ts +18 -0
- package/dist/effects/effect-info-vectors.fixtures.d.ts.map +1 -0
- package/dist/effects/effect-info-vectors.fixtures.js +51 -0
- package/dist/effects/effect-info-vectors.fixtures.js.map +1 -0
- package/dist/effects/effect-info-vectors.js +315 -0
- package/dist/effects/effect-info-vectors.js.map +1 -0
- package/dist/effects/effect-info.d.ts +5 -1
- package/dist/effects/effect-info.d.ts.map +1 -1
- package/dist/effects/effect-info.js +245 -143
- package/dist/effects/effect-info.js.map +1 -1
- package/dist/effects/effect.d.ts +4 -3
- package/dist/effects/effect.d.ts.map +1 -1
- package/dist/effects/effect.js +88 -70
- package/dist/effects/effect.js.map +1 -1
- package/dist/effects/handlers.d.ts +1 -1
- package/dist/effects/handlers.d.ts.map +1 -1
- package/dist/effects/handlers.js +5 -2
- package/dist/effects/handlers.js.map +1 -1
- package/dist/effects/interpreter.d.ts +11 -0
- package/dist/effects/interpreter.d.ts.map +1 -1
- package/dist/effects/interpreter.js +13 -0
- package/dist/effects/interpreter.js.map +1 -1
- package/dist/game/cave-cmd.d.ts +9 -5
- package/dist/game/cave-cmd.d.ts.map +1 -1
- package/dist/game/cave-cmd.js +56 -11
- package/dist/game/cave-cmd.js.map +1 -1
- package/dist/game/cave-square.d.ts +42 -0
- package/dist/game/cave-square.d.ts.map +1 -0
- package/dist/game/cave-square.js +73 -0
- package/dist/game/cave-square.js.map +1 -0
- package/dist/game/char-sheet.d.ts +12 -8
- package/dist/game/char-sheet.d.ts.map +1 -1
- package/dist/game/char-sheet.js +41 -8
- package/dist/game/char-sheet.js.map +1 -1
- package/dist/game/chest.d.ts +2 -3
- package/dist/game/chest.d.ts.map +1 -1
- package/dist/game/chest.js +17 -6
- package/dist/game/chest.js.map +1 -1
- package/dist/game/context.d.ts +213 -22
- package/dist/game/context.d.ts.map +1 -1
- package/dist/game/context.js +109 -17
- package/dist/game/context.js.map +1 -1
- package/dist/game/describe.d.ts +13 -0
- package/dist/game/describe.d.ts.map +1 -1
- package/dist/game/describe.js +32 -4
- package/dist/game/describe.js.map +1 -1
- package/dist/game/display.d.ts +97 -8
- package/dist/game/display.d.ts.map +1 -1
- package/dist/game/display.js +157 -13
- package/dist/game/display.js.map +1 -1
- package/dist/game/dump-level.d.ts.map +1 -1
- package/dist/game/dump-level.js +3 -2
- package/dist/game/dump-level.js.map +1 -1
- package/dist/game/effect-attack.d.ts.map +1 -1
- package/dist/game/effect-attack.js +36 -27
- package/dist/game/effect-attack.js.map +1 -1
- package/dist/game/effect-detect.d.ts +4 -4
- package/dist/game/effect-detect.d.ts.map +1 -1
- package/dist/game/effect-detect.js +42 -9
- package/dist/game/effect-detect.js.map +1 -1
- package/dist/game/effect-env.d.ts +7 -1
- package/dist/game/effect-env.d.ts.map +1 -1
- package/dist/game/effect-env.js +1 -0
- package/dist/game/effect-env.js.map +1 -1
- package/dist/game/effect-general.d.ts +5 -3
- package/dist/game/effect-general.d.ts.map +1 -1
- package/dist/game/effect-general.js +94 -43
- package/dist/game/effect-general.js.map +1 -1
- package/dist/game/effect-item.d.ts +2 -1
- package/dist/game/effect-item.d.ts.map +1 -1
- package/dist/game/effect-item.js +136 -82
- package/dist/game/effect-item.js.map +1 -1
- package/dist/game/effect-melee.d.ts +10 -4
- package/dist/game/effect-melee.d.ts.map +1 -1
- package/dist/game/effect-melee.js +44 -19
- package/dist/game/effect-melee.js.map +1 -1
- package/dist/game/effect-monster.d.ts +26 -4
- package/dist/game/effect-monster.d.ts.map +1 -1
- package/dist/game/effect-monster.js +52 -9
- package/dist/game/effect-monster.js.map +1 -1
- package/dist/game/effect-teleport.d.ts +58 -19
- package/dist/game/effect-teleport.d.ts.map +1 -1
- package/dist/game/effect-teleport.js +143 -27
- package/dist/game/effect-teleport.js.map +1 -1
- package/dist/game/effect-terrain.d.ts +1 -3
- package/dist/game/effect-terrain.d.ts.map +1 -1
- package/dist/game/effect-terrain.js +38 -22
- package/dist/game/effect-terrain.js.map +1 -1
- package/dist/game/equip-cmp.d.ts.map +1 -1
- package/dist/game/equip-cmp.js +10 -7
- package/dist/game/equip-cmp.js.map +1 -1
- package/dist/game/floor.d.ts +16 -4
- package/dist/game/floor.d.ts.map +1 -1
- package/dist/game/floor.js +22 -4
- package/dist/game/floor.js.map +1 -1
- package/dist/game/gear.d.ts +101 -13
- package/dist/game/gear.d.ts.map +1 -1
- package/dist/game/gear.js +183 -24
- package/dist/game/gear.js.map +1 -1
- package/dist/game/harness.d.ts +2 -1
- package/dist/game/harness.d.ts.map +1 -1
- package/dist/game/harness.js +12 -1
- package/dist/game/harness.js.map +1 -1
- package/dist/game/ignore-cmd.d.ts +47 -8
- package/dist/game/ignore-cmd.d.ts.map +1 -1
- package/dist/game/ignore-cmd.js +76 -8
- package/dist/game/ignore-cmd.js.map +1 -1
- package/dist/game/known.d.ts +223 -34
- package/dist/game/known.d.ts.map +1 -1
- package/dist/game/known.js +301 -67
- package/dist/game/known.js.map +1 -1
- package/dist/game/loop.d.ts +4 -3
- package/dist/game/loop.d.ts.map +1 -1
- package/dist/game/loop.js +49 -29
- package/dist/game/loop.js.map +1 -1
- package/dist/game/lore-color.d.ts.map +1 -1
- package/dist/game/lore-color.js +13 -1
- package/dist/game/lore-color.js.map +1 -1
- package/dist/game/mon-cast.d.ts +3 -4
- package/dist/game/mon-cast.d.ts.map +1 -1
- package/dist/game/mon-cast.js +30 -2
- package/dist/game/mon-cast.js.map +1 -1
- package/dist/game/mon-cmd.d.ts +4 -5
- package/dist/game/mon-cmd.d.ts.map +1 -1
- package/dist/game/mon-cmd.js +80 -27
- package/dist/game/mon-cmd.js.map +1 -1
- package/dist/game/mon-death.d.ts +8 -4
- package/dist/game/mon-death.d.ts.map +1 -1
- package/dist/game/mon-death.js +6 -9
- package/dist/game/mon-death.js.map +1 -1
- package/dist/game/mon-group.d.ts +9 -5
- package/dist/game/mon-group.d.ts.map +1 -1
- package/dist/game/mon-group.js +9 -5
- package/dist/game/mon-group.js.map +1 -1
- package/dist/game/mon-message.d.ts +90 -40
- package/dist/game/mon-message.d.ts.map +1 -1
- package/dist/game/mon-message.js +267 -59
- package/dist/game/mon-message.js.map +1 -1
- package/dist/game/mon-place.d.ts +11 -1
- package/dist/game/mon-place.d.ts.map +1 -1
- package/dist/game/mon-place.js +15 -3
- package/dist/game/mon-place.js.map +1 -1
- package/dist/game/mon-ranged.d.ts +2 -1
- package/dist/game/mon-ranged.d.ts.map +1 -1
- package/dist/game/mon-ranged.js +11 -5
- package/dist/game/mon-ranged.js.map +1 -1
- package/dist/game/mon-side.d.ts +3 -2
- package/dist/game/mon-side.d.ts.map +1 -1
- package/dist/game/mon-side.js +15 -14
- package/dist/game/mon-side.js.map +1 -1
- package/dist/game/monster-turn.d.ts +20 -10
- package/dist/game/monster-turn.d.ts.map +1 -1
- package/dist/game/monster-turn.js +110 -83
- package/dist/game/monster-turn.js.map +1 -1
- package/dist/game/notice.d.ts +36 -0
- package/dist/game/notice.d.ts.map +1 -0
- package/dist/game/notice.js +79 -0
- package/dist/game/notice.js.map +1 -0
- package/dist/game/obj-cmd.d.ts +14 -3
- package/dist/game/obj-cmd.d.ts.map +1 -1
- package/dist/game/obj-cmd.js +109 -35
- package/dist/game/obj-cmd.js.map +1 -1
- package/dist/game/obj-list.d.ts +13 -2
- package/dist/game/obj-list.d.ts.map +1 -1
- package/dist/game/obj-list.js +42 -27
- package/dist/game/obj-list.js.map +1 -1
- package/dist/game/object-inspect.d.ts +9 -0
- package/dist/game/object-inspect.d.ts.map +1 -1
- package/dist/game/object-inspect.js +4 -0
- package/dist/game/object-inspect.js.map +1 -1
- package/dist/game/pickup.d.ts +0 -2
- package/dist/game/pickup.d.ts.map +1 -1
- package/dist/game/pickup.js +18 -3
- package/dist/game/pickup.js.map +1 -1
- package/dist/game/player-side-vectors.d.ts +174 -0
- package/dist/game/player-side-vectors.d.ts.map +1 -0
- package/dist/game/player-side-vectors.fixtures.d.ts +33 -0
- package/dist/game/player-side-vectors.fixtures.d.ts.map +1 -0
- package/dist/game/player-side-vectors.fixtures.js +191 -0
- package/dist/game/player-side-vectors.fixtures.js.map +1 -0
- package/dist/game/player-side-vectors.js +292 -0
- package/dist/game/player-side-vectors.js.map +1 -0
- package/dist/game/player-side.d.ts +129 -1
- package/dist/game/player-side.d.ts.map +1 -1
- package/dist/game/player-side.js +520 -338
- package/dist/game/player-side.js.map +1 -1
- package/dist/game/player-turn.d.ts +26 -7
- package/dist/game/player-turn.d.ts.map +1 -1
- package/dist/game/player-turn.js +180 -33
- package/dist/game/player-turn.js.map +1 -1
- package/dist/game/poly.d.ts +38 -0
- package/dist/game/poly.d.ts.map +1 -0
- package/dist/game/poly.js +82 -0
- package/dist/game/poly.js.map +1 -0
- package/dist/game/project-cast.d.ts +20 -3
- package/dist/game/project-cast.d.ts.map +1 -1
- package/dist/game/project-cast.js +49 -6
- package/dist/game/project-cast.js.map +1 -1
- package/dist/game/project-feat-vectors.d.ts +124 -0
- package/dist/game/project-feat-vectors.d.ts.map +1 -0
- package/dist/game/project-feat-vectors.fixtures.d.ts +13 -0
- package/dist/game/project-feat-vectors.fixtures.d.ts.map +1 -0
- package/dist/game/project-feat-vectors.fixtures.js +94 -0
- package/dist/game/project-feat-vectors.fixtures.js.map +1 -0
- package/dist/game/project-feat-vectors.js +229 -0
- package/dist/game/project-feat-vectors.js.map +1 -0
- package/dist/game/project-feat.d.ts +53 -1
- package/dist/game/project-feat.d.ts.map +1 -1
- package/dist/game/project-feat.js +374 -247
- package/dist/game/project-feat.js.map +1 -1
- package/dist/game/project-monster.d.ts +21 -8
- package/dist/game/project-monster.d.ts.map +1 -1
- package/dist/game/project-monster.js +45 -21
- package/dist/game/project-monster.js.map +1 -1
- package/dist/game/project-obj.d.ts +62 -0
- package/dist/game/project-obj.d.ts.map +1 -1
- package/dist/game/project-obj.js +72 -41
- package/dist/game/project-obj.js.map +1 -1
- package/dist/game/project-player.d.ts +8 -0
- package/dist/game/project-player.d.ts.map +1 -1
- package/dist/game/project-player.js.map +1 -1
- package/dist/game/projection-handlers.d.ts +81 -0
- package/dist/game/projection-handlers.d.ts.map +1 -0
- package/dist/game/projection-handlers.js +93 -0
- package/dist/game/projection-handlers.js.map +1 -0
- package/dist/game/quest.d.ts +23 -0
- package/dist/game/quest.d.ts.map +1 -1
- package/dist/game/quest.js +42 -0
- package/dist/game/quest.js.map +1 -1
- package/dist/game/ranged-cmd.d.ts +13 -2
- package/dist/game/ranged-cmd.d.ts.map +1 -1
- package/dist/game/ranged-cmd.js +32 -15
- package/dist/game/ranged-cmd.js.map +1 -1
- package/dist/game/repeat.d.ts +78 -0
- package/dist/game/repeat.d.ts.map +1 -0
- package/dist/game/repeat.js +88 -0
- package/dist/game/repeat.js.map +1 -0
- package/dist/game/shape-inspect.d.ts +74 -0
- package/dist/game/shape-inspect.d.ts.map +1 -0
- package/dist/game/shape-inspect.js +114 -0
- package/dist/game/shape-inspect.js.map +1 -0
- package/dist/game/spell-cmd.d.ts +15 -4
- package/dist/game/spell-cmd.d.ts.map +1 -1
- package/dist/game/spell-cmd.js +35 -6
- package/dist/game/spell-cmd.js.map +1 -1
- package/dist/game/spoil.d.ts.map +1 -1
- package/dist/game/spoil.js +89 -40
- package/dist/game/spoil.js.map +1 -1
- package/dist/game/steal.d.ts +3 -3
- package/dist/game/steal.d.ts.map +1 -1
- package/dist/game/steal.js +9 -4
- package/dist/game/steal.js.map +1 -1
- package/dist/game/target-loop.d.ts +10 -4
- package/dist/game/target-loop.d.ts.map +1 -1
- package/dist/game/target-loop.js +14 -8
- package/dist/game/target-loop.js.map +1 -1
- package/dist/game/target.d.ts +4 -4
- package/dist/game/target.d.ts.map +1 -1
- package/dist/game/target.js +19 -8
- package/dist/game/target.js.map +1 -1
- package/dist/game/ui-entry.d.ts +63 -4
- package/dist/game/ui-entry.d.ts.map +1 -1
- package/dist/game/ui-entry.js +151 -23
- package/dist/game/ui-entry.js.map +1 -1
- package/dist/game/wizard.d.ts +23 -5
- package/dist/game/wizard.d.ts.map +1 -1
- package/dist/game/wizard.js +93 -11
- package/dist/game/wizard.js.map +1 -1
- package/dist/game/world.d.ts.map +1 -1
- package/dist/game/world.js +6 -0
- package/dist/game/world.js.map +1 -1
- package/dist/gen/cave.d.ts +49 -8
- package/dist/gen/cave.d.ts.map +1 -1
- package/dist/gen/cave.js +200 -28
- package/dist/gen/cave.js.map +1 -1
- package/dist/gen/generate.d.ts +54 -9
- package/dist/gen/generate.d.ts.map +1 -1
- package/dist/gen/generate.js +55 -8
- package/dist/gen/generate.js.map +1 -1
- package/dist/gen/glyph-vectors.d.ts +109 -0
- package/dist/gen/glyph-vectors.d.ts.map +1 -0
- package/dist/gen/glyph-vectors.fixtures.d.ts +18 -0
- package/dist/gen/glyph-vectors.fixtures.d.ts.map +1 -0
- package/dist/gen/glyph-vectors.fixtures.js +94 -0
- package/dist/gen/glyph-vectors.fixtures.js.map +1 -0
- package/dist/gen/glyph-vectors.js +218 -0
- package/dist/gen/glyph-vectors.js.map +1 -0
- package/dist/gen/glyph.d.ts +104 -0
- package/dist/gen/glyph.d.ts.map +1 -0
- package/dist/gen/glyph.js +72 -0
- package/dist/gen/glyph.js.map +1 -0
- package/dist/gen/room.d.ts +26 -2
- package/dist/gen/room.d.ts.map +1 -1
- package/dist/gen/room.js +414 -264
- package/dist/gen/room.js.map +1 -1
- package/dist/gen/util.d.ts +11 -2
- package/dist/gen/util.d.ts.map +1 -1
- package/dist/gen/util.js +31 -9
- package/dist/gen/util.js.map +1 -1
- package/dist/i18n/i18n.d.ts +207 -0
- package/dist/i18n/i18n.d.ts.map +1 -0
- package/dist/i18n/i18n.js +405 -0
- package/dist/i18n/i18n.js.map +1 -0
- package/dist/i18n/text.d.ts +62 -0
- package/dist/i18n/text.d.ts.map +1 -0
- package/dist/i18n/text.js +120 -0
- package/dist/i18n/text.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/mod/extension.d.ts +115 -0
- package/dist/mod/extension.d.ts.map +1 -0
- package/dist/mod/extension.js +85 -0
- package/dist/mod/extension.js.map +1 -0
- package/dist/mod/ids.d.ts +10 -0
- package/dist/mod/ids.d.ts.map +1 -1
- package/dist/mod/ids.js +90 -21
- package/dist/mod/ids.js.map +1 -1
- package/dist/mod/record-keys.d.ts +43 -0
- package/dist/mod/record-keys.d.ts.map +1 -0
- package/dist/mod/record-keys.js +100 -0
- package/dist/mod/record-keys.js.map +1 -0
- package/dist/mod/registry-host.d.ts +472 -0
- package/dist/mod/registry-host.d.ts.map +1 -1
- package/dist/mod/registry-host.js +313 -0
- package/dist/mod/registry-host.js.map +1 -1
- package/dist/mod/save-blocks.d.ts +1 -1
- package/dist/mon/bind.d.ts.map +1 -1
- package/dist/mon/bind.js +6 -3
- package/dist/mon/bind.js.map +1 -1
- package/dist/mon/knowledge-groups.d.ts +0 -6
- package/dist/mon/knowledge-groups.d.ts.map +1 -1
- package/dist/mon/knowledge-groups.js +12 -8
- package/dist/mon/knowledge-groups.js.map +1 -1
- package/dist/mon/lore-describe.d.ts +46 -10
- package/dist/mon/lore-describe.d.ts.map +1 -1
- package/dist/mon/lore-describe.js +74 -22
- package/dist/mon/lore-describe.js.map +1 -1
- package/dist/mon/lore-file.d.ts +126 -0
- package/dist/mon/lore-file.d.ts.map +1 -0
- package/dist/mon/lore-file.js +291 -0
- package/dist/mon/lore-file.js.map +1 -0
- package/dist/mon/lore.d.ts +9 -3
- package/dist/mon/lore.d.ts.map +1 -1
- package/dist/mon/lore.js +9 -3
- package/dist/mon/lore.js.map +1 -1
- package/dist/mon/make.d.ts +4 -2
- package/dist/mon/make.d.ts.map +1 -1
- package/dist/mon/make.js +4 -2
- package/dist/mon/make.js.map +1 -1
- package/dist/mon/monster.d.ts +1 -1
- package/dist/mon/monster.js +1 -1
- package/dist/mon/predicate.d.ts +14 -9
- package/dist/mon/predicate.d.ts.map +1 -1
- package/dist/mon/predicate.js +14 -9
- package/dist/mon/predicate.js.map +1 -1
- package/dist/mon/project-mon.d.ts +16 -3
- package/dist/mon/project-mon.d.ts.map +1 -1
- package/dist/mon/project-mon.js +14 -5
- package/dist/mon/project-mon.js.map +1 -1
- package/dist/mon/steal.d.ts +31 -4
- package/dist/mon/steal.d.ts.map +1 -1
- package/dist/mon/steal.js +20 -7
- package/dist/mon/steal.js.map +1 -1
- package/dist/mon/take-hit.d.ts +8 -3
- package/dist/mon/take-hit.d.ts.map +1 -1
- package/dist/mon/take-hit.js +8 -3
- package/dist/mon/take-hit.js.map +1 -1
- package/dist/mon/timed.d.ts +15 -9
- package/dist/mon/timed.d.ts.map +1 -1
- package/dist/mon/timed.js +13 -8
- package/dist/mon/timed.js.map +1 -1
- package/dist/mon/types.d.ts +11 -4
- package/dist/mon/types.d.ts.map +1 -1
- package/dist/mon/types.js.map +1 -1
- package/dist/msg.d.ts +40 -1
- package/dist/msg.d.ts.map +1 -1
- package/dist/msg.js +42 -1
- package/dist/msg.js.map +1 -1
- package/dist/obj/artifact-fake.d.ts +46 -14
- package/dist/obj/artifact-fake.d.ts.map +1 -1
- package/dist/obj/artifact-fake.js +46 -17
- package/dist/obj/artifact-fake.js.map +1 -1
- package/dist/obj/bind.d.ts +23 -0
- package/dist/obj/bind.d.ts.map +1 -1
- package/dist/obj/bind.js +49 -9
- package/dist/obj/bind.js.map +1 -1
- package/dist/obj/desc-vectors.d.ts +68 -0
- package/dist/obj/desc-vectors.d.ts.map +1 -0
- package/dist/obj/desc-vectors.fixtures.d.ts +12 -0
- package/dist/obj/desc-vectors.fixtures.d.ts.map +1 -0
- package/dist/obj/desc-vectors.fixtures.js +95 -0
- package/dist/obj/desc-vectors.fixtures.js.map +1 -0
- package/dist/obj/desc-vectors.js +86 -0
- package/dist/obj/desc-vectors.js.map +1 -0
- package/dist/obj/desc.d.ts +17 -2
- package/dist/obj/desc.d.ts.map +1 -1
- package/dist/obj/desc.js +129 -54
- package/dist/obj/desc.js.map +1 -1
- package/dist/obj/effects-info.d.ts.map +1 -1
- package/dist/obj/effects-info.js +87 -58
- package/dist/obj/effects-info.js.map +1 -1
- package/dist/obj/fake-object.d.ts +70 -0
- package/dist/obj/fake-object.d.ts.map +1 -0
- package/dist/obj/fake-object.js +104 -0
- package/dist/obj/fake-object.js.map +1 -0
- package/dist/obj/ignore.d.ts +55 -12
- package/dist/obj/ignore.d.ts.map +1 -1
- package/dist/obj/ignore.js +68 -31
- package/dist/obj/ignore.js.map +1 -1
- package/dist/obj/knowledge.d.ts +46 -3
- package/dist/obj/knowledge.d.ts.map +1 -1
- package/dist/obj/knowledge.js +169 -151
- package/dist/obj/knowledge.js.map +1 -1
- package/dist/obj/known-object.d.ts +68 -8
- package/dist/obj/known-object.d.ts.map +1 -1
- package/dist/obj/known-object.js +90 -10
- package/dist/obj/known-object.js.map +1 -1
- package/dist/obj/make.d.ts +15 -4
- package/dist/obj/make.d.ts.map +1 -1
- package/dist/obj/make.js +49 -27
- package/dist/obj/make.js.map +1 -1
- package/dist/obj/object-info.d.ts +10 -0
- package/dist/obj/object-info.d.ts.map +1 -1
- package/dist/obj/object-info.js +93 -7
- package/dist/obj/object-info.js.map +1 -1
- package/dist/obj/object.d.ts +42 -4
- package/dist/obj/object.d.ts.map +1 -1
- package/dist/obj/object.js +362 -147
- package/dist/obj/object.js.map +1 -1
- package/dist/obj/power.d.ts +23 -4
- package/dist/obj/power.d.ts.map +1 -1
- package/dist/obj/power.js +231 -65
- package/dist/obj/power.js.map +1 -1
- package/dist/obj/randart-build.d.ts +27 -22
- package/dist/obj/randart-build.d.ts.map +1 -1
- package/dist/obj/randart-build.js +435 -357
- package/dist/obj/randart-build.js.map +1 -1
- package/dist/obj/randart-data.d.ts +62 -24
- package/dist/obj/randart-data.d.ts.map +1 -1
- package/dist/obj/randart-data.js +333 -189
- package/dist/obj/randart-data.js.map +1 -1
- package/dist/obj/randart-file.d.ts +21 -0
- package/dist/obj/randart-file.d.ts.map +1 -0
- package/dist/obj/randart-file.js +119 -0
- package/dist/obj/randart-file.js.map +1 -0
- package/dist/obj/randart-log.d.ts +63 -0
- package/dist/obj/randart-log.d.ts.map +1 -0
- package/dist/obj/randart-log.js +72 -0
- package/dist/obj/randart-log.js.map +1 -0
- package/dist/obj/randart-registry.d.ts +178 -0
- package/dist/obj/randart-registry.d.ts.map +1 -0
- package/dist/obj/randart-registry.js +140 -0
- package/dist/obj/randart-registry.js.map +1 -0
- package/dist/obj/randart-vectors.d.ts +97 -0
- package/dist/obj/randart-vectors.d.ts.map +1 -0
- package/dist/obj/randart-vectors.fixtures.d.ts +18 -0
- package/dist/obj/randart-vectors.fixtures.d.ts.map +1 -0
- package/dist/obj/randart-vectors.fixtures.js +50 -0
- package/dist/obj/randart-vectors.fixtures.js.map +1 -0
- package/dist/obj/randart-vectors.js +311 -0
- package/dist/obj/randart-vectors.js.map +1 -0
- package/dist/obj/randart.d.ts +53 -15
- package/dist/obj/randart.d.ts.map +1 -1
- package/dist/obj/randart.js +166 -44
- package/dist/obj/randart.js.map +1 -1
- package/dist/obj/rune-registry.d.ts +180 -0
- package/dist/obj/rune-registry.d.ts.map +1 -0
- package/dist/obj/rune-registry.js +161 -0
- package/dist/obj/rune-registry.js.map +1 -0
- package/dist/obj/rune-vectors.d.ts +99 -0
- package/dist/obj/rune-vectors.d.ts.map +1 -0
- package/dist/obj/rune-vectors.fixtures.d.ts +44 -0
- package/dist/obj/rune-vectors.fixtures.d.ts.map +1 -0
- package/dist/obj/rune-vectors.fixtures.js +125 -0
- package/dist/obj/rune-vectors.fixtures.js.map +1 -0
- package/dist/obj/rune-vectors.js +159 -0
- package/dist/obj/rune-vectors.js.map +1 -0
- package/dist/obj/tval-registry.d.ts +174 -0
- package/dist/obj/tval-registry.d.ts.map +1 -0
- package/dist/obj/tval-registry.js +151 -0
- package/dist/obj/tval-registry.js.map +1 -0
- package/dist/obj/tval-vectors.d.ts +85 -0
- package/dist/obj/tval-vectors.d.ts.map +1 -0
- package/dist/obj/tval-vectors.fixtures.d.ts +24 -0
- package/dist/obj/tval-vectors.fixtures.d.ts.map +1 -0
- package/dist/obj/tval-vectors.fixtures.js +41 -0
- package/dist/obj/tval-vectors.fixtures.js.map +1 -0
- package/dist/obj/tval-vectors.js +76 -0
- package/dist/obj/tval-vectors.js.map +1 -0
- package/dist/obj/types.d.ts +18 -7
- package/dist/obj/types.d.ts.map +1 -1
- package/dist/obj/types.js.map +1 -1
- package/dist/obj/value.d.ts.map +1 -1
- package/dist/obj/value.js +23 -20
- package/dist/obj/value.js.map +1 -1
- package/dist/parser.d.ts +116 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/parser.js +205 -0
- package/dist/parser.js.map +1 -0
- package/dist/player/bind.d.ts.map +1 -1
- package/dist/player/bind.js +3 -2
- package/dist/player/bind.js.map +1 -1
- package/dist/player/birth.d.ts +2 -1
- package/dist/player/birth.d.ts.map +1 -1
- package/dist/player/birth.js +2 -1
- package/dist/player/birth.js.map +1 -1
- package/dist/player/calcs.d.ts +58 -23
- package/dist/player/calcs.d.ts.map +1 -1
- package/dist/player/calcs.js +93 -36
- package/dist/player/calcs.js.map +1 -1
- package/dist/player/death.d.ts +50 -0
- package/dist/player/death.d.ts.map +1 -0
- package/dist/player/death.js +46 -0
- package/dist/player/death.js.map +1 -0
- package/dist/player/options-file.d.ts +129 -0
- package/dist/player/options-file.d.ts.map +1 -0
- package/dist/player/options-file.js +309 -0
- package/dist/player/options-file.js.map +1 -0
- package/dist/player/options.d.ts +2 -1
- package/dist/player/options.d.ts.map +1 -1
- package/dist/player/options.js +2 -1
- package/dist/player/options.js.map +1 -1
- package/dist/player/player.d.ts +50 -3
- package/dist/player/player.d.ts.map +1 -1
- package/dist/player/player.js +10 -1
- package/dist/player/player.js.map +1 -1
- package/dist/player/shape-lore.d.ts +11 -7
- package/dist/player/shape-lore.d.ts.map +1 -1
- package/dist/player/shape-lore.js +24 -11
- package/dist/player/shape-lore.js.map +1 -1
- package/dist/player/timed.d.ts +5 -3
- package/dist/player/timed.d.ts.map +1 -1
- package/dist/player/timed.js +11 -2
- package/dist/player/timed.js.map +1 -1
- package/dist/player/types.d.ts +29 -4
- package/dist/player/types.d.ts.map +1 -1
- package/dist/player/types.js +24 -1
- package/dist/player/types.js.map +1 -1
- package/dist/session/boot.d.ts +26 -2
- package/dist/session/boot.d.ts.map +1 -1
- package/dist/session/boot.js +21 -2
- package/dist/session/boot.js.map +1 -1
- package/dist/session/game.d.ts +15 -0
- package/dist/session/game.d.ts.map +1 -1
- package/dist/session/game.js +616 -140
- package/dist/session/game.js.map +1 -1
- package/dist/session/save-migrate.d.ts.map +1 -1
- package/dist/session/save-migrate.js +76 -1
- package/dist/session/save-migrate.js.map +1 -1
- package/dist/session/save.d.ts +75 -12
- package/dist/session/save.d.ts.map +1 -1
- package/dist/session/save.js +177 -18
- package/dist/session/save.js.map +1 -1
- package/dist/store/bind.d.ts +1 -1
- package/dist/store/bind.d.ts.map +1 -1
- package/dist/store/bind.js +4 -3
- package/dist/store/bind.js.map +1 -1
- package/dist/store/mass-produce-vectors.d.ts +40 -0
- package/dist/store/mass-produce-vectors.d.ts.map +1 -0
- package/dist/store/mass-produce-vectors.fixtures.d.ts +13 -0
- package/dist/store/mass-produce-vectors.fixtures.d.ts.map +1 -0
- package/dist/store/mass-produce-vectors.fixtures.js +52 -0
- package/dist/store/mass-produce-vectors.fixtures.js.map +1 -0
- package/dist/store/mass-produce-vectors.js +44 -0
- package/dist/store/mass-produce-vectors.js.map +1 -0
- package/dist/store/store.d.ts +104 -7
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +199 -77
- package/dist/store/store.js.map +1 -1
- package/dist/store/transact.d.ts +14 -5
- package/dist/store/transact.d.ts.map +1 -1
- package/dist/store/transact.js +17 -16
- package/dist/store/transact.js.map +1 -1
- package/dist/store/types.d.ts +3 -2
- package/dist/store/types.d.ts.map +1 -1
- package/dist/store/types.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/visuals/index.d.ts +1 -0
- package/dist/visuals/index.d.ts.map +1 -1
- package/dist/visuals/index.js +1 -0
- package/dist/visuals/index.js.map +1 -1
- package/dist/visuals/map-text.d.ts +8 -0
- package/dist/visuals/map-text.d.ts.map +1 -1
- package/dist/visuals/map-text.js +1 -1
- package/dist/visuals/map-text.js.map +1 -1
- package/dist/visuals/object-glyph.d.ts +56 -0
- package/dist/visuals/object-glyph.d.ts.map +1 -0
- package/dist/visuals/object-glyph.js +52 -0
- package/dist/visuals/object-glyph.js.map +1 -0
- package/dist/visuals/prefs.d.ts +14 -22
- package/dist/visuals/prefs.d.ts.map +1 -1
- package/dist/visuals/prefs.js +4 -23
- package/dist/visuals/prefs.js.map +1 -1
- package/dist/visuals/tile-prefs.d.ts +26 -0
- package/dist/visuals/tile-prefs.d.ts.map +1 -1
- package/dist/visuals/tile-prefs.js +28 -0
- package/dist/visuals/tile-prefs.js.map +1 -1
- package/dist/world/feature.d.ts +2 -1
- package/dist/world/feature.d.ts.map +1 -1
- package/dist/world/feature.js +2 -0
- package/dist/world/feature.js.map +1 -1
- package/dist/world/project.d.ts +10 -2
- package/dist/world/project.d.ts.map +1 -1
- package/dist/world/project.js +18 -6
- package/dist/world/project.js.map +1 -1
- package/dist/world/projection.d.ts +37 -3
- package/dist/world/projection.d.ts.map +1 -1
- package/dist/world/projection.js +69 -7
- package/dist/world/projection.js.map +1 -1
- package/dist/world/trap.d.ts +2 -1
- package/dist/world/trap.d.ts.map +1 -1
- package/dist/world/trap.js +2 -1
- package/dist/world/trap.js.map +1 -1
- package/dist/world/view.d.ts +1 -1
- package/dist/world/view.d.ts.map +1 -1
- package/dist/world/view.js +11 -3
- package/dist/world/view.js.map +1 -1
- package/package.json +1 -1
- package/src/agent/perceive.ts +2 -3
- package/src/combat/blow-vectors.fixtures.ts +99 -0
- package/src/combat/blow-vectors.json +482 -0
- package/src/combat/blow-vectors.ts +280 -0
- package/src/combat/brand-slay.ts +42 -11
- package/src/combat/index.ts +1 -1
- package/src/combat/melee.ts +37 -19
- package/src/combat/mon-melee.ts +611 -364
- package/src/combat/ranged.ts +43 -26
- package/src/constants.ts +15 -0
- package/src/datafile.ts +148 -0
- package/src/effects/effect-info-registry.ts +313 -0
- package/src/effects/effect-info-vectors.fixtures.ts +61 -0
- package/src/effects/effect-info-vectors.json +11532 -0
- package/src/effects/effect-info-vectors.ts +376 -0
- package/src/effects/effect-info.ts +1005 -859
- package/src/effects/effect.ts +96 -62
- package/src/effects/handlers.ts +5 -2
- package/src/effects/interpreter.ts +14 -0
- package/src/game/cave-cmd.ts +54 -11
- package/src/game/cave-square.ts +80 -0
- package/src/game/char-sheet.ts +59 -16
- package/src/game/chest.ts +25 -8
- package/src/game/context.ts +293 -27
- package/src/game/describe.ts +34 -4
- package/src/game/display.ts +215 -19
- package/src/game/dump-level.ts +3 -2
- package/src/game/effect-attack.ts +41 -28
- package/src/game/effect-detect.ts +45 -8
- package/src/game/effect-env.ts +8 -0
- package/src/game/effect-general.ts +110 -47
- package/src/game/effect-item.ts +1075 -999
- package/src/game/effect-melee.ts +51 -18
- package/src/game/effect-monster.ts +55 -9
- package/src/game/effect-teleport.ts +173 -38
- package/src/game/effect-terrain.ts +38 -22
- package/src/game/equip-cmp.ts +483 -480
- package/src/game/floor.ts +22 -4
- package/src/game/gear.ts +210 -21
- package/src/game/harness.ts +12 -1
- package/src/game/ignore-cmd.ts +96 -8
- package/src/game/known.ts +392 -73
- package/src/game/loop.ts +52 -27
- package/src/game/lore-color.ts +13 -1
- package/src/game/mon-cast.ts +31 -6
- package/src/game/mon-cmd.ts +95 -30
- package/src/game/mon-death.ts +14 -12
- package/src/game/mon-group.ts +9 -5
- package/src/game/mon-message.ts +363 -65
- package/src/game/mon-place.ts +15 -3
- package/src/game/mon-ranged.ts +14 -5
- package/src/game/mon-side.ts +16 -12
- package/src/game/monster-turn.ts +120 -87
- package/src/game/notice.ts +85 -0
- package/src/game/obj-cmd.ts +126 -37
- package/src/game/obj-list.ts +44 -26
- package/src/game/object-inspect.ts +13 -0
- package/src/game/pickup.ts +29 -5
- package/src/game/player-side-vectors.fixtures.ts +215 -0
- package/src/game/player-side-vectors.json +6914 -0
- package/src/game/player-side-vectors.ts +420 -0
- package/src/game/player-side.ts +622 -340
- package/src/game/player-turn.ts +228 -31
- package/src/game/poly.ts +107 -0
- package/src/game/project-cast.ts +63 -6
- package/src/game/project-feat-vectors.fixtures.ts +106 -0
- package/src/game/project-feat-vectors.json +6554 -0
- package/src/game/project-feat-vectors.ts +323 -0
- package/src/game/project-feat.ts +417 -248
- package/src/game/project-monster.ts +69 -30
- package/src/game/project-obj-vectors.json +1 -0
- package/src/game/project-obj.ts +115 -47
- package/src/game/project-player.ts +8 -0
- package/src/game/projection-handlers.ts +110 -0
- package/src/game/quest.ts +48 -0
- package/src/game/ranged-cmd.ts +45 -11
- package/src/game/repeat.ts +92 -0
- package/src/game/shape-inspect.ts +166 -0
- package/src/game/spell-cmd.ts +39 -6
- package/src/game/spoil.ts +92 -39
- package/src/game/steal.ts +9 -4
- package/src/game/target-loop.ts +14 -7
- package/src/game/target.ts +18 -7
- package/src/game/ui-entry.ts +172 -22
- package/src/game/wizard.ts +97 -10
- package/src/game/world.ts +6 -0
- package/src/gen/cave.ts +225 -26
- package/src/gen/generate.ts +62 -9
- package/src/gen/glyph-vectors.fixtures.ts +122 -0
- package/src/gen/glyph-vectors.json +5996 -0
- package/src/gen/glyph-vectors.ts +280 -0
- package/src/gen/glyph.ts +132 -0
- package/src/gen/room.ts +446 -265
- package/src/gen/util.ts +32 -9
- package/src/i18n/i18n.ts +492 -0
- package/src/i18n/text.ts +117 -0
- package/src/index.ts +307 -254
- package/src/mod/extension.ts +136 -0
- package/src/mod/ids.ts +92 -21
- package/src/mod/record-keys.ts +102 -0
- package/src/mod/registry-host.ts +1063 -234
- package/src/mon/bind.ts +14 -8
- package/src/mon/knowledge-groups.ts +12 -12
- package/src/mon/lore-describe.ts +93 -26
- package/src/mon/lore-file.ts +365 -0
- package/src/mon/lore.ts +9 -3
- package/src/mon/make.ts +4 -2
- package/src/mon/monster.ts +1 -1
- package/src/mon/predicate.ts +14 -9
- package/src/mon/project-mon.ts +23 -5
- package/src/mon/steal.ts +39 -7
- package/src/mon/take-hit.ts +8 -3
- package/src/mon/timed.ts +15 -9
- package/src/mon/types.ts +11 -4
- package/src/msg.ts +55 -1
- package/src/obj/artifact-fake.ts +47 -17
- package/src/obj/bind.ts +52 -9
- package/src/obj/desc-vectors.fixtures.ts +119 -0
- package/src/obj/desc-vectors.json +2360 -0
- package/src/obj/desc-vectors.ts +128 -0
- package/src/obj/desc.ts +159 -55
- package/src/obj/effects-info.ts +90 -59
- package/src/obj/fake-object.ts +135 -0
- package/src/obj/ignore.ts +95 -28
- package/src/obj/knowledge.ts +291 -139
- package/src/obj/known-object.ts +126 -11
- package/src/obj/make.ts +53 -29
- package/src/obj/object-info.ts +103 -6
- package/src/obj/object.ts +392 -151
- package/src/obj/power.ts +297 -59
- package/src/obj/randart-build.ts +1875 -1705
- package/src/obj/randart-data.ts +1547 -1344
- package/src/obj/randart-file.ts +130 -0
- package/src/obj/randart-log.ts +78 -0
- package/src/obj/randart-registry.ts +247 -0
- package/src/obj/randart-vectors.fixtures.ts +61 -0
- package/src/obj/randart-vectors.json +836 -0
- package/src/obj/randart-vectors.ts +369 -0
- package/src/obj/randart.ts +722 -552
- package/src/obj/rune-registry.ts +270 -0
- package/src/obj/rune-vectors.fixtures.ts +164 -0
- package/src/obj/rune-vectors.json +121 -0
- package/src/obj/rune-vectors.ts +229 -0
- package/src/obj/tval-kind-vectors.json +391 -0
- package/src/obj/tval-registry.ts +243 -0
- package/src/obj/tval-vectors.fixtures.ts +50 -0
- package/src/obj/tval-vectors.json +38 -0
- package/src/obj/tval-vectors.ts +126 -0
- package/src/obj/types.ts +18 -7
- package/src/obj/value.ts +26 -20
- package/src/parser.ts +214 -0
- package/src/player/bind.ts +5 -2
- package/src/player/birth.ts +2 -1
- package/src/player/calcs.ts +123 -42
- package/src/player/death.ts +78 -0
- package/src/player/options-file.ts +387 -0
- package/src/player/options.ts +2 -1
- package/src/player/player.ts +60 -4
- package/src/player/shape-lore.ts +33 -14
- package/src/player/timed.ts +14 -4
- package/src/player/types.ts +30 -4
- package/src/session/boot.ts +51 -1
- package/src/session/game.ts +720 -163
- package/src/session/save-migrate.ts +81 -1
- package/src/session/save.ts +264 -22
- package/src/store/bind.ts +4 -3
- package/src/store/mass-produce-vectors.fixtures.ts +64 -0
- package/src/store/mass-produce-vectors.json +1169 -0
- package/src/store/mass-produce-vectors.ts +67 -0
- package/src/store/store.ts +266 -63
- package/src/store/transact.ts +39 -16
- package/src/store/types.ts +3 -2
- package/src/version.ts +1 -1
- package/src/visuals/index.ts +1 -0
- package/src/visuals/map-text.ts +1 -1
- package/src/visuals/object-glyph.ts +76 -0
- package/src/visuals/prefs.ts +22 -32
- package/src/visuals/tile-prefs.ts +32 -0
- package/src/world/feature.ts +4 -1
- package/src/world/project.ts +19 -4
- package/src/world/projection.ts +79 -8
- package/src/world/trap.ts +25 -21
- package/src/world/view.ts +11 -1
package/dist/datafile.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ELEMENT_ENTRIES, OBJECT_MODIFIER_ENTRIES, STAT_ENTRIES, } from "./generated/index.js";
|
|
2
|
+
/** OBJ_MOD_MAX: the stats come first, then list-object-modifiers.h. */
|
|
3
|
+
const OBJ_MOD_NAMES = [
|
|
4
|
+
...STAT_ENTRIES.map((e) => e.name),
|
|
5
|
+
...OBJECT_MODIFIER_ENTRIES.map((e) => e.name),
|
|
6
|
+
];
|
|
7
|
+
/**
|
|
8
|
+
* write_flags (datafile.c:482-514): `intro` followed by the set flags' names,
|
|
9
|
+
* " | "-separated, wrapped at ~60 characters.
|
|
10
|
+
*/
|
|
11
|
+
export function writeFlags(intro, flags, size, names) {
|
|
12
|
+
const lines = [];
|
|
13
|
+
let buf = "";
|
|
14
|
+
let pointer = 0;
|
|
15
|
+
for (let flag = flags.next(1); flag > 0 && flag < size * 8; flag = flags.next(flag + 1)) {
|
|
16
|
+
if (buf.length > 0) {
|
|
17
|
+
buf += " | ";
|
|
18
|
+
pointer += 3;
|
|
19
|
+
}
|
|
20
|
+
/* "If no name, we're past the real flags" - and the trailing " | " stays. */
|
|
21
|
+
const name = names[flag];
|
|
22
|
+
if (name === undefined)
|
|
23
|
+
break;
|
|
24
|
+
buf += name;
|
|
25
|
+
pointer += name.length;
|
|
26
|
+
if (pointer >= 60) {
|
|
27
|
+
lines.push(`${intro}${buf}\n`);
|
|
28
|
+
buf = "";
|
|
29
|
+
pointer = 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/* "Print remaining flags if any", gated on pointer rather than on buf. */
|
|
33
|
+
if (pointer)
|
|
34
|
+
lines.push(`${intro}${buf}\n`);
|
|
35
|
+
return lines.join("");
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* write_mods (datafile.c:520-563): `values:` lines for every non-zero modifier,
|
|
39
|
+
* as NAME[value].
|
|
40
|
+
*
|
|
41
|
+
* `pointer += 5` for the "[%d]" regardless of how many digits the value has -
|
|
42
|
+
* upstream's own approximation, kept because it is what decides where the line
|
|
43
|
+
* breaks.
|
|
44
|
+
*/
|
|
45
|
+
export function writeMods(values) {
|
|
46
|
+
const lines = [];
|
|
47
|
+
let buf = "";
|
|
48
|
+
let pointer = 0;
|
|
49
|
+
for (let i = 0; i < OBJ_MOD_NAMES.length; i++) {
|
|
50
|
+
const v = values[i] ?? 0;
|
|
51
|
+
if (v === 0)
|
|
52
|
+
continue;
|
|
53
|
+
if (buf.length > 0) {
|
|
54
|
+
buf += " | ";
|
|
55
|
+
pointer += 3;
|
|
56
|
+
}
|
|
57
|
+
const name = OBJ_MOD_NAMES[i];
|
|
58
|
+
buf += `${name}[${String(v)}]`;
|
|
59
|
+
pointer += name.length + 5;
|
|
60
|
+
if (pointer >= 60) {
|
|
61
|
+
lines.push(`values:${buf}\n`);
|
|
62
|
+
buf = "";
|
|
63
|
+
pointer = 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (pointer)
|
|
67
|
+
lines.push(`values:${buf}\n`);
|
|
68
|
+
return lines.join("");
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* write_elements (datafile.c:569-610): `values:` lines for every element with a
|
|
72
|
+
* non-zero resistance level, as RES_NAME[level].
|
|
73
|
+
*
|
|
74
|
+
* `pointer += strlen(name) + 4` counts "RES_" but the value still only counts
|
|
75
|
+
* as 5 - the same approximation as write_mods.
|
|
76
|
+
*/
|
|
77
|
+
export function writeElements(elInfo) {
|
|
78
|
+
const lines = [];
|
|
79
|
+
let buf = "";
|
|
80
|
+
let pointer = 0;
|
|
81
|
+
for (let i = 0; i < ELEMENT_ENTRIES.length; i++) {
|
|
82
|
+
const level = elInfo[i]?.resLevel ?? 0;
|
|
83
|
+
if (level === 0)
|
|
84
|
+
continue;
|
|
85
|
+
if (buf.length > 0) {
|
|
86
|
+
buf += " | ";
|
|
87
|
+
pointer += 3;
|
|
88
|
+
}
|
|
89
|
+
const name = ELEMENT_ENTRIES[i].name;
|
|
90
|
+
buf += `RES_${name}[${String(level)}]`;
|
|
91
|
+
pointer += name.length + 4 + 5;
|
|
92
|
+
if (pointer >= 60) {
|
|
93
|
+
lines.push(`values:${buf}\n`);
|
|
94
|
+
buf = "";
|
|
95
|
+
pointer = 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (pointer)
|
|
99
|
+
lines.push(`values:${buf}\n`);
|
|
100
|
+
return lines.join("");
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=datafile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datafile.js","sourceRoot":"","sources":["../src/datafile.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,YAAY,GACb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EAAE,CAAC;IACb,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,CAAC,CAAC;QACvC,IAAI,KAAK,KAAK,CAAC;YAAE,SAAS;QAE1B,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnB,GAAG,IAAI,KAAK,CAAC;YACb,OAAO,IAAI,CAAC,CAAC;QACf,CAAC;QACD,MAAM,IAAI,GAAG,eAAe,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC;QACtC,GAAG,IAAI,OAAO,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;QACvC,OAAO,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QAE/B,IAAI,OAAO,IAAI,EAAE,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;YAC9B,GAAG,GAAG,EAAE,CAAC;YACT,OAAO,GAAG,CAAC,CAAC;QACd,CAAC;IACH,CAAC;IAED,IAAI,OAAO;QAAE,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The EFFECT INFO registry: everything the game SAYS about an effect, and how a
|
|
3
|
+
* gamedata `type:` name becomes its integer subtype.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS IS A REGISTRY. `registry:effect` already let a mod register a handler
|
|
6
|
+
* for a brand-new effect code and have it DO something. What it could not do was
|
|
7
|
+
* let the game describe it. Four closed `switch` statements stood in the way,
|
|
8
|
+
* and each failed silently rather than loudly:
|
|
9
|
+
*
|
|
10
|
+
* - `effectMenuName` (effect-info.ts, keyed on the EFINFO_* flag) returned ""
|
|
11
|
+
* for an unknown flag, so a mod's effect showed a BLANK ROW in the "Activate
|
|
12
|
+
* which item?" and spell menus.
|
|
13
|
+
* - `formatEffectDesc` (effect-info.ts, same key) returned "" as well, so
|
|
14
|
+
* object recall and spell descriptions said nothing at all about it.
|
|
15
|
+
* - the activation summary walker (obj/effects-info.ts, keyed on the effect
|
|
16
|
+
* CODE) counted it "unsummarized", so a randart activation built from a mod
|
|
17
|
+
* effect could never be recognised as duplicating an intrinsic property.
|
|
18
|
+
* - `effectSubtype` (effect.ts, keyed on the EF index) returned -1 for every
|
|
19
|
+
* name, so a mod's effect could take NO named subtype - only a bare integer.
|
|
20
|
+
*
|
|
21
|
+
* FOUR TABLES, THREE KEYS, and they are separate because upstream's keys are.
|
|
22
|
+
* The EFINFO_* flag is a property of the effect's ENTRY (many effects share one
|
|
23
|
+
* flag: twenty flags cover a hundred and twelve effects), the summary walker
|
|
24
|
+
* keys on the effect's own code, and subtype decoding keys on the effect index.
|
|
25
|
+
* Collapsing them would force a mod to register the same behaviour three times
|
|
26
|
+
* under three spellings.
|
|
27
|
+
*
|
|
28
|
+
* WHY MODULE-LEVEL. Ruled 2026-08-09: disabling a mod always takes effect on the
|
|
29
|
+
* next RELOAD (exiting mod management prompts to save and reload). A toggle can
|
|
30
|
+
* therefore never need to apply to a running session, so a module-level table
|
|
31
|
+
* cannot violate the mod default policy.
|
|
32
|
+
*
|
|
33
|
+
* What actually clears it is the reload itself: a fresh page is a fresh module
|
|
34
|
+
* instance, and the host installs each plugin at most once per realm
|
|
35
|
+
* (`installedPluginIds` in web/main.ts is never cleared). So a disabled mod's
|
|
36
|
+
* registrations are gone on the next boot because the table they lived in is.
|
|
37
|
+
* `resetEffectInfoRegistry()` is the same restoration WITHOUT a fresh realm -
|
|
38
|
+
* core's arms back, every mod registration dropped - which is what a test needs
|
|
39
|
+
* in order to prove the mod default policy holds here rather than assert it.
|
|
40
|
+
* It has no production caller and is not meant to acquire one: calling it
|
|
41
|
+
* mid-session would strip a running mod's handlers, which is precisely the
|
|
42
|
+
* live-toggle behaviour the ruling says must not happen.
|
|
43
|
+
*
|
|
44
|
+
* ORDER AND RNG. Core's handlers are the case bodies lifted unchanged. Nothing
|
|
45
|
+
* here draws: upstream's `effect_describe` calls `dice_roll()` to populate the
|
|
46
|
+
* random_value it formats, and the port substitutes `Dice.randomValue()` at
|
|
47
|
+
* every such site precisely so that rendering a menu row cannot perturb the
|
|
48
|
+
* stream (see effect-info.ts's header). A mod handler receives the already
|
|
49
|
+
* computed value and has no Rng to reach, so that property survives the seam.
|
|
50
|
+
*/
|
|
51
|
+
import type { RandomValue } from "../rng.js";
|
|
52
|
+
import type { ProjectionInfo } from "../world/projection.js";
|
|
53
|
+
import type { EffectObjectProperty } from "../obj/randart-build.js";
|
|
54
|
+
import type { EffectRecordJson } from "../obj/types.js";
|
|
55
|
+
import type { GameState } from "../game/context.js";
|
|
56
|
+
import type { ItemRequest } from "../game/effect-item.js";
|
|
57
|
+
import type { Effect, EffectCode, SubtypeInjections } from "./effect.js";
|
|
58
|
+
/** The projection strings an effect's subtype selects, "" when out of range. */
|
|
59
|
+
export interface EffectProjectionText {
|
|
60
|
+
/** projections[subtype].desc - EFINFO_SEEN / _BOLT / _BOLTD / _TOUCH. */
|
|
61
|
+
readonly desc: string;
|
|
62
|
+
/** projections[subtype].player_desc - EFINFO_BALL / _SPOT / _BREATH / _SHORT. */
|
|
63
|
+
readonly playerDesc: string;
|
|
64
|
+
/** projections[subtype].lash_desc - EFINFO_LASH. */
|
|
65
|
+
readonly lashDesc: string;
|
|
66
|
+
}
|
|
67
|
+
/** What a menu-name handler is given (effect_get_menu_name, effects-info.c L583). */
|
|
68
|
+
export interface EffectMenuContext {
|
|
69
|
+
/** The effect being named. */
|
|
70
|
+
readonly effect: Effect;
|
|
71
|
+
/** base_descs[index].menu_name: the raw format string. */
|
|
72
|
+
readonly fmt: string;
|
|
73
|
+
/** sprintf(fmt, ...) - the format string with its arguments filled in. */
|
|
74
|
+
format(...args: Array<string | number>): string;
|
|
75
|
+
/** The effect's dice as a random_value, zeroed when it has none. */
|
|
76
|
+
readonly value: RandomValue;
|
|
77
|
+
/** randcalc(value, level, AVERAGE) - no RNG is drawn. */
|
|
78
|
+
average(level?: number): number;
|
|
79
|
+
/** projections[subtype], with "" for an out-of-range subtype. */
|
|
80
|
+
readonly proj: EffectProjectionText;
|
|
81
|
+
/** timed_effects[subtype].desc, "" when the host supplied no lookup. */
|
|
82
|
+
timedDesc(): string;
|
|
83
|
+
/** The stat property name for the subtype, "" when unavailable. */
|
|
84
|
+
statName(): string;
|
|
85
|
+
/** summon_desc(subtype), "" when unavailable. */
|
|
86
|
+
summonDesc(): string;
|
|
87
|
+
/** z_info->food_value scaled full / hungry thresholds (EFINFO_FOOD). */
|
|
88
|
+
readonly foodFull: number;
|
|
89
|
+
readonly foodHungry: number;
|
|
90
|
+
}
|
|
91
|
+
/** What a description handler is given (effect_describe's body, L384-548). */
|
|
92
|
+
export interface EffectDescContext {
|
|
93
|
+
/** The effect being described. */
|
|
94
|
+
readonly effect: Effect;
|
|
95
|
+
/** base_descs[index].desc: the raw format string. */
|
|
96
|
+
readonly desc: string;
|
|
97
|
+
/** sprintf(desc, ...) - the format string with its arguments filled in. */
|
|
98
|
+
format(...args: Array<string | number>): string;
|
|
99
|
+
/** The random_value in force (an earlier SET_VALUE's, or the effect's own). */
|
|
100
|
+
readonly value: RandomValue;
|
|
101
|
+
/** format_dice_string(value) as the caller already computed it. */
|
|
102
|
+
readonly diceString: string;
|
|
103
|
+
/** format_dice_string(value, multiplier) - EFINFO_FOOD's turn count. */
|
|
104
|
+
diceStringTimes(multiplier: number): string;
|
|
105
|
+
/** The device-skill boost percentage in force. */
|
|
106
|
+
readonly devSkillBoost: number;
|
|
107
|
+
/** append_damage(value, boost) - defaults to the boost in force. */
|
|
108
|
+
appendDamage(boost?: number): string;
|
|
109
|
+
/** randcalc(value, level, AVERAGE) - no RNG is drawn. */
|
|
110
|
+
average(level?: number): number;
|
|
111
|
+
/** projections[subtype], with "" for an out-of-range subtype. */
|
|
112
|
+
readonly proj: EffectProjectionText;
|
|
113
|
+
/** timed_effects[subtype].desc, "" when the host supplied no lookup. */
|
|
114
|
+
timedDesc(): string;
|
|
115
|
+
/** The stat property name for the subtype, "" when unavailable. */
|
|
116
|
+
statName(): string;
|
|
117
|
+
/** summon_desc(subtype), "" when unavailable. */
|
|
118
|
+
summonDesc(): string;
|
|
119
|
+
/** player->lev, 0 when the host supplied none (EFINFO_SHORT). */
|
|
120
|
+
readonly playerLevel: number;
|
|
121
|
+
/** z_info->food_value, 100 upstream (EFINFO_FOOD). */
|
|
122
|
+
readonly foodValue: number;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* What one EFINFO_* flag means. Both halves are optional, and an absent half
|
|
126
|
+
* is upstream's own behaviour for an unhandled flag: "" - which is why a mod
|
|
127
|
+
* that supplies only `describe` still gets a blank menu row, and should say so
|
|
128
|
+
* to itself rather than be surprised.
|
|
129
|
+
*/
|
|
130
|
+
export interface EffectTextHandler {
|
|
131
|
+
/** The row text in the activate / cast menus. */
|
|
132
|
+
menuName?(ctx: EffectMenuContext): string;
|
|
133
|
+
/** The sentence in object recall and spell descriptions. */
|
|
134
|
+
describe?(ctx: EffectDescContext): string;
|
|
135
|
+
}
|
|
136
|
+
/** EFPROP kinds and the resolved timed data, as the walker sees them. */
|
|
137
|
+
export interface ActivationSummaryContext {
|
|
138
|
+
/** The compiled effect record being walked. */
|
|
139
|
+
readonly record: EffectRecordJson;
|
|
140
|
+
/** Append one summarized object property. */
|
|
141
|
+
add(idx: number, reslevelMin: number, reslevelMax: number, kind: number): void;
|
|
142
|
+
/** summarize_cure for the record's `type` (a no-op for an unknown name). */
|
|
143
|
+
summarizeCure(name: string | undefined): void;
|
|
144
|
+
/** The temp-resist / brand / slay / conflict half of an increase. */
|
|
145
|
+
summarizeTimedInc(name: string | undefined): void;
|
|
146
|
+
/** dice_evaluate(dice, 0, MAXIMISE) for this record, honouring SET_VALUE. */
|
|
147
|
+
timedValue(): number;
|
|
148
|
+
/** Whether the pack has a player_timed record under this name. */
|
|
149
|
+
knownTimed(name: string | undefined): boolean;
|
|
150
|
+
/** OF_NO_TELEPORT's index, for the teleport family. */
|
|
151
|
+
readonly ofNoTeleport: number;
|
|
152
|
+
/** Remember (or forget) the dice a later timed effect reads: SET/CLEAR_VALUE. */
|
|
153
|
+
setRememberedDice(dice: string | undefined): void;
|
|
154
|
+
/** Count this record as contributing no object property. */
|
|
155
|
+
markUnsummarized(): void;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* One arm of effect_summarize_properties. Returning nothing is "this effect
|
|
159
|
+
* relates to no object property", which the walker records as unsummarized -
|
|
160
|
+
* so a handler that means "deliberately nothing" must still say so by calling
|
|
161
|
+
* `markUnsummarized()`, exactly as the ported default arm does.
|
|
162
|
+
*/
|
|
163
|
+
export type ActivationSummaryHandler = (ctx: ActivationSummaryContext) => void;
|
|
164
|
+
/** The shape the walker produces, re-exported so a caller need not reach in. */
|
|
165
|
+
export type ActivationSummaryResult = {
|
|
166
|
+
props: EffectObjectProperty[];
|
|
167
|
+
unsummarizedCount: number;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* How one effect turns a gamedata `type:` NAME into its integer subtype.
|
|
171
|
+
* Return null (not -1) for "this name means nothing to me", so the caller can
|
|
172
|
+
* tell a handler that declined from one that resolved the name to -1.
|
|
173
|
+
*/
|
|
174
|
+
export type EffectSubtypeHandler = (type: string, inject: SubtypeInjections) => number | null;
|
|
175
|
+
/**
|
|
176
|
+
* Which item an effect prompts for, when it consumes one. Return null for
|
|
177
|
+
* "this effect chooses no item" - which is what BRAND_WEAPON, CURSE_ARMOR,
|
|
178
|
+
* CURSE_WEAPON and ACQUIRE do, because they pick their own target.
|
|
179
|
+
*/
|
|
180
|
+
export type EffectRequestHandler = (subtype: number, state: GameState) => ItemRequest | null;
|
|
181
|
+
/**
|
|
182
|
+
* One keyed table. Written once and used five times, because the five differ
|
|
183
|
+
* only in their key and handler types - five hand-copied blocks would be five
|
|
184
|
+
* places for `handlerFor` to drift from `set`.
|
|
185
|
+
*/
|
|
186
|
+
export declare class EffectInfoTable<K, H> {
|
|
187
|
+
private readonly table;
|
|
188
|
+
/** Install (or replace) the handler for one key. */
|
|
189
|
+
set(key: K, handler: H): void;
|
|
190
|
+
/**
|
|
191
|
+
* The handler installed for a key right now, or null. This is what a mod
|
|
192
|
+
* calls to WRAP core - keep the returned handler, install its own, and call
|
|
193
|
+
* through - instead of only replacing it.
|
|
194
|
+
*/
|
|
195
|
+
handlerFor(key: K): H | null;
|
|
196
|
+
/** Whether anything handles this key. */
|
|
197
|
+
has(key: K): boolean;
|
|
198
|
+
/** Every key handled, in registration order (core's first). */
|
|
199
|
+
keys(): readonly K[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Everything the game says about an effect, in five tables under three keys.
|
|
203
|
+
*
|
|
204
|
+
* `text` is keyed on the EFINFO_* flag because that is what upstream's two
|
|
205
|
+
* switches key on: twenty flags describe a hundred and twelve effects, and an
|
|
206
|
+
* effect that behaves like an existing one for display purposes reuses its
|
|
207
|
+
* flag rather than repeating it. `summary` is keyed on the effect CODE, and
|
|
208
|
+
* `subtype` / `request` on the effect INDEX (or a mod's string code).
|
|
209
|
+
*/
|
|
210
|
+
export declare class EffectInfoRegistry {
|
|
211
|
+
/** The menu row and the recall sentence, keyed on the EFINFO_* flag. */
|
|
212
|
+
readonly text: EffectInfoTable<string, EffectTextHandler>;
|
|
213
|
+
/** effect_summarize_properties' arms, keyed on the effect code. */
|
|
214
|
+
readonly summary: EffectInfoTable<string, ActivationSummaryHandler>;
|
|
215
|
+
/** effect_subtype's arms, keyed on the effect index (or a mod code). */
|
|
216
|
+
readonly subtype: EffectInfoTable<EffectCode, EffectSubtypeHandler>;
|
|
217
|
+
/** requestForEffect's arms, keyed on the effect index (or a mod code). */
|
|
218
|
+
readonly request: EffectInfoTable<EffectCode, EffectRequestHandler>;
|
|
219
|
+
}
|
|
220
|
+
/** ProjectionInfo as the text handlers read it. */
|
|
221
|
+
export type ProjectionTextSource = readonly Pick<ProjectionInfo, "desc" | "playerDesc" | "lashDesc">[];
|
|
222
|
+
/**
|
|
223
|
+
* Install a set of core arms, now and on every reset. Called at module scope by
|
|
224
|
+
* effect-info.ts, obj/effects-info.ts, effects/effect.ts and
|
|
225
|
+
* game/effect-item.ts; a MOD never calls this - it registers through the
|
|
226
|
+
* capability-gated facade, whose registrations a reset deliberately drops.
|
|
227
|
+
*/
|
|
228
|
+
export declare function seedEffectInfo(seed: (reg: EffectInfoRegistry) => void): void;
|
|
229
|
+
/** The live registry. Module-level; see this file's header for why that is safe. */
|
|
230
|
+
export declare function effectInfoRegistry(): EffectInfoRegistry;
|
|
231
|
+
/**
|
|
232
|
+
* Back to core's arms alone, dropping every mod registration - the same state a
|
|
233
|
+
* reload produces, without needing a fresh realm. No production caller by
|
|
234
|
+
* design; see this file's header.
|
|
235
|
+
*/
|
|
236
|
+
export declare function resetEffectInfoRegistry(): void;
|
|
237
|
+
//# sourceMappingURL=effect-info-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect-info-registry.d.ts","sourceRoot":"","sources":["../../src/effects/effect-info-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS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AIG;IACH,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI;IAI5B,yCAAyC;IACzC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAIpB,+DAA+D;IAC/D,IAAI,IAAI,SAAS,CAAC,EAAE;CAGrB;AAED;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,6CAAoD;IACjE,mEAAmE;IACnE,QAAQ,CAAC,OAAO,oDAA2D;IAC3E,wEAAwE;IACxE,QAAQ,CAAC,OAAO,oDAA2D;IAC3E,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,oDAA2D;CAC5E;AAED,mDAAmD;AACnD,MAAM,MAAM,oBAAoB,GAAG,SAAS,IAAI,CAC9C,cAAc,EACd,MAAM,GAAG,YAAY,GAAG,UAAU,CACnC,EAAE,CAAC;AAkBJ;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,GAAG,IAAI,CAG5E;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,IAAI,kBAAkB,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The EFFECT INFO registry: everything the game SAYS about an effect, and how a
|
|
3
|
+
* gamedata `type:` name becomes its integer subtype.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS IS A REGISTRY. `registry:effect` already let a mod register a handler
|
|
6
|
+
* for a brand-new effect code and have it DO something. What it could not do was
|
|
7
|
+
* let the game describe it. Four closed `switch` statements stood in the way,
|
|
8
|
+
* and each failed silently rather than loudly:
|
|
9
|
+
*
|
|
10
|
+
* - `effectMenuName` (effect-info.ts, keyed on the EFINFO_* flag) returned ""
|
|
11
|
+
* for an unknown flag, so a mod's effect showed a BLANK ROW in the "Activate
|
|
12
|
+
* which item?" and spell menus.
|
|
13
|
+
* - `formatEffectDesc` (effect-info.ts, same key) returned "" as well, so
|
|
14
|
+
* object recall and spell descriptions said nothing at all about it.
|
|
15
|
+
* - the activation summary walker (obj/effects-info.ts, keyed on the effect
|
|
16
|
+
* CODE) counted it "unsummarized", so a randart activation built from a mod
|
|
17
|
+
* effect could never be recognised as duplicating an intrinsic property.
|
|
18
|
+
* - `effectSubtype` (effect.ts, keyed on the EF index) returned -1 for every
|
|
19
|
+
* name, so a mod's effect could take NO named subtype - only a bare integer.
|
|
20
|
+
*
|
|
21
|
+
* FOUR TABLES, THREE KEYS, and they are separate because upstream's keys are.
|
|
22
|
+
* The EFINFO_* flag is a property of the effect's ENTRY (many effects share one
|
|
23
|
+
* flag: twenty flags cover a hundred and twelve effects), the summary walker
|
|
24
|
+
* keys on the effect's own code, and subtype decoding keys on the effect index.
|
|
25
|
+
* Collapsing them would force a mod to register the same behaviour three times
|
|
26
|
+
* under three spellings.
|
|
27
|
+
*
|
|
28
|
+
* WHY MODULE-LEVEL. Ruled 2026-08-09: disabling a mod always takes effect on the
|
|
29
|
+
* next RELOAD (exiting mod management prompts to save and reload). A toggle can
|
|
30
|
+
* therefore never need to apply to a running session, so a module-level table
|
|
31
|
+
* cannot violate the mod default policy.
|
|
32
|
+
*
|
|
33
|
+
* What actually clears it is the reload itself: a fresh page is a fresh module
|
|
34
|
+
* instance, and the host installs each plugin at most once per realm
|
|
35
|
+
* (`installedPluginIds` in web/main.ts is never cleared). So a disabled mod's
|
|
36
|
+
* registrations are gone on the next boot because the table they lived in is.
|
|
37
|
+
* `resetEffectInfoRegistry()` is the same restoration WITHOUT a fresh realm -
|
|
38
|
+
* core's arms back, every mod registration dropped - which is what a test needs
|
|
39
|
+
* in order to prove the mod default policy holds here rather than assert it.
|
|
40
|
+
* It has no production caller and is not meant to acquire one: calling it
|
|
41
|
+
* mid-session would strip a running mod's handlers, which is precisely the
|
|
42
|
+
* live-toggle behaviour the ruling says must not happen.
|
|
43
|
+
*
|
|
44
|
+
* ORDER AND RNG. Core's handlers are the case bodies lifted unchanged. Nothing
|
|
45
|
+
* here draws: upstream's `effect_describe` calls `dice_roll()` to populate the
|
|
46
|
+
* random_value it formats, and the port substitutes `Dice.randomValue()` at
|
|
47
|
+
* every such site precisely so that rendering a menu row cannot perturb the
|
|
48
|
+
* stream (see effect-info.ts's header). A mod handler receives the already
|
|
49
|
+
* computed value and has no Rng to reach, so that property survives the seam.
|
|
50
|
+
*/
|
|
51
|
+
/* ------------------------------------------------------------------ *
|
|
52
|
+
* The tables.
|
|
53
|
+
* ------------------------------------------------------------------ */
|
|
54
|
+
/**
|
|
55
|
+
* One keyed table. Written once and used five times, because the five differ
|
|
56
|
+
* only in their key and handler types - five hand-copied blocks would be five
|
|
57
|
+
* places for `handlerFor` to drift from `set`.
|
|
58
|
+
*/
|
|
59
|
+
export class EffectInfoTable {
|
|
60
|
+
table = new Map();
|
|
61
|
+
/** Install (or replace) the handler for one key. */
|
|
62
|
+
set(key, handler) {
|
|
63
|
+
this.table.set(key, handler);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The handler installed for a key right now, or null. This is what a mod
|
|
67
|
+
* calls to WRAP core - keep the returned handler, install its own, and call
|
|
68
|
+
* through - instead of only replacing it.
|
|
69
|
+
*/
|
|
70
|
+
handlerFor(key) {
|
|
71
|
+
return this.table.get(key) ?? null;
|
|
72
|
+
}
|
|
73
|
+
/** Whether anything handles this key. */
|
|
74
|
+
has(key) {
|
|
75
|
+
return this.table.has(key);
|
|
76
|
+
}
|
|
77
|
+
/** Every key handled, in registration order (core's first). */
|
|
78
|
+
keys() {
|
|
79
|
+
return [...this.table.keys()];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Everything the game says about an effect, in five tables under three keys.
|
|
84
|
+
*
|
|
85
|
+
* `text` is keyed on the EFINFO_* flag because that is what upstream's two
|
|
86
|
+
* switches key on: twenty flags describe a hundred and twelve effects, and an
|
|
87
|
+
* effect that behaves like an existing one for display purposes reuses its
|
|
88
|
+
* flag rather than repeating it. `summary` is keyed on the effect CODE, and
|
|
89
|
+
* `subtype` / `request` on the effect INDEX (or a mod's string code).
|
|
90
|
+
*/
|
|
91
|
+
export class EffectInfoRegistry {
|
|
92
|
+
/** The menu row and the recall sentence, keyed on the EFINFO_* flag. */
|
|
93
|
+
text = new EffectInfoTable();
|
|
94
|
+
/** effect_summarize_properties' arms, keyed on the effect code. */
|
|
95
|
+
summary = new EffectInfoTable();
|
|
96
|
+
/** effect_subtype's arms, keyed on the effect index (or a mod code). */
|
|
97
|
+
subtype = new EffectInfoTable();
|
|
98
|
+
/** requestForEffect's arms, keyed on the effect index (or a mod code). */
|
|
99
|
+
request = new EffectInfoTable();
|
|
100
|
+
}
|
|
101
|
+
/* ------------------------------------------------------------------ *
|
|
102
|
+
* The live registry.
|
|
103
|
+
* ------------------------------------------------------------------ */
|
|
104
|
+
/**
|
|
105
|
+
* Core's own seeders. Each of the four modules that OWNS a table registers its
|
|
106
|
+
* arms here at import time, and each is also the only module that READS its
|
|
107
|
+
* table - so "the module is loaded" and "core's arms are installed" cannot come
|
|
108
|
+
* apart. That is the point: a seeder somebody has to remember to call is a
|
|
109
|
+
* seeder that gets forgotten on one path, and the failure mode here is silent
|
|
110
|
+
* (every effect describes itself as "").
|
|
111
|
+
*/
|
|
112
|
+
const seeders = [];
|
|
113
|
+
let live = new EffectInfoRegistry();
|
|
114
|
+
/**
|
|
115
|
+
* Install a set of core arms, now and on every reset. Called at module scope by
|
|
116
|
+
* effect-info.ts, obj/effects-info.ts, effects/effect.ts and
|
|
117
|
+
* game/effect-item.ts; a MOD never calls this - it registers through the
|
|
118
|
+
* capability-gated facade, whose registrations a reset deliberately drops.
|
|
119
|
+
*/
|
|
120
|
+
export function seedEffectInfo(seed) {
|
|
121
|
+
seeders.push(seed);
|
|
122
|
+
seed(live);
|
|
123
|
+
}
|
|
124
|
+
/** The live registry. Module-level; see this file's header for why that is safe. */
|
|
125
|
+
export function effectInfoRegistry() {
|
|
126
|
+
return live;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Back to core's arms alone, dropping every mod registration - the same state a
|
|
130
|
+
* reload produces, without needing a fresh realm. No production caller by
|
|
131
|
+
* design; see this file's header.
|
|
132
|
+
*/
|
|
133
|
+
export function resetEffectInfoRegistry() {
|
|
134
|
+
live = new EffectInfoRegistry();
|
|
135
|
+
for (const seed of seeders)
|
|
136
|
+
seed(live);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=effect-info-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect-info-registry.js","sourceRoot":"","sources":["../../src/effects/effect-info-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAgKH;;wEAEwE;AAExE;;;;GAIG;AACH,MAAM,OAAO,eAAe;IACT,KAAK,GAAG,IAAI,GAAG,EAAQ,CAAC;IAEzC,oDAAoD;IACpD,GAAG,CAAC,GAAM,EAAE,OAAU;QACpB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,GAAM;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;IACrC,CAAC;IAED,yCAAyC;IACzC,GAAG,CAAC,GAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,+DAA+D;IAC/D,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAChC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAC7B,wEAAwE;IAC/D,IAAI,GAAG,IAAI,eAAe,EAA6B,CAAC;IACjE,mEAAmE;IAC1D,OAAO,GAAG,IAAI,eAAe,EAAoC,CAAC;IAC3E,wEAAwE;IAC/D,OAAO,GAAG,IAAI,eAAe,EAAoC,CAAC;IAC3E,0EAA0E;IACjE,OAAO,GAAG,IAAI,eAAe,EAAoC,CAAC;CAC5E;AAQD;;wEAEwE;AAExE;;;;;;;GAOG;AACH,MAAM,OAAO,GAA6C,EAAE,CAAC;AAE7D,IAAI,IAAI,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAuC;IACpE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,IAAI,CAAC,IAAI,CAAC,CAAC;AACb,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB;IACrC,IAAI,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,OAAO;QAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Golden vectors for EFFECT INFO: the five closed switches of MOD_REACH gap 17.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. Five `switch` statements decide everything the game says
|
|
5
|
+
* about an effect, and each one is closed against a code it has never heard of:
|
|
6
|
+
*
|
|
7
|
+
* - `effectMenuName` (effect-info.ts, keyed on the EFINFO_* flag) - the row
|
|
8
|
+
* text in the "Activate which item?" / spell menus.
|
|
9
|
+
* - `formatEffectDesc` (effect-info.ts, same key) - effect_describe's body,
|
|
10
|
+
* the sentence in object recall and spell descriptions.
|
|
11
|
+
* - the activation summary walker (obj/effects-info.ts, keyed on the effect
|
|
12
|
+
* CODE) - which object properties an activation grants, read by
|
|
13
|
+
* remove_contradictory_activation.
|
|
14
|
+
* - `effectSubtype` (effect.ts, keyed on the EF index) - how a gamedata
|
|
15
|
+
* `type:` NAME becomes the integer subtype.
|
|
16
|
+
*
|
|
17
|
+
* Turning them into keyed registries is a refactor of every string the player
|
|
18
|
+
* reads about an effect, so what has to be proven is not "the effect tests still
|
|
19
|
+
* pass" but "every effect, at every subtype and dice shape the port can build,
|
|
20
|
+
* still produces exactly the same text".
|
|
21
|
+
*
|
|
22
|
+
* NO RNG PROBE HERE, AND THAT IS A MEASURED CLAIM, NOT AN OVERSIGHT. The glyph
|
|
23
|
+
* vectors carry one because level generation draws; this path does not. Upstream
|
|
24
|
+
* `effect_describe` calls `dice_roll()` to populate the random_value it formats;
|
|
25
|
+
* the port substitutes `Dice.randomValue()` at every such site precisely so that
|
|
26
|
+
* rendering a menu row cannot perturb the stream (see effect-info.ts's header).
|
|
27
|
+
* There is no Rng threaded into any of these functions to probe. What is at risk
|
|
28
|
+
* is the TEXT, so the text is what is recorded.
|
|
29
|
+
*
|
|
30
|
+
* THE DEPS ARE SYNTHETIC ON PURPOSE. `timedDesc`, `statName`, `summonDesc` and
|
|
31
|
+
* the projection table are injected, so the real pack would add nothing to
|
|
32
|
+
* dispatch coverage - and stub values that are DISTINCT per index ("tmd7",
|
|
33
|
+
* "proj3-player") are strictly better at catching an arm that reads the wrong
|
|
34
|
+
* field, which real prose ("poison", "a lash of fire") can hide. The activation
|
|
35
|
+
* summary is the exception: it resolves TMD names through the real compiled
|
|
36
|
+
* player_timed records, so those are injected as fixtures.
|
|
37
|
+
*
|
|
38
|
+
* Regenerate with `node packages/core/scripts/gen-effect-info-vectors.mjs` -
|
|
39
|
+
* which OVERWRITES the evidence, so only do it when the change is intended and
|
|
40
|
+
* say so in the commit.
|
|
41
|
+
*/
|
|
42
|
+
import type { ActivationSummarizerDeps } from "../obj/effects-info.js";
|
|
43
|
+
/**
|
|
44
|
+
* One recorded call. Flat and all-string so a diff names the effect and the
|
|
45
|
+
* scenario that moved rather than reflowing a nested object.
|
|
46
|
+
*/
|
|
47
|
+
export interface EffectInfoVector {
|
|
48
|
+
/** Which switch this exercises: "menu" | "desc" | "summary" | "subtype". */
|
|
49
|
+
kind: string;
|
|
50
|
+
/** The effect: an EFFECT_ENTRIES name, or a chain label for "summary". */
|
|
51
|
+
effect: string;
|
|
52
|
+
/** The inputs, spelled out. */
|
|
53
|
+
scenario: string;
|
|
54
|
+
/** What the code produced, as a string ("null" for a null return). */
|
|
55
|
+
out: string;
|
|
56
|
+
}
|
|
57
|
+
/** What the activation-summary vectors need from the shipped pack. */
|
|
58
|
+
export interface EffectInfoVectorFixtures {
|
|
59
|
+
/** The real deps makeActivationSummarizer is bound with at the session site. */
|
|
60
|
+
summarizerDeps(): ActivationSummarizerDeps;
|
|
61
|
+
/** Every TMD name of the pack, in index order - the summary's real keys. */
|
|
62
|
+
timedNames(): readonly string[];
|
|
63
|
+
}
|
|
64
|
+
/** effect_get_menu_name over every effect at every scenario. */
|
|
65
|
+
export declare function computeMenuVectors(): EffectInfoVector[];
|
|
66
|
+
/**
|
|
67
|
+
* effect_describe over every effect at every scenario, `onlyFirst` so exactly
|
|
68
|
+
* one pass through formatEffectDesc is recorded per vector.
|
|
69
|
+
*/
|
|
70
|
+
export declare function computeDescVectors(): EffectInfoVector[];
|
|
71
|
+
/**
|
|
72
|
+
* The chained arms of effect_describe - RANDOM and SELECT walk their
|
|
73
|
+
* sub-effects through create_nested_effect_description, which calls the same
|
|
74
|
+
* switch from a second call site. A chain of BREATHs with matching dice is the
|
|
75
|
+
* combining arm; a mixed chain is the "or"-joined arm.
|
|
76
|
+
*/
|
|
77
|
+
export declare function computeChainVectors(): EffectInfoVector[];
|
|
78
|
+
/**
|
|
79
|
+
* effect_summarize_properties over chains that reach all twelve arms of the
|
|
80
|
+
* activation walker, against the real compiled player_timed records.
|
|
81
|
+
*/
|
|
82
|
+
export declare function computeSummaryVectors(fixtures: EffectInfoVectorFixtures): EffectInfoVector[];
|
|
83
|
+
/**
|
|
84
|
+
* effect_subtype: every effect index against every subtype NAME any effect
|
|
85
|
+
* accepts, plus the numeric and garbage paths. -1 means "no such subtype for
|
|
86
|
+
* this effect", and a refactor that widens or narrows that is exactly what
|
|
87
|
+
* this catches.
|
|
88
|
+
*/
|
|
89
|
+
export declare function computeSubtypeVectors(): EffectInfoVector[];
|
|
90
|
+
/** Every family, in a stable order. */
|
|
91
|
+
export declare function computeEffectInfoVectors(fixtures: EffectInfoVectorFixtures): EffectInfoVector[];
|
|
92
|
+
//# sourceMappingURL=effect-info-vectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect-info-vectors.d.ts","sourceRoot":"","sources":["../../src/effects/effect-info-vectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAKH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAOvE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,sEAAsE;AACtE,MAAM,WAAW,wBAAwB;IACvC,gFAAgF;IAChF,cAAc,IAAI,wBAAwB,CAAC;IAC3C,4EAA4E;IAC5E,UAAU,IAAI,SAAS,MAAM,EAAE,CAAC;CACjC;AAiFD,gEAAgE;AAChE,wBAAgB,kBAAkB,IAAI,gBAAgB,EAAE,CAiBvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,EAAE,CAqBvD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,EAAE,CA8BxD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,wBAAwB,GACjC,gBAAgB,EAAE,CAwDpB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,gBAAgB,EAAE,CAqD1D;AAED,uCAAuC;AACvC,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,wBAAwB,GACjC,gBAAgB,EAAE,CAQpB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pack-derived half of the effect-info vectors.
|
|
3
|
+
*
|
|
4
|
+
* SEPARATE FILE, and it reads the disk: keeping node:fs out of
|
|
5
|
+
* `effect-info-vectors.ts` means that module stays importable from anywhere.
|
|
6
|
+
* ONE copy, shared by `effect-info-vectors.test.ts` and by
|
|
7
|
+
* `scripts/gen-effect-info-vectors.mjs`, so the test and the generator cannot
|
|
8
|
+
* disagree about what they are measuring.
|
|
9
|
+
*
|
|
10
|
+
* Only the activation summary needs this. The menu-name, description and
|
|
11
|
+
* subtype families take their lookups as injected deps and are recorded against
|
|
12
|
+
* synthetic ones (see the header of effect-info-vectors.ts for why that is the
|
|
13
|
+
* stronger choice there); the summary resolves real TMD names against the real
|
|
14
|
+
* compiled player_timed records, so it gets the real pack.
|
|
15
|
+
*/
|
|
16
|
+
import type { EffectInfoVectorFixtures } from "./effect-info-vectors.js";
|
|
17
|
+
export declare function effectInfoVectorFixtures(): EffectInfoVectorFixtures;
|
|
18
|
+
//# sourceMappingURL=effect-info-vectors.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect-info-vectors.fixtures.d.ts","sourceRoot":"","sources":["../../src/effects/effect-info-vectors.fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAYzE,wBAAgB,wBAAwB,IAAI,wBAAwB,CA2BnE"}
|