@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.
Files changed (848) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/perceive.d.ts.map +1 -1
  3. package/dist/agent/perceive.js +2 -2
  4. package/dist/agent/perceive.js.map +1 -1
  5. package/dist/combat/blow-vectors.d.ts +78 -0
  6. package/dist/combat/blow-vectors.d.ts.map +1 -0
  7. package/dist/combat/blow-vectors.fixtures.d.ts +19 -0
  8. package/dist/combat/blow-vectors.fixtures.d.ts.map +1 -0
  9. package/dist/combat/blow-vectors.fixtures.js +81 -0
  10. package/dist/combat/blow-vectors.fixtures.js.map +1 -0
  11. package/dist/combat/blow-vectors.js +195 -0
  12. package/dist/combat/blow-vectors.js.map +1 -0
  13. package/dist/combat/brand-slay.d.ts +22 -9
  14. package/dist/combat/brand-slay.d.ts.map +1 -1
  15. package/dist/combat/brand-slay.js +37 -10
  16. package/dist/combat/brand-slay.js.map +1 -1
  17. package/dist/combat/index.d.ts +1 -1
  18. package/dist/combat/index.js +1 -1
  19. package/dist/combat/melee.d.ts +25 -13
  20. package/dist/combat/melee.d.ts.map +1 -1
  21. package/dist/combat/melee.js +23 -19
  22. package/dist/combat/melee.js.map +1 -1
  23. package/dist/combat/mon-melee.d.ts +166 -7
  24. package/dist/combat/mon-melee.d.ts.map +1 -1
  25. package/dist/combat/mon-melee.js +469 -338
  26. package/dist/combat/mon-melee.js.map +1 -1
  27. package/dist/combat/ranged.d.ts +15 -13
  28. package/dist/combat/ranged.d.ts.map +1 -1
  29. package/dist/combat/ranged.js +31 -29
  30. package/dist/combat/ranged.js.map +1 -1
  31. package/dist/constants.d.ts +14 -0
  32. package/dist/constants.d.ts.map +1 -1
  33. package/dist/constants.js +14 -0
  34. package/dist/constants.js.map +1 -1
  35. package/dist/datafile.d.ts +48 -0
  36. package/dist/datafile.d.ts.map +1 -0
  37. package/dist/datafile.js +102 -0
  38. package/dist/datafile.js.map +1 -0
  39. package/dist/effects/effect-info-registry.d.ts +237 -0
  40. package/dist/effects/effect-info-registry.d.ts.map +1 -0
  41. package/dist/effects/effect-info-registry.js +138 -0
  42. package/dist/effects/effect-info-registry.js.map +1 -0
  43. package/dist/effects/effect-info-vectors.d.ts +92 -0
  44. package/dist/effects/effect-info-vectors.d.ts.map +1 -0
  45. package/dist/effects/effect-info-vectors.fixtures.d.ts +18 -0
  46. package/dist/effects/effect-info-vectors.fixtures.d.ts.map +1 -0
  47. package/dist/effects/effect-info-vectors.fixtures.js +51 -0
  48. package/dist/effects/effect-info-vectors.fixtures.js.map +1 -0
  49. package/dist/effects/effect-info-vectors.js +315 -0
  50. package/dist/effects/effect-info-vectors.js.map +1 -0
  51. package/dist/effects/effect-info.d.ts +5 -1
  52. package/dist/effects/effect-info.d.ts.map +1 -1
  53. package/dist/effects/effect-info.js +245 -143
  54. package/dist/effects/effect-info.js.map +1 -1
  55. package/dist/effects/effect.d.ts +4 -3
  56. package/dist/effects/effect.d.ts.map +1 -1
  57. package/dist/effects/effect.js +88 -70
  58. package/dist/effects/effect.js.map +1 -1
  59. package/dist/effects/handlers.d.ts +1 -1
  60. package/dist/effects/handlers.d.ts.map +1 -1
  61. package/dist/effects/handlers.js +5 -2
  62. package/dist/effects/handlers.js.map +1 -1
  63. package/dist/effects/interpreter.d.ts +11 -0
  64. package/dist/effects/interpreter.d.ts.map +1 -1
  65. package/dist/effects/interpreter.js +13 -0
  66. package/dist/effects/interpreter.js.map +1 -1
  67. package/dist/game/cave-cmd.d.ts +9 -5
  68. package/dist/game/cave-cmd.d.ts.map +1 -1
  69. package/dist/game/cave-cmd.js +56 -11
  70. package/dist/game/cave-cmd.js.map +1 -1
  71. package/dist/game/cave-square.d.ts +42 -0
  72. package/dist/game/cave-square.d.ts.map +1 -0
  73. package/dist/game/cave-square.js +73 -0
  74. package/dist/game/cave-square.js.map +1 -0
  75. package/dist/game/char-sheet.d.ts +12 -8
  76. package/dist/game/char-sheet.d.ts.map +1 -1
  77. package/dist/game/char-sheet.js +41 -8
  78. package/dist/game/char-sheet.js.map +1 -1
  79. package/dist/game/chest.d.ts +2 -3
  80. package/dist/game/chest.d.ts.map +1 -1
  81. package/dist/game/chest.js +17 -6
  82. package/dist/game/chest.js.map +1 -1
  83. package/dist/game/context.d.ts +213 -22
  84. package/dist/game/context.d.ts.map +1 -1
  85. package/dist/game/context.js +109 -17
  86. package/dist/game/context.js.map +1 -1
  87. package/dist/game/describe.d.ts +13 -0
  88. package/dist/game/describe.d.ts.map +1 -1
  89. package/dist/game/describe.js +32 -4
  90. package/dist/game/describe.js.map +1 -1
  91. package/dist/game/display.d.ts +97 -8
  92. package/dist/game/display.d.ts.map +1 -1
  93. package/dist/game/display.js +157 -13
  94. package/dist/game/display.js.map +1 -1
  95. package/dist/game/dump-level.d.ts.map +1 -1
  96. package/dist/game/dump-level.js +3 -2
  97. package/dist/game/dump-level.js.map +1 -1
  98. package/dist/game/effect-attack.d.ts.map +1 -1
  99. package/dist/game/effect-attack.js +36 -27
  100. package/dist/game/effect-attack.js.map +1 -1
  101. package/dist/game/effect-detect.d.ts +4 -4
  102. package/dist/game/effect-detect.d.ts.map +1 -1
  103. package/dist/game/effect-detect.js +42 -9
  104. package/dist/game/effect-detect.js.map +1 -1
  105. package/dist/game/effect-env.d.ts +7 -1
  106. package/dist/game/effect-env.d.ts.map +1 -1
  107. package/dist/game/effect-env.js +1 -0
  108. package/dist/game/effect-env.js.map +1 -1
  109. package/dist/game/effect-general.d.ts +5 -3
  110. package/dist/game/effect-general.d.ts.map +1 -1
  111. package/dist/game/effect-general.js +94 -43
  112. package/dist/game/effect-general.js.map +1 -1
  113. package/dist/game/effect-item.d.ts +2 -1
  114. package/dist/game/effect-item.d.ts.map +1 -1
  115. package/dist/game/effect-item.js +136 -82
  116. package/dist/game/effect-item.js.map +1 -1
  117. package/dist/game/effect-melee.d.ts +10 -4
  118. package/dist/game/effect-melee.d.ts.map +1 -1
  119. package/dist/game/effect-melee.js +44 -19
  120. package/dist/game/effect-melee.js.map +1 -1
  121. package/dist/game/effect-monster.d.ts +26 -4
  122. package/dist/game/effect-monster.d.ts.map +1 -1
  123. package/dist/game/effect-monster.js +52 -9
  124. package/dist/game/effect-monster.js.map +1 -1
  125. package/dist/game/effect-teleport.d.ts +58 -19
  126. package/dist/game/effect-teleport.d.ts.map +1 -1
  127. package/dist/game/effect-teleport.js +143 -27
  128. package/dist/game/effect-teleport.js.map +1 -1
  129. package/dist/game/effect-terrain.d.ts +1 -3
  130. package/dist/game/effect-terrain.d.ts.map +1 -1
  131. package/dist/game/effect-terrain.js +38 -22
  132. package/dist/game/effect-terrain.js.map +1 -1
  133. package/dist/game/equip-cmp.d.ts.map +1 -1
  134. package/dist/game/equip-cmp.js +10 -7
  135. package/dist/game/equip-cmp.js.map +1 -1
  136. package/dist/game/floor.d.ts +16 -4
  137. package/dist/game/floor.d.ts.map +1 -1
  138. package/dist/game/floor.js +22 -4
  139. package/dist/game/floor.js.map +1 -1
  140. package/dist/game/gear.d.ts +101 -13
  141. package/dist/game/gear.d.ts.map +1 -1
  142. package/dist/game/gear.js +183 -24
  143. package/dist/game/gear.js.map +1 -1
  144. package/dist/game/harness.d.ts +2 -1
  145. package/dist/game/harness.d.ts.map +1 -1
  146. package/dist/game/harness.js +12 -1
  147. package/dist/game/harness.js.map +1 -1
  148. package/dist/game/ignore-cmd.d.ts +47 -8
  149. package/dist/game/ignore-cmd.d.ts.map +1 -1
  150. package/dist/game/ignore-cmd.js +76 -8
  151. package/dist/game/ignore-cmd.js.map +1 -1
  152. package/dist/game/known.d.ts +223 -34
  153. package/dist/game/known.d.ts.map +1 -1
  154. package/dist/game/known.js +301 -67
  155. package/dist/game/known.js.map +1 -1
  156. package/dist/game/loop.d.ts +4 -3
  157. package/dist/game/loop.d.ts.map +1 -1
  158. package/dist/game/loop.js +49 -29
  159. package/dist/game/loop.js.map +1 -1
  160. package/dist/game/lore-color.d.ts.map +1 -1
  161. package/dist/game/lore-color.js +13 -1
  162. package/dist/game/lore-color.js.map +1 -1
  163. package/dist/game/mon-cast.d.ts +3 -4
  164. package/dist/game/mon-cast.d.ts.map +1 -1
  165. package/dist/game/mon-cast.js +30 -2
  166. package/dist/game/mon-cast.js.map +1 -1
  167. package/dist/game/mon-cmd.d.ts +4 -5
  168. package/dist/game/mon-cmd.d.ts.map +1 -1
  169. package/dist/game/mon-cmd.js +80 -27
  170. package/dist/game/mon-cmd.js.map +1 -1
  171. package/dist/game/mon-death.d.ts +8 -4
  172. package/dist/game/mon-death.d.ts.map +1 -1
  173. package/dist/game/mon-death.js +6 -9
  174. package/dist/game/mon-death.js.map +1 -1
  175. package/dist/game/mon-group.d.ts +9 -5
  176. package/dist/game/mon-group.d.ts.map +1 -1
  177. package/dist/game/mon-group.js +9 -5
  178. package/dist/game/mon-group.js.map +1 -1
  179. package/dist/game/mon-message.d.ts +90 -40
  180. package/dist/game/mon-message.d.ts.map +1 -1
  181. package/dist/game/mon-message.js +267 -59
  182. package/dist/game/mon-message.js.map +1 -1
  183. package/dist/game/mon-place.d.ts +11 -1
  184. package/dist/game/mon-place.d.ts.map +1 -1
  185. package/dist/game/mon-place.js +15 -3
  186. package/dist/game/mon-place.js.map +1 -1
  187. package/dist/game/mon-ranged.d.ts +2 -1
  188. package/dist/game/mon-ranged.d.ts.map +1 -1
  189. package/dist/game/mon-ranged.js +11 -5
  190. package/dist/game/mon-ranged.js.map +1 -1
  191. package/dist/game/mon-side.d.ts +3 -2
  192. package/dist/game/mon-side.d.ts.map +1 -1
  193. package/dist/game/mon-side.js +15 -14
  194. package/dist/game/mon-side.js.map +1 -1
  195. package/dist/game/monster-turn.d.ts +20 -10
  196. package/dist/game/monster-turn.d.ts.map +1 -1
  197. package/dist/game/monster-turn.js +110 -83
  198. package/dist/game/monster-turn.js.map +1 -1
  199. package/dist/game/notice.d.ts +36 -0
  200. package/dist/game/notice.d.ts.map +1 -0
  201. package/dist/game/notice.js +79 -0
  202. package/dist/game/notice.js.map +1 -0
  203. package/dist/game/obj-cmd.d.ts +14 -3
  204. package/dist/game/obj-cmd.d.ts.map +1 -1
  205. package/dist/game/obj-cmd.js +109 -35
  206. package/dist/game/obj-cmd.js.map +1 -1
  207. package/dist/game/obj-list.d.ts +13 -2
  208. package/dist/game/obj-list.d.ts.map +1 -1
  209. package/dist/game/obj-list.js +42 -27
  210. package/dist/game/obj-list.js.map +1 -1
  211. package/dist/game/object-inspect.d.ts +9 -0
  212. package/dist/game/object-inspect.d.ts.map +1 -1
  213. package/dist/game/object-inspect.js +4 -0
  214. package/dist/game/object-inspect.js.map +1 -1
  215. package/dist/game/pickup.d.ts +0 -2
  216. package/dist/game/pickup.d.ts.map +1 -1
  217. package/dist/game/pickup.js +18 -3
  218. package/dist/game/pickup.js.map +1 -1
  219. package/dist/game/player-side-vectors.d.ts +174 -0
  220. package/dist/game/player-side-vectors.d.ts.map +1 -0
  221. package/dist/game/player-side-vectors.fixtures.d.ts +33 -0
  222. package/dist/game/player-side-vectors.fixtures.d.ts.map +1 -0
  223. package/dist/game/player-side-vectors.fixtures.js +191 -0
  224. package/dist/game/player-side-vectors.fixtures.js.map +1 -0
  225. package/dist/game/player-side-vectors.js +292 -0
  226. package/dist/game/player-side-vectors.js.map +1 -0
  227. package/dist/game/player-side.d.ts +129 -1
  228. package/dist/game/player-side.d.ts.map +1 -1
  229. package/dist/game/player-side.js +520 -338
  230. package/dist/game/player-side.js.map +1 -1
  231. package/dist/game/player-turn.d.ts +26 -7
  232. package/dist/game/player-turn.d.ts.map +1 -1
  233. package/dist/game/player-turn.js +180 -33
  234. package/dist/game/player-turn.js.map +1 -1
  235. package/dist/game/poly.d.ts +38 -0
  236. package/dist/game/poly.d.ts.map +1 -0
  237. package/dist/game/poly.js +82 -0
  238. package/dist/game/poly.js.map +1 -0
  239. package/dist/game/project-cast.d.ts +20 -3
  240. package/dist/game/project-cast.d.ts.map +1 -1
  241. package/dist/game/project-cast.js +49 -6
  242. package/dist/game/project-cast.js.map +1 -1
  243. package/dist/game/project-feat-vectors.d.ts +124 -0
  244. package/dist/game/project-feat-vectors.d.ts.map +1 -0
  245. package/dist/game/project-feat-vectors.fixtures.d.ts +13 -0
  246. package/dist/game/project-feat-vectors.fixtures.d.ts.map +1 -0
  247. package/dist/game/project-feat-vectors.fixtures.js +94 -0
  248. package/dist/game/project-feat-vectors.fixtures.js.map +1 -0
  249. package/dist/game/project-feat-vectors.js +229 -0
  250. package/dist/game/project-feat-vectors.js.map +1 -0
  251. package/dist/game/project-feat.d.ts +53 -1
  252. package/dist/game/project-feat.d.ts.map +1 -1
  253. package/dist/game/project-feat.js +374 -247
  254. package/dist/game/project-feat.js.map +1 -1
  255. package/dist/game/project-monster.d.ts +21 -8
  256. package/dist/game/project-monster.d.ts.map +1 -1
  257. package/dist/game/project-monster.js +45 -21
  258. package/dist/game/project-monster.js.map +1 -1
  259. package/dist/game/project-obj.d.ts +62 -0
  260. package/dist/game/project-obj.d.ts.map +1 -1
  261. package/dist/game/project-obj.js +72 -41
  262. package/dist/game/project-obj.js.map +1 -1
  263. package/dist/game/project-player.d.ts +8 -0
  264. package/dist/game/project-player.d.ts.map +1 -1
  265. package/dist/game/project-player.js.map +1 -1
  266. package/dist/game/projection-handlers.d.ts +81 -0
  267. package/dist/game/projection-handlers.d.ts.map +1 -0
  268. package/dist/game/projection-handlers.js +93 -0
  269. package/dist/game/projection-handlers.js.map +1 -0
  270. package/dist/game/quest.d.ts +23 -0
  271. package/dist/game/quest.d.ts.map +1 -1
  272. package/dist/game/quest.js +42 -0
  273. package/dist/game/quest.js.map +1 -1
  274. package/dist/game/ranged-cmd.d.ts +13 -2
  275. package/dist/game/ranged-cmd.d.ts.map +1 -1
  276. package/dist/game/ranged-cmd.js +32 -15
  277. package/dist/game/ranged-cmd.js.map +1 -1
  278. package/dist/game/repeat.d.ts +78 -0
  279. package/dist/game/repeat.d.ts.map +1 -0
  280. package/dist/game/repeat.js +88 -0
  281. package/dist/game/repeat.js.map +1 -0
  282. package/dist/game/shape-inspect.d.ts +74 -0
  283. package/dist/game/shape-inspect.d.ts.map +1 -0
  284. package/dist/game/shape-inspect.js +114 -0
  285. package/dist/game/shape-inspect.js.map +1 -0
  286. package/dist/game/spell-cmd.d.ts +15 -4
  287. package/dist/game/spell-cmd.d.ts.map +1 -1
  288. package/dist/game/spell-cmd.js +35 -6
  289. package/dist/game/spell-cmd.js.map +1 -1
  290. package/dist/game/spoil.d.ts.map +1 -1
  291. package/dist/game/spoil.js +89 -40
  292. package/dist/game/spoil.js.map +1 -1
  293. package/dist/game/steal.d.ts +3 -3
  294. package/dist/game/steal.d.ts.map +1 -1
  295. package/dist/game/steal.js +9 -4
  296. package/dist/game/steal.js.map +1 -1
  297. package/dist/game/target-loop.d.ts +10 -4
  298. package/dist/game/target-loop.d.ts.map +1 -1
  299. package/dist/game/target-loop.js +14 -8
  300. package/dist/game/target-loop.js.map +1 -1
  301. package/dist/game/target.d.ts +4 -4
  302. package/dist/game/target.d.ts.map +1 -1
  303. package/dist/game/target.js +19 -8
  304. package/dist/game/target.js.map +1 -1
  305. package/dist/game/ui-entry.d.ts +63 -4
  306. package/dist/game/ui-entry.d.ts.map +1 -1
  307. package/dist/game/ui-entry.js +151 -23
  308. package/dist/game/ui-entry.js.map +1 -1
  309. package/dist/game/wizard.d.ts +23 -5
  310. package/dist/game/wizard.d.ts.map +1 -1
  311. package/dist/game/wizard.js +93 -11
  312. package/dist/game/wizard.js.map +1 -1
  313. package/dist/game/world.d.ts.map +1 -1
  314. package/dist/game/world.js +6 -0
  315. package/dist/game/world.js.map +1 -1
  316. package/dist/gen/cave.d.ts +49 -8
  317. package/dist/gen/cave.d.ts.map +1 -1
  318. package/dist/gen/cave.js +200 -28
  319. package/dist/gen/cave.js.map +1 -1
  320. package/dist/gen/generate.d.ts +54 -9
  321. package/dist/gen/generate.d.ts.map +1 -1
  322. package/dist/gen/generate.js +55 -8
  323. package/dist/gen/generate.js.map +1 -1
  324. package/dist/gen/glyph-vectors.d.ts +109 -0
  325. package/dist/gen/glyph-vectors.d.ts.map +1 -0
  326. package/dist/gen/glyph-vectors.fixtures.d.ts +18 -0
  327. package/dist/gen/glyph-vectors.fixtures.d.ts.map +1 -0
  328. package/dist/gen/glyph-vectors.fixtures.js +94 -0
  329. package/dist/gen/glyph-vectors.fixtures.js.map +1 -0
  330. package/dist/gen/glyph-vectors.js +218 -0
  331. package/dist/gen/glyph-vectors.js.map +1 -0
  332. package/dist/gen/glyph.d.ts +104 -0
  333. package/dist/gen/glyph.d.ts.map +1 -0
  334. package/dist/gen/glyph.js +72 -0
  335. package/dist/gen/glyph.js.map +1 -0
  336. package/dist/gen/room.d.ts +26 -2
  337. package/dist/gen/room.d.ts.map +1 -1
  338. package/dist/gen/room.js +414 -264
  339. package/dist/gen/room.js.map +1 -1
  340. package/dist/gen/util.d.ts +11 -2
  341. package/dist/gen/util.d.ts.map +1 -1
  342. package/dist/gen/util.js +31 -9
  343. package/dist/gen/util.js.map +1 -1
  344. package/dist/i18n/i18n.d.ts +207 -0
  345. package/dist/i18n/i18n.d.ts.map +1 -0
  346. package/dist/i18n/i18n.js +405 -0
  347. package/dist/i18n/i18n.js.map +1 -0
  348. package/dist/i18n/text.d.ts +62 -0
  349. package/dist/i18n/text.d.ts.map +1 -0
  350. package/dist/i18n/text.js +120 -0
  351. package/dist/i18n/text.js.map +1 -0
  352. package/dist/index.d.ts +25 -0
  353. package/dist/index.d.ts.map +1 -1
  354. package/dist/index.js +38 -0
  355. package/dist/index.js.map +1 -1
  356. package/dist/mod/extension.d.ts +115 -0
  357. package/dist/mod/extension.d.ts.map +1 -0
  358. package/dist/mod/extension.js +85 -0
  359. package/dist/mod/extension.js.map +1 -0
  360. package/dist/mod/ids.d.ts +10 -0
  361. package/dist/mod/ids.d.ts.map +1 -1
  362. package/dist/mod/ids.js +90 -21
  363. package/dist/mod/ids.js.map +1 -1
  364. package/dist/mod/record-keys.d.ts +43 -0
  365. package/dist/mod/record-keys.d.ts.map +1 -0
  366. package/dist/mod/record-keys.js +100 -0
  367. package/dist/mod/record-keys.js.map +1 -0
  368. package/dist/mod/registry-host.d.ts +472 -0
  369. package/dist/mod/registry-host.d.ts.map +1 -1
  370. package/dist/mod/registry-host.js +313 -0
  371. package/dist/mod/registry-host.js.map +1 -1
  372. package/dist/mod/save-blocks.d.ts +1 -1
  373. package/dist/mon/bind.d.ts.map +1 -1
  374. package/dist/mon/bind.js +6 -3
  375. package/dist/mon/bind.js.map +1 -1
  376. package/dist/mon/knowledge-groups.d.ts +0 -6
  377. package/dist/mon/knowledge-groups.d.ts.map +1 -1
  378. package/dist/mon/knowledge-groups.js +12 -8
  379. package/dist/mon/knowledge-groups.js.map +1 -1
  380. package/dist/mon/lore-describe.d.ts +46 -10
  381. package/dist/mon/lore-describe.d.ts.map +1 -1
  382. package/dist/mon/lore-describe.js +74 -22
  383. package/dist/mon/lore-describe.js.map +1 -1
  384. package/dist/mon/lore-file.d.ts +126 -0
  385. package/dist/mon/lore-file.d.ts.map +1 -0
  386. package/dist/mon/lore-file.js +291 -0
  387. package/dist/mon/lore-file.js.map +1 -0
  388. package/dist/mon/lore.d.ts +9 -3
  389. package/dist/mon/lore.d.ts.map +1 -1
  390. package/dist/mon/lore.js +9 -3
  391. package/dist/mon/lore.js.map +1 -1
  392. package/dist/mon/make.d.ts +4 -2
  393. package/dist/mon/make.d.ts.map +1 -1
  394. package/dist/mon/make.js +4 -2
  395. package/dist/mon/make.js.map +1 -1
  396. package/dist/mon/monster.d.ts +1 -1
  397. package/dist/mon/monster.js +1 -1
  398. package/dist/mon/predicate.d.ts +14 -9
  399. package/dist/mon/predicate.d.ts.map +1 -1
  400. package/dist/mon/predicate.js +14 -9
  401. package/dist/mon/predicate.js.map +1 -1
  402. package/dist/mon/project-mon.d.ts +16 -3
  403. package/dist/mon/project-mon.d.ts.map +1 -1
  404. package/dist/mon/project-mon.js +14 -5
  405. package/dist/mon/project-mon.js.map +1 -1
  406. package/dist/mon/steal.d.ts +31 -4
  407. package/dist/mon/steal.d.ts.map +1 -1
  408. package/dist/mon/steal.js +20 -7
  409. package/dist/mon/steal.js.map +1 -1
  410. package/dist/mon/take-hit.d.ts +8 -3
  411. package/dist/mon/take-hit.d.ts.map +1 -1
  412. package/dist/mon/take-hit.js +8 -3
  413. package/dist/mon/take-hit.js.map +1 -1
  414. package/dist/mon/timed.d.ts +15 -9
  415. package/dist/mon/timed.d.ts.map +1 -1
  416. package/dist/mon/timed.js +13 -8
  417. package/dist/mon/timed.js.map +1 -1
  418. package/dist/mon/types.d.ts +11 -4
  419. package/dist/mon/types.d.ts.map +1 -1
  420. package/dist/mon/types.js.map +1 -1
  421. package/dist/msg.d.ts +40 -1
  422. package/dist/msg.d.ts.map +1 -1
  423. package/dist/msg.js +42 -1
  424. package/dist/msg.js.map +1 -1
  425. package/dist/obj/artifact-fake.d.ts +46 -14
  426. package/dist/obj/artifact-fake.d.ts.map +1 -1
  427. package/dist/obj/artifact-fake.js +46 -17
  428. package/dist/obj/artifact-fake.js.map +1 -1
  429. package/dist/obj/bind.d.ts +23 -0
  430. package/dist/obj/bind.d.ts.map +1 -1
  431. package/dist/obj/bind.js +49 -9
  432. package/dist/obj/bind.js.map +1 -1
  433. package/dist/obj/desc-vectors.d.ts +68 -0
  434. package/dist/obj/desc-vectors.d.ts.map +1 -0
  435. package/dist/obj/desc-vectors.fixtures.d.ts +12 -0
  436. package/dist/obj/desc-vectors.fixtures.d.ts.map +1 -0
  437. package/dist/obj/desc-vectors.fixtures.js +95 -0
  438. package/dist/obj/desc-vectors.fixtures.js.map +1 -0
  439. package/dist/obj/desc-vectors.js +86 -0
  440. package/dist/obj/desc-vectors.js.map +1 -0
  441. package/dist/obj/desc.d.ts +17 -2
  442. package/dist/obj/desc.d.ts.map +1 -1
  443. package/dist/obj/desc.js +129 -54
  444. package/dist/obj/desc.js.map +1 -1
  445. package/dist/obj/effects-info.d.ts.map +1 -1
  446. package/dist/obj/effects-info.js +87 -58
  447. package/dist/obj/effects-info.js.map +1 -1
  448. package/dist/obj/fake-object.d.ts +70 -0
  449. package/dist/obj/fake-object.d.ts.map +1 -0
  450. package/dist/obj/fake-object.js +104 -0
  451. package/dist/obj/fake-object.js.map +1 -0
  452. package/dist/obj/ignore.d.ts +55 -12
  453. package/dist/obj/ignore.d.ts.map +1 -1
  454. package/dist/obj/ignore.js +68 -31
  455. package/dist/obj/ignore.js.map +1 -1
  456. package/dist/obj/knowledge.d.ts +46 -3
  457. package/dist/obj/knowledge.d.ts.map +1 -1
  458. package/dist/obj/knowledge.js +169 -151
  459. package/dist/obj/knowledge.js.map +1 -1
  460. package/dist/obj/known-object.d.ts +68 -8
  461. package/dist/obj/known-object.d.ts.map +1 -1
  462. package/dist/obj/known-object.js +90 -10
  463. package/dist/obj/known-object.js.map +1 -1
  464. package/dist/obj/make.d.ts +15 -4
  465. package/dist/obj/make.d.ts.map +1 -1
  466. package/dist/obj/make.js +49 -27
  467. package/dist/obj/make.js.map +1 -1
  468. package/dist/obj/object-info.d.ts +10 -0
  469. package/dist/obj/object-info.d.ts.map +1 -1
  470. package/dist/obj/object-info.js +93 -7
  471. package/dist/obj/object-info.js.map +1 -1
  472. package/dist/obj/object.d.ts +42 -4
  473. package/dist/obj/object.d.ts.map +1 -1
  474. package/dist/obj/object.js +362 -147
  475. package/dist/obj/object.js.map +1 -1
  476. package/dist/obj/power.d.ts +23 -4
  477. package/dist/obj/power.d.ts.map +1 -1
  478. package/dist/obj/power.js +231 -65
  479. package/dist/obj/power.js.map +1 -1
  480. package/dist/obj/randart-build.d.ts +27 -22
  481. package/dist/obj/randart-build.d.ts.map +1 -1
  482. package/dist/obj/randart-build.js +435 -357
  483. package/dist/obj/randart-build.js.map +1 -1
  484. package/dist/obj/randart-data.d.ts +62 -24
  485. package/dist/obj/randart-data.d.ts.map +1 -1
  486. package/dist/obj/randart-data.js +333 -189
  487. package/dist/obj/randart-data.js.map +1 -1
  488. package/dist/obj/randart-file.d.ts +21 -0
  489. package/dist/obj/randart-file.d.ts.map +1 -0
  490. package/dist/obj/randart-file.js +119 -0
  491. package/dist/obj/randart-file.js.map +1 -0
  492. package/dist/obj/randart-log.d.ts +63 -0
  493. package/dist/obj/randart-log.d.ts.map +1 -0
  494. package/dist/obj/randart-log.js +72 -0
  495. package/dist/obj/randart-log.js.map +1 -0
  496. package/dist/obj/randart-registry.d.ts +178 -0
  497. package/dist/obj/randart-registry.d.ts.map +1 -0
  498. package/dist/obj/randart-registry.js +140 -0
  499. package/dist/obj/randart-registry.js.map +1 -0
  500. package/dist/obj/randart-vectors.d.ts +97 -0
  501. package/dist/obj/randart-vectors.d.ts.map +1 -0
  502. package/dist/obj/randart-vectors.fixtures.d.ts +18 -0
  503. package/dist/obj/randart-vectors.fixtures.d.ts.map +1 -0
  504. package/dist/obj/randart-vectors.fixtures.js +50 -0
  505. package/dist/obj/randart-vectors.fixtures.js.map +1 -0
  506. package/dist/obj/randart-vectors.js +311 -0
  507. package/dist/obj/randart-vectors.js.map +1 -0
  508. package/dist/obj/randart.d.ts +53 -15
  509. package/dist/obj/randart.d.ts.map +1 -1
  510. package/dist/obj/randart.js +166 -44
  511. package/dist/obj/randart.js.map +1 -1
  512. package/dist/obj/rune-registry.d.ts +180 -0
  513. package/dist/obj/rune-registry.d.ts.map +1 -0
  514. package/dist/obj/rune-registry.js +161 -0
  515. package/dist/obj/rune-registry.js.map +1 -0
  516. package/dist/obj/rune-vectors.d.ts +99 -0
  517. package/dist/obj/rune-vectors.d.ts.map +1 -0
  518. package/dist/obj/rune-vectors.fixtures.d.ts +44 -0
  519. package/dist/obj/rune-vectors.fixtures.d.ts.map +1 -0
  520. package/dist/obj/rune-vectors.fixtures.js +125 -0
  521. package/dist/obj/rune-vectors.fixtures.js.map +1 -0
  522. package/dist/obj/rune-vectors.js +159 -0
  523. package/dist/obj/rune-vectors.js.map +1 -0
  524. package/dist/obj/tval-registry.d.ts +174 -0
  525. package/dist/obj/tval-registry.d.ts.map +1 -0
  526. package/dist/obj/tval-registry.js +151 -0
  527. package/dist/obj/tval-registry.js.map +1 -0
  528. package/dist/obj/tval-vectors.d.ts +85 -0
  529. package/dist/obj/tval-vectors.d.ts.map +1 -0
  530. package/dist/obj/tval-vectors.fixtures.d.ts +24 -0
  531. package/dist/obj/tval-vectors.fixtures.d.ts.map +1 -0
  532. package/dist/obj/tval-vectors.fixtures.js +41 -0
  533. package/dist/obj/tval-vectors.fixtures.js.map +1 -0
  534. package/dist/obj/tval-vectors.js +76 -0
  535. package/dist/obj/tval-vectors.js.map +1 -0
  536. package/dist/obj/types.d.ts +18 -7
  537. package/dist/obj/types.d.ts.map +1 -1
  538. package/dist/obj/types.js.map +1 -1
  539. package/dist/obj/value.d.ts.map +1 -1
  540. package/dist/obj/value.js +23 -20
  541. package/dist/obj/value.js.map +1 -1
  542. package/dist/parser.d.ts +116 -0
  543. package/dist/parser.d.ts.map +1 -0
  544. package/dist/parser.js +205 -0
  545. package/dist/parser.js.map +1 -0
  546. package/dist/player/bind.d.ts.map +1 -1
  547. package/dist/player/bind.js +3 -2
  548. package/dist/player/bind.js.map +1 -1
  549. package/dist/player/birth.d.ts +2 -1
  550. package/dist/player/birth.d.ts.map +1 -1
  551. package/dist/player/birth.js +2 -1
  552. package/dist/player/birth.js.map +1 -1
  553. package/dist/player/calcs.d.ts +58 -23
  554. package/dist/player/calcs.d.ts.map +1 -1
  555. package/dist/player/calcs.js +93 -36
  556. package/dist/player/calcs.js.map +1 -1
  557. package/dist/player/death.d.ts +50 -0
  558. package/dist/player/death.d.ts.map +1 -0
  559. package/dist/player/death.js +46 -0
  560. package/dist/player/death.js.map +1 -0
  561. package/dist/player/options-file.d.ts +129 -0
  562. package/dist/player/options-file.d.ts.map +1 -0
  563. package/dist/player/options-file.js +309 -0
  564. package/dist/player/options-file.js.map +1 -0
  565. package/dist/player/options.d.ts +2 -1
  566. package/dist/player/options.d.ts.map +1 -1
  567. package/dist/player/options.js +2 -1
  568. package/dist/player/options.js.map +1 -1
  569. package/dist/player/player.d.ts +50 -3
  570. package/dist/player/player.d.ts.map +1 -1
  571. package/dist/player/player.js +10 -1
  572. package/dist/player/player.js.map +1 -1
  573. package/dist/player/shape-lore.d.ts +11 -7
  574. package/dist/player/shape-lore.d.ts.map +1 -1
  575. package/dist/player/shape-lore.js +24 -11
  576. package/dist/player/shape-lore.js.map +1 -1
  577. package/dist/player/timed.d.ts +5 -3
  578. package/dist/player/timed.d.ts.map +1 -1
  579. package/dist/player/timed.js +11 -2
  580. package/dist/player/timed.js.map +1 -1
  581. package/dist/player/types.d.ts +29 -4
  582. package/dist/player/types.d.ts.map +1 -1
  583. package/dist/player/types.js +24 -1
  584. package/dist/player/types.js.map +1 -1
  585. package/dist/session/boot.d.ts +26 -2
  586. package/dist/session/boot.d.ts.map +1 -1
  587. package/dist/session/boot.js +21 -2
  588. package/dist/session/boot.js.map +1 -1
  589. package/dist/session/game.d.ts +15 -0
  590. package/dist/session/game.d.ts.map +1 -1
  591. package/dist/session/game.js +616 -140
  592. package/dist/session/game.js.map +1 -1
  593. package/dist/session/save-migrate.d.ts.map +1 -1
  594. package/dist/session/save-migrate.js +76 -1
  595. package/dist/session/save-migrate.js.map +1 -1
  596. package/dist/session/save.d.ts +75 -12
  597. package/dist/session/save.d.ts.map +1 -1
  598. package/dist/session/save.js +177 -18
  599. package/dist/session/save.js.map +1 -1
  600. package/dist/store/bind.d.ts +1 -1
  601. package/dist/store/bind.d.ts.map +1 -1
  602. package/dist/store/bind.js +4 -3
  603. package/dist/store/bind.js.map +1 -1
  604. package/dist/store/mass-produce-vectors.d.ts +40 -0
  605. package/dist/store/mass-produce-vectors.d.ts.map +1 -0
  606. package/dist/store/mass-produce-vectors.fixtures.d.ts +13 -0
  607. package/dist/store/mass-produce-vectors.fixtures.d.ts.map +1 -0
  608. package/dist/store/mass-produce-vectors.fixtures.js +52 -0
  609. package/dist/store/mass-produce-vectors.fixtures.js.map +1 -0
  610. package/dist/store/mass-produce-vectors.js +44 -0
  611. package/dist/store/mass-produce-vectors.js.map +1 -0
  612. package/dist/store/store.d.ts +104 -7
  613. package/dist/store/store.d.ts.map +1 -1
  614. package/dist/store/store.js +199 -77
  615. package/dist/store/store.js.map +1 -1
  616. package/dist/store/transact.d.ts +14 -5
  617. package/dist/store/transact.d.ts.map +1 -1
  618. package/dist/store/transact.js +17 -16
  619. package/dist/store/transact.js.map +1 -1
  620. package/dist/store/types.d.ts +3 -2
  621. package/dist/store/types.d.ts.map +1 -1
  622. package/dist/store/types.js +1 -1
  623. package/dist/version.d.ts +1 -1
  624. package/dist/version.js +1 -1
  625. package/dist/visuals/index.d.ts +1 -0
  626. package/dist/visuals/index.d.ts.map +1 -1
  627. package/dist/visuals/index.js +1 -0
  628. package/dist/visuals/index.js.map +1 -1
  629. package/dist/visuals/map-text.d.ts +8 -0
  630. package/dist/visuals/map-text.d.ts.map +1 -1
  631. package/dist/visuals/map-text.js +1 -1
  632. package/dist/visuals/map-text.js.map +1 -1
  633. package/dist/visuals/object-glyph.d.ts +56 -0
  634. package/dist/visuals/object-glyph.d.ts.map +1 -0
  635. package/dist/visuals/object-glyph.js +52 -0
  636. package/dist/visuals/object-glyph.js.map +1 -0
  637. package/dist/visuals/prefs.d.ts +14 -22
  638. package/dist/visuals/prefs.d.ts.map +1 -1
  639. package/dist/visuals/prefs.js +4 -23
  640. package/dist/visuals/prefs.js.map +1 -1
  641. package/dist/visuals/tile-prefs.d.ts +26 -0
  642. package/dist/visuals/tile-prefs.d.ts.map +1 -1
  643. package/dist/visuals/tile-prefs.js +28 -0
  644. package/dist/visuals/tile-prefs.js.map +1 -1
  645. package/dist/world/feature.d.ts +2 -1
  646. package/dist/world/feature.d.ts.map +1 -1
  647. package/dist/world/feature.js +2 -0
  648. package/dist/world/feature.js.map +1 -1
  649. package/dist/world/project.d.ts +10 -2
  650. package/dist/world/project.d.ts.map +1 -1
  651. package/dist/world/project.js +18 -6
  652. package/dist/world/project.js.map +1 -1
  653. package/dist/world/projection.d.ts +37 -3
  654. package/dist/world/projection.d.ts.map +1 -1
  655. package/dist/world/projection.js +69 -7
  656. package/dist/world/projection.js.map +1 -1
  657. package/dist/world/trap.d.ts +2 -1
  658. package/dist/world/trap.d.ts.map +1 -1
  659. package/dist/world/trap.js +2 -1
  660. package/dist/world/trap.js.map +1 -1
  661. package/dist/world/view.d.ts +1 -1
  662. package/dist/world/view.d.ts.map +1 -1
  663. package/dist/world/view.js +11 -3
  664. package/dist/world/view.js.map +1 -1
  665. package/package.json +1 -1
  666. package/src/agent/perceive.ts +2 -3
  667. package/src/combat/blow-vectors.fixtures.ts +99 -0
  668. package/src/combat/blow-vectors.json +482 -0
  669. package/src/combat/blow-vectors.ts +280 -0
  670. package/src/combat/brand-slay.ts +42 -11
  671. package/src/combat/index.ts +1 -1
  672. package/src/combat/melee.ts +37 -19
  673. package/src/combat/mon-melee.ts +611 -364
  674. package/src/combat/ranged.ts +43 -26
  675. package/src/constants.ts +15 -0
  676. package/src/datafile.ts +148 -0
  677. package/src/effects/effect-info-registry.ts +313 -0
  678. package/src/effects/effect-info-vectors.fixtures.ts +61 -0
  679. package/src/effects/effect-info-vectors.json +11532 -0
  680. package/src/effects/effect-info-vectors.ts +376 -0
  681. package/src/effects/effect-info.ts +1005 -859
  682. package/src/effects/effect.ts +96 -62
  683. package/src/effects/handlers.ts +5 -2
  684. package/src/effects/interpreter.ts +14 -0
  685. package/src/game/cave-cmd.ts +54 -11
  686. package/src/game/cave-square.ts +80 -0
  687. package/src/game/char-sheet.ts +59 -16
  688. package/src/game/chest.ts +25 -8
  689. package/src/game/context.ts +293 -27
  690. package/src/game/describe.ts +34 -4
  691. package/src/game/display.ts +215 -19
  692. package/src/game/dump-level.ts +3 -2
  693. package/src/game/effect-attack.ts +41 -28
  694. package/src/game/effect-detect.ts +45 -8
  695. package/src/game/effect-env.ts +8 -0
  696. package/src/game/effect-general.ts +110 -47
  697. package/src/game/effect-item.ts +1075 -999
  698. package/src/game/effect-melee.ts +51 -18
  699. package/src/game/effect-monster.ts +55 -9
  700. package/src/game/effect-teleport.ts +173 -38
  701. package/src/game/effect-terrain.ts +38 -22
  702. package/src/game/equip-cmp.ts +483 -480
  703. package/src/game/floor.ts +22 -4
  704. package/src/game/gear.ts +210 -21
  705. package/src/game/harness.ts +12 -1
  706. package/src/game/ignore-cmd.ts +96 -8
  707. package/src/game/known.ts +392 -73
  708. package/src/game/loop.ts +52 -27
  709. package/src/game/lore-color.ts +13 -1
  710. package/src/game/mon-cast.ts +31 -6
  711. package/src/game/mon-cmd.ts +95 -30
  712. package/src/game/mon-death.ts +14 -12
  713. package/src/game/mon-group.ts +9 -5
  714. package/src/game/mon-message.ts +363 -65
  715. package/src/game/mon-place.ts +15 -3
  716. package/src/game/mon-ranged.ts +14 -5
  717. package/src/game/mon-side.ts +16 -12
  718. package/src/game/monster-turn.ts +120 -87
  719. package/src/game/notice.ts +85 -0
  720. package/src/game/obj-cmd.ts +126 -37
  721. package/src/game/obj-list.ts +44 -26
  722. package/src/game/object-inspect.ts +13 -0
  723. package/src/game/pickup.ts +29 -5
  724. package/src/game/player-side-vectors.fixtures.ts +215 -0
  725. package/src/game/player-side-vectors.json +6914 -0
  726. package/src/game/player-side-vectors.ts +420 -0
  727. package/src/game/player-side.ts +622 -340
  728. package/src/game/player-turn.ts +228 -31
  729. package/src/game/poly.ts +107 -0
  730. package/src/game/project-cast.ts +63 -6
  731. package/src/game/project-feat-vectors.fixtures.ts +106 -0
  732. package/src/game/project-feat-vectors.json +6554 -0
  733. package/src/game/project-feat-vectors.ts +323 -0
  734. package/src/game/project-feat.ts +417 -248
  735. package/src/game/project-monster.ts +69 -30
  736. package/src/game/project-obj-vectors.json +1 -0
  737. package/src/game/project-obj.ts +115 -47
  738. package/src/game/project-player.ts +8 -0
  739. package/src/game/projection-handlers.ts +110 -0
  740. package/src/game/quest.ts +48 -0
  741. package/src/game/ranged-cmd.ts +45 -11
  742. package/src/game/repeat.ts +92 -0
  743. package/src/game/shape-inspect.ts +166 -0
  744. package/src/game/spell-cmd.ts +39 -6
  745. package/src/game/spoil.ts +92 -39
  746. package/src/game/steal.ts +9 -4
  747. package/src/game/target-loop.ts +14 -7
  748. package/src/game/target.ts +18 -7
  749. package/src/game/ui-entry.ts +172 -22
  750. package/src/game/wizard.ts +97 -10
  751. package/src/game/world.ts +6 -0
  752. package/src/gen/cave.ts +225 -26
  753. package/src/gen/generate.ts +62 -9
  754. package/src/gen/glyph-vectors.fixtures.ts +122 -0
  755. package/src/gen/glyph-vectors.json +5996 -0
  756. package/src/gen/glyph-vectors.ts +280 -0
  757. package/src/gen/glyph.ts +132 -0
  758. package/src/gen/room.ts +446 -265
  759. package/src/gen/util.ts +32 -9
  760. package/src/i18n/i18n.ts +492 -0
  761. package/src/i18n/text.ts +117 -0
  762. package/src/index.ts +307 -254
  763. package/src/mod/extension.ts +136 -0
  764. package/src/mod/ids.ts +92 -21
  765. package/src/mod/record-keys.ts +102 -0
  766. package/src/mod/registry-host.ts +1063 -234
  767. package/src/mon/bind.ts +14 -8
  768. package/src/mon/knowledge-groups.ts +12 -12
  769. package/src/mon/lore-describe.ts +93 -26
  770. package/src/mon/lore-file.ts +365 -0
  771. package/src/mon/lore.ts +9 -3
  772. package/src/mon/make.ts +4 -2
  773. package/src/mon/monster.ts +1 -1
  774. package/src/mon/predicate.ts +14 -9
  775. package/src/mon/project-mon.ts +23 -5
  776. package/src/mon/steal.ts +39 -7
  777. package/src/mon/take-hit.ts +8 -3
  778. package/src/mon/timed.ts +15 -9
  779. package/src/mon/types.ts +11 -4
  780. package/src/msg.ts +55 -1
  781. package/src/obj/artifact-fake.ts +47 -17
  782. package/src/obj/bind.ts +52 -9
  783. package/src/obj/desc-vectors.fixtures.ts +119 -0
  784. package/src/obj/desc-vectors.json +2360 -0
  785. package/src/obj/desc-vectors.ts +128 -0
  786. package/src/obj/desc.ts +159 -55
  787. package/src/obj/effects-info.ts +90 -59
  788. package/src/obj/fake-object.ts +135 -0
  789. package/src/obj/ignore.ts +95 -28
  790. package/src/obj/knowledge.ts +291 -139
  791. package/src/obj/known-object.ts +126 -11
  792. package/src/obj/make.ts +53 -29
  793. package/src/obj/object-info.ts +103 -6
  794. package/src/obj/object.ts +392 -151
  795. package/src/obj/power.ts +297 -59
  796. package/src/obj/randart-build.ts +1875 -1705
  797. package/src/obj/randart-data.ts +1547 -1344
  798. package/src/obj/randart-file.ts +130 -0
  799. package/src/obj/randart-log.ts +78 -0
  800. package/src/obj/randart-registry.ts +247 -0
  801. package/src/obj/randart-vectors.fixtures.ts +61 -0
  802. package/src/obj/randart-vectors.json +836 -0
  803. package/src/obj/randart-vectors.ts +369 -0
  804. package/src/obj/randart.ts +722 -552
  805. package/src/obj/rune-registry.ts +270 -0
  806. package/src/obj/rune-vectors.fixtures.ts +164 -0
  807. package/src/obj/rune-vectors.json +121 -0
  808. package/src/obj/rune-vectors.ts +229 -0
  809. package/src/obj/tval-kind-vectors.json +391 -0
  810. package/src/obj/tval-registry.ts +243 -0
  811. package/src/obj/tval-vectors.fixtures.ts +50 -0
  812. package/src/obj/tval-vectors.json +38 -0
  813. package/src/obj/tval-vectors.ts +126 -0
  814. package/src/obj/types.ts +18 -7
  815. package/src/obj/value.ts +26 -20
  816. package/src/parser.ts +214 -0
  817. package/src/player/bind.ts +5 -2
  818. package/src/player/birth.ts +2 -1
  819. package/src/player/calcs.ts +123 -42
  820. package/src/player/death.ts +78 -0
  821. package/src/player/options-file.ts +387 -0
  822. package/src/player/options.ts +2 -1
  823. package/src/player/player.ts +60 -4
  824. package/src/player/shape-lore.ts +33 -14
  825. package/src/player/timed.ts +14 -4
  826. package/src/player/types.ts +30 -4
  827. package/src/session/boot.ts +51 -1
  828. package/src/session/game.ts +720 -163
  829. package/src/session/save-migrate.ts +81 -1
  830. package/src/session/save.ts +264 -22
  831. package/src/store/bind.ts +4 -3
  832. package/src/store/mass-produce-vectors.fixtures.ts +64 -0
  833. package/src/store/mass-produce-vectors.json +1169 -0
  834. package/src/store/mass-produce-vectors.ts +67 -0
  835. package/src/store/store.ts +266 -63
  836. package/src/store/transact.ts +39 -16
  837. package/src/store/types.ts +3 -2
  838. package/src/version.ts +1 -1
  839. package/src/visuals/index.ts +1 -0
  840. package/src/visuals/map-text.ts +1 -1
  841. package/src/visuals/object-glyph.ts +76 -0
  842. package/src/visuals/prefs.ts +22 -32
  843. package/src/visuals/tile-prefs.ts +32 -0
  844. package/src/world/feature.ts +4 -1
  845. package/src/world/project.ts +19 -4
  846. package/src/world/projection.ts +79 -8
  847. package/src/world/trap.ts +25 -21
  848. 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
- * DEFERRED (ledgered in parity/ledger/game-project-feat.yaml):
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 { squareIsEmpty, squareIsPlayer, squareMonster } from "./context.js";
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
- dropNear(state, obj, 0, grid, false, false);
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
- * project_f: affect the terrain at `grid` (PROJECT_GRID). Returns whether
89
- * anything the player can see happened.
90
- */
91
- export function projectFeature(state, _r, grid, dam, typ, env = {}) {
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
- switch (typ) {
95
- case PROJ.LIGHT_WEAK:
96
- case PROJ.LIGHT: {
97
- /* Turn on the light. */
98
- c.sqinfoOn(grid, SQUARE.GLOW);
99
- if (squareIsView(c, grid)) {
100
- if ((state.actor.player.timed[TMD.BLIND] ?? 0) === 0)
101
- obvious = true;
102
- state.updateFov?.(state);
103
- }
104
- break;
105
- }
106
- case PROJ.DARK_WEAK:
107
- case PROJ.DARK: {
108
- /* Turn off the light, but NOT a naturally bright feature (lava) and NOT
109
- * a daylit surface grid (project-feat.c L73:
110
- * (depth != 0 || !is_daytime()) && !square_isbright). PR2. */
111
- const daylit = c.depth === 0 && isDaytime(state.turn, state.z.dayLength);
112
- if (!daylit && !featIsBright(c.features, c.feat(grid))) {
113
- c.sqinfoOff(grid, SQUARE.GLOW);
114
- }
115
- if (squareIsView(c, grid)) {
116
- obvious = true;
117
- state.updateFov?.(state);
118
- }
119
- break;
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
- case PROJ.KILL_WALL: {
122
- /* Non-walls (etc). */
123
- if (c.isPassable(grid) && !c.isRubble(grid))
124
- break;
125
- /* Permanent walls. */
126
- if (c.isPerm(grid))
127
- break;
128
- const seen = squareIsSeen(c, grid);
129
- if (c.isRubble(grid)) {
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?.("The wall turns into mud!");
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
- case PROJ.KILL_DOOR: {
193
- if (c.isDoor(grid)) {
194
- if (squareIsView(c, grid)) {
195
- env.msg?.("There is a bright flash of light!");
196
- obvious = true;
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
- case PROJ.KILL_TRAP: {
210
- /* Reveal secret doors. */
211
- if (squareIsSecretDoor(state, grid)) {
212
- c.setFeat(grid, FEAT.CLOSED);
213
- if (squareIsSeen(c, grid))
214
- obvious = true;
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
- case PROJ.MAKE_DOOR: {
242
- /* Require a floor grid without monsters or the player. */
243
- if (squareMonster(state, grid) || squareIsPlayer(state, grid))
244
- break;
245
- if (!c.isFloor(grid))
246
- break;
247
- /* Push objects off the grid, then create a closed door:
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
- case PROJ.MAKE_TRAP: {
257
- /* Require an empty floor grid with no existing traps. */
258
- if (!squareIsEmpty(state, grid))
259
- break;
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
- case PROJ.FIRE:
271
- case PROJ.PLASMA: {
272
- if (observed(state, grid))
273
- obvious = true;
274
- /* Fire removes webs. */
275
- if (typ === PROJ.FIRE && env.trapDeps) {
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
- case PROJ.COLD:
290
- case PROJ.ICE: {
291
- if (observed(state, grid))
292
- obvious = true;
293
- /* Sufficiently intense cold can solidify lava. */
294
- if (dam > state.rng.randint1(900) + 300 && c.isFiery(grid)) {
295
- /* square_isoccupied (cave-square.c:391): square->mon != 0, i.e. either
296
- * a monster (positive midx) or the player (-1). */
297
- const occupied = squareMonster(state, grid) !== null || squareIsPlayer(state, grid);
298
- if (state.rng.oneIn(2)) {
299
- c.setFeat(grid, FEAT.FLOOR);
300
- }
301
- else if (state.rng.oneIn(2) && !occupied) {
302
- c.setFeat(grid, FEAT.RUBBLE);
303
- }
304
- else {
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
- /* The monster-directed projections have empty feature handlers upstream:
313
- * they never touch terrain and never set obvious (project-feat.c:581-675),
314
- * so the player observes nothing from them at the grid level. */
315
- case PROJ.AWAY_UNDEAD:
316
- case PROJ.AWAY_EVIL:
317
- case PROJ.AWAY_SPIRIT:
318
- case PROJ.AWAY_ALL:
319
- case PROJ.TURN_UNDEAD:
320
- case PROJ.TURN_EVIL:
321
- case PROJ.TURN_LIVING:
322
- case PROJ.TURN_ALL:
323
- case PROJ.DISP_UNDEAD:
324
- case PROJ.DISP_EVIL:
325
- case PROJ.DISP_ALL:
326
- case PROJ.SLEEP_UNDEAD:
327
- case PROJ.SLEEP_EVIL:
328
- case PROJ.SLEEP_ALL:
329
- case PROJ.MON_CLONE:
330
- case PROJ.MON_POLY:
331
- case PROJ.MON_HEAL:
332
- case PROJ.MON_SPEED:
333
- case PROJ.MON_SLOW:
334
- case PROJ.MON_CONF:
335
- case PROJ.MON_HOLD:
336
- case PROJ.MON_STUN:
337
- case PROJ.MON_DRAIN:
338
- case PROJ.MON_CRUSH:
339
- break;
340
- /* The remaining (damage / elemental) projections only give the player a
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