@rpgm-tools/neo-angband-core 0.19.0 → 0.20.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/cmd.d.ts +44 -2
- package/dist/cmd.d.ts.map +1 -1
- package/dist/cmd.js +59 -3
- package/dist/cmd.js.map +1 -1
- package/dist/game/context.d.ts +31 -0
- package/dist/game/context.d.ts.map +1 -1
- package/dist/game/context.js.map +1 -1
- package/dist/game/display.d.ts +26 -0
- package/dist/game/display.d.ts.map +1 -1
- package/dist/game/display.js +116 -22
- package/dist/game/display.js.map +1 -1
- package/dist/game/dump-level.d.ts +1 -1
- package/dist/game/dump-level.js +1 -1
- package/dist/game/effect-attack.d.ts.map +1 -1
- package/dist/game/effect-attack.js +1 -3
- package/dist/game/effect-attack.js.map +1 -1
- package/dist/game/effect-general.d.ts.map +1 -1
- package/dist/game/effect-general.js +12 -11
- package/dist/game/effect-general.js.map +1 -1
- package/dist/game/effect-item.d.ts.map +1 -1
- package/dist/game/effect-item.js +10 -4
- package/dist/game/effect-item.js.map +1 -1
- package/dist/game/effect-teleport.d.ts.map +1 -1
- package/dist/game/effect-teleport.js +21 -12
- package/dist/game/effect-teleport.js.map +1 -1
- package/dist/game/effect-terrain.d.ts +1 -1
- package/dist/game/effect-terrain.js +1 -1
- package/dist/game/equip-cmp.d.ts +17 -6
- package/dist/game/equip-cmp.d.ts.map +1 -1
- package/dist/game/equip-cmp.js +43 -24
- package/dist/game/equip-cmp.js.map +1 -1
- package/dist/game/floor.d.ts +32 -0
- package/dist/game/floor.d.ts.map +1 -1
- package/dist/game/floor.js +42 -0
- package/dist/game/floor.js.map +1 -1
- package/dist/game/gear.d.ts +17 -3
- package/dist/game/gear.d.ts.map +1 -1
- package/dist/game/gear.js +2 -2
- package/dist/game/gear.js.map +1 -1
- package/dist/game/inscription-confirm.d.ts +13 -6
- package/dist/game/inscription-confirm.d.ts.map +1 -1
- package/dist/game/inscription-confirm.js +13 -6
- package/dist/game/inscription-confirm.js.map +1 -1
- package/dist/game/known.d.ts +31 -6
- package/dist/game/known.d.ts.map +1 -1
- package/dist/game/known.js +81 -13
- package/dist/game/known.js.map +1 -1
- package/dist/game/mon-cast.d.ts.map +1 -1
- package/dist/game/mon-cast.js +9 -5
- package/dist/game/mon-cast.js.map +1 -1
- package/dist/game/mon-cmd.d.ts.map +1 -1
- package/dist/game/mon-cmd.js +4 -7
- package/dist/game/mon-cmd.js.map +1 -1
- package/dist/game/mon-message.d.ts.map +1 -1
- package/dist/game/mon-message.js +0 -1
- package/dist/game/mon-message.js.map +1 -1
- package/dist/game/mon-side.d.ts.map +1 -1
- package/dist/game/mon-side.js +4 -7
- package/dist/game/mon-side.js.map +1 -1
- package/dist/game/monster-turn.d.ts +4 -1
- package/dist/game/monster-turn.d.ts.map +1 -1
- package/dist/game/monster-turn.js +8 -4
- package/dist/game/monster-turn.js.map +1 -1
- package/dist/game/obj-cmd.d.ts.map +1 -1
- package/dist/game/obj-cmd.js +21 -3
- package/dist/game/obj-cmd.js.map +1 -1
- package/dist/game/player-turn.d.ts +2 -1
- package/dist/game/player-turn.d.ts.map +1 -1
- package/dist/game/player-turn.js +3 -3
- package/dist/game/player-turn.js.map +1 -1
- package/dist/game/project-cast.d.ts.map +1 -1
- package/dist/game/project-cast.js +9 -0
- package/dist/game/project-cast.js.map +1 -1
- package/dist/game/project-monster.d.ts +10 -0
- package/dist/game/project-monster.d.ts.map +1 -1
- package/dist/game/project-monster.js +11 -2
- package/dist/game/project-monster.js.map +1 -1
- package/dist/game/projection-handlers.d.ts +9 -1
- package/dist/game/projection-handlers.d.ts.map +1 -1
- package/dist/game/projection-handlers.js +9 -1
- package/dist/game/projection-handlers.js.map +1 -1
- package/dist/game/ranged-cmd.d.ts.map +1 -1
- package/dist/game/ranged-cmd.js +6 -2
- package/dist/game/ranged-cmd.js.map +1 -1
- package/dist/game/repeat.d.ts +38 -1
- package/dist/game/repeat.d.ts.map +1 -1
- package/dist/game/repeat.js +24 -1
- package/dist/game/repeat.js.map +1 -1
- package/dist/game/shape-inspect.d.ts +2 -2
- package/dist/game/shape-inspect.js +3 -3
- package/dist/game/spoil.js +1 -1
- package/dist/game/take-hit-hooks.d.ts.map +1 -1
- package/dist/game/take-hit-hooks.js +4 -12
- package/dist/game/take-hit-hooks.js.map +1 -1
- package/dist/game/target-loop.d.ts +13 -8
- package/dist/game/target-loop.d.ts.map +1 -1
- package/dist/game/target-loop.js +43 -14
- package/dist/game/target-loop.js.map +1 -1
- package/dist/game/ui-entry-registry.d.ts +124 -0
- package/dist/game/ui-entry-registry.d.ts.map +1 -0
- package/dist/game/ui-entry-registry.js +102 -0
- package/dist/game/ui-entry-registry.js.map +1 -0
- package/dist/game/ui-entry.d.ts +90 -20
- package/dist/game/ui-entry.d.ts.map +1 -1
- package/dist/game/ui-entry.js +510 -315
- package/dist/game/ui-entry.js.map +1 -1
- package/dist/game/wizard.d.ts +27 -23
- package/dist/game/wizard.d.ts.map +1 -1
- package/dist/game/wizard.js +38 -34
- package/dist/game/wizard.js.map +1 -1
- package/dist/gen/gen-monster.d.ts +4 -2
- package/dist/gen/gen-monster.d.ts.map +1 -1
- package/dist/gen/gen-monster.js +11 -8
- package/dist/gen/gen-monster.js.map +1 -1
- package/dist/gen/util.d.ts +1 -1
- package/dist/gen/util.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mod/extension.d.ts +20 -0
- package/dist/mod/extension.d.ts.map +1 -1
- package/dist/mod/extension.js +12 -2
- package/dist/mod/extension.js.map +1 -1
- package/dist/mod/ids.d.ts +12 -0
- package/dist/mod/ids.d.ts.map +1 -1
- package/dist/mod/ids.js +119 -14
- package/dist/mod/ids.js.map +1 -1
- package/dist/mod/message-declarations.d.ts +132 -0
- package/dist/mod/message-declarations.d.ts.map +1 -0
- package/dist/mod/message-declarations.js +223 -0
- package/dist/mod/message-declarations.js.map +1 -0
- package/dist/mod/record-keys.d.ts +4 -3
- package/dist/mod/record-keys.d.ts.map +1 -1
- package/dist/mod/record-keys.js +4 -3
- package/dist/mod/record-keys.js.map +1 -1
- package/dist/mod/registry-host.d.ts +167 -1
- package/dist/mod/registry-host.d.ts.map +1 -1
- package/dist/mod/registry-host.js +95 -1
- package/dist/mod/registry-host.js.map +1 -1
- package/dist/mod/save-blocks.d.ts +8 -3
- package/dist/mod/save-blocks.d.ts.map +1 -1
- package/dist/mod/save-blocks.js +153 -14
- package/dist/mod/save-blocks.js.map +1 -1
- package/dist/mon/bind.d.ts +5 -0
- package/dist/mon/bind.d.ts.map +1 -1
- package/dist/mon/bind.js +12 -10
- package/dist/mon/bind.js.map +1 -1
- package/dist/mon/knowledge-groups.js +1 -1
- package/dist/mon/lore-describe.d.ts.map +1 -1
- package/dist/mon/lore-describe.js +3 -2
- package/dist/mon/lore-describe.js.map +1 -1
- package/dist/mon/lore-file.d.ts +4 -4
- package/dist/mon/lore-file.d.ts.map +1 -1
- package/dist/mon/lore-file.js +22 -12
- package/dist/mon/lore-file.js.map +1 -1
- package/dist/mon/lore.d.ts +6 -0
- package/dist/mon/lore.d.ts.map +1 -1
- package/dist/mon/lore.js +10 -3
- package/dist/mon/lore.js.map +1 -1
- package/dist/mon/predicate.d.ts.map +1 -1
- package/dist/mon/predicate.js +3 -2
- package/dist/mon/predicate.js.map +1 -1
- package/dist/mon/project-mon.d.ts +48 -4
- package/dist/mon/project-mon.d.ts.map +1 -1
- package/dist/mon/project-mon.js +47 -4
- package/dist/mon/project-mon.js.map +1 -1
- package/dist/mon/spell-declarations.d.ts +44 -0
- package/dist/mon/spell-declarations.d.ts.map +1 -0
- package/dist/mon/spell-declarations.js +57 -0
- package/dist/mon/spell-declarations.js.map +1 -0
- package/dist/mon/spell-registry.d.ts +136 -0
- package/dist/mon/spell-registry.d.ts.map +1 -0
- package/dist/mon/spell-registry.js +178 -0
- package/dist/mon/spell-registry.js.map +1 -0
- package/dist/mon/spell.js +2 -2
- package/dist/mon/spell.js.map +1 -1
- package/dist/mon/types.d.ts +12 -1
- package/dist/mon/types.d.ts.map +1 -1
- package/dist/mon/types.js +18 -1
- package/dist/mon/types.js.map +1 -1
- package/dist/msg.d.ts +26 -0
- package/dist/msg.d.ts.map +1 -1
- package/dist/msg.js +28 -1
- package/dist/msg.js.map +1 -1
- package/dist/obj/artifact-fake.d.ts +1 -1
- package/dist/obj/artifact-fake.js +1 -1
- package/dist/obj/artifact-known.d.ts +4 -4
- package/dist/obj/artifact-known.js +3 -3
- package/dist/obj/bind.d.ts +2 -2
- package/dist/obj/bind.d.ts.map +1 -1
- package/dist/obj/bind.js +5 -4
- package/dist/obj/bind.js.map +1 -1
- package/dist/obj/desc.d.ts +1 -1
- package/dist/obj/desc.js +1 -1
- package/dist/obj/fake-object.d.ts +2 -2
- package/dist/obj/fake-object.js +2 -2
- package/dist/obj/knowledge.d.ts +2 -2
- package/dist/obj/knowledge.js +2 -2
- package/dist/obj/make.d.ts +1 -1
- package/dist/obj/make.d.ts.map +1 -1
- package/dist/obj/make.js +3 -3
- package/dist/obj/make.js.map +1 -1
- package/dist/obj/object-info.d.ts +1 -1
- package/dist/obj/object-info.js +2 -2
- package/dist/obj/object-info.js.map +1 -1
- package/dist/obj/object.d.ts +12 -5
- package/dist/obj/object.d.ts.map +1 -1
- package/dist/obj/object.js +15 -6
- package/dist/obj/object.js.map +1 -1
- package/dist/obj/power.d.ts +2 -2
- package/dist/obj/power.js +4 -4
- package/dist/obj/power.js.map +1 -1
- package/dist/obj/randart-build.d.ts.map +1 -1
- package/dist/obj/randart-build.js +22 -46
- package/dist/obj/randart-build.js.map +1 -1
- package/dist/obj/randart-data.d.ts.map +1 -1
- package/dist/obj/randart-data.js +16 -33
- package/dist/obj/randart-data.js.map +1 -1
- package/dist/obj/types.d.ts +25 -0
- package/dist/obj/types.d.ts.map +1 -1
- package/dist/parser.d.ts +26 -46
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +26 -115
- package/dist/parser.js.map +1 -1
- package/dist/player/birth.d.ts +1 -1
- package/dist/player/birth.js +2 -2
- package/dist/player/options-file.d.ts +55 -29
- package/dist/player/options-file.d.ts.map +1 -1
- package/dist/player/options-file.js +125 -139
- package/dist/player/options-file.js.map +1 -1
- package/dist/player/options.d.ts +1 -1
- package/dist/player/options.js +1 -1
- package/dist/player/shape-lore.d.ts +1 -1
- package/dist/player/shape-lore.d.ts.map +1 -1
- package/dist/player/shape-lore.js +16 -13
- package/dist/player/shape-lore.js.map +1 -1
- package/dist/player/spell.d.ts.map +1 -1
- package/dist/player/spell.js +24 -2
- package/dist/player/spell.js.map +1 -1
- package/dist/score/display.d.ts.map +1 -1
- package/dist/score/display.js +39 -18
- package/dist/score/display.js.map +1 -1
- package/dist/score/score.d.ts +7 -7
- package/dist/score/score.js +3 -3
- package/dist/score/types.d.ts +51 -0
- package/dist/score/types.d.ts.map +1 -1
- package/dist/score/types.js.map +1 -1
- package/dist/session/boot.d.ts +2 -0
- package/dist/session/boot.d.ts.map +1 -1
- package/dist/session/boot.js +22 -0
- package/dist/session/boot.js.map +1 -1
- package/dist/session/game.d.ts.map +1 -1
- package/dist/session/game.js +113 -6
- package/dist/session/game.js.map +1 -1
- package/dist/session/save-migrate.d.ts +3 -3
- package/dist/session/save-migrate.d.ts.map +1 -1
- package/dist/session/save-migrate.js +429 -21
- package/dist/session/save-migrate.js.map +1 -1
- package/dist/session/save.d.ts +442 -28
- package/dist/session/save.d.ts.map +1 -1
- package/dist/session/save.js +691 -51
- package/dist/session/save.js.map +1 -1
- package/dist/sound/engine.d.ts +17 -0
- package/dist/sound/engine.d.ts.map +1 -1
- package/dist/sound/engine.js +55 -6
- package/dist/sound/engine.js.map +1 -1
- package/dist/sound/index.d.ts +2 -0
- package/dist/sound/index.d.ts.map +1 -1
- package/dist/sound/index.js +2 -0
- package/dist/sound/index.js.map +1 -1
- package/dist/sound/message-types.d.ts +89 -0
- package/dist/sound/message-types.d.ts.map +1 -0
- package/dist/sound/message-types.js +126 -0
- package/dist/sound/message-types.js.map +1 -0
- package/dist/sound/sound-registry.d.ts +93 -0
- package/dist/sound/sound-registry.d.ts.map +1 -0
- package/dist/sound/sound-registry.js +117 -0
- package/dist/sound/sound-registry.js.map +1 -0
- package/dist/store/store.d.ts +12 -11
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +16 -16
- package/dist/store/store.js.map +1 -1
- package/dist/store/transact.d.ts +25 -7
- package/dist/store/transact.d.ts.map +1 -1
- package/dist/store/transact.js +27 -9
- package/dist/store/transact.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/visuals/glyph-table.d.ts +2 -2
- package/dist/visuals/glyph-table.js +2 -2
- package/dist/visuals/hallucination.d.ts +140 -0
- package/dist/visuals/hallucination.d.ts.map +1 -0
- package/dist/visuals/hallucination.js +122 -0
- package/dist/visuals/hallucination.js.map +1 -0
- 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 +5 -4
- package/dist/visuals/map-text.d.ts.map +1 -1
- package/dist/visuals/map-text.js +5 -4
- package/dist/visuals/map-text.js.map +1 -1
- package/dist/visuals/object-glyph.d.ts +5 -0
- package/dist/visuals/object-glyph.d.ts.map +1 -1
- package/dist/visuals/object-glyph.js +7 -2
- package/dist/visuals/object-glyph.js.map +1 -1
- package/dist/visuals/prefs.d.ts +172 -17
- package/dist/visuals/prefs.d.ts.map +1 -1
- package/dist/visuals/prefs.js +221 -25
- package/dist/visuals/prefs.js.map +1 -1
- package/dist/world/trap.d.ts +1 -1
- package/package.json +1 -1
- package/src/cmd.ts +67 -3
- package/src/effects/effect-info.ts +1005 -1005
- package/src/game/context.ts +31 -0
- package/src/game/display.ts +144 -22
- package/src/game/dump-level.ts +1 -1
- package/src/game/effect-attack.ts +1 -2
- package/src/game/effect-general.ts +12 -11
- package/src/game/effect-item.ts +1080 -1075
- package/src/game/effect-teleport.ts +21 -12
- package/src/game/effect-terrain.ts +1 -1
- package/src/game/equip-cmp.ts +62 -32
- package/src/game/floor.ts +52 -0
- package/src/game/gear.ts +18 -4
- package/src/game/inscription-confirm.ts +15 -7
- package/src/game/known.ts +83 -12
- package/src/game/loop.ts +695 -695
- package/src/game/mon-cast.ts +8 -6
- package/src/game/mon-cmd.ts +4 -7
- package/src/game/mon-message.ts +0 -1
- package/src/game/mon-side.ts +4 -6
- package/src/game/monster-turn.ts +8 -4
- package/src/game/obj-cmd.ts +19 -2
- package/src/game/player-turn.ts +2 -3
- package/src/game/project-cast.ts +9 -0
- package/src/game/project-monster.ts +24 -3
- package/src/game/projection-handlers.ts +12 -1
- package/src/game/ranged-cmd.ts +5 -3
- package/src/game/repeat.ts +56 -1
- package/src/game/shape-inspect.ts +3 -3
- package/src/game/spoil.ts +1 -1
- package/src/game/take-hit-hooks.ts +4 -11
- package/src/game/target-loop.ts +44 -12
- package/src/game/ui-entry-registry.ts +159 -0
- package/src/game/ui-entry.ts +2528 -2222
- package/src/game/wizard.ts +39 -35
- package/src/gen/cave.ts +3057 -3057
- package/src/gen/gen-monster.ts +11 -8
- package/src/gen/generate.ts +576 -576
- package/src/gen/util.ts +1 -1
- package/src/index.ts +311 -307
- package/src/mod/extension.ts +37 -2
- package/src/mod/hooks.ts +521 -521
- package/src/mod/ids.ts +160 -13
- package/src/mod/message-declarations.ts +293 -0
- package/src/mod/record-keys.ts +4 -3
- package/src/mod/registry-host.ts +1274 -1009
- package/src/mod/save-blocks.ts +162 -15
- package/src/mon/bind.ts +14 -10
- package/src/mon/knowledge-groups.ts +1 -1
- package/src/mon/lore-describe.ts +3 -2
- package/src/mon/lore-file.ts +22 -12
- package/src/mon/lore.ts +10 -3
- package/src/mon/predicate.ts +3 -2
- package/src/mon/project-mon.ts +65 -4
- package/src/mon/spell-declarations.ts +80 -0
- package/src/mon/spell-registry.ts +221 -0
- package/src/mon/spell.ts +2 -2
- package/src/mon/types.ts +27 -1
- package/src/msg.ts +29 -1
- package/src/obj/artifact-fake.ts +1 -1
- package/src/obj/artifact-known.ts +4 -4
- package/src/obj/bind.ts +4 -4
- package/src/obj/desc.ts +1 -1
- package/src/obj/fake-object.ts +2 -2
- package/src/obj/knowledge.ts +2 -2
- package/src/obj/make.ts +3 -2
- package/src/obj/object-info.ts +2 -2
- package/src/obj/object.ts +15 -6
- package/src/obj/power.ts +4 -4
- package/src/obj/randart-build.ts +1847 -1875
- package/src/obj/randart-data.ts +1519 -1547
- package/src/obj/randart-registry.ts +247 -247
- package/src/obj/randart-vectors.ts +369 -369
- package/src/obj/randart.ts +722 -722
- package/src/obj/types.ts +22 -0
- package/src/parser.ts +26 -115
- package/src/player/birth.ts +2 -2
- package/src/player/options-file.ts +128 -164
- package/src/player/options.ts +1 -1
- package/src/player/shape-lore.ts +16 -13
- package/src/player/spell.ts +31 -2
- package/src/score/display.ts +38 -17
- package/src/score/score.ts +8 -8
- package/src/score/types.ts +52 -0
- package/src/session/boot.ts +50 -0
- package/src/session/game.ts +117 -6
- package/src/session/save-migrate.ts +517 -22
- package/src/session/save.ts +917 -74
- package/src/sound/engine.ts +59 -4
- package/src/sound/index.ts +2 -0
- package/src/sound/message-types.ts +164 -0
- package/src/sound/sound-registry.ts +149 -0
- package/src/store/store.ts +21 -19
- package/src/store/transact.ts +30 -12
- package/src/version.ts +1 -1
- package/src/visuals/glyph-table.ts +2 -2
- package/src/visuals/hallucination.ts +200 -0
- package/src/visuals/index.ts +1 -0
- package/src/visuals/map-text.ts +5 -4
- package/src/visuals/object-glyph.ts +7 -2
- package/src/visuals/prefs.ts +1236 -971
- package/src/visuals/tile-prefs.ts +215 -215
- package/src/world/trap.ts +1 -1
package/src/game/context.ts
CHANGED
|
@@ -805,6 +805,37 @@ export interface GameState {
|
|
|
805
805
|
* from a mod's register(), is dispatched to on the next projection.
|
|
806
806
|
*/
|
|
807
807
|
projectionHandlers?: import("./projection-handlers.js").ProjectionHandlerRegistry;
|
|
808
|
+
/**
|
|
809
|
+
* The verb "Really <verb> <the object>? " uses, keyed by command code
|
|
810
|
+
* (cmd.ts). wireGame seeds one per game with core's, and a mod names the verb
|
|
811
|
+
* for its OWN command through ModRegistryHost.commands.setVerb
|
|
812
|
+
* ("registry:command") - COMMAND_INFO is keyed by the closed CommandCode
|
|
813
|
+
* union, so a mod's code could never have had one.
|
|
814
|
+
*
|
|
815
|
+
* Per game, for the same reason as blowEffects: one character's mod verb must
|
|
816
|
+
* not leak into the next character's game. A UI STRING and nothing else; the
|
|
817
|
+
* command's behaviour still lives in the ActionRegistry.
|
|
818
|
+
*/
|
|
819
|
+
commandVerbs?: import("../cmd.js").CommandVerbTable;
|
|
820
|
+
/**
|
|
821
|
+
* The second character screen's two ui-entry tables - the nine value
|
|
822
|
+
* COMBINERS and the six renderer BACKENDS - seeded per game and reached by a
|
|
823
|
+
* mod through ModRegistryHost.uiEntry ("registry:ui-entry").
|
|
824
|
+
*
|
|
825
|
+
* `characterGrid` and `equipCmpSummary` read this field at the moment they
|
|
826
|
+
* compute a row, and resolve BY NAME against it, so a combiner or backend
|
|
827
|
+
* installed later - from a mod's register() - is dispatched to the next time
|
|
828
|
+
* either screen opens. Nothing stores the resolved handler, and nothing
|
|
829
|
+
* stores a slot: the 1-based combiner index and 0..5 backend index this
|
|
830
|
+
* replaced were coordinates into core's own tables, which a registered
|
|
831
|
+
* handler has none of.
|
|
832
|
+
*
|
|
833
|
+
* Optional only because the headless harnesses build a GameState without one;
|
|
834
|
+
* ui-entry then resolves against core's nine and six, which is stock
|
|
835
|
+
* behaviour, and a mod can never reach that fallback because the facade
|
|
836
|
+
* refuses to register when the host wired no registry.
|
|
837
|
+
*/
|
|
838
|
+
uiEntry?: import("./ui-entry-registry.js").UiEntryRegistry;
|
|
808
839
|
/**
|
|
809
840
|
* Named boolean "mod rule" flags: the player's per-patch choices, resolved by
|
|
810
841
|
* the HOST from each enabled mod's manifest `rules` against their saved Fixes
|
package/src/game/display.ts
CHANGED
|
@@ -73,11 +73,36 @@ export interface DisplayRun {
|
|
|
73
73
|
color: number;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* The numbers behind a display field, for a consumer that is not going to draw
|
|
78
|
+
* the text.
|
|
79
|
+
*
|
|
80
|
+
* Upstream has no such thing: prt_hp formats "HP 20/ 20" and the number is
|
|
81
|
+
* gone. The port's runs preserved that exactly, which is right for the faithful
|
|
82
|
+
* terminal and useless to anything else - a replacement HUD that wants to draw
|
|
83
|
+
* hit points as a proportional bar had to parse a rendering, and parsing a
|
|
84
|
+
* rendering is how a mod ends up broken by a pref file (MOD_REACH gap 21).
|
|
85
|
+
*
|
|
86
|
+
* ONE CONVENTION, and it is the whole point of the type: `current` and `max`
|
|
87
|
+
* together mean THIS IS A PROPORTION and `current / max` is meaningful. A field
|
|
88
|
+
* that has two numbers which are not a ratio must not use those two names -
|
|
89
|
+
* a stat's 18/118 encoding is not 15% of anything, so it publishes `use`, `cur`
|
|
90
|
+
* and `max` and a bar-drawing consumer correctly finds no proportion to draw.
|
|
91
|
+
* Every other key is a plain named quantity, documented where it is produced.
|
|
92
|
+
*
|
|
93
|
+
* Absent means "no number here", never zero: a monster health bar reads
|
|
94
|
+
* `[----------]` when the monster is unseen, and the honest answer for its
|
|
95
|
+
* current hit points is that this display does not know them.
|
|
96
|
+
*/
|
|
97
|
+
export type DisplayValues = Readonly<Record<string, number>>;
|
|
98
|
+
|
|
76
99
|
/** One computed sidebar field: its handler key and its ordered runs. */
|
|
77
100
|
export interface SidebarField {
|
|
78
101
|
/** The side_handlers[] prt_* name minus the "prt_" prefix. */
|
|
79
102
|
key: string;
|
|
80
103
|
runs: DisplayRun[];
|
|
104
|
+
/** The numbers this field's text was formatted from, where it has any. */
|
|
105
|
+
values?: DisplayValues;
|
|
81
106
|
}
|
|
82
107
|
|
|
83
108
|
/** One computed status-line indicator: its handler key and its runs. */
|
|
@@ -85,6 +110,8 @@ export interface StatusIndicator {
|
|
|
85
110
|
/** The status_handlers[] prt_* name minus the "prt_" prefix. */
|
|
86
111
|
key: string;
|
|
87
112
|
runs: DisplayRun[];
|
|
113
|
+
/** The numbers this indicator's text was formatted from, where it has any. */
|
|
114
|
+
values?: DisplayValues;
|
|
88
115
|
}
|
|
89
116
|
|
|
90
117
|
/**
|
|
@@ -441,6 +468,23 @@ function statRuns(player: Player, stat: number, deps: ResolvedDeps): DisplayRun[
|
|
|
441
468
|
];
|
|
442
469
|
}
|
|
443
470
|
|
|
471
|
+
/**
|
|
472
|
+
* The three numbers behind one stat row.
|
|
473
|
+
*
|
|
474
|
+
* NOT `current`/`max`: `use` is the internal 18/xx encoding, where 118 means
|
|
475
|
+
* 18/100 and is one point above 117. A bar drawn from `use / max` would report
|
|
476
|
+
* an 18/100 character as 15% of a maxed one. The names say what each number is
|
|
477
|
+
* and leave the arithmetic to whoever knows what the encoding means (`cnvStat`
|
|
478
|
+
* is exported for exactly that).
|
|
479
|
+
*/
|
|
480
|
+
function statValues(player: Player, stat: number, deps: ResolvedDeps): DisplayValues {
|
|
481
|
+
return {
|
|
482
|
+
use: deps.statUse[stat] ?? 0,
|
|
483
|
+
cur: player.statCur[stat] ?? 0,
|
|
484
|
+
max: player.statMax[stat] ?? 0,
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
|
|
444
488
|
/** prt_level (ui-display.c L207). */
|
|
445
489
|
function levelRuns(player: Player): DisplayRun[] {
|
|
446
490
|
const value = rjust(player.lev, 6);
|
|
@@ -459,11 +503,7 @@ function levelRuns(player: Player): DisplayRun[] {
|
|
|
459
503
|
*/
|
|
460
504
|
function expRuns(player: Player): DisplayRun[] {
|
|
461
505
|
const levMax = player.lev === PY_MAX_LEVEL;
|
|
462
|
-
|
|
463
|
-
if (!levMax) {
|
|
464
|
-
const base = player_exp[player.lev - 1] ?? 0;
|
|
465
|
-
xp = Math.trunc((base * player.expFactor) / 100) - player.exp;
|
|
466
|
-
}
|
|
506
|
+
const xp = levMax ? player.exp : expAdvance(player);
|
|
467
507
|
const value = rjust(xp, 8);
|
|
468
508
|
const atMax = player.exp >= player.maxExp;
|
|
469
509
|
const label = levMax ? (atMax ? "EXP" : "Exp") : atMax ? "NXT" : "Nxt";
|
|
@@ -473,6 +513,20 @@ function expRuns(player: Player): DisplayRun[] {
|
|
|
473
513
|
];
|
|
474
514
|
}
|
|
475
515
|
|
|
516
|
+
/**
|
|
517
|
+
* The experience prt_exp counts DOWN to the next level (L232-243), or 0 at
|
|
518
|
+
* PY_MAX_LEVEL where the field shows the total instead.
|
|
519
|
+
*
|
|
520
|
+
* Shared by the text and the numbers so the two cannot part: this used to be
|
|
521
|
+
* inline in expRuns, and a second copy computing it for `values` would be a
|
|
522
|
+
* transcription of the same formula sitting one screen away from the original.
|
|
523
|
+
*/
|
|
524
|
+
function expAdvance(player: Player): number {
|
|
525
|
+
if (player.lev === PY_MAX_LEVEL) return 0;
|
|
526
|
+
const base = player_exp[player.lev - 1] ?? 0;
|
|
527
|
+
return Math.trunc((base * player.expFactor) / 100) - player.exp;
|
|
528
|
+
}
|
|
529
|
+
|
|
476
530
|
/** prt_gold (ui-display.c L256). */
|
|
477
531
|
function goldRuns(player: Player): DisplayRun[] {
|
|
478
532
|
return [
|
|
@@ -523,10 +577,19 @@ function hpRuns(player: Player, deps: ResolvedDeps): DisplayRun[] {
|
|
|
523
577
|
];
|
|
524
578
|
}
|
|
525
579
|
|
|
580
|
+
/**
|
|
581
|
+
* Whether this character HAS mana - prt_sp's own gate (L333-336), shared so the
|
|
582
|
+
* blank field and the absent numbers can never disagree. A warrior has no spell
|
|
583
|
+
* points, which is not the same fact as having zero of them.
|
|
584
|
+
*/
|
|
585
|
+
function hasMana(player: Player): boolean {
|
|
586
|
+
const magic = player.cls.magic;
|
|
587
|
+
return Boolean(magic.totalSpells) && player.lev >= magic.spellFirst;
|
|
588
|
+
}
|
|
589
|
+
|
|
526
590
|
/** prt_sp (ui-display.c L332): empty unless the class has mana at this level. */
|
|
527
591
|
function spRuns(player: Player, deps: ResolvedDeps): DisplayRun[] {
|
|
528
|
-
|
|
529
|
-
if (!magic.totalSpells || player.lev < magic.spellFirst) {
|
|
592
|
+
if (!hasMana(player)) {
|
|
530
593
|
/* An experience-drain clear (L344) leaves the field blank either way. */
|
|
531
594
|
return [];
|
|
532
595
|
}
|
|
@@ -538,6 +601,23 @@ function spRuns(player: Player, deps: ResolvedDeps): DisplayRun[] {
|
|
|
538
601
|
];
|
|
539
602
|
}
|
|
540
603
|
|
|
604
|
+
/**
|
|
605
|
+
* The tracked monster's hit points, but ONLY when the bar is showing them.
|
|
606
|
+
*
|
|
607
|
+
* prt_health_aux draws `[----------]` for a monster that is unseen, dead or
|
|
608
|
+
* being hallucinated (L433-441), and the honest answer for its current hit
|
|
609
|
+
* points in that state is that this display does not know them. Returning
|
|
610
|
+
* `{ current: 0, max: 1 }` there would draw an empty bar that reads as "nearly
|
|
611
|
+
* dead" - a wrong number is worse than an absent one.
|
|
612
|
+
*/
|
|
613
|
+
function healthValues(player: Player, deps: ResolvedDeps): DisplayValues | undefined {
|
|
614
|
+
const mon = deps.healthWho;
|
|
615
|
+
if (!mon) return undefined;
|
|
616
|
+
const image = (player.timed[TMD.IMAGE] ?? 0) > 0;
|
|
617
|
+
if (!monsterIsVisible(mon) || image || mon.hp < 0) return undefined;
|
|
618
|
+
return { current: mon.hp, max: mon.maxhp };
|
|
619
|
+
}
|
|
620
|
+
|
|
541
621
|
/** prt_health / prt_health_aux (ui-display.c L425). */
|
|
542
622
|
function healthRuns(player: Player, deps: ResolvedDeps): DisplayRun[] {
|
|
543
623
|
const mon = deps.healthWho;
|
|
@@ -674,25 +754,55 @@ export function sidebarModel(
|
|
|
674
754
|
const d = resolveDeps(state, deps);
|
|
675
755
|
const player = state.actor.player;
|
|
676
756
|
const shape = playerIsShapechanged(player);
|
|
757
|
+
const combat = state.actor.knownCombat;
|
|
758
|
+
const health = healthValues(player, d);
|
|
759
|
+
const mana = hasMana(player);
|
|
760
|
+
/* `current`/`max` ONLY where the ratio means something (see DisplayValues):
|
|
761
|
+
hp, sp and the monster health bar are proportions and nothing else here is.
|
|
762
|
+
A stat's 18/118 encoding and a drained character's level are two numbers
|
|
763
|
+
apiece that a bar would misdraw, so they publish their own names. */
|
|
677
764
|
return [
|
|
678
765
|
{ key: "race", runs: field(shape ? "" : player.race.name) },
|
|
679
766
|
{ key: "title", runs: field(fmtTitle(player, d)) },
|
|
680
767
|
{ key: "class", runs: field(shape ? "" : player.cls.name) },
|
|
681
|
-
{ key: "level", runs: levelRuns(player) },
|
|
682
|
-
{
|
|
683
|
-
|
|
768
|
+
{ key: "level", runs: levelRuns(player), values: { level: player.lev, maxLevel: player.maxLev } },
|
|
769
|
+
{
|
|
770
|
+
key: "exp",
|
|
771
|
+
runs: expRuns(player),
|
|
772
|
+
values: { exp: player.exp, maxExp: player.maxExp, advance: expAdvance(player) },
|
|
773
|
+
},
|
|
774
|
+
{ key: "gold", runs: goldRuns(player), values: { au: player.au } },
|
|
684
775
|
{ key: "equippy", runs: equippyRuns(state, d) },
|
|
685
|
-
{ key: "str", runs: statRuns(player, STAT.STR, d) },
|
|
686
|
-
{ key: "int", runs: statRuns(player, STAT.INT, d) },
|
|
687
|
-
{ key: "wis", runs: statRuns(player, STAT.WIS, d) },
|
|
688
|
-
{ key: "dex", runs: statRuns(player, STAT.DEX, d) },
|
|
689
|
-
{ key: "con", runs: statRuns(player, STAT.CON, d) },
|
|
690
|
-
{
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
{ key: "
|
|
776
|
+
{ key: "str", runs: statRuns(player, STAT.STR, d), values: statValues(player, STAT.STR, d) },
|
|
777
|
+
{ key: "int", runs: statRuns(player, STAT.INT, d), values: statValues(player, STAT.INT, d) },
|
|
778
|
+
{ key: "wis", runs: statRuns(player, STAT.WIS, d), values: statValues(player, STAT.WIS, d) },
|
|
779
|
+
{ key: "dex", runs: statRuns(player, STAT.DEX, d), values: statValues(player, STAT.DEX, d) },
|
|
780
|
+
{ key: "con", runs: statRuns(player, STAT.CON, d), values: statValues(player, STAT.CON, d) },
|
|
781
|
+
{
|
|
782
|
+
key: "ac",
|
|
783
|
+
runs: acRuns(state),
|
|
784
|
+
values: { ac: combat.ac + combat.toA, armour: combat.ac, bonus: combat.toA },
|
|
785
|
+
},
|
|
786
|
+
{ key: "hp", runs: hpRuns(player, d), values: { current: player.chp, max: player.mhp } },
|
|
787
|
+
{
|
|
788
|
+
key: "sp",
|
|
789
|
+
runs: spRuns(player, d),
|
|
790
|
+
...(mana ? { values: { current: player.csp, max: player.msp } } : {}),
|
|
791
|
+
},
|
|
792
|
+
{ key: "health", runs: healthRuns(player, d), ...(health ? { values: health } : {}) },
|
|
793
|
+
{
|
|
794
|
+
key: "speed",
|
|
795
|
+
runs: speedRuns(state, d),
|
|
796
|
+
/* Published at normal speed too, where the FIELD is blank: 110 is a known
|
|
797
|
+
number, not a missing one, and a replacement that wants to show "+0" is
|
|
798
|
+
entitled to. Core's own text stays upstream's. */
|
|
799
|
+
values: { speed: state.actor.speed, relative: state.actor.speed - 110 },
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
key: "depth",
|
|
803
|
+
runs: depthRuns(state),
|
|
804
|
+
values: { depth: state.chunk.depth, feet: state.chunk.depth * 50 },
|
|
805
|
+
},
|
|
696
806
|
];
|
|
697
807
|
}
|
|
698
808
|
|
|
@@ -985,7 +1095,19 @@ export function statusLineModel(
|
|
|
985
1095
|
const d = resolveDeps(state, deps);
|
|
986
1096
|
const player = state.actor.player;
|
|
987
1097
|
return [
|
|
988
|
-
{
|
|
1098
|
+
{
|
|
1099
|
+
key: "level_feeling",
|
|
1100
|
+
runs: levelFeelingRuns(state, d),
|
|
1101
|
+
/* "LF:3-4" is two digits that are each an INDEX into a colour table, and
|
|
1102
|
+
both are printed inverted (11 - objFeeling). A consumer that wants its
|
|
1103
|
+
own wording for a feeling needs the indices, not the arithmetic. */
|
|
1104
|
+
values: {
|
|
1105
|
+
object: Math.trunc(state.chunk.feeling / 10),
|
|
1106
|
+
monster: state.chunk.feeling % 10,
|
|
1107
|
+
squares: state.chunk.feelingSquares,
|
|
1108
|
+
need: d.feelingNeed,
|
|
1109
|
+
},
|
|
1110
|
+
},
|
|
989
1111
|
{ key: "light", runs: lightRuns(state) },
|
|
990
1112
|
{ key: "moves", runs: movesRuns(d) },
|
|
991
1113
|
{ key: "unignore", runs: unignoreRuns(d) },
|
package/src/game/dump-level.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The post-mortem level dump: one HTML page holding an ASCII map of a chunk, one
|
|
5
5
|
* character per grid, in upstream's own precedence order. Two commands use it -
|
|
6
|
-
* the wizard's "dump level map" (cmd-wizard.c:
|
|
6
|
+
* the wizard's "dump level map" (cmd-wizard.c:1162) and wiz-stats' disconnect
|
|
7
7
|
* report (disconnect.html) - and the `dist` argument is what the latter needs:
|
|
8
8
|
* where the distance array is negative, the grid is written as '*' instead of
|
|
9
9
|
* its own glyph, which is how an unreachable region shows up on the page.
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* attack projections are rare and resolve to a bare source.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
import { EF,
|
|
27
|
+
import { EF, PROJ, TMD } from "../generated/index.js";
|
|
28
28
|
import type { Loc } from "../loc.js";
|
|
29
29
|
import { monsterIsPowerful } from "../mon/predicate.js";
|
|
30
30
|
import { MDESC_DIED_FROM, monsterDesc } from "../mon/desc.js";
|
|
@@ -239,7 +239,6 @@ const handleBREATH: EffectHandler = (ctx) => {
|
|
|
239
239
|
const proj = env.cast.projections[ctx.subtype];
|
|
240
240
|
if (proj) {
|
|
241
241
|
ctx.env.messages?.msg(`You breathe ${proj.desc}.`, proj.msgt ?? undefined);
|
|
242
|
-
if (proj.msgt) env.state.sound?.((MSG as Record<string, number>)[proj.msgt] ?? 0);
|
|
243
242
|
}
|
|
244
243
|
}
|
|
245
244
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* squareIsDecoyed / monsterIsDecoyed).
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
import { EF, MON_TMD,
|
|
29
|
+
import { EF, MON_TMD, OF, PROJ, TMD } from "../generated/index.js";
|
|
30
30
|
import { DDGRID, distance, loc, locSum } from "../loc.js";
|
|
31
31
|
import { PROJECT } from "../world/project.js";
|
|
32
32
|
import { GLYPH_DECOY } from "../effects/effect.js";
|
|
@@ -152,8 +152,10 @@ interface GameEffectEnvLike {
|
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
154
|
* msg() over the effect context's optional message sink. `msgt` is a MSG_*
|
|
155
|
-
* name and
|
|
156
|
-
*
|
|
155
|
+
* name, and passing one makes this the whole of msgt(): the sink plays the
|
|
156
|
+
* type's sound as well (#239). It used to supply only the message half, with
|
|
157
|
+
* every caller expected to add a `state.sound` of its own - which is why the
|
|
158
|
+
* ones that did not were silent.
|
|
157
159
|
*/
|
|
158
160
|
function say(ctx: EffectHandlerContext, text: string, msgt?: string): void {
|
|
159
161
|
ctx.env.messages?.msg(text, msgt);
|
|
@@ -762,9 +764,9 @@ const handleRECALL: EffectHandler = (ctx) => {
|
|
|
762
764
|
};
|
|
763
765
|
|
|
764
766
|
/**
|
|
765
|
-
* EF_DEEP_DESCENT: a delayed drop of several levels
|
|
766
|
-
* general.c
|
|
767
|
-
* (4 / stair_skip) + 1 from the deepest reached depth.
|
|
767
|
+
* EF_DEEP_DESCENT: a delayed drop of several levels
|
|
768
|
+
* (effect-handler-general.c L1162-1181), counted down by process_world. The
|
|
769
|
+
* target increment is (4 / stair_skip) + 1 from the deepest reached depth.
|
|
768
770
|
*/
|
|
769
771
|
const handleDEEP_DESCENT: EffectHandler = (ctx) => {
|
|
770
772
|
const env = gameEnv(ctx);
|
|
@@ -780,10 +782,10 @@ const handleDEEP_DESCENT: EffectHandler = (ctx) => {
|
|
|
780
782
|
|
|
781
783
|
/* Both arms are msgt(MSG_TPLEVEL, ...) (effect-handler-general.c:1171,
|
|
782
784
|
* :1178) - the message carries the type, and msgt's other half is the
|
|
783
|
-
* sound. Neither half existed here (PORT_TODO 3.26)
|
|
785
|
+
* sound. Neither half existed here (PORT_TODO 3.26); the second half is the
|
|
786
|
+
* typed sink's job now (#239). */
|
|
784
787
|
if (targetDepth > state.chunk.depth) {
|
|
785
788
|
say(ctx, "The air around you starts to swirl...", "TPLEVEL");
|
|
786
|
-
state.sound?.(MSG.TPLEVEL);
|
|
787
789
|
p.deepDescent = 3 + state.rng.randint1(4);
|
|
788
790
|
} else {
|
|
789
791
|
say(
|
|
@@ -791,7 +793,6 @@ const handleDEEP_DESCENT: EffectHandler = (ctx) => {
|
|
|
791
793
|
"You sense a malevolent presence blocking passage to the levels below.",
|
|
792
794
|
"TPLEVEL",
|
|
793
795
|
);
|
|
794
|
-
state.sound?.(MSG.TPLEVEL);
|
|
795
796
|
}
|
|
796
797
|
ctx.ident = true;
|
|
797
798
|
return true;
|
|
@@ -1157,9 +1158,9 @@ const GENERAL_HANDLERS: ReadonlyMap<number, EffectHandler> = new Map<
|
|
|
1157
1158
|
[EF.DRAIN_LIGHT, handleDRAIN_LIGHT],
|
|
1158
1159
|
/* effect_handler_DRAIN_MANA (effect-handler-general.c:956) */
|
|
1159
1160
|
[EF.DRAIN_MANA, handleDRAIN_MANA],
|
|
1160
|
-
/* effect_handler_SCRAMBLE_STATS (effect-handler-general.c:
|
|
1161
|
+
/* effect_handler_SCRAMBLE_STATS (effect-handler-general.c:3630) */
|
|
1161
1162
|
[EF.SCRAMBLE_STATS, handleSCRAMBLE_STATS],
|
|
1162
|
-
/* effect_handler_UNSCRAMBLE_STATS (effect-handler-general.c:
|
|
1163
|
+
/* effect_handler_UNSCRAMBLE_STATS (effect-handler-general.c:3642) */
|
|
1163
1164
|
[EF.UNSCRAMBLE_STATS, handleUNSCRAMBLE_STATS],
|
|
1164
1165
|
/* effect_handler_TIMED_INC (effect-handler-general.c:576) */
|
|
1165
1166
|
[EF.TIMED_INC, handleTIMED_INC],
|