@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
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The RANDOM ARTIFACT registry: what an ability does, what an item class starts
|
|
3
|
+
* with, which bucket it counts toward, and whether an activation is redundant.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS IS A REGISTRY. `artifact.json` has always accepted a new record, so a
|
|
6
|
+
* mod could always ship a fixed artifact. What it could not do was reach the
|
|
7
|
+
* RANDOM artifact generator, which is a different thing entirely: four closed
|
|
8
|
+
* `switch` statements decided every property a randart can have, and each failed
|
|
9
|
+
* silently rather than loudly.
|
|
10
|
+
*
|
|
11
|
+
* - `addAbilityAux` (randart-build.ts, keyed on the `ART_IDX` ability, 87
|
|
12
|
+
* cases) - the largest dispatch in the port. A mod-coined ability index took
|
|
13
|
+
* the default arm, which is `break`: the design loop spent power on it and
|
|
14
|
+
* the artifact got NOTHING.
|
|
15
|
+
* - `artifactPrep` (randart-build.ts, keyed on the base item's tval, 15) - the
|
|
16
|
+
* starting to-hit / to-dam / AC an item class is given. An unlisted tval got
|
|
17
|
+
* zero of each, so a mod's new item class produced randarts that started
|
|
18
|
+
* blank and could never be told apart from a bug.
|
|
19
|
+
* - the item-class census (randart-data.ts, keyed on tval, 14) - which
|
|
20
|
+
* `data.*Total` bucket a standard artifact counts toward. That census feeds
|
|
21
|
+
* the frequency table the design loop SPENDS, so a mod's item class landing
|
|
22
|
+
* in `otherTotal` skews what every randart in the game becomes.
|
|
23
|
+
* - the redundancy test (randart-build.ts, keyed on the `EFPROP` kind, 9) -
|
|
24
|
+
* whether an activation only duplicates something the artifact already has.
|
|
25
|
+
* An unknown kind takes upstream's conservative default (keep it), which is
|
|
26
|
+
* right for core and useless to a mod that coined a new property kind.
|
|
27
|
+
*
|
|
28
|
+
* FOUR TABLES, THREE KEYS, kept separate because upstream's keys are: the
|
|
29
|
+
* ability index, the tval, and the EFPROP kind name three different things and
|
|
30
|
+
* collapsing them would force a mod to register the same behaviour twice.
|
|
31
|
+
*
|
|
32
|
+
* WHAT A HANDLER GETS, AND WHY IT IS NOT A PILE OF CALLBACKS. Every primitive
|
|
33
|
+
* core's own arms use - `addFlag`, `addMod`, `addResist`, `addBrand`, `addSlay`,
|
|
34
|
+
* `addToHit`, `addToDam`, `addToAC`, `addLowResist`, `addHighResist`,
|
|
35
|
+
* `addImmunity`, `addStat`, `addSustain`, `addDamageDice`, `addWeightMod`,
|
|
36
|
+
* `addActivation` - is exported and reachable through `ctx.core`. So the context
|
|
37
|
+
* carries STATE (the registry, the artifact, the base kind, the target power,
|
|
38
|
+
* the set data, the rng) and nothing else. A mod's handler is written exactly
|
|
39
|
+
* the way core's arms are written.
|
|
40
|
+
*
|
|
41
|
+
* That reachability was NOT free, and it is the trap this seam nearly shipped
|
|
42
|
+
* with. The helpers were exported from `randart-build.ts` but the module was
|
|
43
|
+
* never re-exported from core's index, so none of them were in `ctx.core` - a
|
|
44
|
+
* mod could register a handler and had no way to write its body. `index.ts` now
|
|
45
|
+
* exports `randart-build.js` and `randart-data.js` for exactly that reason. A
|
|
46
|
+
* seam whose primitives a mod cannot reach is a seam a mod cannot use.
|
|
47
|
+
*
|
|
48
|
+
* ORDER AND RNG. Core's handlers are the case bodies lifted unchanged, so the
|
|
49
|
+
* draw sequence is identical - which is what `randart-vectors.json` exists to
|
|
50
|
+
* prove, 834 vectors recorded before this file existed, the per-arm families
|
|
51
|
+
* carrying an RNG probe because a changed draw count is invisible in the
|
|
52
|
+
* artifact and diverges every artifact after it. A MOD's handler draws from the
|
|
53
|
+
* same `rng`, so it changes the stream from that ability onward. That is
|
|
54
|
+
* inherent in adding behaviour to generation and is why a modded game is not
|
|
55
|
+
* seed-compatible with an unmodded one.
|
|
56
|
+
*
|
|
57
|
+
* WHY MODULE-LEVEL. The same 2026-08-09 ruling that justified
|
|
58
|
+
* `EffectInfoRegistry`: disabling a mod always takes effect on the next RELOAD,
|
|
59
|
+
* so a module-level table cannot violate the mod default policy. A fresh page is
|
|
60
|
+
* a fresh module instance and the host installs each plugin at most once per
|
|
61
|
+
* realm, so a disabled mod's registrations are gone on the next boot because the
|
|
62
|
+
* table they lived in is. `resetRandartRegistry()` is the same restoration
|
|
63
|
+
* without a fresh realm; it has no production caller by design.
|
|
64
|
+
*/
|
|
65
|
+
import type { Rng } from "../rng.js";
|
|
66
|
+
import type { ObjRegistry } from "./bind.js";
|
|
67
|
+
import type { EffectObjectProperty } from "./randart-build.js";
|
|
68
|
+
import type { ArtifactSetData } from "./randart-data.js";
|
|
69
|
+
import type { Artifact, ObjectKind } from "./types.js";
|
|
70
|
+
/** The state one `add_ability_aux` arm is given (obj-randart.c L2150). */
|
|
71
|
+
export interface RandartAbilityContext {
|
|
72
|
+
/** The object registry, for the flag / brand / slay / element tables. */
|
|
73
|
+
readonly reg: ObjRegistry;
|
|
74
|
+
/** The artifact being built. Handlers mutate this. */
|
|
75
|
+
readonly art: Artifact;
|
|
76
|
+
/** The base item kind, or null when the tval/sval pair names none. */
|
|
77
|
+
readonly kind: ObjectKind | null;
|
|
78
|
+
/** The power the design loop is aiming at (gates AGGRAVATE, sizes ACTIV). */
|
|
79
|
+
readonly targetPower: number;
|
|
80
|
+
/** The measured profile of the standard set: increments, powers, frequencies. */
|
|
81
|
+
readonly data: ArtifactSetData;
|
|
82
|
+
/** The generation stream. Drawing from it moves every later artifact. */
|
|
83
|
+
readonly rng: Rng;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* What one ability does to an artifact. Write it the way core's arms are
|
|
87
|
+
* written: call the exported `addFlag` / `addMod` / `addResist` / ... helpers,
|
|
88
|
+
* which handle the "already has it" case and the randart.log line.
|
|
89
|
+
*/
|
|
90
|
+
export type RandartAbilityHandler = (ctx: RandartAbilityContext) => void;
|
|
91
|
+
/** The state one `artifact_prep` item-class arm is given. */
|
|
92
|
+
export interface RandartPrepContext {
|
|
93
|
+
readonly reg: ObjRegistry;
|
|
94
|
+
/** The artifact, already given the base kind's own values. */
|
|
95
|
+
readonly art: Artifact;
|
|
96
|
+
/** The base item kind this artifact was built from. */
|
|
97
|
+
readonly kind: ObjectKind;
|
|
98
|
+
readonly data: ArtifactSetData;
|
|
99
|
+
readonly rng: Rng;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The basic stats an item class starts with. Upstream gives weapons to-hit and
|
|
103
|
+
* to-dam, armour to-AC, and everything else nothing at all - an unregistered
|
|
104
|
+
* tval takes that last arm, which is upstream's own default rather than a hole.
|
|
105
|
+
*/
|
|
106
|
+
export type RandartPrepHandler = (ctx: RandartPrepContext) => void;
|
|
107
|
+
/**
|
|
108
|
+
* Which `data.*Total` bucket a standard artifact counts toward. This feeds the
|
|
109
|
+
* frequency table the design loop spends, so it is not bookkeeping: a class in
|
|
110
|
+
* the wrong bucket changes what every randart in the game becomes.
|
|
111
|
+
*
|
|
112
|
+
* `TV.NULL` is registered as an explicit no-op rather than left to the default,
|
|
113
|
+
* because upstream distinguishes "an empty artifact slot" from "an item class I
|
|
114
|
+
* have no bucket for" - the first counts toward nothing, the second toward
|
|
115
|
+
* `otherTotal`.
|
|
116
|
+
*/
|
|
117
|
+
export type RandartCensusHandler = (data: ArtifactSetData) => void;
|
|
118
|
+
/** The state one redundancy arm is given (obj-randart.c L2420). */
|
|
119
|
+
export interface RandartRedundancyContext {
|
|
120
|
+
readonly reg: ObjRegistry;
|
|
121
|
+
/** The artifact whose activation is on trial. */
|
|
122
|
+
readonly art: Artifact;
|
|
123
|
+
/** The summarized property this arm is judging. */
|
|
124
|
+
readonly prop: EffectObjectProperty;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Whether the activation is STILL redundant after considering this property.
|
|
128
|
+
* Return false the moment the activation does something the artifact does not
|
|
129
|
+
* already do - upstream stops at the first `false` and keeps the activation.
|
|
130
|
+
* An unregistered kind takes upstream's conservative default (not redundant),
|
|
131
|
+
* which is the safe direction: a kept activation is a weaker artifact than
|
|
132
|
+
* intended, a dropped one is a missing power.
|
|
133
|
+
*/
|
|
134
|
+
export type RandartRedundancyHandler = (ctx: RandartRedundancyContext) => boolean;
|
|
135
|
+
/**
|
|
136
|
+
* One keyed table. Written once and used four times, because the four differ
|
|
137
|
+
* only in their key and handler types.
|
|
138
|
+
*/
|
|
139
|
+
export declare class RandartTable<K, H> {
|
|
140
|
+
private readonly table;
|
|
141
|
+
/** Install (or replace) the handler for one key. */
|
|
142
|
+
set(key: K, handler: H): void;
|
|
143
|
+
/**
|
|
144
|
+
* The handler installed for a key right now, or null. This is what a mod
|
|
145
|
+
* calls to WRAP core - keep the returned handler, install its own, and call
|
|
146
|
+
* through. Wrapping matters more here than almost anywhere else: an ability
|
|
147
|
+
* that draws a different NUMBER of random values changes every artifact
|
|
148
|
+
* generated after it, so a handler that reimplements core's from scratch and
|
|
149
|
+
* gets the draw count wrong is a whole-set divergence, not a local one.
|
|
150
|
+
*/
|
|
151
|
+
handlerFor(key: K): H | null;
|
|
152
|
+
/** Whether anything handles this key. */
|
|
153
|
+
has(key: K): boolean;
|
|
154
|
+
/** Every key handled, in registration order (core's first). */
|
|
155
|
+
keys(): readonly K[];
|
|
156
|
+
}
|
|
157
|
+
/** Random artifact construction, in four tables under three keys. */
|
|
158
|
+
export declare class RandartRegistry {
|
|
159
|
+
/** What an ability does, keyed on the ART_IDX index. */
|
|
160
|
+
readonly abilities: RandartTable<number, RandartAbilityHandler>;
|
|
161
|
+
/** An item class's starting stats, keyed on tval. */
|
|
162
|
+
readonly prep: RandartTable<number, RandartPrepHandler>;
|
|
163
|
+
/** The item-class census bucket, keyed on tval. */
|
|
164
|
+
readonly census: RandartTable<number, RandartCensusHandler>;
|
|
165
|
+
/** Activation redundancy, keyed on the EFPROP kind. */
|
|
166
|
+
readonly redundancy: RandartTable<number, RandartRedundancyHandler>;
|
|
167
|
+
}
|
|
168
|
+
/** Install a set of core arms, now and on every reset. A MOD never calls this. */
|
|
169
|
+
export declare function seedRandart(seed: (reg: RandartRegistry) => void): void;
|
|
170
|
+
/** The live registry. Module-level; see this file's header for why that is safe. */
|
|
171
|
+
export declare function randartRegistry(): RandartRegistry;
|
|
172
|
+
/**
|
|
173
|
+
* Back to core's arms alone, dropping every mod registration - the same state a
|
|
174
|
+
* reload produces, without needing a fresh realm. No production caller by
|
|
175
|
+
* design; see this file's header.
|
|
176
|
+
*/
|
|
177
|
+
export declare function resetRandartRegistry(): void;
|
|
178
|
+
//# sourceMappingURL=randart-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"randart-registry.d.ts","sourceRoot":"","sources":["../../src/obj/randart-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC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item class starts
|
|
3
|
+
* with, which bucket it counts toward, and whether an activation is redundant.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS IS A REGISTRY. `artifact.json` has always accepted a new record, so a
|
|
6
|
+
* mod could always ship a fixed artifact. What it could not do was reach the
|
|
7
|
+
* RANDOM artifact generator, which is a different thing entirely: four closed
|
|
8
|
+
* `switch` statements decided every property a randart can have, and each failed
|
|
9
|
+
* silently rather than loudly.
|
|
10
|
+
*
|
|
11
|
+
* - `addAbilityAux` (randart-build.ts, keyed on the `ART_IDX` ability, 87
|
|
12
|
+
* cases) - the largest dispatch in the port. A mod-coined ability index took
|
|
13
|
+
* the default arm, which is `break`: the design loop spent power on it and
|
|
14
|
+
* the artifact got NOTHING.
|
|
15
|
+
* - `artifactPrep` (randart-build.ts, keyed on the base item's tval, 15) - the
|
|
16
|
+
* starting to-hit / to-dam / AC an item class is given. An unlisted tval got
|
|
17
|
+
* zero of each, so a mod's new item class produced randarts that started
|
|
18
|
+
* blank and could never be told apart from a bug.
|
|
19
|
+
* - the item-class census (randart-data.ts, keyed on tval, 14) - which
|
|
20
|
+
* `data.*Total` bucket a standard artifact counts toward. That census feeds
|
|
21
|
+
* the frequency table the design loop SPENDS, so a mod's item class landing
|
|
22
|
+
* in `otherTotal` skews what every randart in the game becomes.
|
|
23
|
+
* - the redundancy test (randart-build.ts, keyed on the `EFPROP` kind, 9) -
|
|
24
|
+
* whether an activation only duplicates something the artifact already has.
|
|
25
|
+
* An unknown kind takes upstream's conservative default (keep it), which is
|
|
26
|
+
* right for core and useless to a mod that coined a new property kind.
|
|
27
|
+
*
|
|
28
|
+
* FOUR TABLES, THREE KEYS, kept separate because upstream's keys are: the
|
|
29
|
+
* ability index, the tval, and the EFPROP kind name three different things and
|
|
30
|
+
* collapsing them would force a mod to register the same behaviour twice.
|
|
31
|
+
*
|
|
32
|
+
* WHAT A HANDLER GETS, AND WHY IT IS NOT A PILE OF CALLBACKS. Every primitive
|
|
33
|
+
* core's own arms use - `addFlag`, `addMod`, `addResist`, `addBrand`, `addSlay`,
|
|
34
|
+
* `addToHit`, `addToDam`, `addToAC`, `addLowResist`, `addHighResist`,
|
|
35
|
+
* `addImmunity`, `addStat`, `addSustain`, `addDamageDice`, `addWeightMod`,
|
|
36
|
+
* `addActivation` - is exported and reachable through `ctx.core`. So the context
|
|
37
|
+
* carries STATE (the registry, the artifact, the base kind, the target power,
|
|
38
|
+
* the set data, the rng) and nothing else. A mod's handler is written exactly
|
|
39
|
+
* the way core's arms are written.
|
|
40
|
+
*
|
|
41
|
+
* That reachability was NOT free, and it is the trap this seam nearly shipped
|
|
42
|
+
* with. The helpers were exported from `randart-build.ts` but the module was
|
|
43
|
+
* never re-exported from core's index, so none of them were in `ctx.core` - a
|
|
44
|
+
* mod could register a handler and had no way to write its body. `index.ts` now
|
|
45
|
+
* exports `randart-build.js` and `randart-data.js` for exactly that reason. A
|
|
46
|
+
* seam whose primitives a mod cannot reach is a seam a mod cannot use.
|
|
47
|
+
*
|
|
48
|
+
* ORDER AND RNG. Core's handlers are the case bodies lifted unchanged, so the
|
|
49
|
+
* draw sequence is identical - which is what `randart-vectors.json` exists to
|
|
50
|
+
* prove, 834 vectors recorded before this file existed, the per-arm families
|
|
51
|
+
* carrying an RNG probe because a changed draw count is invisible in the
|
|
52
|
+
* artifact and diverges every artifact after it. A MOD's handler draws from the
|
|
53
|
+
* same `rng`, so it changes the stream from that ability onward. That is
|
|
54
|
+
* inherent in adding behaviour to generation and is why a modded game is not
|
|
55
|
+
* seed-compatible with an unmodded one.
|
|
56
|
+
*
|
|
57
|
+
* WHY MODULE-LEVEL. The same 2026-08-09 ruling that justified
|
|
58
|
+
* `EffectInfoRegistry`: disabling a mod always takes effect on the next RELOAD,
|
|
59
|
+
* so a module-level table cannot violate the mod default policy. A fresh page is
|
|
60
|
+
* a fresh module instance and the host installs each plugin at most once per
|
|
61
|
+
* realm, so a disabled mod's registrations are gone on the next boot because the
|
|
62
|
+
* table they lived in is. `resetRandartRegistry()` is the same restoration
|
|
63
|
+
* without a fresh realm; it has no production caller by design.
|
|
64
|
+
*/
|
|
65
|
+
/* ------------------------------------------------------------------ *
|
|
66
|
+
* The tables.
|
|
67
|
+
* ------------------------------------------------------------------ */
|
|
68
|
+
/**
|
|
69
|
+
* One keyed table. Written once and used four times, because the four differ
|
|
70
|
+
* only in their key and handler types.
|
|
71
|
+
*/
|
|
72
|
+
export class RandartTable {
|
|
73
|
+
table = new Map();
|
|
74
|
+
/** Install (or replace) the handler for one key. */
|
|
75
|
+
set(key, handler) {
|
|
76
|
+
this.table.set(key, handler);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The handler installed for a key right now, or null. This is what a mod
|
|
80
|
+
* calls to WRAP core - keep the returned handler, install its own, and call
|
|
81
|
+
* through. Wrapping matters more here than almost anywhere else: an ability
|
|
82
|
+
* that draws a different NUMBER of random values changes every artifact
|
|
83
|
+
* generated after it, so a handler that reimplements core's from scratch and
|
|
84
|
+
* gets the draw count wrong is a whole-set divergence, not a local one.
|
|
85
|
+
*/
|
|
86
|
+
handlerFor(key) {
|
|
87
|
+
return this.table.get(key) ?? null;
|
|
88
|
+
}
|
|
89
|
+
/** Whether anything handles this key. */
|
|
90
|
+
has(key) {
|
|
91
|
+
return this.table.has(key);
|
|
92
|
+
}
|
|
93
|
+
/** Every key handled, in registration order (core's first). */
|
|
94
|
+
keys() {
|
|
95
|
+
return [...this.table.keys()];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** Random artifact construction, in four tables under three keys. */
|
|
99
|
+
export class RandartRegistry {
|
|
100
|
+
/** What an ability does, keyed on the ART_IDX index. */
|
|
101
|
+
abilities = new RandartTable();
|
|
102
|
+
/** An item class's starting stats, keyed on tval. */
|
|
103
|
+
prep = new RandartTable();
|
|
104
|
+
/** The item-class census bucket, keyed on tval. */
|
|
105
|
+
census = new RandartTable();
|
|
106
|
+
/** Activation redundancy, keyed on the EFPROP kind. */
|
|
107
|
+
redundancy = new RandartTable();
|
|
108
|
+
}
|
|
109
|
+
/* ------------------------------------------------------------------ *
|
|
110
|
+
* The live registry.
|
|
111
|
+
* ------------------------------------------------------------------ */
|
|
112
|
+
/**
|
|
113
|
+
* Core's own seeders. The modules that OWN a table register their arms here at
|
|
114
|
+
* import time, and each is also the only module that READS its table - so "the
|
|
115
|
+
* module is loaded" and "core's arms are installed" cannot come apart. A seeder
|
|
116
|
+
* somebody has to remember to call is a seeder that gets forgotten on one path,
|
|
117
|
+
* and the failure mode here is silent: every randart comes out blank.
|
|
118
|
+
*/
|
|
119
|
+
const seeders = [];
|
|
120
|
+
let live = new RandartRegistry();
|
|
121
|
+
/** Install a set of core arms, now and on every reset. A MOD never calls this. */
|
|
122
|
+
export function seedRandart(seed) {
|
|
123
|
+
seeders.push(seed);
|
|
124
|
+
seed(live);
|
|
125
|
+
}
|
|
126
|
+
/** The live registry. Module-level; see this file's header for why that is safe. */
|
|
127
|
+
export function randartRegistry() {
|
|
128
|
+
return live;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Back to core's arms alone, dropping every mod registration - the same state a
|
|
132
|
+
* reload produces, without needing a fresh realm. No production caller by
|
|
133
|
+
* design; see this file's header.
|
|
134
|
+
*/
|
|
135
|
+
export function resetRandartRegistry() {
|
|
136
|
+
live = new RandartRegistry();
|
|
137
|
+
for (const seed of seeders)
|
|
138
|
+
seed(live);
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=randart-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"randart-registry.js","sourceRoot":"","sources":["../../src/obj/randart-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAkGH;;wEAEwE;AAExE;;;GAGG;AACH,MAAM,OAAO,YAAY;IACN,KAAK,GAAG,IAAI,GAAG,EAAQ,CAAC;IAEzC,oDAAoD;IACpD,GAAG,CAAC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AAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Golden vectors for RANDOM ARTIFACT construction: MOD_REACH gap 14.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. Four closed `switch` statements build every random artifact
|
|
5
|
+
* in the game, and they are the largest dispatch left in the tree:
|
|
6
|
+
*
|
|
7
|
+
* - `addAbilityAux` (randart-build.ts, keyed on the `ART_IDX` ability, 87
|
|
8
|
+
* cases) - what "add this ability" actually does to the artifact.
|
|
9
|
+
* - `artifactPrep` (randart-build.ts, keyed on the base item's tval, 15) -
|
|
10
|
+
* the starting to-hit / to-dam / AC an item class is given.
|
|
11
|
+
* - the item-class census (randart-data.ts, keyed on tval, 14) - which
|
|
12
|
+
* `data.*Total` bucket a standard artifact counts toward, which feeds the
|
|
13
|
+
* frequency table the design loop spends.
|
|
14
|
+
* - the redundancy test (randart-build.ts, keyed on the `EFPROP` kind, 9) -
|
|
15
|
+
* whether an activation only duplicates something the artifact already has.
|
|
16
|
+
*
|
|
17
|
+
* Converting them into keyed registries so a mod can define a NEW ability, or a
|
|
18
|
+
* new item class, is a refactor of the most RNG-dense code in the port. What has
|
|
19
|
+
* to be proven is not "the randart tests still pass" but "the same seed still
|
|
20
|
+
* produces the same artifacts, drawn in the same order".
|
|
21
|
+
*
|
|
22
|
+
* WHY THE EXISTING TESTS ARE NOT THAT. `randart.test.ts` asserts do_randart is
|
|
23
|
+
* deterministic by running it TWICE IN ONE PROCESS and comparing. That is a real
|
|
24
|
+
* property and it catches real bugs - but it cannot fail across a refactor,
|
|
25
|
+
* because a change that moves every artifact moves both runs identically.
|
|
26
|
+
* Agreement is symmetric; a fixture recorded on disk is not.
|
|
27
|
+
*
|
|
28
|
+
* THE PROBE IS THE POINT, AND IT NEEDED A SEAM TO EXIST. `doRandart` owns its
|
|
29
|
+
* Rng internally, so the whole-set family below has no probe: what defends it is
|
|
30
|
+
* that all ~130 artifacts come off ONE stream in sequence, so a changed draw
|
|
31
|
+
* count anywhere but after the final draw moves everything downstream of it. The
|
|
32
|
+
* blind spot that leaves - a draw added at the very end - is closed by the
|
|
33
|
+
* per-arm families, which drive `artifactPrep` and `addAbilityAux` with an Rng
|
|
34
|
+
* this module owns and probe it afterwards. That is also what makes those two
|
|
35
|
+
* families per-ARM coverage rather than aggregate: a vector per `ART_IDX` fails
|
|
36
|
+
* naming the ability that moved.
|
|
37
|
+
*
|
|
38
|
+
* Fixtures are INJECTED rather than loaded here, so this module pulls in no
|
|
39
|
+
* node:fs and no content pack, and can be imported from anywhere.
|
|
40
|
+
*
|
|
41
|
+
* Regenerate with `node packages/core/scripts/gen-randart-vectors.mjs` - which
|
|
42
|
+
* OVERWRITES the evidence, so only do it when artifact generation is
|
|
43
|
+
* deliberately changing, and say so in the commit.
|
|
44
|
+
*/
|
|
45
|
+
import type { Constants } from "../constants.js";
|
|
46
|
+
import type { ObjRegistry } from "./bind.js";
|
|
47
|
+
/** One recorded call. Flat and all-string so a diff names what moved. */
|
|
48
|
+
export interface RandartVector {
|
|
49
|
+
/** Which family: "set" | "prep" | "ability" | "data". */
|
|
50
|
+
kind: string;
|
|
51
|
+
/** The artifact, the tval name, or the ART_IDX name. */
|
|
52
|
+
subject: string;
|
|
53
|
+
/** The inputs, spelled out. */
|
|
54
|
+
scenario: string;
|
|
55
|
+
/** What the code produced. */
|
|
56
|
+
out: string;
|
|
57
|
+
/**
|
|
58
|
+
* One draw taken from an Rng THIS MODULE owns, after the call - it can only
|
|
59
|
+
* match if the stream is at the same position. Absent for the whole-set
|
|
60
|
+
* family, whose Rng lives inside `doRandart`; see the module header for what
|
|
61
|
+
* defends that one instead.
|
|
62
|
+
*/
|
|
63
|
+
probe?: number;
|
|
64
|
+
}
|
|
65
|
+
/** What the vectors need from the shipped pack. */
|
|
66
|
+
export interface RandartVectorFixtures {
|
|
67
|
+
/** A registry with projections bound - `add_brand` cannot run without them. */
|
|
68
|
+
registry(): ObjRegistry;
|
|
69
|
+
/** z_info, which `artifact_power` reaches through `make_fake_artifact`. */
|
|
70
|
+
constants(): Constants;
|
|
71
|
+
}
|
|
72
|
+
/** The seeds the whole-set family runs. Three, because a set is expensive. */
|
|
73
|
+
export declare const RANDART_VECTOR_SEEDS: readonly [1, 4242, 999999];
|
|
74
|
+
/** The seeds the cheap per-arm families run, on both sides of a coin flip. */
|
|
75
|
+
export declare const RANDART_ARM_SEEDS: readonly [7, 31337];
|
|
76
|
+
/**
|
|
77
|
+
* The target powers the ability family runs at, and the second one is not
|
|
78
|
+
* decoration. `ART_IDX.WEAPON_AGGR` / `NONWEAPON_AGGR` only grant AGGRAVATE
|
|
79
|
+
* when `targetPower > AGGR_POWER` (300, obj-randart.h L47), so a family run at
|
|
80
|
+
* one low power records those two arms doing NOTHING - indistinguishable from
|
|
81
|
+
* the `*_SUPER` frequency-table indices that genuinely have no case. The first
|
|
82
|
+
* recording of these vectors had exactly that hole. This is the same failure
|
|
83
|
+
* the glyph work found the expensive way: a scenario grid that never reaches
|
|
84
|
+
* the arm it was written to defend.
|
|
85
|
+
*/
|
|
86
|
+
export declare const RANDART_TARGET_POWERS: readonly [100, 500];
|
|
87
|
+
/** do_randart at each seed, one vector per generated artifact. */
|
|
88
|
+
export declare function computeSetVectors(fixtures: RandartVectorFixtures): RandartVector[];
|
|
89
|
+
/** artifact_prep per item class, with the RNG position afterwards. */
|
|
90
|
+
export declare function computePrepVectors(fixtures: RandartVectorFixtures): RandartVector[];
|
|
91
|
+
/** add_ability_aux per ART_IDX, with the RNG position afterwards. */
|
|
92
|
+
export declare function computeAbilityVectors(fixtures: RandartVectorFixtures): RandartVector[];
|
|
93
|
+
/** collect_artifact_data over the standard set: every scalar it produces. */
|
|
94
|
+
export declare function computeDataVectors(fixtures: RandartVectorFixtures): RandartVector[];
|
|
95
|
+
/** Every family, in a stable order. */
|
|
96
|
+
export declare function computeRandartVectors(fixtures: RandartVectorFixtures): RandartVector[];
|
|
97
|
+
//# sourceMappingURL=randart-vect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AqB,GAC9B,aAAa,EAAE,CAqDjB;AAED,uCAAuC;AACvC,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,qBAAqB,GAC9B,aAAa,EAAE,CAOjB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The registry and constants a randart vector is recorded against, built from
|
|
3
|
+
* the real shipped content pack.
|
|
4
|
+
*
|
|
5
|
+
* SEPARATE FILE, and it reads the disk: keeping node:fs out of
|
|
6
|
+
* `randart-vectors.ts` means that module stays importable from anywhere. ONE
|
|
7
|
+
* copy, shared by `randart-vectors.test.ts` and by
|
|
8
|
+
* `scripts/gen-randart-vectors.mjs`, so the test and the generator cannot
|
|
9
|
+
* disagree about what they are measuring.
|
|
10
|
+
*
|
|
11
|
+
* The projections are bound for a reason that is not decoration: `add_brand`
|
|
12
|
+
* (obj-randart.c:1951) compares the brand it picked against `projections[i].name`
|
|
13
|
+
* to grant the matching resist, so a registry without them cannot run
|
|
14
|
+
* `do_randart` at all.
|
|
15
|
+
*/
|
|
16
|
+
import type { RandartVectorFixtures } from "./randart-vectors.js";
|
|
17
|
+
export declare function randartVectorFixtures(): RandartVectorFixtures;
|
|
18
|
+
//# sourceMappingURL=randart-vectors.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"randart-vectors.fixtures.d.ts","sourceRoot":"","sources":["../../src/obj/randart-vectors.fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAQlE,wBAAgB,qBAAqB,IAAI,qBAAqB,CA6B7D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The registry and constants a randart vector is recorded against, built from
|
|
3
|
+
* the real shipped content pack.
|
|
4
|
+
*
|
|
5
|
+
* SEPARATE FILE, and it reads the disk: keeping node:fs out of
|
|
6
|
+
* `randart-vectors.ts` means that module stays importable from anywhere. ONE
|
|
7
|
+
* copy, shared by `randart-vectors.test.ts` and by
|
|
8
|
+
* `scripts/gen-randart-vectors.mjs`, so the test and the generator cannot
|
|
9
|
+
* disagree about what they are measuring.
|
|
10
|
+
*
|
|
11
|
+
* The projections are bound for a reason that is not decoration: `add_brand`
|
|
12
|
+
* (obj-randart.c:1951) compares the brand it picked against `projections[i].name`
|
|
13
|
+
* to grant the matching resist, so a registry without them cannot run
|
|
14
|
+
* `do_randart` at all.
|
|
15
|
+
*/
|
|
16
|
+
import { readFileSync } from "node:fs";
|
|
17
|
+
import { bindConstants } from "../constants.js";
|
|
18
|
+
import { bindProjections } from "../world/projection.js";
|
|
19
|
+
import { ObjRegistry } from "./bind.js";
|
|
20
|
+
function loadJson(name) {
|
|
21
|
+
return JSON.parse(readFileSync(new URL(`../../../content/pack/${name}.json`, import.meta.url), "utf8"));
|
|
22
|
+
}
|
|
23
|
+
export function randartVectorFixtures() {
|
|
24
|
+
/* Parsed ONCE; a fresh ObjRegistry is built per call from the same records,
|
|
25
|
+
* because the whole-set family wants a registry no earlier seed has run
|
|
26
|
+
* against. */
|
|
27
|
+
const pack = {
|
|
28
|
+
objectBase: loadJson("object_base"),
|
|
29
|
+
object: loadJson("object"),
|
|
30
|
+
egoItem: loadJson("ego_item"),
|
|
31
|
+
artifact: loadJson("artifact"),
|
|
32
|
+
curse: loadJson("curse"),
|
|
33
|
+
brand: loadJson("brand"),
|
|
34
|
+
slay: loadJson("slay"),
|
|
35
|
+
activation: loadJson("activation"),
|
|
36
|
+
objectProperty: loadJson("object_property"),
|
|
37
|
+
flavor: loadJson("flavor"),
|
|
38
|
+
};
|
|
39
|
+
const projectionRecords = loadJson("projection").records;
|
|
40
|
+
const constants = bindConstants(loadJson("constants"));
|
|
41
|
+
return {
|
|
42
|
+
registry() {
|
|
43
|
+
const reg = new ObjRegistry(pack);
|
|
44
|
+
reg.projections = bindProjections(projectionRecords);
|
|
45
|
+
return reg;
|
|
46
|
+
},
|
|
47
|
+
constants: () => constants,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=randart-vectors.fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"randart-vectors.fixtures.js","sourceRoot":"","sources":["../../src/obj/randart-vectors.fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,SAAS,QAAQ,CAAI,IAAY;IAC/B,OAAO,IAAI,CAAC,KAAK,CACf,YAAY,CAAC,IAAI,GAAG,CAAC,yBAAyB,IAAI,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAChF,CAAC;AACT,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC;;kBAEc;IACd,MAAM,IAAI,GAAG;QACX,UAAU,EAAE,QAAQ,CAAC,aAAa,CAAC;QACnC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC;QAC1B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC;QAC7B,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC;QAC9B,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;QACxB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;QACxB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QACtB,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC;QAClC,cAAc,EAAE,QAAQ,CAAC,iBAAiB,CAAC;QAC3C,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC;KACZ,CAAC;IACjB,MAAM,iBAAiB,GAAG,QAAQ,CAChC,YAAY,CACb,CAAC,OAAO,CAAC;I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