@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
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* terrain to the sun, guarded on cave->depth == 0. That guard never fires yet
|
|
14
14
|
* (the port has no surface/town), so the branch is dormant but faithful.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* NOTES (ledgered in parity/ledger/game-project-feat.yaml):
|
|
17
17
|
* - square_forget / square_unmark and the PU_UPDATE_VIEW | PU_MONSTERS
|
|
18
18
|
* redraw requests: the core keeps no player square-memory yet (the web
|
|
19
19
|
* renderer holds its own explored set); FOV refresh rides the state
|
|
@@ -25,16 +25,78 @@ import { squareIsSeen, squareIsView } from "../world/view.js";
|
|
|
25
25
|
import { featIsBright, featIsTreasure } from "../world/chunk.js";
|
|
26
26
|
import { lookupTrap } from "../world/trap.js";
|
|
27
27
|
import { isDaytime } from "./world.js";
|
|
28
|
-
import {
|
|
28
|
+
import { squareIsEmptyLive } from "./mon-place.js";
|
|
29
|
+
import { deleteMonster, monsterSwap, squareIsPlayer, squareMonster } from "./context.js";
|
|
29
30
|
import { dropNear, floorExcise, floorPile, floorCarry } from "./floor.js";
|
|
31
|
+
import { scatterExt } from "../world/scatter.js";
|
|
30
32
|
import { squareIsSecretDoor } from "./cave-cmd.js";
|
|
31
33
|
import { placeTrap, squareDoorPower, squareIsDisarmableTrap, squareIsTrap, squareRemoveAllTraps, squareRevealTrap, squareSetDoorLock, squareIsPlayerTrap, squareSetTrapTimeout, } from "./trap.js";
|
|
32
34
|
import { makeObject, makeGold } from "../obj/make.js";
|
|
35
|
+
import { projectionCodeFor } from "../world/projection.js";
|
|
33
36
|
/** Is the grid in view and the player able to see (not blind)? */
|
|
34
37
|
function observed(state, grid) {
|
|
35
38
|
return (squareIsView(state.chunk, grid) &&
|
|
36
39
|
(state.actor.player.timed[TMD.BLIND] ?? 0) === 0);
|
|
37
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* push_object's unrevealed-mimic arm (obj-pile.c:1213-1256).
|
|
43
|
+
*
|
|
44
|
+
* An object with a mimicking monster behind it may not simply be dropped: the
|
|
45
|
+
* monster IS the object as far as the player can tell, so upstream keeps the
|
|
46
|
+
* pair together. It scatters outward from d=1 looking for an empty grid that
|
|
47
|
+
* will take the object, then MOVES THE MONSTER onto it with monster_swap and
|
|
48
|
+
* re-links the two. At d >= 4 it gives up and destroys both rather than let
|
|
49
|
+
* them part.
|
|
50
|
+
*
|
|
51
|
+
* The C resets mimicked_obj to NULL up front because its queued object is a
|
|
52
|
+
* COPY and the pointer it holds has just been freed. The port has no copy -
|
|
53
|
+
* the same GameObject is excised and re-placed - so nothing dangles here. The
|
|
54
|
+
* clear is kept anyway, because monster_swap reads the link three times and
|
|
55
|
+
* one of those readings is observable:
|
|
56
|
+
*
|
|
57
|
+
* - become_aware and move_mimicked_object both resolve the object through the
|
|
58
|
+
* monster's OLD grid, which push_object has already emptied, so neither can
|
|
59
|
+
* tell whether the link is up. (In the C they read the pointer directly and
|
|
60
|
+
* still cannot: it is NULL there for the same stretch.)
|
|
61
|
+
* - update_mon can. A monster still mimicking a non-ignored item KEEPS
|
|
62
|
+
* MFLAG_VISIBLE when it drops out of sight (mon-util.c L429-433), because
|
|
63
|
+
* what the player is looking at is the item. Leave the link up and the mimic
|
|
64
|
+
* stays marked visible in transit, where upstream clears the mark.
|
|
65
|
+
*
|
|
66
|
+
* game/push-object.test.ts pins that third case; without the clear it fails.
|
|
67
|
+
*/
|
|
68
|
+
function pushMimic(state, grid, obj) {
|
|
69
|
+
const midx = obj.mimickingMIdx;
|
|
70
|
+
const mimic = state.monsters[midx];
|
|
71
|
+
/* Upstream asserts the monster exists. A live game cannot reach this with a
|
|
72
|
+
* dangling index, but a mod or a hand-built save could; dropping the stale
|
|
73
|
+
* link and treating it as an ordinary object beats aborting the turn. */
|
|
74
|
+
if (!mimic) {
|
|
75
|
+
obj.mimickingMIdx = 0;
|
|
76
|
+
dropNear(state, obj, 0, grid, false, false);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
mimic.mimickedObj = 0;
|
|
80
|
+
for (let d = 1;; d++) {
|
|
81
|
+
if (d >= 4) {
|
|
82
|
+
/* Give up: destroy both the mimic and the object. The object is already
|
|
83
|
+
* excised, so letting the reference go IS object_delete - and the
|
|
84
|
+
* player's memory of it, which upstream deletes alongside, is dropped by
|
|
85
|
+
* forget_remembered_objects the next time this grid is known (its
|
|
86
|
+
* original is no longer held here). */
|
|
87
|
+
deleteMonster(state, midx);
|
|
88
|
+
obj.mimickingMIdx = 0;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const [newgrid] = scatterExt(state.chunk, state.rng, 1, grid, d, true, (_c, g) => squareIsEmptyLive(state, g));
|
|
92
|
+
if (newgrid && floorCarry(state, newgrid, obj)) {
|
|
93
|
+
/* Move the monster and give it the object back. */
|
|
94
|
+
monsterSwap(state, grid, newgrid);
|
|
95
|
+
mimic.mimickedObj = 1;
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
38
100
|
/**
|
|
39
101
|
* push_object (obj-pile.c): move the pile off a grid that stopped holding
|
|
40
102
|
* objects. As upstream, the grid temporarily becomes an open door so
|
|
@@ -53,7 +115,11 @@ export function pushObject(state, grid) {
|
|
|
53
115
|
* excising every member removes the entry - there is no head pointer to null. */
|
|
54
116
|
for (const obj of [...floorPile(state, grid)]) {
|
|
55
117
|
floorExcise(state, grid, obj);
|
|
56
|
-
|
|
118
|
+
/* "Unrevealed mimics require special handling, as always" (:1211). */
|
|
119
|
+
if (obj.mimickingMIdx)
|
|
120
|
+
pushMimic(state, grid, obj);
|
|
121
|
+
else
|
|
122
|
+
dropNear(state, obj, 0, grid, false, false);
|
|
57
123
|
}
|
|
58
124
|
c.setFeat(grid, featOld);
|
|
59
125
|
}
|
|
@@ -84,267 +150,328 @@ function disableTraps(state, grid) {
|
|
|
84
150
|
return;
|
|
85
151
|
squareSetTrapTimeout(state, grid, -1, 10);
|
|
86
152
|
}
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
|
|
91
|
-
|
|
153
|
+
/* ------------------------------------------------------------------ *
|
|
154
|
+
* The handlers. One function per project_f switch arm (project-feat.c),
|
|
155
|
+
* bodies unchanged from the switch they came out of - including the ORDER of
|
|
156
|
+
* every rng draw, which the 6,552 committed vectors in
|
|
157
|
+
* project-feat-vectors.json replay.
|
|
158
|
+
* ------------------------------------------------------------------ */
|
|
159
|
+
/** LIGHT / LIGHT_WEAK: turn the grid's glow on. */
|
|
160
|
+
const light = ({ state, grid }) => {
|
|
92
161
|
const c = state.chunk;
|
|
93
162
|
let obvious = false;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
163
|
+
c.sqinfoOn(grid, SQUARE.GLOW);
|
|
164
|
+
if (squareIsView(c, grid)) {
|
|
165
|
+
if ((state.actor.player.timed[TMD.BLIND] ?? 0) === 0)
|
|
166
|
+
obvious = true;
|
|
167
|
+
state.updateFov?.(state);
|
|
168
|
+
}
|
|
169
|
+
return obvious;
|
|
170
|
+
};
|
|
171
|
+
/** DARK / DARK_WEAK: turn it off, but not lava and not a daylit surface. */
|
|
172
|
+
const dark = ({ state, grid }) => {
|
|
173
|
+
const c = state.chunk;
|
|
174
|
+
let obvious = false;
|
|
175
|
+
/* project-feat.c L73: (depth != 0 || !is_daytime()) && !square_isbright. PR2. */
|
|
176
|
+
const daylit = c.depth === 0 && isDaytime(state.turn, state.z.dayLength);
|
|
177
|
+
if (!daylit && !featIsBright(c.features, c.feat(grid))) {
|
|
178
|
+
c.sqinfoOff(grid, SQUARE.GLOW);
|
|
179
|
+
}
|
|
180
|
+
if (squareIsView(c, grid)) {
|
|
181
|
+
obvious = true;
|
|
182
|
+
state.updateFov?.(state);
|
|
183
|
+
}
|
|
184
|
+
return obvious;
|
|
185
|
+
};
|
|
186
|
+
/** KILL_WALL: stone to mud, with rubble finds and gold-vein payouts. */
|
|
187
|
+
const killWall = ({ state, grid, env }) => {
|
|
188
|
+
const c = state.chunk;
|
|
189
|
+
let obvious = false;
|
|
190
|
+
/* Non-walls (etc). */
|
|
191
|
+
if (c.isPassable(grid) && !c.isRubble(grid))
|
|
192
|
+
return false;
|
|
193
|
+
/* Permanent walls. */
|
|
194
|
+
if (c.isPerm(grid))
|
|
195
|
+
return false;
|
|
196
|
+
const seen = squareIsSeen(c, grid);
|
|
197
|
+
if (c.isRubble(grid)) {
|
|
198
|
+
if (seen) {
|
|
199
|
+
env.msg?.("The rubble turns into mud!");
|
|
200
|
+
obvious = true;
|
|
120
201
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (seen) {
|
|
131
|
-
env.msg?.("The rubble turns into mud!");
|
|
132
|
-
obvious = true;
|
|
133
|
-
}
|
|
134
|
-
/* square_destroy_rubble (cave-square.c:1502): set_feat(FEAT_FLOOR). */
|
|
135
|
-
c.setFeat(grid, FEAT.FLOOR);
|
|
136
|
-
/* Hidden find: 10% chance of a buried object. */
|
|
137
|
-
if (state.rng.randint0(100) < 10 && env.makeDeps) {
|
|
138
|
-
const found = makeObject(state.rng, env.makeDeps, c.depth, false, false, false, 0, c.depth);
|
|
139
|
-
if (found) {
|
|
140
|
-
found.origin = ORIGIN.RUBBLE;
|
|
141
|
-
found.originDepth = c.depth;
|
|
142
|
-
floorCarry(state, grid, found);
|
|
143
|
-
if (seen) {
|
|
144
|
-
env.msg?.("There was something buried in the rubble!");
|
|
145
|
-
obvious = true;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
else if (c.isDoor(grid)) {
|
|
151
|
-
if (seen) {
|
|
152
|
-
env.msg?.("The door turns into mud!");
|
|
153
|
-
obvious = true;
|
|
154
|
-
}
|
|
155
|
-
c.setFeat(grid, FEAT.FLOOR);
|
|
156
|
-
}
|
|
157
|
-
else if (featIsTreasure(c.features, c.feat(grid))) {
|
|
158
|
-
if (seen) {
|
|
159
|
-
env.msg?.("The vein turns into mud!");
|
|
160
|
-
env.msg?.("You have found something!");
|
|
161
|
-
obvious = true;
|
|
162
|
-
}
|
|
163
|
-
c.setFeat(grid, FEAT.FLOOR);
|
|
164
|
-
/* Place some gold. */
|
|
165
|
-
if (env.makeDeps) {
|
|
166
|
-
const money = makeGold(state.rng, env.makeDeps, c.depth, "any");
|
|
167
|
-
money.origin = ORIGIN.FLOOR;
|
|
168
|
-
money.originDepth = c.depth;
|
|
169
|
-
floorCarry(state, grid, money);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
else if (c.isMagma(grid) || c.isQuartz(grid)) {
|
|
173
|
-
if (seen) {
|
|
174
|
-
env.msg?.("The vein turns into mud!");
|
|
175
|
-
obvious = true;
|
|
176
|
-
}
|
|
177
|
-
c.setFeat(grid, FEAT.FLOOR);
|
|
178
|
-
}
|
|
179
|
-
else if (c.isGranite(grid)) {
|
|
202
|
+
/* square_destroy_rubble (cave-square.c:1502): set_feat(FEAT_FLOOR). */
|
|
203
|
+
c.setFeat(grid, FEAT.FLOOR);
|
|
204
|
+
/* Hidden find: 10% chance of a buried object. */
|
|
205
|
+
if (state.rng.randint0(100) < 10 && env.makeDeps) {
|
|
206
|
+
const found = makeObject(state.rng, env.makeDeps, c.depth, false, false, false, 0, c.depth);
|
|
207
|
+
if (found) {
|
|
208
|
+
found.origin = ORIGIN.RUBBLE;
|
|
209
|
+
found.originDepth = c.depth;
|
|
210
|
+
floorCarry(state, grid, found);
|
|
180
211
|
if (seen) {
|
|
181
|
-
env.msg?.("
|
|
212
|
+
env.msg?.("There was something buried in the rubble!");
|
|
182
213
|
obvious = true;
|
|
183
214
|
}
|
|
184
|
-
c.setFeat(grid, FEAT.FLOOR);
|
|
185
215
|
}
|
|
186
|
-
/* On the surface, new terrain may be exposed to the sun. */
|
|
187
|
-
if (c.depth === 0)
|
|
188
|
-
exposeToSun(state, grid, isDaytime(state.turn, state.z.dayLength));
|
|
189
|
-
state.updateFov?.(state);
|
|
190
|
-
break;
|
|
191
216
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
/* square_destroy_door (cave-square.c:1382): drop the "door lock" trap
|
|
199
|
-
* and set FEAT_FLOOR. The lock removal rides the setFeat hook here
|
|
200
|
-
* (FEAT_FLOOR cannot hold a lock), so only the set_feat is explicit. */
|
|
201
|
-
c.setFeat(grid, FEAT.FLOOR);
|
|
202
|
-
/* On the surface, new terrain may be exposed to the sun. */
|
|
203
|
-
if (c.depth === 0)
|
|
204
|
-
exposeToSun(state, grid, isDaytime(state.turn, state.z.dayLength));
|
|
205
|
-
state.updateFov?.(state);
|
|
206
|
-
}
|
|
207
|
-
break;
|
|
217
|
+
}
|
|
218
|
+
else if (c.isDoor(grid)) {
|
|
219
|
+
if (seen) {
|
|
220
|
+
env.msg?.("The door turns into mud!");
|
|
221
|
+
obvious = true;
|
|
208
222
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
/* Disable traps, unlock doors. Gate on square_isdisarmabletrap
|
|
217
|
-
* (project-feat.c L230): enabled + visible + player trap, so an
|
|
218
|
-
* already-disabled or non-player visible trap falls through to the
|
|
219
|
-
* door-lock branch instead of "seizing up" again. PR1. */
|
|
220
|
-
if (squareIsDisarmableTrap(state, grid)) {
|
|
221
|
-
if (squareIsSeen(c, grid)) {
|
|
222
|
-
env.msg?.("The trap seizes up.");
|
|
223
|
-
obvious = true;
|
|
224
|
-
}
|
|
225
|
-
disableTraps(state, grid);
|
|
226
|
-
}
|
|
227
|
-
else if (env.trapDeps && squareDoorPower(state, grid, env.trapDeps) > 0) {
|
|
228
|
-
/* square_unlock_door (cave-square.c:1377-1380) = square_set_door_lock(c,
|
|
229
|
-
* grid, 0), and square_set_door_lock (trap.c:706-726) KEEPS the "door
|
|
230
|
-
* lock" trap and sets its power to 0 - it does not delete it. The trap
|
|
231
|
-
* object must survive: square_istrap / square_isplayertrap and the
|
|
232
|
-
* savefile's trap block both see it upstream. */
|
|
233
|
-
squareSetDoorLock(state, grid, 0, env.trapDeps);
|
|
234
|
-
if (squareIsView(c, grid)) {
|
|
235
|
-
env.msg?.("Click!");
|
|
236
|
-
obvious = true;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
break;
|
|
223
|
+
c.setFeat(grid, FEAT.FLOOR);
|
|
224
|
+
}
|
|
225
|
+
else if (featIsTreasure(c.features, c.feat(grid))) {
|
|
226
|
+
if (seen) {
|
|
227
|
+
env.msg?.("The vein turns into mud!");
|
|
228
|
+
env.msg?.("You have found something!");
|
|
229
|
+
obvious = true;
|
|
240
230
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
* square_add_door(c, grid, true) (cave-square.c:1347). */
|
|
249
|
-
pushObject(state, grid);
|
|
250
|
-
c.setFeat(grid, FEAT.CLOSED);
|
|
251
|
-
if (squareIsSeen(c, grid))
|
|
252
|
-
obvious = true;
|
|
253
|
-
state.updateFov?.(state);
|
|
254
|
-
break;
|
|
231
|
+
c.setFeat(grid, FEAT.FLOOR);
|
|
232
|
+
/* Place some gold. */
|
|
233
|
+
if (env.makeDeps) {
|
|
234
|
+
const money = makeGold(state.rng, env.makeDeps, c.depth, "any");
|
|
235
|
+
money.origin = ORIGIN.FLOOR;
|
|
236
|
+
money.originDepth = c.depth;
|
|
237
|
+
floorCarry(state, grid, money);
|
|
255
238
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
if (squareIsTrap(state, grid))
|
|
261
|
-
break;
|
|
262
|
-
if (state.rng.oneIn(4) && env.trapDeps) {
|
|
263
|
-
/* square_add_trap (cave-square.c:1304) = place_trap(c, grid, -1, depth). */
|
|
264
|
-
placeTrap(state, grid, -1, c.depth, env.trapDeps);
|
|
265
|
-
squareRevealTrap(state, grid, false, env.trapDeps);
|
|
266
|
-
}
|
|
239
|
+
}
|
|
240
|
+
else if (c.isMagma(grid) || c.isQuartz(grid)) {
|
|
241
|
+
if (seen) {
|
|
242
|
+
env.msg?.("The vein turns into mud!");
|
|
267
243
|
obvious = true;
|
|
268
|
-
break;
|
|
269
244
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
const web = lookupTrap(env.trapDeps.kinds, "web");
|
|
277
|
-
if (web)
|
|
278
|
-
squareRemoveAllTraps(state, grid, web.tidx);
|
|
279
|
-
}
|
|
280
|
-
/* Can create lava if extremely powerful. */
|
|
281
|
-
if (dam > state.rng.randint1(1800) + 600 && c.isFloor(grid)) {
|
|
282
|
-
c.setFeat(grid, FEAT.LAVA);
|
|
283
|
-
if (c.depth === 0)
|
|
284
|
-
exposeToSun(state, grid, isDaytime(state.turn, state.z.dayLength));
|
|
285
|
-
pushObject(state, grid);
|
|
286
|
-
}
|
|
287
|
-
break;
|
|
245
|
+
c.setFeat(grid, FEAT.FLOOR);
|
|
246
|
+
}
|
|
247
|
+
else if (c.isGranite(grid)) {
|
|
248
|
+
if (seen) {
|
|
249
|
+
env.msg?.("The wall turns into mud!");
|
|
250
|
+
obvious = true;
|
|
288
251
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
c.setFeat(grid, FEAT.PASS_RUBBLE);
|
|
306
|
-
}
|
|
307
|
-
if (c.depth === 0)
|
|
308
|
-
exposeToSun(state, grid, isDaytime(state.turn, state.z.dayLength));
|
|
309
|
-
}
|
|
310
|
-
break;
|
|
252
|
+
c.setFeat(grid, FEAT.FLOOR);
|
|
253
|
+
}
|
|
254
|
+
/* On the surface, new terrain may be exposed to the sun. */
|
|
255
|
+
if (c.depth === 0)
|
|
256
|
+
exposeToSun(state, grid, isDaytime(state.turn, state.z.dayLength));
|
|
257
|
+
state.updateFov?.(state);
|
|
258
|
+
return obvious;
|
|
259
|
+
};
|
|
260
|
+
/** KILL_DOOR: destroy a door. */
|
|
261
|
+
const killDoor = ({ state, grid, env }) => {
|
|
262
|
+
const c = state.chunk;
|
|
263
|
+
let obvious = false;
|
|
264
|
+
if (c.isDoor(grid)) {
|
|
265
|
+
if (squareIsView(c, grid)) {
|
|
266
|
+
env.msg?.("There is a bright flash of light!");
|
|
267
|
+
obvious = true;
|
|
311
268
|
}
|
|
312
|
-
/*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
* chance to observe. */
|
|
342
|
-
default: {
|
|
343
|
-
if (observed(state, grid))
|
|
344
|
-
obvious = true;
|
|
345
|
-
break;
|
|
269
|
+
/* square_destroy_door (cave-square.c:1382): drop the "door lock" trap and
|
|
270
|
+
* set FEAT_FLOOR. The lock removal rides the setFeat hook here (FEAT_FLOOR
|
|
271
|
+
* cannot hold a lock), so only the set_feat is explicit. */
|
|
272
|
+
c.setFeat(grid, FEAT.FLOOR);
|
|
273
|
+
/* On the surface, new terrain may be exposed to the sun. */
|
|
274
|
+
if (c.depth === 0)
|
|
275
|
+
exposeToSun(state, grid, isDaytime(state.turn, state.z.dayLength));
|
|
276
|
+
state.updateFov?.(state);
|
|
277
|
+
}
|
|
278
|
+
return obvious;
|
|
279
|
+
};
|
|
280
|
+
/** KILL_TRAP: reveal secret doors, disable traps, unlock doors. */
|
|
281
|
+
const killTrap = ({ state, grid, env }) => {
|
|
282
|
+
const c = state.chunk;
|
|
283
|
+
let obvious = false;
|
|
284
|
+
/* Reveal secret doors. */
|
|
285
|
+
if (squareIsSecretDoor(state, grid)) {
|
|
286
|
+
c.setFeat(grid, FEAT.CLOSED);
|
|
287
|
+
if (squareIsSeen(c, grid))
|
|
288
|
+
obvious = true;
|
|
289
|
+
}
|
|
290
|
+
/* Disable traps, unlock doors. Gate on square_isdisarmabletrap
|
|
291
|
+
* (project-feat.c L230): enabled + visible + player trap, so an
|
|
292
|
+
* already-disabled or non-player visible trap falls through to the door-lock
|
|
293
|
+
* branch instead of "seizing up" again. PR1. */
|
|
294
|
+
if (squareIsDisarmableTrap(state, grid)) {
|
|
295
|
+
if (squareIsSeen(c, grid)) {
|
|
296
|
+
env.msg?.("The trap seizes up.");
|
|
297
|
+
obvious = true;
|
|
346
298
|
}
|
|
299
|
+
disableTraps(state, grid);
|
|
300
|
+
}
|
|
301
|
+
else if (env.trapDeps && squareDoorPower(state, grid, env.trapDeps) > 0) {
|
|
302
|
+
/* square_unlock_door (cave-square.c:1377-1380) = square_set_door_lock(c,
|
|
303
|
+
* grid, 0), and square_set_door_lock (trap.c:706-726) KEEPS the "door lock"
|
|
304
|
+
* trap and sets its power to 0 - it does not delete it. The trap object must
|
|
305
|
+
* survive: square_istrap / square_isplayertrap and the savefile's trap block
|
|
306
|
+
* both see it upstream. */
|
|
307
|
+
squareSetDoorLock(state, grid, 0, env.trapDeps);
|
|
308
|
+
if (squareIsView(c, grid)) {
|
|
309
|
+
env.msg?.("Click!");
|
|
310
|
+
obvious = true;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return obvious;
|
|
314
|
+
};
|
|
315
|
+
/** MAKE_DOOR: a closed door on an unoccupied floor grid. */
|
|
316
|
+
const makeDoor = ({ state, grid }) => {
|
|
317
|
+
const c = state.chunk;
|
|
318
|
+
/* Require a floor grid without monsters or the player. */
|
|
319
|
+
if (squareMonster(state, grid) || squareIsPlayer(state, grid))
|
|
320
|
+
return false;
|
|
321
|
+
if (!c.isFloor(grid))
|
|
322
|
+
return false;
|
|
323
|
+
/* Push objects off the grid, then create a closed door:
|
|
324
|
+
* square_add_door(c, grid, true) (cave-square.c:1347). */
|
|
325
|
+
pushObject(state, grid);
|
|
326
|
+
c.setFeat(grid, FEAT.CLOSED);
|
|
327
|
+
const obvious = squareIsSeen(c, grid);
|
|
328
|
+
state.updateFov?.(state);
|
|
329
|
+
return obvious;
|
|
330
|
+
};
|
|
331
|
+
/** MAKE_TRAP: one in four on an empty, trapless floor grid. */
|
|
332
|
+
const makeTrap = ({ state, grid, env }) => {
|
|
333
|
+
const c = state.chunk;
|
|
334
|
+
/* Require an empty floor grid with no existing traps. */
|
|
335
|
+
if (!squareIsEmptyLive(state, grid))
|
|
336
|
+
return false;
|
|
337
|
+
if (squareIsTrap(state, grid))
|
|
338
|
+
return false;
|
|
339
|
+
if (state.rng.oneIn(4) && env.trapDeps) {
|
|
340
|
+
/* square_add_trap (cave-square.c:1304) = place_trap(c, grid, -1, depth). */
|
|
341
|
+
placeTrap(state, grid, -1, c.depth, env.trapDeps);
|
|
342
|
+
squareRevealTrap(state, grid, false, env.trapDeps);
|
|
343
|
+
}
|
|
344
|
+
return true;
|
|
345
|
+
};
|
|
346
|
+
/** FIRE / PLASMA: fire clears webs, and either can make lava if huge. */
|
|
347
|
+
const fire = ({ state, grid, dam, typ, env }) => {
|
|
348
|
+
const c = state.chunk;
|
|
349
|
+
const obvious = observed(state, grid);
|
|
350
|
+
/* Fire removes webs. */
|
|
351
|
+
if (typ === PROJ.FIRE && env.trapDeps) {
|
|
352
|
+
const web = lookupTrap(env.trapDeps.kinds, "web");
|
|
353
|
+
if (web)
|
|
354
|
+
squareRemoveAllTraps(state, grid, web.tidx);
|
|
355
|
+
}
|
|
356
|
+
/* Can create lava if extremely powerful. */
|
|
357
|
+
if (dam > state.rng.randint1(1800) + 600 && c.isFloor(grid)) {
|
|
358
|
+
c.setFeat(grid, FEAT.LAVA);
|
|
359
|
+
if (c.depth === 0)
|
|
360
|
+
exposeToSun(state, grid, isDaytime(state.turn, state.z.dayLength));
|
|
361
|
+
pushObject(state, grid);
|
|
362
|
+
}
|
|
363
|
+
return obvious;
|
|
364
|
+
};
|
|
365
|
+
/** COLD / ICE: intense cold solidifies lava. */
|
|
366
|
+
const cold = ({ state, grid, dam }) => {
|
|
367
|
+
const c = state.chunk;
|
|
368
|
+
const obvious = observed(state, grid);
|
|
369
|
+
/* Sufficiently intense cold can solidify lava. */
|
|
370
|
+
if (dam > state.rng.randint1(900) + 300 && c.isFiery(grid)) {
|
|
371
|
+
/* square_isoccupied (cave-square.c:391): square->mon != 0, i.e. either a
|
|
372
|
+
* monster (positive midx) or the player (-1). */
|
|
373
|
+
const occupied = squareMonster(state, grid) !== null || squareIsPlayer(state, grid);
|
|
374
|
+
if (state.rng.oneIn(2)) {
|
|
375
|
+
c.setFeat(grid, FEAT.FLOOR);
|
|
376
|
+
}
|
|
377
|
+
else if (state.rng.oneIn(2) && !occupied) {
|
|
378
|
+
c.setFeat(grid, FEAT.RUBBLE);
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
c.setFeat(grid, FEAT.PASS_RUBBLE);
|
|
382
|
+
}
|
|
383
|
+
if (c.depth === 0)
|
|
384
|
+
exposeToSun(state, grid, isDaytime(state.turn, state.z.dayLength));
|
|
347
385
|
}
|
|
348
386
|
return obvious;
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* The monster-directed projections have EMPTY feature handlers upstream: they
|
|
390
|
+
* never touch terrain and never set obvious (project-feat.c:581-675), so the
|
|
391
|
+
* player observes nothing from them at the grid level. Registered explicitly
|
|
392
|
+
* rather than left to fall through, because the fallback is observe-only and
|
|
393
|
+
* would hand them an `obvious` upstream does not give them.
|
|
394
|
+
*/
|
|
395
|
+
const inert = () => false;
|
|
396
|
+
/**
|
|
397
|
+
* The fallback, and upstream's `default`: the remaining damage / elemental
|
|
398
|
+
* projections only give the player a chance to observe. This is also what a
|
|
399
|
+
* mod's projection gets until it registers a handler, which is why adding one
|
|
400
|
+
* is safe with no code at all.
|
|
401
|
+
*/
|
|
402
|
+
const observeOnly = ({ state, grid }) => observed(state, grid);
|
|
403
|
+
/** The 24 monster-directed codes whose upstream feature handler is empty. */
|
|
404
|
+
const INERT_CODES = [
|
|
405
|
+
"AWAY_UNDEAD",
|
|
406
|
+
"AWAY_EVIL",
|
|
407
|
+
"AWAY_SPIRIT",
|
|
408
|
+
"AWAY_ALL",
|
|
409
|
+
"TURN_UNDEAD",
|
|
410
|
+
"TURN_EVIL",
|
|
411
|
+
"TURN_LIVING",
|
|
412
|
+
"TURN_ALL",
|
|
413
|
+
"DISP_UNDEAD",
|
|
414
|
+
"DISP_EVIL",
|
|
415
|
+
"DISP_ALL",
|
|
416
|
+
"SLEEP_UNDEAD",
|
|
417
|
+
"SLEEP_EVIL",
|
|
418
|
+
"SLEEP_ALL",
|
|
419
|
+
"MON_CLONE",
|
|
420
|
+
"MON_POLY",
|
|
421
|
+
"MON_HEAL",
|
|
422
|
+
"MON_SPEED",
|
|
423
|
+
"MON_SLOW",
|
|
424
|
+
"MON_CONF",
|
|
425
|
+
"MON_HOLD",
|
|
426
|
+
"MON_STUN",
|
|
427
|
+
"MON_DRAIN",
|
|
428
|
+
"MON_CRUSH",
|
|
429
|
+
];
|
|
430
|
+
/**
|
|
431
|
+
* project_f's switch, as a table keyed by projection CODE.
|
|
432
|
+
*
|
|
433
|
+
* KEYED BY CODE, NOT BY THE PROJ NUMBER, and that is the whole point. A PROJ_
|
|
434
|
+
* value is an index into a compiled-in enum; a mod's projection is appended
|
|
435
|
+
* past the end of it (bindProjections), so its number depends on what else is
|
|
436
|
+
* installed. Its `code` does not - that is the identity the record itself
|
|
437
|
+
* declares, and the same string composition keys projection.json by
|
|
438
|
+
* (mod-sdk/src/record-key.ts).
|
|
439
|
+
*
|
|
440
|
+
* Every code core ships appears here, INCLUDING the 24 that do nothing, so the
|
|
441
|
+
* table is a complete statement of the switch it replaced rather than a partial
|
|
442
|
+
* one with a catch-all behind it. project-feat-registry.test.ts asserts that in
|
|
443
|
+
* both directions against the bound projection table.
|
|
444
|
+
*/
|
|
445
|
+
export const PROJECT_FEAT_HANDLERS = new Map([
|
|
446
|
+
["LIGHT_WEAK", light],
|
|
447
|
+
["LIGHT", light],
|
|
448
|
+
["DARK_WEAK", dark],
|
|
449
|
+
["DARK", dark],
|
|
450
|
+
["KILL_WALL", killWall],
|
|
451
|
+
["KILL_DOOR", killDoor],
|
|
452
|
+
["KILL_TRAP", killTrap],
|
|
453
|
+
["MAKE_DOOR", makeDoor],
|
|
454
|
+
["MAKE_TRAP", makeTrap],
|
|
455
|
+
["FIRE", fire],
|
|
456
|
+
["PLASMA", fire],
|
|
457
|
+
["COLD", cold],
|
|
458
|
+
["ICE", cold],
|
|
459
|
+
...INERT_CODES.map((code) => [code, inert]),
|
|
460
|
+
]);
|
|
461
|
+
/**
|
|
462
|
+
* project_f: affect the terrain at `grid` (PROJECT_GRID). Returns whether
|
|
463
|
+
* anything the player can see happened.
|
|
464
|
+
*
|
|
465
|
+
* This was a 37-case switch until 2026-08-08; it is now a lookup in
|
|
466
|
+
* PROJECT_FEAT_HANDLERS, and a mod reaches it through the per-game
|
|
467
|
+
* ProjectionHandlerRegistry that wireGame supplies as `env.featHandlers`.
|
|
468
|
+
* The signature, the arms and every rng draw are unchanged - the 6,552 vectors
|
|
469
|
+
* in project-feat-vectors.json are replayed against it for exactly that reason.
|
|
470
|
+
*/
|
|
471
|
+
export function projectFeature(state, _r, grid, dam, typ, env = {}) {
|
|
472
|
+
const code = projectionCodeFor(typ, env.projections);
|
|
473
|
+
const table = env.featHandlers ?? PROJECT_FEAT_HANDLERS;
|
|
474
|
+
const handler = (code === undefined ? undefined : table.get(code)) ?? observeOnly;
|
|
475
|
+
return handler({ state, grid, dam, typ, env });
|
|
349
476
|
}
|
|
350
477
|
//# sourceMappingURL=project-feat.js.map
|