@archivist-gg/dnd5e 0.3.19 → 0.3.26

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 (441) hide show
  1. package/LICENSE +48 -21
  2. package/README.md +26 -48
  3. package/dist/armor/armor.codec.d.ts +0 -7
  4. package/dist/armor/armor.codec.js +1 -9
  5. package/dist/armor/armor.parser.js +1 -8
  6. package/dist/armor/armor.schema.js +1 -7
  7. package/dist/armor/armor.types.d.ts +0 -3
  8. package/dist/background/background.codec.d.ts +0 -6
  9. package/dist/background/background.codec.js +1 -12
  10. package/dist/background/background.parser.js +1 -11
  11. package/dist/background/background.schema.js +1 -12
  12. package/dist/background/background.types.d.ts +0 -5
  13. package/dist/chunk-2EOGK6R6.js +1 -0
  14. package/dist/chunk-2HRRH3WL.js +1 -0
  15. package/dist/chunk-2NUDWOFG.js +1 -0
  16. package/dist/chunk-3LWOVRLA.js +1 -0
  17. package/dist/chunk-3QQOATV3.js +1 -0
  18. package/dist/chunk-4E2GIWJE.js +1 -0
  19. package/dist/chunk-4GN3GYMP.js +1 -0
  20. package/dist/chunk-4IAMSRHD.js +1 -0
  21. package/dist/chunk-4JEF3CET.js +1 -0
  22. package/dist/chunk-4KVVAENP.js +1 -0
  23. package/dist/chunk-4SYAKWY4.js +1 -0
  24. package/dist/chunk-56JK6VCL.js +1 -0
  25. package/dist/chunk-5XDCM6YK.js +1 -0
  26. package/dist/chunk-63YJPWTM.js +1 -0
  27. package/dist/chunk-6R46KYGU.js +1 -0
  28. package/dist/chunk-6W253VHH.js +1 -0
  29. package/dist/chunk-72PRMZRD.js +1 -0
  30. package/dist/chunk-757KM22B.js +1 -0
  31. package/dist/chunk-7EL3GWWJ.js +1 -0
  32. package/dist/chunk-7FPQJDFD.js +1 -0
  33. package/dist/chunk-AINRPPLH.js +1 -0
  34. package/dist/chunk-BC52J4LA.js +1 -0
  35. package/dist/chunk-BCXGB4HP.js +1 -0
  36. package/dist/chunk-BREHZNTL.js +1 -0
  37. package/dist/chunk-BZ6BGGZS.js +1 -0
  38. package/dist/chunk-CAPYNIGK.js +1 -0
  39. package/dist/chunk-CCAVZANF.js +1 -0
  40. package/dist/chunk-CCFIINBA.js +1 -0
  41. package/dist/chunk-CEHL7PPC.js +1 -0
  42. package/dist/chunk-CMIEZQL4.js +1 -0
  43. package/dist/chunk-CNMHADNV.js +1 -0
  44. package/dist/chunk-CSTAQQGX.js +1 -0
  45. package/dist/chunk-DTB7YBMZ.js +1 -0
  46. package/dist/chunk-DVUXUIPV.js +1 -0
  47. package/dist/chunk-DZITM5AG.js +1 -0
  48. package/dist/chunk-E3MS4M3N.js +1 -0
  49. package/dist/chunk-E7KFJLDR.js +1 -0
  50. package/dist/chunk-EAARMPCW.js +1 -0
  51. package/dist/chunk-EPA24PVZ.js +1 -0
  52. package/dist/chunk-ETDMOGFO.js +1 -0
  53. package/dist/chunk-EVT7MGAC.js +1 -0
  54. package/dist/chunk-FOLHTMSC.js +1 -0
  55. package/dist/chunk-GCYUCIDN.js +1 -0
  56. package/dist/chunk-GD7WRCNH.js +1 -0
  57. package/dist/chunk-GGQDQSIF.js +1 -0
  58. package/dist/chunk-GIQLIBC7.js +1 -0
  59. package/dist/chunk-HX7WBOKR.js +1 -0
  60. package/dist/chunk-I26FHSI6.js +1 -0
  61. package/dist/chunk-IHPLT2ZT.js +1 -0
  62. package/dist/chunk-J3RP5C7L.js +1 -0
  63. package/dist/chunk-J5GL6FLP.js +1 -0
  64. package/dist/chunk-JXDX2DKF.js +1 -0
  65. package/dist/chunk-KEXSF3CH.js +1 -0
  66. package/dist/chunk-KM75CC6Q.js +1 -0
  67. package/dist/chunk-L2DXF7YS.js +1 -0
  68. package/dist/chunk-LHH5XSEA.js +1 -0
  69. package/dist/chunk-LJNT3PJP.js +1 -0
  70. package/dist/chunk-LR6UMA5V.js +1 -0
  71. package/dist/chunk-M6RPOLKS.js +1 -0
  72. package/dist/chunk-MGGKZGLG.js +1 -0
  73. package/dist/chunk-NEMX7QGG.js +1 -0
  74. package/dist/chunk-NIWLD33X.js +1 -0
  75. package/dist/chunk-NU2Z7MTS.js +1 -0
  76. package/dist/chunk-NYPH7RQN.js +1 -0
  77. package/dist/chunk-NYTR6NJS.js +1 -0
  78. package/dist/chunk-O2QZ73GA.js +1 -0
  79. package/dist/chunk-O776WL7O.js +1 -0
  80. package/dist/chunk-ONCXJMJM.js +1 -0
  81. package/dist/chunk-OTRH62HY.js +1 -0
  82. package/dist/chunk-PFQPP77Q.js +1 -0
  83. package/dist/chunk-PKIMOVQG.js +1 -0
  84. package/dist/chunk-PZ3ZZ5H5.js +1 -0
  85. package/dist/chunk-PZ4L2EEG.js +1 -0
  86. package/dist/chunk-QMEKQTUT.js +1 -0
  87. package/dist/chunk-QVWT67WA.js +1 -0
  88. package/dist/chunk-RE5Z5RNK.js +1 -0
  89. package/dist/chunk-RHIEOYDX.js +1 -0
  90. package/dist/chunk-RQZCGXUZ.js +1 -0
  91. package/dist/chunk-S5UCI27C.js +1 -0
  92. package/dist/chunk-SEOASDO4.js +1 -0
  93. package/dist/chunk-SFK57JAA.js +1 -0
  94. package/dist/chunk-SU4MEZ5P.js +1 -0
  95. package/dist/chunk-T55DELVL.js +1 -0
  96. package/dist/chunk-TKIEPC6F.js +1 -0
  97. package/dist/chunk-UBUKCRZ3.js +1 -0
  98. package/dist/chunk-VA3ZWV7C.js +1 -0
  99. package/dist/chunk-VIP3FH2O.js +1 -0
  100. package/dist/chunk-VTQ4RWEG.js +1 -0
  101. package/dist/chunk-VVJXZZ4Z.js +1 -0
  102. package/dist/chunk-WAUNLUFQ.js +1 -0
  103. package/dist/chunk-X22SISGM.js +1 -0
  104. package/dist/chunk-XKJXT2PN.js +1 -0
  105. package/dist/chunk-XPF53K54.js +1 -0
  106. package/dist/chunk-YGH7S5ZF.js +1 -0
  107. package/dist/chunk-ZE46ADXS.js +1 -0
  108. package/dist/chunk-ZI3FEUX3.js +1 -0
  109. package/dist/chunk-ZS5BMNXC.js +1 -0
  110. package/dist/chunk-ZVL5FXXO.js +1 -0
  111. package/dist/class/class.codec.d.ts +0 -7
  112. package/dist/class/class.codec.js +1 -18
  113. package/dist/class/class.parser.js +1 -17
  114. package/dist/class/class.schema.d.ts +4 -3
  115. package/dist/class/class.schema.js +1 -15
  116. package/dist/class/class.slug.d.ts +0 -11
  117. package/dist/class/class.slug.js +1 -8
  118. package/dist/class/class.standard-array.d.ts +0 -7
  119. package/dist/class/class.standard-array.js +1 -20
  120. package/dist/class/class.types.d.ts +0 -20
  121. package/dist/condition/condition.codec.d.ts +0 -6
  122. package/dist/condition/condition.parser.d.ts +0 -10
  123. package/dist/condition/condition.parser.js +1 -7
  124. package/dist/condition/condition.schema.d.ts +0 -16
  125. package/dist/condition/condition.types.d.ts +0 -3
  126. package/dist/data-srd/index.generated.js +1 -146
  127. package/dist/dnd/amount-text.d.ts +3 -30
  128. package/dist/dnd/amount-text.js +1 -15
  129. package/dist/dnd/constants.d.ts +0 -18
  130. package/dist/dnd/constants.js +1 -42
  131. package/dist/dnd/formula-tags.d.ts +0 -2
  132. package/dist/dnd/formula-tags.js +1 -119
  133. package/dist/dnd/math.d.ts +0 -26
  134. package/dist/dnd/math.js +1 -45
  135. package/dist/dnd/prose-tags.d.ts +1 -15
  136. package/dist/dnd/prose-tags.js +1 -18
  137. package/dist/dnd/resource-die.d.ts +0 -4
  138. package/dist/dnd/resource-die.js +1 -17
  139. package/dist/dnd/resource-formula.d.ts +0 -43
  140. package/dist/dnd/resource-formula.js +1 -14
  141. package/dist/dnd/resource-words.d.ts +0 -2
  142. package/dist/dnd/resource-words.js +1 -30
  143. package/dist/dnd/srd-tag-converter.d.ts +0 -21
  144. package/dist/dnd/srd-tag-converter.js +1 -12
  145. package/dist/dnd/tag-grammar.js +1 -12
  146. package/dist/dnd/warn-once.js +1 -8
  147. package/dist/encounter/encounter.ai-schema.js +1 -8
  148. package/dist/entities/base-item-resolver.d.ts +0 -26
  149. package/dist/entities/base-item-resolver.js +1 -11
  150. package/dist/entities/registry-revision.d.ts +0 -15
  151. package/dist/entities/registry-revision.js +1 -10
  152. package/dist/entities/slug.d.ts +1 -31
  153. package/dist/entities/slug.js +1 -12
  154. package/dist/entities/wikilink-display.d.ts +0 -2
  155. package/dist/entities/wikilink-display.js +1 -10
  156. package/dist/feat/feat.category-codes.d.ts +1 -26
  157. package/dist/feat/feat.category-codes.js +1 -14
  158. package/dist/feat/feat.codec.d.ts +0 -6
  159. package/dist/feat/feat.codec.js +1 -12
  160. package/dist/feat/feat.parser.js +1 -11
  161. package/dist/feat/feat.schema.d.ts +46 -4
  162. package/dist/feat/feat.schema.js +1 -10
  163. package/dist/feat/feat.types.d.ts +0 -6
  164. package/dist/index.js +45 -141495
  165. package/dist/inline-tag-parser.js +1 -6
  166. package/dist/item/item.actions-map.d.ts +4 -63
  167. package/dist/item/item.actions-map.js +1 -10
  168. package/dist/item/item.ai-schema.js +1 -6
  169. package/dist/item/item.attunement.d.ts +0 -14
  170. package/dist/item/item.attunement.js +1 -6
  171. package/dist/item/item.bonuses.js +1 -10
  172. package/dist/item/item.codec.js +1 -9
  173. package/dist/item/item.conditions.d.ts +0 -7
  174. package/dist/item/item.conditions.js +1 -11
  175. package/dist/item/item.conditions.types.d.ts +0 -2
  176. package/dist/item/item.cost.js +1 -29
  177. package/dist/item/item.enrichment.js +1 -9
  178. package/dist/item/item.icon.d.ts +0 -8
  179. package/dist/item/item.icon.js +1 -211
  180. package/dist/item/item.parser.js +1 -8
  181. package/dist/item/item.schema.d.ts +5 -0
  182. package/dist/item/item.schema.js +1 -11
  183. package/dist/item/item.types.d.ts +5 -28
  184. package/dist/monster/monster.ai-schema.js +1 -6
  185. package/dist/monster/monster.codec.d.ts +0 -10
  186. package/dist/monster/monster.enrichment.js +1 -19
  187. package/dist/monster/monster.format.d.ts +0 -69
  188. package/dist/monster/monster.format.js +1 -78
  189. package/dist/monster/monster.parser.d.ts +0 -4
  190. package/dist/monster/monster.parser.js +1 -15
  191. package/dist/monster/monster.resolve.d.ts +0 -4
  192. package/dist/monster/monster.schema.d.ts +0 -9
  193. package/dist/monster/monster.schema.js +1 -34
  194. package/dist/monster/monster.types.d.ts +0 -3
  195. package/dist/monster/monster.types.js +1 -1
  196. package/dist/optional-feature/optional-feature.codec.d.ts +0 -11
  197. package/dist/optional-feature/optional-feature.codec.js +1 -13
  198. package/dist/optional-feature/optional-feature.parser.js +1 -12
  199. package/dist/optional-feature/optional-feature.schema.d.ts +44 -3
  200. package/dist/optional-feature/optional-feature.schema.js +1 -15
  201. package/dist/pack.d.ts +0 -9
  202. package/dist/pc/conditions.constants.js +1 -6
  203. package/dist/pc/decision-recognizer.js +1 -8
  204. package/dist/pc/pc.additional-spells.d.ts +0 -24
  205. package/dist/pc/pc.additional-spells.js +1 -26
  206. package/dist/pc/pc.amount-bindings.d.ts +3 -28
  207. package/dist/pc/pc.amount-bindings.js +1 -28
  208. package/dist/pc/pc.asi-flatten.d.ts +0 -59
  209. package/dist/pc/pc.asi-flatten.js +1 -16
  210. package/dist/pc/pc.conditions.d.ts +1 -0
  211. package/dist/pc/pc.conditions.js +1 -6
  212. package/dist/pc/pc.containment.d.ts +0 -5
  213. package/dist/pc/pc.containment.js +1 -24
  214. package/dist/pc/pc.decision-engine.d.ts +6 -145
  215. package/dist/pc/pc.decision-engine.js +1 -55
  216. package/dist/pc/pc.defense-normalize.d.ts +0 -10
  217. package/dist/pc/pc.defense-normalize.js +1 -6
  218. package/dist/pc/pc.entry-overrides.d.ts +19 -58
  219. package/dist/pc/pc.entry-overrides.js +1 -41
  220. package/dist/pc/pc.equipment.d.ts +2 -22
  221. package/dist/pc/pc.equipment.js +1 -34
  222. package/dist/pc/pc.feature-effects.d.ts +27 -281
  223. package/dist/pc/pc.feature-effects.js +1 -39
  224. package/dist/pc/pc.formula-context.js +1 -11
  225. package/dist/pc/pc.infusions.d.ts +0 -65
  226. package/dist/pc/pc.infusions.js +1 -65
  227. package/dist/pc/pc.item-effects.d.ts +19 -0
  228. package/dist/pc/pc.item-effects.js +1 -0
  229. package/dist/pc/pc.member-choices.d.ts +3 -66
  230. package/dist/pc/pc.member-choices.js +1 -39
  231. package/dist/pc/pc.parser.js +1 -58
  232. package/dist/pc/pc.pools.d.ts +7 -10
  233. package/dist/pc/pc.pools.js +1 -27
  234. package/dist/pc/pc.proficiencies.d.ts +0 -40
  235. package/dist/pc/pc.proficiencies.js +1 -156
  236. package/dist/pc/pc.proficiency-grants.d.ts +3 -27
  237. package/dist/pc/pc.proficiency-normalize.d.ts +0 -35
  238. package/dist/pc/pc.proficiency-normalize.js +1 -18
  239. package/dist/pc/pc.proficiency-query.d.ts +0 -13
  240. package/dist/pc/pc.proficiency-query.js +1 -27
  241. package/dist/pc/pc.recalc.d.ts +8 -131
  242. package/dist/pc/pc.recalc.js +1 -1042
  243. package/dist/pc/pc.resolver.d.ts +9 -107
  244. package/dist/pc/pc.resolver.js +1 -60
  245. package/dist/pc/pc.resource-seed.d.ts +0 -8
  246. package/dist/pc/pc.resource-seed.js +1 -42
  247. package/dist/pc/pc.resources.d.ts +1 -59
  248. package/dist/pc/pc.resources.js +1 -23
  249. package/dist/pc/pc.rest.d.ts +1 -20
  250. package/dist/pc/pc.rest.js +1 -231
  251. package/dist/pc/pc.schema.d.ts +20 -2
  252. package/dist/pc/pc.schema.js +1 -9
  253. package/dist/pc/pc.slotting.d.ts +0 -29
  254. package/dist/pc/pc.slotting.js +1 -28
  255. package/dist/pc/pc.speeds.d.ts +36 -0
  256. package/dist/pc/pc.spell-scope.d.ts +0 -16
  257. package/dist/pc/pc.spellcasting.d.ts +0 -70
  258. package/dist/pc/pc.spellcasting.js +1 -28
  259. package/dist/pc/pc.table-column.d.ts +3 -22
  260. package/dist/pc/pc.table-column.js +1 -18
  261. package/dist/pc/pc.tool-picks.d.ts +0 -27
  262. package/dist/pc/pc.tool-picks.js +1 -18
  263. package/dist/pc/pc.types.d.ts +59 -374
  264. package/dist/pc/pc.weapon-grant.d.ts +0 -6
  265. package/dist/pc/pool-layout.d.ts +0 -39
  266. package/dist/pc/pool-layout.js +1 -18
  267. package/dist/pc/resource-equivalents.d.ts +2 -40
  268. package/dist/pc/roll-scope.js +1 -8
  269. package/dist/pc/roll-tag-labels.d.ts +0 -32
  270. package/dist/pc/roll-tag-labels.js +1 -17
  271. package/dist/pc/spell-source.d.ts +0 -11
  272. package/dist/pc/spell-source.js +1 -8
  273. package/dist/race/race.codec.d.ts +0 -6
  274. package/dist/race/race.codec.js +1 -15
  275. package/dist/race/race.parser.js +1 -14
  276. package/dist/race/race.schema.d.ts +0 -8
  277. package/dist/race/race.schema.js +1 -14
  278. package/dist/race/race.structural.d.ts +0 -6
  279. package/dist/race/race.structural.js +1 -6
  280. package/dist/race/race.types.d.ts +0 -8
  281. package/dist/schemas/attack-schema.d.ts +5 -0
  282. package/dist/schemas/caster-type-schema.d.ts +1 -6
  283. package/dist/schemas/caster-type-schema.js +1 -6
  284. package/dist/schemas/choice-schema.js +1 -7
  285. package/dist/schemas/duration-schema.d.ts +0 -2
  286. package/dist/schemas/duration-schema.js +1 -6
  287. package/dist/schemas/entity-extras-schema.d.ts +0 -30
  288. package/dist/schemas/entity-extras-schema.js +1 -10
  289. package/dist/schemas/equipment-grant-schema.d.ts +0 -2
  290. package/dist/schemas/equipment-grant-schema.js +1 -12
  291. package/dist/schemas/feature-alias.d.ts +0 -27
  292. package/dist/schemas/feature-effect-schema.d.ts +44 -3
  293. package/dist/schemas/feature-effect-schema.js +1 -6
  294. package/dist/schemas/feature-schema.d.ts +0 -6
  295. package/dist/schemas/feature-schema.js +1 -12
  296. package/dist/schemas/resource-schema.d.ts +1 -34
  297. package/dist/schemas/resource-schema.js +1 -12
  298. package/dist/schemas/selection-pool-schema.js +1 -10
  299. package/dist/spell/casting-time.d.ts +0 -15
  300. package/dist/spell/casting-time.js +1 -6
  301. package/dist/spell/spell.access.d.ts +0 -6
  302. package/dist/spell/spell.access.js +1 -45
  303. package/dist/spell/spell.ai-schema.js +1 -6
  304. package/dist/spell/spell.codec.js +1 -9
  305. package/dist/spell/spell.enrichment.js +1 -9
  306. package/dist/spell/spell.filter.d.ts +0 -5
  307. package/dist/spell/spell.filter.js +1 -75
  308. package/dist/spell/spell.parser.d.ts +0 -31
  309. package/dist/spell/spell.parser.js +1 -16
  310. package/dist/spell/spell.scaling.d.ts +0 -46
  311. package/dist/spell/spell.scaling.js +1 -79
  312. package/dist/spell/spell.schema.js +1 -7
  313. package/dist/spell/spell.types.d.ts +0 -7
  314. package/dist/srd/retired-items.d.ts +0 -4
  315. package/dist/srd/retired-items.js +1 -11
  316. package/dist/srd-store.d.ts +0 -33
  317. package/dist/subclass/subclass.codec.d.ts +0 -8
  318. package/dist/subclass/subclass.codec.js +1 -17
  319. package/dist/subclass/subclass.parser.js +1 -16
  320. package/dist/subclass/subclass.schema.d.ts +2 -1
  321. package/dist/subclass/subclass.schema.js +1 -14
  322. package/dist/subclass/subclass.types.d.ts +0 -3
  323. package/dist/types/attack.d.ts +2 -0
  324. package/dist/types/casting-option.d.ts +0 -4
  325. package/dist/types/choice.d.ts +1 -72
  326. package/dist/types/choice.js +1 -24
  327. package/dist/types/edition.d.ts +0 -3
  328. package/dist/types/equipment-grant.d.ts +1 -27
  329. package/dist/types/equipment-grant.js +1 -12
  330. package/dist/types/feature-effect.d.ts +11 -23
  331. package/dist/types/feature.d.ts +0 -22
  332. package/dist/types/optional-feature.types.d.ts +1 -31
  333. package/dist/types/resource.d.ts +1 -21
  334. package/dist/types/selection-pool.d.ts +0 -24
  335. package/dist/weapon/weapon-mastery.d.ts +0 -1
  336. package/dist/weapon/weapon.classify.d.ts +0 -11
  337. package/dist/weapon/weapon.classify.js +1 -7
  338. package/dist/weapon/weapon.codec.d.ts +0 -9
  339. package/dist/weapon/weapon.codec.js +1 -9
  340. package/dist/weapon/weapon.parser.js +1 -8
  341. package/dist/weapon/weapon.schema.js +1 -7
  342. package/dist/weapon/weapon.types.d.ts +0 -3
  343. package/package.json +3 -3
  344. package/src/data-srd/ATTRIBUTION.md +1 -1
  345. package/dist/chunk-2FRUSVZS.js +0 -489
  346. package/dist/chunk-2LULMQTF.js +0 -14
  347. package/dist/chunk-3LWMFYKS.js +0 -57
  348. package/dist/chunk-3SFGWFVQ.js +0 -19
  349. package/dist/chunk-3SIUAFDQ.js +0 -18
  350. package/dist/chunk-3TM34RSJ.js +0 -23
  351. package/dist/chunk-4J6DS3EJ.js +0 -30
  352. package/dist/chunk-4U55VNC7.js +0 -22
  353. package/dist/chunk-5GKJAUMX.js +0 -59
  354. package/dist/chunk-5JXFJ5AU.js +0 -26
  355. package/dist/chunk-64VNLMSG.js +0 -375
  356. package/dist/chunk-656QCX4U.js +0 -22
  357. package/dist/chunk-6GNXYAYP.js +0 -25
  358. package/dist/chunk-6PXTNCBP.js +0 -133
  359. package/dist/chunk-6X2NV665.js +0 -33
  360. package/dist/chunk-7Q2VPKCD.js +0 -181
  361. package/dist/chunk-7XJHI5H5.js +0 -709
  362. package/dist/chunk-A54HHCWW.js +0 -67
  363. package/dist/chunk-B2QHP6UF.js +0 -159
  364. package/dist/chunk-B3DP42OM.js +0 -55
  365. package/dist/chunk-BJGOSM76.js +0 -18
  366. package/dist/chunk-BJWSOQUC.js +0 -133
  367. package/dist/chunk-CJYCVNW2.js +0 -7
  368. package/dist/chunk-CM5CWO4K.js +0 -735
  369. package/dist/chunk-DEEHHLAP.js +0 -271
  370. package/dist/chunk-DPUJDOKV.js +0 -365
  371. package/dist/chunk-EJD47JHL.js +0 -1838
  372. package/dist/chunk-EJP263OP.js +0 -186
  373. package/dist/chunk-EVMUJYUD.js +0 -195
  374. package/dist/chunk-EYX4JMAU.js +0 -101
  375. package/dist/chunk-FC4IGH5Y.js +0 -18
  376. package/dist/chunk-FJYBLXV7.js +0 -89
  377. package/dist/chunk-FMUD3LDV.js +0 -19
  378. package/dist/chunk-FMYWORTP.js +0 -93
  379. package/dist/chunk-FVXLP7P3.js +0 -18
  380. package/dist/chunk-G6MHJDVT.js +0 -41
  381. package/dist/chunk-GVWEFECG.js +0 -18
  382. package/dist/chunk-HHBD4SQ6.js +0 -24
  383. package/dist/chunk-HS6FIOLP.js +0 -52
  384. package/dist/chunk-HY2SRSVM.js +0 -23
  385. package/dist/chunk-IHE6KVC3.js +0 -13
  386. package/dist/chunk-IN4M4X7P.js +0 -34
  387. package/dist/chunk-IUAAXXNO.js +0 -58
  388. package/dist/chunk-JXWNXIIZ.js +0 -219
  389. package/dist/chunk-K5NJBTE2.js +0 -18
  390. package/dist/chunk-KR6JF3BF.js +0 -14
  391. package/dist/chunk-KSTV7J2U.js +0 -112
  392. package/dist/chunk-KU3YLF6D.js +0 -106
  393. package/dist/chunk-LBEXLN6I.js +0 -91
  394. package/dist/chunk-LHZXYFBU.js +0 -94
  395. package/dist/chunk-LICYHPI3.js +0 -237
  396. package/dist/chunk-LNT64X7C.js +0 -81
  397. package/dist/chunk-LSLSG67V.js +0 -31
  398. package/dist/chunk-LVQLWRCU.js +0 -15
  399. package/dist/chunk-MYY2C5MB.js +0 -233
  400. package/dist/chunk-NKZMQV2C.js +0 -19
  401. package/dist/chunk-NTU2DXNG.js +0 -355
  402. package/dist/chunk-NXUY5XQN.js +0 -1062
  403. package/dist/chunk-NZO7M5GV.js +0 -18
  404. package/dist/chunk-OOL4KMG2.js +0 -71
  405. package/dist/chunk-OOSRUJBI.js +0 -19
  406. package/dist/chunk-PDJSUH24.js +0 -110
  407. package/dist/chunk-PTXBIDG7.js +0 -63
  408. package/dist/chunk-PVCEA4HZ.js +0 -6
  409. package/dist/chunk-QA3YCOML.js +0 -101
  410. package/dist/chunk-QFWQKS3M.js +0 -110
  411. package/dist/chunk-QS5L5YTJ.js +0 -24
  412. package/dist/chunk-QYZV2MQA.js +0 -97
  413. package/dist/chunk-RD2MID3M.js +0 -292
  414. package/dist/chunk-S3YUXDSC.js +0 -278
  415. package/dist/chunk-S7REMWW4.js +0 -21
  416. package/dist/chunk-TOM66P2P.js +0 -38
  417. package/dist/chunk-TRBGC4ZG.js +0 -112
  418. package/dist/chunk-UA5KS2PL.js +0 -26
  419. package/dist/chunk-UJCK5IW4.js +0 -187
  420. package/dist/chunk-UNYR5GLI.js +0 -23
  421. package/dist/chunk-UZXG6QSY.js +0 -58
  422. package/dist/chunk-VN5DLURA.js +0 -158
  423. package/dist/chunk-VP5TIXDK.js +0 -178
  424. package/dist/chunk-VPYBK2MG.js +0 -18
  425. package/dist/chunk-VTTA2ALZ.js +0 -16
  426. package/dist/chunk-W6GC6OKK.js +0 -16
  427. package/dist/chunk-WELIKLZF.js +0 -256
  428. package/dist/chunk-WOHX7YTH.js +0 -165
  429. package/dist/chunk-WSVMLNTO.js +0 -31
  430. package/dist/chunk-WYGD2UGN.js +0 -14
  431. package/dist/chunk-XCFC7LGF.js +0 -122
  432. package/dist/chunk-XJ2F2WO6.js +0 -8
  433. package/dist/chunk-XTEFPUSN.js +0 -23
  434. package/dist/chunk-YBLDE5CG.js +0 -42
  435. package/dist/chunk-YDGMBMYI.js +0 -25
  436. package/dist/chunk-YHYTW5QA.js +0 -20
  437. package/dist/chunk-ZCTUYGNV.js +0 -26
  438. package/dist/chunk-ZDAEGJH4.js +0 -102
  439. package/dist/chunk-ZJXSXVFP.js +0 -58
  440. package/dist/chunk-ZOWKWMD2.js +0 -18
  441. package/dist/chunk-ZUQW5VBZ.js +0 -89
@@ -1,292 +0,0 @@
1
- import {
2
- parsePickKey,
3
- poolAnchorLevel
4
- } from "./chunk-NXUY5XQN.js";
5
- import {
6
- featProgressionCategory
7
- } from "./chunk-YBLDE5CG.js";
8
- import {
9
- warnOnce
10
- } from "./chunk-LVQLWRCU.js";
11
- import {
12
- bucketOf
13
- } from "./chunk-4J6DS3EJ.js";
14
- import {
15
- bareEntitySlug,
16
- wikilinkTailSlug
17
- } from "./chunk-ZCTUYGNV.js";
18
-
19
- // src/pc/pc.member-choices.ts
20
- var OPTIONAL_FEATURE_TYPE_CODE = {
21
- "MV:B": "maneuver",
22
- MV: "maneuver",
23
- EI: "invocation",
24
- MM: "metamagic",
25
- "FS:F": "fighting_style"
26
- };
27
- function spellFilter(choose, edition) {
28
- const where = { edition };
29
- for (const part of choose.split("|")) {
30
- const [rawKey, rawValue = ""] = part.split("=");
31
- const key = rawKey.trim().toLowerCase();
32
- const value = rawValue.trim();
33
- if (key === "level") {
34
- const n = Number(value.split(";")[0]);
35
- if (!Number.isInteger(n)) return null;
36
- where.level = n;
37
- } else if (key === "class") where.list = value.toLowerCase();
38
- else if (key === "components & miscellaneous" && /ritual/i.test(value)) where.ritual = true;
39
- }
40
- return where;
41
- }
42
- function isTargetChoice(ch) {
43
- return ch.kind === "select-entity" && ch.target === true;
44
- }
45
- function progressionCount(p) {
46
- var _a;
47
- if (Array.isArray(p)) return 0;
48
- return (_a = p["*"]) != null ? _a : Math.max(0, ...Object.values(p));
49
- }
50
- function spellChoices(entity, used) {
51
- var _a, _b;
52
- const out = [];
53
- for (const block of (_a = entity.additional_spells) != null ? _a : []) {
54
- for (const bucket of ["known", "prepared"]) {
55
- const byLevel = block[bucket];
56
- if (!byLevel || typeof byLevel !== "object") continue;
57
- for (const rows of Object.values(byLevel)) {
58
- for (const row of Array.isArray(rows) ? rows : []) {
59
- const r = row;
60
- if (typeof r.choose !== "string") continue;
61
- const where = spellFilter(r.choose, entity.edition);
62
- if (!where) continue;
63
- const base = where.ritual ? "rituals" : where.level === 0 ? "cantrips" : `spells-${(_b = where.level) != null ? _b : "any"}`;
64
- const label = where.ritual ? "Rituals" : where.level === 0 ? "Cantrips" : `Level ${where.level} spells`;
65
- let id = base;
66
- for (let i = 2; used.has(id); i++) id = `${base}-${i}`;
67
- used.add(id);
68
- out.push({ kind: "select-entity", id, label, count: typeof r.count === "number" ? r.count : 1, entity_type: "spell", where });
69
- }
70
- }
71
- }
72
- }
73
- return out;
74
- }
75
- function memberChoices(entity) {
76
- var _a, _b, _c, _d, _e, _f;
77
- if (!entity) return [];
78
- if ((_a = entity.choices) == null ? void 0 : _a.length) return entity.choices;
79
- const out = [];
80
- const used = /* @__PURE__ */ new Set();
81
- for (const fp of (_b = entity.feat_progression) != null ? _b : []) {
82
- const category = featProgressionCategory(fp.category);
83
- const count = progressionCount(fp.progression);
84
- if (!category || count < 1) continue;
85
- const id = used.has("feat") ? `feat-${used.size}` : "feat";
86
- used.add(id);
87
- out.push({ kind: "select-entity", id, label: fp.name, count, entity_type: "feat", where: { category, edition: entity.edition } });
88
- }
89
- for (const op of (_c = entity.optionalfeature_progression) != null ? _c : []) {
90
- const codes = (_e = (_d = op.feature_type) != null ? _d : op.featureType) != null ? _e : [];
91
- const featureType = codes.map((c) => OPTIONAL_FEATURE_TYPE_CODE[c]).find((t) => !!t);
92
- const count = progressionCount(op.progression);
93
- if (!featureType || count < 1) {
94
- if (!featureType) warnOnce(`member-of-code:${entity.slug}`, `Archivist: "${entity.slug}" asks for optional features of type ${codes.join(", ")}, which this engine does not map; no pick is offered`);
95
- continue;
96
- }
97
- const id = op.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "option";
98
- used.add(id);
99
- out.push({ kind: "select-entity", id, label: op.name, count, entity_type: "optional-feature", where: { feature_type: featureType, edition: entity.edition } });
100
- }
101
- out.push(...spellChoices(entity, used));
102
- for (const pre of (_f = entity.prerequisites) != null ? _f : []) {
103
- if (pre.kind !== "spell-choose") continue;
104
- const where = spellFilter(pre.choose, entity.edition);
105
- if (!where || used.has("cantrip")) continue;
106
- used.add("cantrip");
107
- out.push({ kind: "select-entity", id: "cantrip", label: where.level === 0 ? "Cantrip" : "Spell", count: 1, entity_type: "spell", where, target: true });
108
- }
109
- return out;
110
- }
111
- function memberSpellTargets(member, read) {
112
- var _a;
113
- const refs = [];
114
- const open = [];
115
- for (const ch of memberChoices(member)) {
116
- if (ch.kind !== "select-entity" || !isTargetChoice(ch) || ch.entity_type !== "spell") continue;
117
- const v = read(ch.id);
118
- const picked = (Array.isArray(v) ? v : [v]).filter((x) => typeof x === "string" && x.trim() !== "");
119
- if (picked.length) refs.push(...picked);
120
- else if (ch.where) open.push(ch.where);
121
- }
122
- for (const pre of (_a = member.prerequisites) != null ? _a : []) if (pre.kind === "spell-known") refs.push(pre.spell);
123
- return refs.length || open.length ? { refs, open } : null;
124
- }
125
- function spellMatchesFilter(d, where) {
126
- var _a, _b;
127
- if (where.list && !((_a = d.classes) != null ? _a : []).includes(where.list)) return false;
128
- if (where.level !== void 0 && ((_b = d.level) != null ? _b : 0) !== where.level) return false;
129
- if (where.edition && d.edition !== where.edition) return false;
130
- if (where.ritual && d.ritual !== true) return false;
131
- return true;
132
- }
133
- function spellsReached(targets, spells) {
134
- if (!targets) return [];
135
- const hit = /* @__PURE__ */ new Set();
136
- for (const ref of targets.refs) {
137
- const full = stripRef(ref);
138
- const exact = spells.filter((s) => s.slug === full);
139
- const bare = wikilinkTailSlug(ref);
140
- for (const s of exact.length ? exact : spells.filter((s2) => bareEntitySlug(s2.slug) === bare)) hit.add(s.slug);
141
- }
142
- for (const where of targets.open) {
143
- const legal = new Set(spells.filter((s) => {
144
- var _a;
145
- return spellMatchesFilter(s.entity, where) && !!((_a = s.entity.damage_roll) == null ? void 0 : _a.trim());
146
- }).map((s) => s.slug));
147
- if (legal.size === 1) hit.add([...legal][0]);
148
- }
149
- return [...new Set(spells.map((s) => s.slug))].filter((slug) => hit.has(slug));
150
- }
151
- function siteOf(classIndex, level, poolId, pickKey, member, memberSlug, block) {
152
- const choices = memberChoices(member);
153
- if (!choices.length) return null;
154
- const prefix = `${poolId}:${pickKey}:`;
155
- return { classIndex, level, poolId, pickKey, member, memberSlug, choices, prefix, block, read: (id) => block[`${prefix}${id}`] };
156
- }
157
- function poolMemberSites(classes, registry) {
158
- const out = [];
159
- let byBare = null;
160
- let all = null;
161
- const lookup = (s, ownerPrefix) => {
162
- all != null ? all : all = bucketOf(registry, "optional-feature");
163
- const bare = bareEntitySlug(s);
164
- const owned = all.find((e) => bareEntitySlug(e.slug) === bare && e.slug.split("_")[0] === ownerPrefix);
165
- if (owned) return owned;
166
- const direct = registry.getByTypeAndSlug("optional-feature", s);
167
- if (direct) return direct;
168
- byBare != null ? byBare : byBare = new Map(all.map((e) => [bareEntitySlug(e.slug), e]));
169
- return byBare.get(bare);
170
- };
171
- classes.forEach((rc, classIndex) => {
172
- var _a, _b, _c, _d, _e;
173
- if (!rc.entity) return;
174
- const seen = /* @__PURE__ */ new Set();
175
- for (const pool of [...(_a = rc.entity.selection_pools) != null ? _a : [], ...(_c = (_b = rc.subclass) == null ? void 0 : _b.selection_pools) != null ? _c : []]) {
176
- if (seen.has(pool.id)) continue;
177
- seen.add(pool.id);
178
- const { anchorLevel } = poolAnchorLevel(rc.entity, pool);
179
- const block = (_e = (_d = rc.choices) == null ? void 0 : _d[anchorLevel]) != null ? _e : {};
180
- const raw = block[pool.id];
181
- const picks = Array.isArray(raw) ? raw : typeof raw === "string" ? [raw] : [];
182
- for (const s of picks) {
183
- if (typeof s !== "string") continue;
184
- const { slugPart, param } = parsePickKey(s);
185
- const reg = lookup(slugPart, rc.entity.slug.split("_")[0]);
186
- if (!reg) continue;
187
- const member = reg.data;
188
- const key = member.repeatable === true || param !== null ? s : reg.slug;
189
- const site = siteOf(classIndex, anchorLevel, pool.id, key, member, reg.slug, block);
190
- if (site) out.push(site);
191
- }
192
- }
193
- });
194
- return out;
195
- }
196
- function poolMemberSitesOf(resolved) {
197
- var _a, _b, _c, _d, _e, _f;
198
- const out = [];
199
- for (const pool of (_a = resolved.pools) != null ? _a : []) {
200
- const block = (_e = (_d = (_c = (_b = resolved.classes) == null ? void 0 : _b[pool.classIndex]) == null ? void 0 : _c.choices) == null ? void 0 : _d[pool.anchorLevel]) != null ? _e : {};
201
- for (const e of (_f = pool.selected) != null ? _f : []) {
202
- const site = siteOf(pool.classIndex, pool.anchorLevel, pool.id, e.key, e.entity, e.slug, block);
203
- if (site) out.push(site);
204
- }
205
- }
206
- return out;
207
- }
208
- var stripRef = (ref) => ref.replace(/^\[\[/, "").replace(/\]\]$/, "");
209
- function featPickSites(classEntries, memberSites, classSlugOf) {
210
- const out = [];
211
- (classEntries != null ? classEntries : []).forEach((c, classIndex) => {
212
- var _a;
213
- for (const [lvl, choiceBlock] of Object.entries((_a = c.choices) != null ? _a : {})) {
214
- const block = choiceBlock;
215
- const feat = block == null ? void 0 : block.feat;
216
- if (!block || typeof feat !== "string") continue;
217
- const slug = stripRef(feat);
218
- if (!slug) continue;
219
- const level = /^\d+$/.test(lvl) ? Number(lvl) : null;
220
- const cls = classSlugOf(classIndex);
221
- out.push({
222
- slug,
223
- classIndex,
224
- level,
225
- via: cls && level !== null ? { kind: "class", slug: cls, level } : null,
226
- read: (id) => block[`feat:${id}`]
227
- });
228
- }
229
- });
230
- for (const site of memberSites) {
231
- for (const ch of site.choices) {
232
- if (ch.kind !== "select-entity" || ch.entity_type !== "feat" || ch.target === true) continue;
233
- const v = site.read(ch.id);
234
- for (const ref of Array.isArray(v) ? v : typeof v === "string" ? [v] : []) {
235
- if (typeof ref !== "string") continue;
236
- const slug = stripRef(ref);
237
- if (!slug) continue;
238
- const cls = classSlugOf(site.classIndex);
239
- out.push({
240
- slug,
241
- classIndex: site.classIndex,
242
- level: site.level,
243
- via: cls ? { kind: "pool", slug: site.memberSlug, name: site.member.name, classSlug: cls, level: site.level } : null,
244
- read: (id) => site.block[`${site.prefix}feat:${id}`]
245
- });
246
- }
247
- }
248
- }
249
- return out;
250
- }
251
- function raceFeatSites(race, originChoices) {
252
- var _a;
253
- if (!race) return [];
254
- const oc = originChoices != null ? originChoices : {};
255
- const out = [];
256
- for (const list of [race.choices, ...((_a = race.traits) != null ? _a : []).map((t) => t == null ? void 0 : t.choices)]) {
257
- for (const ch of Array.isArray(list) ? list : []) {
258
- if ((ch == null ? void 0 : ch.kind) !== "select-entity" || ch.entity_type !== "feat") continue;
259
- const v = oc[`race:${ch.id}`];
260
- for (const ref of Array.isArray(v) ? v : typeof v === "string" ? [v] : []) {
261
- const slug = typeof ref === "string" ? stripRef(ref) : "";
262
- if (slug) out.push({ slug, via: { kind: "race", slug: race.slug }, read: (id) => oc[`race:feat:${id}`] });
263
- }
264
- }
265
- }
266
- return out;
267
- }
268
- function featOfSite(site, feats) {
269
- var _a;
270
- return (_a = feats.find((f) => f.slug === site.slug)) != null ? _a : feats.find((f) => bareEntitySlug(f.slug) === bareEntitySlug(site.slug));
271
- }
272
- function nestedPickKeysToPrune(block, key, next) {
273
- const prev = block == null ? void 0 : block[key];
274
- if (!block || !Array.isArray(prev)) return [];
275
- const keep = new Set(next);
276
- const gone = prev.filter((k) => typeof k === "string" && !keep.has(k));
277
- if (!gone.length) return [];
278
- return Object.keys(block).filter((k) => gone.some((g) => k.startsWith(`${key}:${g}:`)));
279
- }
280
-
281
- export {
282
- isTargetChoice,
283
- memberChoices,
284
- memberSpellTargets,
285
- spellsReached,
286
- poolMemberSites,
287
- poolMemberSitesOf,
288
- featPickSites,
289
- raceFeatSites,
290
- featOfSite,
291
- nestedPickKeysToPrune
292
- };
@@ -1,278 +0,0 @@
1
- import {
2
- imageField
3
- } from "./chunk-UA5KS2PL.js";
4
-
5
- // src/item/item.schema.ts
6
- import { z } from "zod";
7
- var tier1Conditions = [
8
- z.object({ kind: z.literal("no_armor") }),
9
- z.object({ kind: z.literal("no_shield") }),
10
- z.object({ kind: z.literal("wielding_two_handed") }),
11
- z.object({ kind: z.literal("is_class"), value: z.string() }),
12
- z.object({ kind: z.literal("is_race"), value: z.string() }),
13
- z.object({ kind: z.literal("is_subclass"), value: z.string() })
14
- ];
15
- var tier2Conditions = [
16
- z.object({ kind: z.literal("vs_creature_type"), value: z.string() }),
17
- z.object({ kind: z.literal("vs_attack_type"), value: z.enum(["ranged", "melee"]) }),
18
- z.object({ kind: z.literal("on_attack_type"), value: z.enum(["ranged", "melee"]) }),
19
- z.object({ kind: z.literal("with_weapon_property"), value: z.string() }),
20
- z.object({ kind: z.literal("vs_spell_save") })
21
- ];
22
- var tier3Conditions = [
23
- z.object({ kind: z.literal("lighting"), value: z.enum(["dim", "bright", "daylight", "darkness"]) }),
24
- z.object({ kind: z.literal("underwater") }),
25
- z.object({ kind: z.literal("movement_state"), value: z.enum(["flying", "swimming", "climbing", "mounted"]) })
26
- ];
27
- var tier4Conditions = [
28
- z.object({ kind: z.literal("has_condition"), value: z.string() }),
29
- z.object({ kind: z.literal("is_concentrating") }),
30
- z.object({ kind: z.literal("bloodied") })
31
- ];
32
- var rawCondition = z.object({ kind: z.literal("raw"), text: z.string() });
33
- var conditionSchema = z.lazy(
34
- () => z.discriminatedUnion("kind", [
35
- ...tier1Conditions,
36
- ...tier2Conditions,
37
- ...tier3Conditions,
38
- ...tier4Conditions,
39
- rawCondition,
40
- z.object({ kind: z.literal("any_of"), conditions: z.array(conditionSchema) })
41
- ])
42
- );
43
- var conditionalBonusSchema = z.object({
44
- value: z.number().int(),
45
- when: z.array(conditionSchema)
46
- });
47
- var numberOrConditional = z.union([z.number().int(), conditionalBonusSchema]);
48
- var abilityEnum = z.enum(["str", "dex", "con", "int", "wis", "cha"]);
49
- var bonusesSchema = z.object({
50
- ac: numberOrConditional.optional(),
51
- weapon_attack: numberOrConditional.optional(),
52
- weapon_damage: numberOrConditional.optional(),
53
- spell_attack: numberOrConditional.optional(),
54
- spell_save_dc: numberOrConditional.optional(),
55
- saving_throws: numberOrConditional.optional(),
56
- // Converter-measured (spec §4): 24 / 3 / 2 / 1 carriers. Same numberOrConditional
57
- // shape as the six above, so a conditional arm is legal on these too.
58
- spell_damage: numberOrConditional.optional(),
59
- ability_check: numberOrConditional.optional(),
60
- proficiency_bonus: numberOrConditional.optional(),
61
- saving_throw_concentration: numberOrConditional.optional(),
62
- ability_scores: z.object({
63
- // partial: each ability is independently optional. z.record(enum, …) in
64
- // Zod v4 treats every enum key as required, which doesn't match the
65
- // data (e.g. Amulet of Health only sets `con: 19`).
66
- static: z.object({
67
- str: z.number().int().optional(),
68
- dex: z.number().int().optional(),
69
- con: z.number().int().optional(),
70
- int: z.number().int().optional(),
71
- wis: z.number().int().optional(),
72
- cha: z.number().int().optional()
73
- }).optional(),
74
- bonus: z.object({
75
- str: numberOrConditional.optional(),
76
- dex: numberOrConditional.optional(),
77
- con: numberOrConditional.optional(),
78
- int: numberOrConditional.optional(),
79
- wis: numberOrConditional.optional(),
80
- cha: numberOrConditional.optional()
81
- }).optional(),
82
- // "choose `count` of `from`, each +`amount`" (6 measured leaves). `amount` is
83
- // OPTIONAL: Lost Laboratory of Kwalish/Deck of Several Things carries
84
- // {from: [all six], count: 1} with NO amount, and a required `amount` would
85
- // refuse that document outright.
86
- choose: z.array(z.strictObject({
87
- from: z.array(abilityEnum),
88
- count: z.number().int().positive(),
89
- amount: z.number().int().optional()
90
- })).optional()
91
- }).optional(),
92
- speed: z.object({
93
- walk: numberOrConditional.optional(),
94
- fly: z.union([numberOrConditional, z.literal("walk")]).optional(),
95
- swim: numberOrConditional.optional(),
96
- climb: numberOrConditional.optional()
97
- }).optional()
98
- });
99
- var chargesSchema = z.object({
100
- max: z.number().int(),
101
- // Dice regained per recharge, e.g. "1d4 - 1" (68 carriers). Distinct from
102
- // `recharge_amount`, which the canonical pipeline also emits as a string.
103
- dice: z.string().optional(),
104
- recharge: z.string().optional(),
105
- recharge_amount: z.string().optional(),
106
- destroy_on_empty: z.object({
107
- roll: z.string(),
108
- threshold: z.number().int(),
109
- effect: z.string().optional()
110
- }).optional()
111
- });
112
- var attachedSpellsSchema = z.object({
113
- charges: z.record(z.string(), z.array(z.string())).optional(),
114
- daily: z.record(z.string(), z.array(z.string())).optional(),
115
- will: z.array(z.string()).optional(),
116
- rest: z.record(z.string(), z.array(z.string())).optional(),
117
- // `limited` = total uses with no recharge (item often consumed when empty).
118
- // Distinct from `charges` (cost-per-cast) and `daily` (resets per day).
119
- // Source canonical pipeline emits this for Necklace of Fireballs, Helm of
120
- // Brilliance, Candle of Invocation, Efreeti Bottle. Key is total available
121
- // uses (e.g. "9": ["fireball"] for the necklace's 9 beads).
122
- limited: z.record(z.string(), z.array(z.string())).optional(),
123
- // Converter-measured (spec §4): spells the item lists without a cost model (18),
124
- // the casting ability for the item's attached spells (10), and ritual-only
125
- // spells (1).
126
- other: z.array(z.string()).optional(),
127
- ability: z.string().optional(),
128
- ritual: z.array(z.string()).optional()
129
- });
130
- var attunementTagSchema = z.union([
131
- z.object({
132
- class: z.string(),
133
- subclass: z.string().optional(),
134
- alignment: z.union([z.string(), z.array(z.string())]).optional()
135
- }),
136
- // alignment can be a single string OR an array of alignment-letter codes
137
- // (e.g. ["G"] for good, ["L", "G"] for lawful good).
138
- z.object({
139
- alignment: z.union([z.string(), z.array(z.string())]),
140
- race: z.string().optional()
141
- }),
142
- z.object({
143
- race: z.string(),
144
- alignment: z.union([z.string(), z.array(z.string())]).optional()
145
- }),
146
- z.object({ creature_type: z.string(), size: z.string().optional() }),
147
- z.object({ spellcasting: z.boolean() }),
148
- z.object({ background: z.string() }),
149
- z.object({ psionics: z.boolean() }),
150
- z.object({ int: z.number().int() }),
151
- z.object({ skill_proficiency: z.array(z.string()) }),
152
- z.object({ language_proficiency: z.array(z.string()) })
153
- ]);
154
- var attunementCanonicalSchema = z.object({
155
- required: z.boolean(),
156
- restriction: z.string().optional(),
157
- tags: z.array(attunementTagSchema).optional()
158
- });
159
- var grantsSchema = z.object({
160
- proficiency: z.boolean().optional(),
161
- languages: z.union([z.boolean(), z.array(z.string())]).optional(),
162
- senses: z.object({
163
- darkvision: z.number().optional(),
164
- tremorsense: z.number().optional(),
165
- truesight: z.number().optional(),
166
- blindsight: z.number().optional()
167
- }).optional()
168
- });
169
- var containerCapacitySchema = z.strictObject({
170
- weight: z.array(z.number()).optional(),
171
- item: z.array(z.record(z.string(), z.number())).optional(),
172
- weightless: z.boolean().optional(),
173
- volume: z.array(z.number()).optional()
174
- });
175
- var containerSchema = z.object({
176
- capacity_weight: z.number().optional(),
177
- holds_items: z.boolean().optional(),
178
- pack_contents: z.array(z.string()).optional(),
179
- pack_atomic: z.boolean().optional(),
180
- capacity: containerCapacitySchema.optional()
181
- });
182
- var lightSchema = z.object({
183
- bright_radius: z.number(),
184
- dim_radius: z.number()
185
- });
186
- var lightEntrySchema = z.strictObject({
187
- bright: z.number().optional(),
188
- dim: z.number().optional(),
189
- shape: z.string().optional()
190
- });
191
- var itemEntitySchema = z.object({
192
- name: z.string().min(1),
193
- slug: z.string().optional(),
194
- type: z.string().optional(),
195
- rarity: z.string().optional(),
196
- base_item: z.string().optional(),
197
- bonuses: bonusesSchema.optional(),
198
- resist: z.array(z.string()).optional(),
199
- immune: z.array(z.string()).optional(),
200
- vulnerable: z.array(z.string()).optional(),
201
- condition_immune: z.array(z.string()).optional(),
202
- charges: z.union([chargesSchema, z.number().int().nonnegative()]).optional(),
203
- attached_spells: attachedSpellsSchema.optional(),
204
- attunement: z.union([attunementCanonicalSchema, z.boolean(), z.string()]).optional(),
205
- grants: grantsSchema.optional(),
206
- container: containerSchema.optional(),
207
- light: z.union([lightSchema, z.array(lightEntrySchema).nonempty()]).optional(),
208
- cursed: z.boolean().optional(),
209
- sentient: z.boolean().optional(),
210
- tattoo: z.boolean().optional(),
211
- // 54 docs carry a LIST of classes that may use the item as a focus
212
- // (e.g. ["Druid", "Ranger"]); 26 carry a single string, 2 a boolean.
213
- focus: z.union([z.boolean(), z.string(), z.array(z.string())]).optional(),
214
- tier: z.enum(["major", "minor"]).optional(),
215
- damage: z.union([
216
- z.object({
217
- dice: z.string(),
218
- type: z.string(),
219
- versatile_dice: z.string().optional()
220
- }),
221
- z.string()
222
- ]).optional(),
223
- weapon_category: z.string().optional(),
224
- armor_category: z.string().optional(),
225
- weight: z.union([z.number(), z.string()]).optional(),
226
- cost: z.string().optional(),
227
- source: z.string().optional(),
228
- page: z.number().int().optional(),
229
- edition: z.string().optional(),
230
- description: z.string().optional(),
231
- entries: z.array(z.unknown()).optional(),
232
- effects: z.array(z.unknown()).optional(),
233
- damage_riders: z.array(z.object({
234
- amount: z.string(),
235
- damage_type: z.string(),
236
- applies_to: z.enum(["weapon", "spell", "all"]).optional(),
237
- condition: z.string().optional()
238
- })).optional(),
239
- // Scroll & unidentified-item markers (Phase 4). Declared here so they survive
240
- // parse (the schema strips undeclared keys) and are ALSO listed in the
241
- // parser's KNOWN_KEYS so they are not additionally copied into `raw`.
242
- scroll_level: z.number().optional(),
243
- unidentified: z.boolean().optional(),
244
- masked_category: z.string().optional(),
245
- // Converter-modelled top-level keys (spec §4). Declared here so they survive
246
- // parse AND listed in the parser's KNOWN_KEYS so they are not additionally
247
- // copied into `raw` — the schema and the raw-bag are independent gates.
248
- // `modify_speed` (124 carriers): equal 101 (string-valued, e.g. {fly: "walk"}) ·
249
- // static 20 · multiply 3 · bonus 1 (keyed "*").
250
- modify_speed: z.strictObject({
251
- equal: z.record(z.string(), z.string()).optional(),
252
- static: z.record(z.string(), z.number()).optional(),
253
- multiply: z.record(z.string(), z.number()).optional(),
254
- bonus: z.record(z.string(), z.number()).optional()
255
- }).optional(),
256
- // Carried by all 6,046 converter item docs, ALWAYS as the empty string today:
257
- // `.min(1)` is forbidden here.
258
- rendering_hint: z.string().optional(),
259
- // The icon key (I3): a key of the renderer's icon set or a Lucide name; itemIconKey reads it first.
260
- icon: z.string().optional(),
261
- has_fluff: z.boolean().optional(),
262
- has_fluff_images: z.boolean().optional(),
263
- // Already `.optional()` at its source — never append a second one.
264
- image: imageField,
265
- raw: z.record(z.string(), z.unknown()).optional(),
266
- // Legacy fields preserved
267
- damage_dice: z.string().optional(),
268
- damage_type: z.string().optional(),
269
- properties: z.array(z.string()).optional(),
270
- recharge: z.string().optional(),
271
- curse: z.boolean().optional()
272
- });
273
-
274
- export {
275
- conditionSchema,
276
- containerSchema,
277
- itemEntitySchema
278
- };
@@ -1,21 +0,0 @@
1
- // src/pc/conditions.constants.ts
2
- var CONDITION_SLUGS = [
3
- "blinded",
4
- "charmed",
5
- "deafened",
6
- "frightened",
7
- "grappled",
8
- "incapacitated",
9
- "invisible",
10
- "paralyzed",
11
- "petrified",
12
- "poisoned",
13
- "prone",
14
- "restrained",
15
- "stunned",
16
- "unconscious"
17
- ];
18
-
19
- export {
20
- CONDITION_SLUGS
21
- };
@@ -1,38 +0,0 @@
1
- import {
2
- ALL_SKILL_SLUGS
3
- } from "./chunk-KU3YLF6D.js";
4
- import {
5
- normalizeAbility
6
- } from "./chunk-WELIKLZF.js";
7
-
8
- // src/pc/roll-scope.ts
9
- var NOUNS = /\b(saving throws?|saves?|ability checks?|checks?|attack rolls?)\b/gi;
10
- var QUANTIFIERS = /\b(all|any|other|the next|you make|that you make)\b/gi;
11
- var slug = (s) => s.toLowerCase().trim().replace(/[^a-z]+/g, "-").replace(/(^-|-$)/g, "");
12
- function normalizeRollScope(raw, _roll) {
13
- if (raw == null) return void 0;
14
- const cleaned = raw.replace(NOUNS, " ").replace(QUANTIFIERS, " ").replace(/\s+/g, " ").trim();
15
- const parts = cleaned.split(/\s*(?:,|\/|\band\b|\bor\b)\s*/i).map((p) => p.trim()).filter(Boolean);
16
- if (parts.length === 0 || parts.length > 3) return void 0;
17
- const out = [];
18
- for (let p of parts) {
19
- const m = p.match(/^(?:[a-z]+\s*)?\(\s*([a-z -]+)\s*\)$/i);
20
- if (m) p = m[1];
21
- const s = slug(p);
22
- if (ALL_SKILL_SLUGS.includes(s)) {
23
- out.push(s);
24
- continue;
25
- }
26
- const ab = normalizeAbility(p);
27
- if (ab) {
28
- out.push(ab);
29
- continue;
30
- }
31
- return void 0;
32
- }
33
- return out;
34
- }
35
-
36
- export {
37
- normalizeRollScope
38
- };