@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.
Files changed (417) hide show
  1. package/README.md +1 -1
  2. package/dist/cmd.d.ts +44 -2
  3. package/dist/cmd.d.ts.map +1 -1
  4. package/dist/cmd.js +59 -3
  5. package/dist/cmd.js.map +1 -1
  6. package/dist/game/context.d.ts +31 -0
  7. package/dist/game/context.d.ts.map +1 -1
  8. package/dist/game/context.js.map +1 -1
  9. package/dist/game/display.d.ts +26 -0
  10. package/dist/game/display.d.ts.map +1 -1
  11. package/dist/game/display.js +116 -22
  12. package/dist/game/display.js.map +1 -1
  13. package/dist/game/dump-level.d.ts +1 -1
  14. package/dist/game/dump-level.js +1 -1
  15. package/dist/game/effect-attack.d.ts.map +1 -1
  16. package/dist/game/effect-attack.js +1 -3
  17. package/dist/game/effect-attack.js.map +1 -1
  18. package/dist/game/effect-general.d.ts.map +1 -1
  19. package/dist/game/effect-general.js +12 -11
  20. package/dist/game/effect-general.js.map +1 -1
  21. package/dist/game/effect-item.d.ts.map +1 -1
  22. package/dist/game/effect-item.js +10 -4
  23. package/dist/game/effect-item.js.map +1 -1
  24. package/dist/game/effect-teleport.d.ts.map +1 -1
  25. package/dist/game/effect-teleport.js +21 -12
  26. package/dist/game/effect-teleport.js.map +1 -1
  27. package/dist/game/effect-terrain.d.ts +1 -1
  28. package/dist/game/effect-terrain.js +1 -1
  29. package/dist/game/equip-cmp.d.ts +17 -6
  30. package/dist/game/equip-cmp.d.ts.map +1 -1
  31. package/dist/game/equip-cmp.js +43 -24
  32. package/dist/game/equip-cmp.js.map +1 -1
  33. package/dist/game/floor.d.ts +32 -0
  34. package/dist/game/floor.d.ts.map +1 -1
  35. package/dist/game/floor.js +42 -0
  36. package/dist/game/floor.js.map +1 -1
  37. package/dist/game/gear.d.ts +17 -3
  38. package/dist/game/gear.d.ts.map +1 -1
  39. package/dist/game/gear.js +2 -2
  40. package/dist/game/gear.js.map +1 -1
  41. package/dist/game/inscription-confirm.d.ts +13 -6
  42. package/dist/game/inscription-confirm.d.ts.map +1 -1
  43. package/dist/game/inscription-confirm.js +13 -6
  44. package/dist/game/inscription-confirm.js.map +1 -1
  45. package/dist/game/known.d.ts +31 -6
  46. package/dist/game/known.d.ts.map +1 -1
  47. package/dist/game/known.js +81 -13
  48. package/dist/game/known.js.map +1 -1
  49. package/dist/game/mon-cast.d.ts.map +1 -1
  50. package/dist/game/mon-cast.js +9 -5
  51. package/dist/game/mon-cast.js.map +1 -1
  52. package/dist/game/mon-cmd.d.ts.map +1 -1
  53. package/dist/game/mon-cmd.js +4 -7
  54. package/dist/game/mon-cmd.js.map +1 -1
  55. package/dist/game/mon-message.d.ts.map +1 -1
  56. package/dist/game/mon-message.js +0 -1
  57. package/dist/game/mon-message.js.map +1 -1
  58. package/dist/game/mon-side.d.ts.map +1 -1
  59. package/dist/game/mon-side.js +4 -7
  60. package/dist/game/mon-side.js.map +1 -1
  61. package/dist/game/monster-turn.d.ts +4 -1
  62. package/dist/game/monster-turn.d.ts.map +1 -1
  63. package/dist/game/monster-turn.js +8 -4
  64. package/dist/game/monster-turn.js.map +1 -1
  65. package/dist/game/obj-cmd.d.ts.map +1 -1
  66. package/dist/game/obj-cmd.js +21 -3
  67. package/dist/game/obj-cmd.js.map +1 -1
  68. package/dist/game/player-turn.d.ts +2 -1
  69. package/dist/game/player-turn.d.ts.map +1 -1
  70. package/dist/game/player-turn.js +3 -3
  71. package/dist/game/player-turn.js.map +1 -1
  72. package/dist/game/project-cast.d.ts.map +1 -1
  73. package/dist/game/project-cast.js +9 -0
  74. package/dist/game/project-cast.js.map +1 -1
  75. package/dist/game/project-monster.d.ts +10 -0
  76. package/dist/game/project-monster.d.ts.map +1 -1
  77. package/dist/game/project-monster.js +11 -2
  78. package/dist/game/project-monster.js.map +1 -1
  79. package/dist/game/projection-handlers.d.ts +9 -1
  80. package/dist/game/projection-handlers.d.ts.map +1 -1
  81. package/dist/game/projection-handlers.js +9 -1
  82. package/dist/game/projection-handlers.js.map +1 -1
  83. package/dist/game/ranged-cmd.d.ts.map +1 -1
  84. package/dist/game/ranged-cmd.js +6 -2
  85. package/dist/game/ranged-cmd.js.map +1 -1
  86. package/dist/game/repeat.d.ts +38 -1
  87. package/dist/game/repeat.d.ts.map +1 -1
  88. package/dist/game/repeat.js +24 -1
  89. package/dist/game/repeat.js.map +1 -1
  90. package/dist/game/shape-inspect.d.ts +2 -2
  91. package/dist/game/shape-inspect.js +3 -3
  92. package/dist/game/spoil.js +1 -1
  93. package/dist/game/take-hit-hooks.d.ts.map +1 -1
  94. package/dist/game/take-hit-hooks.js +4 -12
  95. package/dist/game/take-hit-hooks.js.map +1 -1
  96. package/dist/game/target-loop.d.ts +13 -8
  97. package/dist/game/target-loop.d.ts.map +1 -1
  98. package/dist/game/target-loop.js +43 -14
  99. package/dist/game/target-loop.js.map +1 -1
  100. package/dist/game/ui-entry-registry.d.ts +124 -0
  101. package/dist/game/ui-entry-registry.d.ts.map +1 -0
  102. package/dist/game/ui-entry-registry.js +102 -0
  103. package/dist/game/ui-entry-registry.js.map +1 -0
  104. package/dist/game/ui-entry.d.ts +90 -20
  105. package/dist/game/ui-entry.d.ts.map +1 -1
  106. package/dist/game/ui-entry.js +510 -315
  107. package/dist/game/ui-entry.js.map +1 -1
  108. package/dist/game/wizard.d.ts +27 -23
  109. package/dist/game/wizard.d.ts.map +1 -1
  110. package/dist/game/wizard.js +38 -34
  111. package/dist/game/wizard.js.map +1 -1
  112. package/dist/gen/gen-monster.d.ts +4 -2
  113. package/dist/gen/gen-monster.d.ts.map +1 -1
  114. package/dist/gen/gen-monster.js +11 -8
  115. package/dist/gen/gen-monster.js.map +1 -1
  116. package/dist/gen/util.d.ts +1 -1
  117. package/dist/gen/util.d.ts.map +1 -1
  118. package/dist/index.d.ts +1 -0
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +4 -0
  121. package/dist/index.js.map +1 -1
  122. package/dist/mod/extension.d.ts +20 -0
  123. package/dist/mod/extension.d.ts.map +1 -1
  124. package/dist/mod/extension.js +12 -2
  125. package/dist/mod/extension.js.map +1 -1
  126. package/dist/mod/ids.d.ts +12 -0
  127. package/dist/mod/ids.d.ts.map +1 -1
  128. package/dist/mod/ids.js +119 -14
  129. package/dist/mod/ids.js.map +1 -1
  130. package/dist/mod/message-declarations.d.ts +132 -0
  131. package/dist/mod/message-declarations.d.ts.map +1 -0
  132. package/dist/mod/message-declarations.js +223 -0
  133. package/dist/mod/message-declarations.js.map +1 -0
  134. package/dist/mod/record-keys.d.ts +4 -3
  135. package/dist/mod/record-keys.d.ts.map +1 -1
  136. package/dist/mod/record-keys.js +4 -3
  137. package/dist/mod/record-keys.js.map +1 -1
  138. package/dist/mod/registry-host.d.ts +167 -1
  139. package/dist/mod/registry-host.d.ts.map +1 -1
  140. package/dist/mod/registry-host.js +95 -1
  141. package/dist/mod/registry-host.js.map +1 -1
  142. package/dist/mod/save-blocks.d.ts +8 -3
  143. package/dist/mod/save-blocks.d.ts.map +1 -1
  144. package/dist/mod/save-blocks.js +153 -14
  145. package/dist/mod/save-blocks.js.map +1 -1
  146. package/dist/mon/bind.d.ts +5 -0
  147. package/dist/mon/bind.d.ts.map +1 -1
  148. package/dist/mon/bind.js +12 -10
  149. package/dist/mon/bind.js.map +1 -1
  150. package/dist/mon/knowledge-groups.js +1 -1
  151. package/dist/mon/lore-describe.d.ts.map +1 -1
  152. package/dist/mon/lore-describe.js +3 -2
  153. package/dist/mon/lore-describe.js.map +1 -1
  154. package/dist/mon/lore-file.d.ts +4 -4
  155. package/dist/mon/lore-file.d.ts.map +1 -1
  156. package/dist/mon/lore-file.js +22 -12
  157. package/dist/mon/lore-file.js.map +1 -1
  158. package/dist/mon/lore.d.ts +6 -0
  159. package/dist/mon/lore.d.ts.map +1 -1
  160. package/dist/mon/lore.js +10 -3
  161. package/dist/mon/lore.js.map +1 -1
  162. package/dist/mon/predicate.d.ts.map +1 -1
  163. package/dist/mon/predicate.js +3 -2
  164. package/dist/mon/predicate.js.map +1 -1
  165. package/dist/mon/project-mon.d.ts +48 -4
  166. package/dist/mon/project-mon.d.ts.map +1 -1
  167. package/dist/mon/project-mon.js +47 -4
  168. package/dist/mon/project-mon.js.map +1 -1
  169. package/dist/mon/spell-declarations.d.ts +44 -0
  170. package/dist/mon/spell-declarations.d.ts.map +1 -0
  171. package/dist/mon/spell-declarations.js +57 -0
  172. package/dist/mon/spell-declarations.js.map +1 -0
  173. package/dist/mon/spell-registry.d.ts +136 -0
  174. package/dist/mon/spell-registry.d.ts.map +1 -0
  175. package/dist/mon/spell-registry.js +178 -0
  176. package/dist/mon/spell-registry.js.map +1 -0
  177. package/dist/mon/spell.js +2 -2
  178. package/dist/mon/spell.js.map +1 -1
  179. package/dist/mon/types.d.ts +12 -1
  180. package/dist/mon/types.d.ts.map +1 -1
  181. package/dist/mon/types.js +18 -1
  182. package/dist/mon/types.js.map +1 -1
  183. package/dist/msg.d.ts +26 -0
  184. package/dist/msg.d.ts.map +1 -1
  185. package/dist/msg.js +28 -1
  186. package/dist/msg.js.map +1 -1
  187. package/dist/obj/artifact-fake.d.ts +1 -1
  188. package/dist/obj/artifact-fake.js +1 -1
  189. package/dist/obj/artifact-known.d.ts +4 -4
  190. package/dist/obj/artifact-known.js +3 -3
  191. package/dist/obj/bind.d.ts +2 -2
  192. package/dist/obj/bind.d.ts.map +1 -1
  193. package/dist/obj/bind.js +5 -4
  194. package/dist/obj/bind.js.map +1 -1
  195. package/dist/obj/desc.d.ts +1 -1
  196. package/dist/obj/desc.js +1 -1
  197. package/dist/obj/fake-object.d.ts +2 -2
  198. package/dist/obj/fake-object.js +2 -2
  199. package/dist/obj/knowledge.d.ts +2 -2
  200. package/dist/obj/knowledge.js +2 -2
  201. package/dist/obj/make.d.ts +1 -1
  202. package/dist/obj/make.d.ts.map +1 -1
  203. package/dist/obj/make.js +3 -3
  204. package/dist/obj/make.js.map +1 -1
  205. package/dist/obj/object-info.d.ts +1 -1
  206. package/dist/obj/object-info.js +2 -2
  207. package/dist/obj/object-info.js.map +1 -1
  208. package/dist/obj/object.d.ts +12 -5
  209. package/dist/obj/object.d.ts.map +1 -1
  210. package/dist/obj/object.js +15 -6
  211. package/dist/obj/object.js.map +1 -1
  212. package/dist/obj/power.d.ts +2 -2
  213. package/dist/obj/power.js +4 -4
  214. package/dist/obj/power.js.map +1 -1
  215. package/dist/obj/randart-build.d.ts.map +1 -1
  216. package/dist/obj/randart-build.js +22 -46
  217. package/dist/obj/randart-build.js.map +1 -1
  218. package/dist/obj/randart-data.d.ts.map +1 -1
  219. package/dist/obj/randart-data.js +16 -33
  220. package/dist/obj/randart-data.js.map +1 -1
  221. package/dist/obj/types.d.ts +25 -0
  222. package/dist/obj/types.d.ts.map +1 -1
  223. package/dist/parser.d.ts +26 -46
  224. package/dist/parser.d.ts.map +1 -1
  225. package/dist/parser.js +26 -115
  226. package/dist/parser.js.map +1 -1
  227. package/dist/player/birth.d.ts +1 -1
  228. package/dist/player/birth.js +2 -2
  229. package/dist/player/options-file.d.ts +55 -29
  230. package/dist/player/options-file.d.ts.map +1 -1
  231. package/dist/player/options-file.js +125 -139
  232. package/dist/player/options-file.js.map +1 -1
  233. package/dist/player/options.d.ts +1 -1
  234. package/dist/player/options.js +1 -1
  235. package/dist/player/shape-lore.d.ts +1 -1
  236. package/dist/player/shape-lore.d.ts.map +1 -1
  237. package/dist/player/shape-lore.js +16 -13
  238. package/dist/player/shape-lore.js.map +1 -1
  239. package/dist/player/spell.d.ts.map +1 -1
  240. package/dist/player/spell.js +24 -2
  241. package/dist/player/spell.js.map +1 -1
  242. package/dist/score/display.d.ts.map +1 -1
  243. package/dist/score/display.js +39 -18
  244. package/dist/score/display.js.map +1 -1
  245. package/dist/score/score.d.ts +7 -7
  246. package/dist/score/score.js +3 -3
  247. package/dist/score/types.d.ts +51 -0
  248. package/dist/score/types.d.ts.map +1 -1
  249. package/dist/score/types.js.map +1 -1
  250. package/dist/session/boot.d.ts +2 -0
  251. package/dist/session/boot.d.ts.map +1 -1
  252. package/dist/session/boot.js +22 -0
  253. package/dist/session/boot.js.map +1 -1
  254. package/dist/session/game.d.ts.map +1 -1
  255. package/dist/session/game.js +113 -6
  256. package/dist/session/game.js.map +1 -1
  257. package/dist/session/save-migrate.d.ts +3 -3
  258. package/dist/session/save-migrate.d.ts.map +1 -1
  259. package/dist/session/save-migrate.js +429 -21
  260. package/dist/session/save-migrate.js.map +1 -1
  261. package/dist/session/save.d.ts +442 -28
  262. package/dist/session/save.d.ts.map +1 -1
  263. package/dist/session/save.js +691 -51
  264. package/dist/session/save.js.map +1 -1
  265. package/dist/sound/engine.d.ts +17 -0
  266. package/dist/sound/engine.d.ts.map +1 -1
  267. package/dist/sound/engine.js +55 -6
  268. package/dist/sound/engine.js.map +1 -1
  269. package/dist/sound/index.d.ts +2 -0
  270. package/dist/sound/index.d.ts.map +1 -1
  271. package/dist/sound/index.js +2 -0
  272. package/dist/sound/index.js.map +1 -1
  273. package/dist/sound/message-types.d.ts +89 -0
  274. package/dist/sound/message-types.d.ts.map +1 -0
  275. package/dist/sound/message-types.js +126 -0
  276. package/dist/sound/message-types.js.map +1 -0
  277. package/dist/sound/sound-registry.d.ts +93 -0
  278. package/dist/sound/sound-registry.d.ts.map +1 -0
  279. package/dist/sound/sound-registry.js +117 -0
  280. package/dist/sound/sound-registry.js.map +1 -0
  281. package/dist/store/store.d.ts +12 -11
  282. package/dist/store/store.d.ts.map +1 -1
  283. package/dist/store/store.js +16 -16
  284. package/dist/store/store.js.map +1 -1
  285. package/dist/store/transact.d.ts +25 -7
  286. package/dist/store/transact.d.ts.map +1 -1
  287. package/dist/store/transact.js +27 -9
  288. package/dist/store/transact.js.map +1 -1
  289. package/dist/version.d.ts +1 -1
  290. package/dist/version.js +1 -1
  291. package/dist/visuals/glyph-table.d.ts +2 -2
  292. package/dist/visuals/glyph-table.js +2 -2
  293. package/dist/visuals/hallucination.d.ts +140 -0
  294. package/dist/visuals/hallucination.d.ts.map +1 -0
  295. package/dist/visuals/hallucination.js +122 -0
  296. package/dist/visuals/hallucination.js.map +1 -0
  297. package/dist/visuals/index.d.ts +1 -0
  298. package/dist/visuals/index.d.ts.map +1 -1
  299. package/dist/visuals/index.js +1 -0
  300. package/dist/visuals/index.js.map +1 -1
  301. package/dist/visuals/map-text.d.ts +5 -4
  302. package/dist/visuals/map-text.d.ts.map +1 -1
  303. package/dist/visuals/map-text.js +5 -4
  304. package/dist/visuals/map-text.js.map +1 -1
  305. package/dist/visuals/object-glyph.d.ts +5 -0
  306. package/dist/visuals/object-glyph.d.ts.map +1 -1
  307. package/dist/visuals/object-glyph.js +7 -2
  308. package/dist/visuals/object-glyph.js.map +1 -1
  309. package/dist/visuals/prefs.d.ts +172 -17
  310. package/dist/visuals/prefs.d.ts.map +1 -1
  311. package/dist/visuals/prefs.js +221 -25
  312. package/dist/visuals/prefs.js.map +1 -1
  313. package/dist/world/trap.d.ts +1 -1
  314. package/package.json +1 -1
  315. package/src/cmd.ts +67 -3
  316. package/src/effects/effect-info.ts +1005 -1005
  317. package/src/game/context.ts +31 -0
  318. package/src/game/display.ts +144 -22
  319. package/src/game/dump-level.ts +1 -1
  320. package/src/game/effect-attack.ts +1 -2
  321. package/src/game/effect-general.ts +12 -11
  322. package/src/game/effect-item.ts +1080 -1075
  323. package/src/game/effect-teleport.ts +21 -12
  324. package/src/game/effect-terrain.ts +1 -1
  325. package/src/game/equip-cmp.ts +62 -32
  326. package/src/game/floor.ts +52 -0
  327. package/src/game/gear.ts +18 -4
  328. package/src/game/inscription-confirm.ts +15 -7
  329. package/src/game/known.ts +83 -12
  330. package/src/game/loop.ts +695 -695
  331. package/src/game/mon-cast.ts +8 -6
  332. package/src/game/mon-cmd.ts +4 -7
  333. package/src/game/mon-message.ts +0 -1
  334. package/src/game/mon-side.ts +4 -6
  335. package/src/game/monster-turn.ts +8 -4
  336. package/src/game/obj-cmd.ts +19 -2
  337. package/src/game/player-turn.ts +2 -3
  338. package/src/game/project-cast.ts +9 -0
  339. package/src/game/project-monster.ts +24 -3
  340. package/src/game/projection-handlers.ts +12 -1
  341. package/src/game/ranged-cmd.ts +5 -3
  342. package/src/game/repeat.ts +56 -1
  343. package/src/game/shape-inspect.ts +3 -3
  344. package/src/game/spoil.ts +1 -1
  345. package/src/game/take-hit-hooks.ts +4 -11
  346. package/src/game/target-loop.ts +44 -12
  347. package/src/game/ui-entry-registry.ts +159 -0
  348. package/src/game/ui-entry.ts +2528 -2222
  349. package/src/game/wizard.ts +39 -35
  350. package/src/gen/cave.ts +3057 -3057
  351. package/src/gen/gen-monster.ts +11 -8
  352. package/src/gen/generate.ts +576 -576
  353. package/src/gen/util.ts +1 -1
  354. package/src/index.ts +311 -307
  355. package/src/mod/extension.ts +37 -2
  356. package/src/mod/hooks.ts +521 -521
  357. package/src/mod/ids.ts +160 -13
  358. package/src/mod/message-declarations.ts +293 -0
  359. package/src/mod/record-keys.ts +4 -3
  360. package/src/mod/registry-host.ts +1274 -1009
  361. package/src/mod/save-blocks.ts +162 -15
  362. package/src/mon/bind.ts +14 -10
  363. package/src/mon/knowledge-groups.ts +1 -1
  364. package/src/mon/lore-describe.ts +3 -2
  365. package/src/mon/lore-file.ts +22 -12
  366. package/src/mon/lore.ts +10 -3
  367. package/src/mon/predicate.ts +3 -2
  368. package/src/mon/project-mon.ts +65 -4
  369. package/src/mon/spell-declarations.ts +80 -0
  370. package/src/mon/spell-registry.ts +221 -0
  371. package/src/mon/spell.ts +2 -2
  372. package/src/mon/types.ts +27 -1
  373. package/src/msg.ts +29 -1
  374. package/src/obj/artifact-fake.ts +1 -1
  375. package/src/obj/artifact-known.ts +4 -4
  376. package/src/obj/bind.ts +4 -4
  377. package/src/obj/desc.ts +1 -1
  378. package/src/obj/fake-object.ts +2 -2
  379. package/src/obj/knowledge.ts +2 -2
  380. package/src/obj/make.ts +3 -2
  381. package/src/obj/object-info.ts +2 -2
  382. package/src/obj/object.ts +15 -6
  383. package/src/obj/power.ts +4 -4
  384. package/src/obj/randart-build.ts +1847 -1875
  385. package/src/obj/randart-data.ts +1519 -1547
  386. package/src/obj/randart-registry.ts +247 -247
  387. package/src/obj/randart-vectors.ts +369 -369
  388. package/src/obj/randart.ts +722 -722
  389. package/src/obj/types.ts +22 -0
  390. package/src/parser.ts +26 -115
  391. package/src/player/birth.ts +2 -2
  392. package/src/player/options-file.ts +128 -164
  393. package/src/player/options.ts +1 -1
  394. package/src/player/shape-lore.ts +16 -13
  395. package/src/player/spell.ts +31 -2
  396. package/src/score/display.ts +38 -17
  397. package/src/score/score.ts +8 -8
  398. package/src/score/types.ts +52 -0
  399. package/src/session/boot.ts +50 -0
  400. package/src/session/game.ts +117 -6
  401. package/src/session/save-migrate.ts +517 -22
  402. package/src/session/save.ts +917 -74
  403. package/src/sound/engine.ts +59 -4
  404. package/src/sound/index.ts +2 -0
  405. package/src/sound/message-types.ts +164 -0
  406. package/src/sound/sound-registry.ts +149 -0
  407. package/src/store/store.ts +21 -19
  408. package/src/store/transact.ts +30 -12
  409. package/src/version.ts +1 -1
  410. package/src/visuals/glyph-table.ts +2 -2
  411. package/src/visuals/hallucination.ts +200 -0
  412. package/src/visuals/index.ts +1 -0
  413. package/src/visuals/map-text.ts +5 -4
  414. package/src/visuals/object-glyph.ts +7 -2
  415. package/src/visuals/prefs.ts +1236 -971
  416. package/src/visuals/tile-prefs.ts +215 -215
  417. package/src/world/trap.ts +1 -1
@@ -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
@@ -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
- let xp = player.exp;
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
- const magic = player.cls.magic;
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
- { key: "exp", runs: expRuns(player) },
683
- { key: "gold", runs: goldRuns(player) },
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
- { key: "ac", runs: acRuns(state) },
691
- { key: "hp", runs: hpRuns(player, d) },
692
- { key: "sp", runs: spRuns(player, d) },
693
- { key: "health", runs: healthRuns(player, d) },
694
- { key: "speed", runs: speedRuns(state, d) },
695
- { key: "depth", runs: depthRuns(state) },
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
- { key: "level_feeling", runs: levelFeelingRuns(state, d) },
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) },
@@ -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:1112) and wiz-stats' disconnect
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, MSG, PROJ, TMD } from "../generated/index.js";
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, MSG, OF, PROJ, TMD } from "../generated/index.js";
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 supplies msgt's message half; the sound half is state.sound at the
156
- * call site (this helper has no state).
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 (effect-handler-
766
- * general.c L1166), counted down by process_world. The target increment is
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:3634) */
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:3646) */
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],