@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,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Golden vectors for project_p: what EVERY projection does to the PLAYER,
|
|
3
|
+
* recorded from the code BEFORE the dispatch switch became a registry.
|
|
4
|
+
*
|
|
5
|
+
* WHY A RECORDING AND NOT "THE TESTS STILL PASS". player-side.test.ts asserts
|
|
6
|
+
* particular behaviours - SHARD cuts, PROT_STUN blocks a SOUND stun, a resisted
|
|
7
|
+
* breath still teaches its rune - and those were written to pin the bugs they
|
|
8
|
+
* were found by, not the cross product. Converting a 21-case switch over
|
|
9
|
+
* faithful behaviour to a registry buys moddability and nothing else, so the
|
|
10
|
+
* standard is "nothing moved", and only a recording of the producer can say so.
|
|
11
|
+
*
|
|
12
|
+
* WHAT A SCENARIO CAPTURES. project_p is the widest-reaching of the three
|
|
13
|
+
* projection handlers: it damages the pack, drains stats and experience, sets
|
|
14
|
+
* nine timed effects, disenchants worn gear, spends mana and energy, and
|
|
15
|
+
* teleports the player outright. So the snapshot is broad on purpose - every
|
|
16
|
+
* message in order, the extra damage returned, the whole timed array, both stat
|
|
17
|
+
* arrays, exp / mana / energy, where the player ended up, and what is left of
|
|
18
|
+
* the pack and the worn armour.
|
|
19
|
+
*
|
|
20
|
+
* AND THE RNG POSITION. `rngProbe` is one draw taken after the scenario. Two
|
|
21
|
+
* implementations can agree on every visible value while drawing a different
|
|
22
|
+
* NUMBER of randoms, and here that is not hypothetical: FIRE, COLD, DARK,
|
|
23
|
+
* NETHER and POIS all roll `randint0(dam)` and then decide, TIME picks a branch
|
|
24
|
+
* with two draws before doing anything, and POIS's acid sting runs adjust_dam,
|
|
25
|
+
* which evaluates a dice denominator. Every one of those is invisible in the
|
|
26
|
+
* result and diverges the whole game a few turns later.
|
|
27
|
+
*
|
|
28
|
+
* The fixtures are INJECTED (`PlayerSideFixtures`) so this module needs no
|
|
29
|
+
* node:fs and stays importable anywhere; the one copy that reads the disk is
|
|
30
|
+
* `player-side-vectors.fixtures.ts`, shared by the test and the generator so
|
|
31
|
+
* they cannot disagree about what they are measuring.
|
|
32
|
+
*/
|
|
33
|
+
import { loc } from "../loc.js";
|
|
34
|
+
import type { GameState } from "./context.js";
|
|
35
|
+
import type { ProjectionInfo } from "../world/projection.js";
|
|
36
|
+
import type { TimedEffect } from "../player/types.js";
|
|
37
|
+
/** What the recorder needs from the real content pack and the real harness. */
|
|
38
|
+
export interface PlayerSideFixtures {
|
|
39
|
+
/** A fresh game state on a given seed; the same one the game tests use. */
|
|
40
|
+
makeState: (seed: number) => GameState;
|
|
41
|
+
/** The bound player_timed table, so the timed effects are the shipped ones. */
|
|
42
|
+
timed: readonly TimedEffect[];
|
|
43
|
+
/**
|
|
44
|
+
* The bound projection table. POIS's acid sting runs adjust_dam through it,
|
|
45
|
+
* and adjust_dam EVALUATES A DICE DENOMINATOR - so a stubbed table would
|
|
46
|
+
* record a different draw count than the game makes.
|
|
47
|
+
*/
|
|
48
|
+
projections: readonly ProjectionInfo[];
|
|
49
|
+
/** Fill the pack with real kinds that real elements really destroy. */
|
|
50
|
+
fillPack: (state: GameState) => void;
|
|
51
|
+
/**
|
|
52
|
+
* The kind inven_damage really destroys, per element, as the fixture derived
|
|
53
|
+
* it. Exposed so the coverage guard can fail when an element found none -
|
|
54
|
+
* an empty pack would make every ACID row record an untouched pack forever.
|
|
55
|
+
*/
|
|
56
|
+
destroyedByElement: ReadonlyMap<number, unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* Fill every weapon and armour slot, optionally with every protective flag
|
|
59
|
+
* project_p reads. Not optional and not one item: minus_ac and
|
|
60
|
+
* disenchant_equipment both pick a random slot BY TYPE and then look for an
|
|
61
|
+
* item in it, so a single suit in the wrong slot is invisible to both.
|
|
62
|
+
*/
|
|
63
|
+
equipArmour: (state: GameState, warded: boolean) => void;
|
|
64
|
+
/** Put a real monster at `grid`; returns its index, or 0 if it could not. */
|
|
65
|
+
addMonster: (state: GameState, grid: ReturnType<typeof loc>) => number;
|
|
66
|
+
}
|
|
67
|
+
/** One recorded scenario: its inputs, and everything observable afterwards. */
|
|
68
|
+
export interface PlayerSideVector {
|
|
69
|
+
/** Stable identity for the row, so a divergence names the case. */
|
|
70
|
+
readonly id: string;
|
|
71
|
+
readonly proj: string;
|
|
72
|
+
readonly dam: number;
|
|
73
|
+
readonly power: number;
|
|
74
|
+
/** "none" | "resist" | "immune": the res_level the actor reports for all. */
|
|
75
|
+
readonly resist: string;
|
|
76
|
+
/** Whether the worn armour carries the protective flags. */
|
|
77
|
+
readonly warded: boolean;
|
|
78
|
+
/** "monster" | "trap": what cave->mon_current and origin.grid resolve to. */
|
|
79
|
+
readonly origin: string;
|
|
80
|
+
readonly seed: number;
|
|
81
|
+
/** The extra damage the handler returned (POIS's acid sting). */
|
|
82
|
+
readonly xtra: number;
|
|
83
|
+
/** Every message, in order. */
|
|
84
|
+
readonly messages: readonly string[];
|
|
85
|
+
/** Non-zero timed effects afterwards, by name, sorted. */
|
|
86
|
+
readonly timed: readonly string[];
|
|
87
|
+
/** p->stat_cur, then p->stat_max: drains show in one or both. */
|
|
88
|
+
readonly statCur: readonly number[];
|
|
89
|
+
readonly statMax: readonly number[];
|
|
90
|
+
readonly exp: number;
|
|
91
|
+
readonly maxExp: number;
|
|
92
|
+
readonly csp: number;
|
|
93
|
+
/** p->energy: NETHER's "Your energy is sapped!" zeroes it. */
|
|
94
|
+
readonly energy: number;
|
|
95
|
+
/** Where the player ended up: GRAVITY, NEXUS and FORCE all move them. */
|
|
96
|
+
readonly grid: readonly [number, number];
|
|
97
|
+
/** The depth teleport_player_level asked for, or null if it did not. */
|
|
98
|
+
readonly levelChangeTo: number | null;
|
|
99
|
+
/** How many times the post-move seam fired (teleports and FORCE's thrust). */
|
|
100
|
+
readonly postMoves: number;
|
|
101
|
+
/** How many stacks remain in the pack, and how many items in total. */
|
|
102
|
+
readonly packStacks: number;
|
|
103
|
+
readonly packItems: number;
|
|
104
|
+
/**
|
|
105
|
+
* The summed to_h + to_d + to_a over EVERY carried and worn object.
|
|
106
|
+
*
|
|
107
|
+
* One number rather than one slot, because the three ways project_p writes
|
|
108
|
+
* enchantment land in different places: disenchant_equipment picks a random
|
|
109
|
+
* worn slot, minus_ac picks a random ARMOUR slot, and inven_damage's damage
|
|
110
|
+
* arm decrements a PACK weapon or suit. Reading slot 0 saw only the first of
|
|
111
|
+
* those, and reported 8 in all 2,304 rows of the first recording.
|
|
112
|
+
*/
|
|
113
|
+
readonly gearEnchant: number;
|
|
114
|
+
/** Object flags the player has LEARNED: every arm here teaches runes. */
|
|
115
|
+
readonly learnedFlags: number;
|
|
116
|
+
/** ONE draw taken after the scenario: catches a changed DRAW COUNT. */
|
|
117
|
+
readonly rngProbe: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The projections worth recording: every arm of the switch, plus three that
|
|
121
|
+
* fall to the empty default. The default group is sampled rather than
|
|
122
|
+
* enumerated because the vectors would then be measuring `PROJ`'s size rather
|
|
123
|
+
* than project_p's behaviour - its membership is asserted separately by the
|
|
124
|
+
* coverage guard in the test.
|
|
125
|
+
*/
|
|
126
|
+
export declare const VECTOR_PROJECTIONS: readonly (readonly [string, number])[];
|
|
127
|
+
/**
|
|
128
|
+
* Damage values. The `randint0(dam) > 500` gates in FIRE, COLD and DARK cannot
|
|
129
|
+
* fire below 501 at all, so a grid that only ran small hits would record the
|
|
130
|
+
* powerful-attack arms as dead code. 5000 clears every threshold in the file.
|
|
131
|
+
*/
|
|
132
|
+
export declare const VECTOR_DAMAGE: readonly number[];
|
|
133
|
+
/**
|
|
134
|
+
* Monster spell power. The bonus arms gate on >= 60 (POIS), >= 70 (DARK) and
|
|
135
|
+
* >= 80 (FIRE, COLD, NETHER); 0 is below all of them and 80 is above all.
|
|
136
|
+
*/
|
|
137
|
+
export declare const VECTOR_POWER: readonly number[];
|
|
138
|
+
/**
|
|
139
|
+
* res_level the projection actor reports for EVERY element. 3 is immunity,
|
|
140
|
+
* which is what ACID / ELEC / FIRE / COLD / ICE check before touching the pack;
|
|
141
|
+
* 1 is the plain resist that makes nine handlers bail with "You resist the
|
|
142
|
+
* effect!" - and those early breaks are exactly what a mis-keyed registry would
|
|
143
|
+
* skip.
|
|
144
|
+
*/
|
|
145
|
+
export declare const VECTOR_RESISTS: readonly (readonly [string, number])[];
|
|
146
|
+
/**
|
|
147
|
+
* The seeds the grid runs.
|
|
148
|
+
*
|
|
149
|
+
* SIX, NOT TWO, and the reason is worth keeping. Seven handlers ignore `power`
|
|
150
|
+
* and NEXUS ignores `dam` as well, so for those the whole rest of the grid
|
|
151
|
+
* collapses onto ONE rng stream per seed - two seeds gave NEXUS four distinct
|
|
152
|
+
* paths and its 1-in-4 teleport-level arm came up empty in all 96 of its rows.
|
|
153
|
+
* A dimension that does not vary the handler's input does not sample it.
|
|
154
|
+
*/
|
|
155
|
+
export declare const VECTOR_SEEDS: readonly number[];
|
|
156
|
+
/**
|
|
157
|
+
* Run one scenario and record it.
|
|
158
|
+
*
|
|
159
|
+
* Built fresh from a seeded state each time, so a vector is a function of its
|
|
160
|
+
* own inputs alone - no ordering between rows, which is what lets one `it()`
|
|
161
|
+
* per row report a divergence by name.
|
|
162
|
+
*/
|
|
163
|
+
export declare function recordPlayerSide(fx: PlayerSideFixtures, projName: string, proj: number, dam: number, power: number, resistName: string, resistLevel: number, warded: boolean, originName: string, seed: number): PlayerSideVector;
|
|
164
|
+
/** Every scenario in the grid, in a fixed order. */
|
|
165
|
+
export declare function recordAllPlayerSide(fx: PlayerSideFixtures): PlayerSideVector[];
|
|
166
|
+
/** The elements whose immunity gates a pack-damage arm, for the coverage guard. */
|
|
167
|
+
export declare const PACK_DAMAGE_ELEMENTS: readonly number[];
|
|
168
|
+
/**
|
|
169
|
+
* The dungeon depth every scenario runs at. Not incidental: the harness builds
|
|
170
|
+
* at depth 0, the TOWN, and teleport_player_level cannot go up from there - so
|
|
171
|
+
* its up/down coin flip, a real RNG draw, never happened on the first pass.
|
|
172
|
+
*/
|
|
173
|
+
export declare const VECTOR_DEPTH = 5;
|
|
174
|
+
//# sourceMappingURL=player-side-vectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-side-vectors.d.ts","sourceRoot":"","sources":["../../src/game/player-side-vectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,SAAS,EAA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iCtE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,kBAAkB,EACtB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,gBAAgB,CAiIlB;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,kBAAkB,GACrB,gBAAgB,EAAE,CAuBpB;AAED,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAKjD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The real content a project_p vector is run against.
|
|
3
|
+
*
|
|
4
|
+
* SEPARATE FILE, and it reads the disk: keeping node:fs out of
|
|
5
|
+
* `player-side-vectors.ts` means that module stays importable from anywhere.
|
|
6
|
+
* ONE copy, shared by `player-side-vectors.test.ts` and by
|
|
7
|
+
* `scripts/gen-player-side-vectors.mjs`, so the test and the generator cannot
|
|
8
|
+
* disagree about what they are measuring - which is the whole point of a
|
|
9
|
+
* recording.
|
|
10
|
+
*
|
|
11
|
+
* FOUR ARMS THIS FILE EXISTS TO REACH. The first recording ran 2,304 scenarios
|
|
12
|
+
* in which the pack was never damaged, the worn armour was never disenchanted,
|
|
13
|
+
* minus_ac never bit and every teleport failed - four whole handler arms
|
|
14
|
+
* recorded as dead code, and a vector file that would have replayed forever
|
|
15
|
+
* without noticing. Each of the four is deliberate here:
|
|
16
|
+
*
|
|
17
|
+
* - PACK KINDS ARE PICKED FROM PREPPED OBJECTS. `object_prep` ORs the object
|
|
18
|
+
* BASE's el_info into the kind's (obj-make.c), which is where scrolls learn
|
|
19
|
+
* to hate fire and potions to hate cold. Filtering on `kind.el_info` alone
|
|
20
|
+
* found six ELEC kinds and three FIRE ones, and nothing at all for ACID or
|
|
21
|
+
* COLD.
|
|
22
|
+
* - THE ARMOUR GOES IN THE ARMOUR SLOTS. Both minus_ac and
|
|
23
|
+
* disenchant_equipment pick a random slot BY TYPE and then look for an item
|
|
24
|
+
* in it; a suit of armour parked in slot 0 (WEAPON) is invisible to both.
|
|
25
|
+
* - THE CHUNK IS DUNGEON-SIZED. NEXUS teleports 200 grids and
|
|
26
|
+
* chooseTeleportDestination simply fails on a 40x25 field, so every teleport
|
|
27
|
+
* row recorded "Failed to find teleport destination!".
|
|
28
|
+
* - AND IT IS BELOW THE TOWN. teleport_player_level cannot go UP from depth 0,
|
|
29
|
+
* so the up/down coin flip - a real RNG draw - never happened.
|
|
30
|
+
*/
|
|
31
|
+
import type { PlayerSideFixtures } from "./player-side-vectors.js";
|
|
32
|
+
export declare function playerSideFixtures(): PlayerSideFixtures;
|
|
33
|
+
//# sourceMappingURL=player-side-vectors.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-side-vectors.fixtures.d.ts","sourceRoot":"","sources":["../../src/game/player-side-vectors.fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAkBH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAsDnE,wBAAgB,kBAAkB,IAAI,kBAAkB,CAiHvD"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The real content a project_p vector is run against.
|
|
3
|
+
*
|
|
4
|
+
* SEPARATE FILE, and it reads the disk: keeping node:fs out of
|
|
5
|
+
* `player-side-vectors.ts` means that module stays importable from anywhere.
|
|
6
|
+
* ONE copy, shared by `player-side-vectors.test.ts` and by
|
|
7
|
+
* `scripts/gen-player-side-vectors.mjs`, so the test and the generator cannot
|
|
8
|
+
* disagree about what they are measuring - which is the whole point of a
|
|
9
|
+
* recording.
|
|
10
|
+
*
|
|
11
|
+
* FOUR ARMS THIS FILE EXISTS TO REACH. The first recording ran 2,304 scenarios
|
|
12
|
+
* in which the pack was never damaged, the worn armour was never disenchanted,
|
|
13
|
+
* minus_ac never bit and every teleport failed - four whole handler arms
|
|
14
|
+
* recorded as dead code, and a vector file that would have replayed forever
|
|
15
|
+
* without noticing. Each of the four is deliberate here:
|
|
16
|
+
*
|
|
17
|
+
* - PACK KINDS ARE PICKED FROM PREPPED OBJECTS. `object_prep` ORs the object
|
|
18
|
+
* BASE's el_info into the kind's (obj-make.c), which is where scrolls learn
|
|
19
|
+
* to hate fire and potions to hate cold. Filtering on `kind.el_info` alone
|
|
20
|
+
* found six ELEC kinds and three FIRE ones, and nothing at all for ACID or
|
|
21
|
+
* COLD.
|
|
22
|
+
* - THE ARMOUR GOES IN THE ARMOUR SLOTS. Both minus_ac and
|
|
23
|
+
* disenchant_equipment pick a random slot BY TYPE and then look for an item
|
|
24
|
+
* in it; a suit of armour parked in slot 0 (WEAPON) is invisible to both.
|
|
25
|
+
* - THE CHUNK IS DUNGEON-SIZED. NEXUS teleports 200 grids and
|
|
26
|
+
* chooseTeleportDestination simply fails on a 40x25 field, so every teleport
|
|
27
|
+
* row recorded "Failed to find teleport destination!".
|
|
28
|
+
* - AND IT IS BELOW THE TOWN. teleport_player_level cannot go UP from depth 0,
|
|
29
|
+
* so the up/down coin flip - a real RNG draw - never happened.
|
|
30
|
+
*/
|
|
31
|
+
import { readFileSync } from "node:fs";
|
|
32
|
+
import { bindConstants } from "../constants.js";
|
|
33
|
+
import { OF, TV } from "../generated/index.js";
|
|
34
|
+
import { EL_INFO_HATES, EL_INFO_IGNORE } from "../obj/types.js";
|
|
35
|
+
import { ObjRegistry } from "../obj/bind.js";
|
|
36
|
+
import { objectPrep } from "../obj/make.js";
|
|
37
|
+
import { Rng } from "../rng.js";
|
|
38
|
+
import { bindProjections } from "../world/projection.js";
|
|
39
|
+
import { addMon, makeRace, makeState, plReg } from "./harness.js";
|
|
40
|
+
import { gearAdd } from "./gear.js";
|
|
41
|
+
import { PACK_DAMAGE_ELEMENTS, VECTOR_DEPTH } from "./player-side-vectors.js";
|
|
42
|
+
function loadJson(name) {
|
|
43
|
+
return JSON.parse(readFileSync(new URL(`../../../content/pack/${name}.json`, import.meta.url), "utf8"));
|
|
44
|
+
}
|
|
45
|
+
function records(name) {
|
|
46
|
+
const raw = loadJson(name);
|
|
47
|
+
return Array.isArray(raw) ? raw : raw.records;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Every protective flag project_p reads, in one place.
|
|
51
|
+
*
|
|
52
|
+
* The five sustains are here because EF_DRAIN_STAT's sustain arm (FIRE's STR,
|
|
53
|
+
* COLD's DEX, POIS's CON) prints a different message and skips the drain, and
|
|
54
|
+
* without them that arm is unreachable in every row.
|
|
55
|
+
*/
|
|
56
|
+
const WARD_FLAGS = [
|
|
57
|
+
OF.HOLD_LIFE,
|
|
58
|
+
OF.PROT_STUN,
|
|
59
|
+
OF.PROT_CONF,
|
|
60
|
+
OF.PROT_BLIND,
|
|
61
|
+
OF.FREE_ACT,
|
|
62
|
+
OF.SUST_STR,
|
|
63
|
+
OF.SUST_INT,
|
|
64
|
+
OF.SUST_WIS,
|
|
65
|
+
OF.SUST_DEX,
|
|
66
|
+
OF.SUST_CON,
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* The dungeon the vectors run in: upstream's DUNGEON_WID x DUNGEON_HGT
|
|
70
|
+
* (cave.h). Not a round number chosen for comfort - NEXUS asks for a 200-grid
|
|
71
|
+
* teleport and the search either has that much room or reports failure.
|
|
72
|
+
*/
|
|
73
|
+
const CHUNK_W = 198;
|
|
74
|
+
const CHUNK_H = 66;
|
|
75
|
+
/** The armour slot types minus_ac and disenchant_equipment can pick. */
|
|
76
|
+
const ARMOUR_SLOTS = [
|
|
77
|
+
"BODY_ARMOR",
|
|
78
|
+
"CLOAK",
|
|
79
|
+
"SHIELD",
|
|
80
|
+
"HAT",
|
|
81
|
+
"GLOVES",
|
|
82
|
+
"BOOTS",
|
|
83
|
+
];
|
|
84
|
+
export function playerSideFixtures() {
|
|
85
|
+
const objPack = {
|
|
86
|
+
objectBase: loadJson("object_base"),
|
|
87
|
+
object: loadJson("object"),
|
|
88
|
+
egoItem: loadJson("ego_item"),
|
|
89
|
+
artifact: loadJson("artifact"),
|
|
90
|
+
curse: loadJson("curse"),
|
|
91
|
+
brand: loadJson("brand"),
|
|
92
|
+
slay: loadJson("slay"),
|
|
93
|
+
activation: loadJson("activation"),
|
|
94
|
+
objectProperty: loadJson("object_property"),
|
|
95
|
+
flavor: loadJson("flavor"),
|
|
96
|
+
};
|
|
97
|
+
const reg = new ObjRegistry(objPack);
|
|
98
|
+
const constants = bindConstants(loadJson("constants"));
|
|
99
|
+
const projections = bindProjections(records("projection"));
|
|
100
|
+
const prep = (rng, kind) => objectPrep(rng, reg, constants, kind, 20, "average");
|
|
101
|
+
/**
|
|
102
|
+
* One destroyable kind per element inven_damage is called with, selected by
|
|
103
|
+
* running the real object_prep and reading the resulting el_info.
|
|
104
|
+
*
|
|
105
|
+
* DERIVED, NOT NAMED. A fixed sval would be an assertion about the content
|
|
106
|
+
* pack, and an unchecked one; picked this way, a content change that stopped
|
|
107
|
+
* making scrolls flammable moves the fixture instead of silently emptying it.
|
|
108
|
+
* The selection runs on its own throwaway Rng so it cannot perturb a
|
|
109
|
+
* scenario's stream.
|
|
110
|
+
*/
|
|
111
|
+
const scratch = new Rng(999);
|
|
112
|
+
const destroyedBy = new Map();
|
|
113
|
+
for (const kind of reg.kinds) {
|
|
114
|
+
/* Weapons and armour take inven_damage's DAMAGE arm (to_h/to_d/to_a--)
|
|
115
|
+
* rather than the destruction arm; both are wanted, but separately. */
|
|
116
|
+
if (kind.tval === TV.SOFT_ARMOR || kind.tval === TV.SWORD)
|
|
117
|
+
continue;
|
|
118
|
+
const obj = prep(scratch, kind);
|
|
119
|
+
for (const elem of PACK_DAMAGE_ELEMENTS) {
|
|
120
|
+
if (destroyedBy.has(elem))
|
|
121
|
+
continue;
|
|
122
|
+
const info = obj.elInfo[elem];
|
|
123
|
+
if (info &&
|
|
124
|
+
info.flags & EL_INFO_HATES &&
|
|
125
|
+
!(info.flags & EL_INFO_IGNORE)) {
|
|
126
|
+
destroyedBy.set(elem, kind);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const armourKind = reg.kinds.find((k) => k.tval === TV.SOFT_ARMOR);
|
|
131
|
+
const weaponKind = reg.kinds.find((k) => k.tval === TV.SWORD);
|
|
132
|
+
if (!armourKind || !weaponKind) {
|
|
133
|
+
throw new Error("the content pack has no soft armour or no sword");
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
makeState: (seed) => {
|
|
137
|
+
const state = makeState({ seed, w: CHUNK_W, h: CHUNK_H });
|
|
138
|
+
/* Below the town, so teleport_player_level has an UP to choose and the
|
|
139
|
+
* up/down coin flip is a real draw. */
|
|
140
|
+
state.chunk.depth = VECTOR_DEPTH;
|
|
141
|
+
return state;
|
|
142
|
+
},
|
|
143
|
+
timed: plReg.timed,
|
|
144
|
+
projections,
|
|
145
|
+
destroyedByElement: destroyedBy,
|
|
146
|
+
fillPack: (state) => {
|
|
147
|
+
for (const elem of PACK_DAMAGE_ELEMENTS) {
|
|
148
|
+
const kind = destroyedBy.get(elem);
|
|
149
|
+
if (!kind)
|
|
150
|
+
continue;
|
|
151
|
+
const obj = prep(state.rng, kind);
|
|
152
|
+
/* A BIG stack. inven_damage rolls randint0(10000) < cperc PER ITEM, and
|
|
153
|
+
* cperc peaks at 300 - so a stack of five destroyed nothing in 2,304
|
|
154
|
+
* scenarios and the whole destruction arm recorded as dead code. Twenty
|
|
155
|
+
* makes it near-certain in the high-damage rows, and its "All of your" /
|
|
156
|
+
* "Some of your" / "One of your" prefixes all reachable. */
|
|
157
|
+
obj.number = 20;
|
|
158
|
+
state.gear.pack.push(gearAdd(state.gear, obj));
|
|
159
|
+
}
|
|
160
|
+
/* A weapon and a spare suit of armour take inven_damage's DAMAGE arm
|
|
161
|
+
* instead: a different branch, a different message, a different number of
|
|
162
|
+
* draws. */
|
|
163
|
+
state.gear.pack.push(gearAdd(state.gear, prep(state.rng, weaponKind)));
|
|
164
|
+
state.gear.pack.push(gearAdd(state.gear, prep(state.rng, armourKind)));
|
|
165
|
+
},
|
|
166
|
+
equipArmour: (state, warded) => {
|
|
167
|
+
const p = state.actor.player;
|
|
168
|
+
for (let slot = 0; slot < p.body.count; slot++) {
|
|
169
|
+
const type = p.body.slots[slot]?.type;
|
|
170
|
+
if (type !== "WEAPON" && !ARMOUR_SLOTS.includes(type ?? ""))
|
|
171
|
+
continue;
|
|
172
|
+
const obj = prep(state.rng, type === "WEAPON" ? weaponKind : armourKind);
|
|
173
|
+
/* Real enchantment, so disenchant_equipment and minus_ac both have
|
|
174
|
+
* something to remove; at to_a 0 minus_ac declines outright and DISEN
|
|
175
|
+
* records nothing but a message. */
|
|
176
|
+
obj.toA = 8;
|
|
177
|
+
obj.toH = 5;
|
|
178
|
+
obj.toD = 5;
|
|
179
|
+
if (warded)
|
|
180
|
+
for (const f of WARD_FLAGS)
|
|
181
|
+
obj.flags.on(f);
|
|
182
|
+
p.equipment[slot] = gearAdd(state.gear, obj);
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
addMonster: (state, grid) => {
|
|
186
|
+
const mon = addMon(state, makeRace(), grid);
|
|
187
|
+
return state.monsters.indexOf(mon);
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=player-side-vectors.fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-side-vectors.fixtures.js","sourceRoot":"","sources":["../../src/game/player-side-vectors.fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,YAAY,EAAE,M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