@archivist-gg/dnd5e 0.3.19 → 0.3.24

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 (440) 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-2LCGKNVM.js +1 -0
  16. package/dist/chunk-2NUDWOFG.js +1 -0
  17. package/dist/chunk-334WLI7V.js +1 -0
  18. package/dist/chunk-3LWOVRLA.js +1 -0
  19. package/dist/chunk-3QQOATV3.js +1 -0
  20. package/dist/chunk-4E2GIWJE.js +1 -0
  21. package/dist/chunk-4GN3GYMP.js +1 -0
  22. package/dist/chunk-4IAMSRHD.js +1 -0
  23. package/dist/chunk-4JEF3CET.js +1 -0
  24. package/dist/chunk-4KVVAENP.js +1 -0
  25. package/dist/chunk-56JK6VCL.js +1 -0
  26. package/dist/chunk-5FEXHY4U.js +1 -0
  27. package/dist/chunk-63YJPWTM.js +1 -0
  28. package/dist/chunk-6ASJ3MVB.js +1 -0
  29. package/dist/chunk-6IC53O3Q.js +1 -0
  30. package/dist/chunk-6LCNV26D.js +1 -0
  31. package/dist/chunk-6W253VHH.js +1 -0
  32. package/dist/chunk-7AKJBRBD.js +1 -0
  33. package/dist/chunk-7EL3GWWJ.js +1 -0
  34. package/dist/chunk-7FPQJDFD.js +1 -0
  35. package/dist/chunk-7J5BNH2D.js +1 -0
  36. package/dist/chunk-7LPKI27J.js +1 -0
  37. package/dist/chunk-7UPYRKMF.js +1 -0
  38. package/dist/chunk-A7H6LX47.js +1 -0
  39. package/dist/chunk-AINRPPLH.js +1 -0
  40. package/dist/chunk-BC52J4LA.js +1 -0
  41. package/dist/chunk-BCXGB4HP.js +1 -0
  42. package/dist/chunk-BGX36NPE.js +1 -0
  43. package/dist/chunk-BPKG6RZ7.js +1 -0
  44. package/dist/chunk-BREHZNTL.js +1 -0
  45. package/dist/chunk-BZ6BGGZS.js +1 -0
  46. package/dist/chunk-CAPYNIGK.js +1 -0
  47. package/dist/chunk-CCFIINBA.js +1 -0
  48. package/dist/chunk-CMIEZQL4.js +1 -0
  49. package/dist/chunk-DVUXUIPV.js +1 -0
  50. package/dist/chunk-DY6FVAGA.js +1 -0
  51. package/dist/chunk-DZITM5AG.js +1 -0
  52. package/dist/chunk-DZKSXSJF.js +1 -0
  53. package/dist/chunk-EAARMPCW.js +1 -0
  54. package/dist/chunk-EVT7MGAC.js +1 -0
  55. package/dist/chunk-FOLHTMSC.js +1 -0
  56. package/dist/chunk-GCYUCIDN.js +1 -0
  57. package/dist/chunk-GIOV6JW7.js +1 -0
  58. package/dist/chunk-HCK6IUB3.js +1 -0
  59. package/dist/chunk-HR5MKCP2.js +1 -0
  60. package/dist/chunk-I26FHSI6.js +1 -0
  61. package/dist/chunk-I4O2FIDT.js +1 -0
  62. package/dist/chunk-IGVRLGLM.js +1 -0
  63. package/dist/chunk-IHPLT2ZT.js +1 -0
  64. package/dist/chunk-IOCJIWCV.js +1 -0
  65. package/dist/chunk-JXDX2DKF.js +1 -0
  66. package/dist/chunk-KBFSJ5WE.js +1 -0
  67. package/dist/chunk-KM75CC6Q.js +1 -0
  68. package/dist/chunk-KZDDFG4O.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-MC6PLWRZ.js +1 -0
  73. package/dist/chunk-MGGKZGLG.js +1 -0
  74. package/dist/chunk-N3RYJ7RE.js +1 -0
  75. package/dist/chunk-NEMX7QGG.js +1 -0
  76. package/dist/chunk-NI364WV7.js +1 -0
  77. package/dist/chunk-O2QZ73GA.js +1 -0
  78. package/dist/chunk-O776WL7O.js +1 -0
  79. package/dist/chunk-OTFNINUY.js +1 -0
  80. package/dist/chunk-PQAVMK3T.js +1 -0
  81. package/dist/chunk-PZ3ZZ5H5.js +1 -0
  82. package/dist/chunk-PZ4L2EEG.js +1 -0
  83. package/dist/chunk-PZUPZBTN.js +1 -0
  84. package/dist/chunk-QBA757AU.js +1 -0
  85. package/dist/chunk-QFIGPOFW.js +1 -0
  86. package/dist/chunk-QMEKQTUT.js +1 -0
  87. package/dist/chunk-QVWT67WA.js +1 -0
  88. package/dist/chunk-RDXQAZBA.js +1 -0
  89. package/dist/chunk-RE5Z5RNK.js +1 -0
  90. package/dist/chunk-RL4VY2AL.js +1 -0
  91. package/dist/chunk-RQGTBHJW.js +1 -0
  92. package/dist/chunk-RQZCGXUZ.js +1 -0
  93. package/dist/chunk-S5UCI27C.js +1 -0
  94. package/dist/chunk-SEOASDO4.js +1 -0
  95. package/dist/chunk-SU4MEZ5P.js +1 -0
  96. package/dist/chunk-T55DELVL.js +1 -0
  97. package/dist/chunk-TKIEPC6F.js +1 -0
  98. package/dist/chunk-TLXFGGWH.js +1 -0
  99. package/dist/chunk-UBUKCRZ3.js +1 -0
  100. package/dist/chunk-V6NQ547U.js +1 -0
  101. package/dist/chunk-VA3ZWV7C.js +1 -0
  102. package/dist/chunk-VIP3FH2O.js +1 -0
  103. package/dist/chunk-VTQ4RWEG.js +1 -0
  104. package/dist/chunk-WUHTSLG4.js +1 -0
  105. package/dist/chunk-X22SISGM.js +1 -0
  106. package/dist/chunk-XKJXT2PN.js +1 -0
  107. package/dist/chunk-XQMKH4R4.js +1 -0
  108. package/dist/chunk-YGH7S5ZF.js +1 -0
  109. package/dist/chunk-ZE46ADXS.js +1 -0
  110. package/dist/chunk-ZI3FEUX3.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 +2 -1
  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 +22 -1
  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 +2 -0
  182. package/dist/item/item.schema.js +1 -11
  183. package/dist/item/item.types.d.ts +2 -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 +21 -1
  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 +0 -25
  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 +0 -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 +0 -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 +22 -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 +18 -0
  228. package/dist/pc/pc.member-choices.d.ts +3 -66
  229. package/dist/pc/pc.member-choices.js +1 -39
  230. package/dist/pc/pc.parser.js +1 -58
  231. package/dist/pc/pc.pools.d.ts +7 -10
  232. package/dist/pc/pc.pools.js +1 -27
  233. package/dist/pc/pc.proficiencies.d.ts +0 -40
  234. package/dist/pc/pc.proficiencies.js +1 -156
  235. package/dist/pc/pc.proficiency-grants.d.ts +0 -26
  236. package/dist/pc/pc.proficiency-normalize.d.ts +0 -35
  237. package/dist/pc/pc.proficiency-normalize.js +1 -18
  238. package/dist/pc/pc.proficiency-query.d.ts +0 -13
  239. package/dist/pc/pc.proficiency-query.js +1 -27
  240. package/dist/pc/pc.recalc.d.ts +7 -131
  241. package/dist/pc/pc.recalc.js +1 -1042
  242. package/dist/pc/pc.resolver.d.ts +0 -107
  243. package/dist/pc/pc.resolver.js +1 -60
  244. package/dist/pc/pc.resource-seed.d.ts +0 -8
  245. package/dist/pc/pc.resource-seed.js +1 -42
  246. package/dist/pc/pc.resources.d.ts +1 -59
  247. package/dist/pc/pc.resources.js +1 -23
  248. package/dist/pc/pc.rest.d.ts +1 -20
  249. package/dist/pc/pc.rest.js +1 -231
  250. package/dist/pc/pc.schema.d.ts +0 -2
  251. package/dist/pc/pc.schema.js +1 -9
  252. package/dist/pc/pc.slotting.d.ts +0 -29
  253. package/dist/pc/pc.slotting.js +1 -28
  254. package/dist/pc/pc.speeds.d.ts +19 -0
  255. package/dist/pc/pc.spell-scope.d.ts +0 -16
  256. package/dist/pc/pc.spellcasting.d.ts +0 -70
  257. package/dist/pc/pc.spellcasting.js +1 -28
  258. package/dist/pc/pc.table-column.d.ts +0 -22
  259. package/dist/pc/pc.table-column.js +1 -18
  260. package/dist/pc/pc.tool-picks.d.ts +0 -27
  261. package/dist/pc/pc.tool-picks.js +1 -18
  262. package/dist/pc/pc.types.d.ts +54 -374
  263. package/dist/pc/pc.weapon-grant.d.ts +0 -6
  264. package/dist/pc/pool-layout.d.ts +0 -39
  265. package/dist/pc/pool-layout.js +1 -18
  266. package/dist/pc/resource-equivalents.d.ts +2 -40
  267. package/dist/pc/roll-scope.js +1 -8
  268. package/dist/pc/roll-tag-labels.d.ts +0 -32
  269. package/dist/pc/roll-tag-labels.js +1 -17
  270. package/dist/pc/spell-source.d.ts +0 -11
  271. package/dist/pc/spell-source.js +1 -8
  272. package/dist/race/race.codec.d.ts +0 -6
  273. package/dist/race/race.codec.js +1 -15
  274. package/dist/race/race.parser.js +1 -14
  275. package/dist/race/race.schema.d.ts +0 -8
  276. package/dist/race/race.schema.js +1 -14
  277. package/dist/race/race.structural.d.ts +0 -6
  278. package/dist/race/race.structural.js +1 -6
  279. package/dist/race/race.types.d.ts +0 -8
  280. package/dist/schemas/attack-schema.d.ts +5 -0
  281. package/dist/schemas/caster-type-schema.d.ts +1 -6
  282. package/dist/schemas/caster-type-schema.js +1 -6
  283. package/dist/schemas/choice-schema.js +1 -7
  284. package/dist/schemas/duration-schema.d.ts +0 -2
  285. package/dist/schemas/duration-schema.js +1 -6
  286. package/dist/schemas/entity-extras-schema.d.ts +0 -30
  287. package/dist/schemas/entity-extras-schema.js +1 -10
  288. package/dist/schemas/equipment-grant-schema.d.ts +0 -2
  289. package/dist/schemas/equipment-grant-schema.js +1 -12
  290. package/dist/schemas/feature-alias.d.ts +0 -27
  291. package/dist/schemas/feature-effect-schema.d.ts +21 -1
  292. package/dist/schemas/feature-effect-schema.js +1 -6
  293. package/dist/schemas/feature-schema.d.ts +0 -6
  294. package/dist/schemas/feature-schema.js +1 -12
  295. package/dist/schemas/resource-schema.d.ts +1 -34
  296. package/dist/schemas/resource-schema.js +1 -12
  297. package/dist/schemas/selection-pool-schema.js +1 -10
  298. package/dist/spell/casting-time.d.ts +0 -15
  299. package/dist/spell/casting-time.js +1 -6
  300. package/dist/spell/spell.access.d.ts +0 -6
  301. package/dist/spell/spell.access.js +1 -45
  302. package/dist/spell/spell.ai-schema.js +1 -6
  303. package/dist/spell/spell.codec.js +1 -9
  304. package/dist/spell/spell.enrichment.js +1 -9
  305. package/dist/spell/spell.filter.d.ts +0 -5
  306. package/dist/spell/spell.filter.js +1 -75
  307. package/dist/spell/spell.parser.d.ts +0 -31
  308. package/dist/spell/spell.parser.js +1 -16
  309. package/dist/spell/spell.scaling.d.ts +0 -46
  310. package/dist/spell/spell.scaling.js +1 -79
  311. package/dist/spell/spell.schema.js +1 -7
  312. package/dist/spell/spell.types.d.ts +0 -7
  313. package/dist/srd/retired-items.d.ts +0 -4
  314. package/dist/srd/retired-items.js +1 -11
  315. package/dist/srd-store.d.ts +0 -33
  316. package/dist/subclass/subclass.codec.d.ts +0 -8
  317. package/dist/subclass/subclass.codec.js +1 -17
  318. package/dist/subclass/subclass.parser.js +1 -16
  319. package/dist/subclass/subclass.schema.d.ts +2 -1
  320. package/dist/subclass/subclass.schema.js +1 -14
  321. package/dist/subclass/subclass.types.d.ts +0 -3
  322. package/dist/types/attack.d.ts +2 -0
  323. package/dist/types/casting-option.d.ts +0 -4
  324. package/dist/types/choice.d.ts +1 -72
  325. package/dist/types/choice.js +1 -24
  326. package/dist/types/edition.d.ts +0 -3
  327. package/dist/types/equipment-grant.d.ts +1 -27
  328. package/dist/types/equipment-grant.js +1 -12
  329. package/dist/types/feature-effect.d.ts +4 -22
  330. package/dist/types/feature.d.ts +0 -22
  331. package/dist/types/optional-feature.types.d.ts +1 -31
  332. package/dist/types/resource.d.ts +1 -21
  333. package/dist/types/selection-pool.d.ts +0 -24
  334. package/dist/weapon/weapon-mastery.d.ts +0 -1
  335. package/dist/weapon/weapon.classify.d.ts +0 -11
  336. package/dist/weapon/weapon.classify.js +1 -7
  337. package/dist/weapon/weapon.codec.d.ts +0 -9
  338. package/dist/weapon/weapon.codec.js +1 -9
  339. package/dist/weapon/weapon.parser.js +1 -8
  340. package/dist/weapon/weapon.schema.js +1 -7
  341. package/dist/weapon/weapon.types.d.ts +0 -3
  342. package/package.json +3 -3
  343. package/src/data-srd/ATTRIBUTION.md +1 -1
  344. package/dist/chunk-2FRUSVZS.js +0 -489
  345. package/dist/chunk-2LULMQTF.js +0 -14
  346. package/dist/chunk-3LWMFYKS.js +0 -57
  347. package/dist/chunk-3SFGWFVQ.js +0 -19
  348. package/dist/chunk-3SIUAFDQ.js +0 -18
  349. package/dist/chunk-3TM34RSJ.js +0 -23
  350. package/dist/chunk-4J6DS3EJ.js +0 -30
  351. package/dist/chunk-4U55VNC7.js +0 -22
  352. package/dist/chunk-5GKJAUMX.js +0 -59
  353. package/dist/chunk-5JXFJ5AU.js +0 -26
  354. package/dist/chunk-64VNLMSG.js +0 -375
  355. package/dist/chunk-656QCX4U.js +0 -22
  356. package/dist/chunk-6GNXYAYP.js +0 -25
  357. package/dist/chunk-6PXTNCBP.js +0 -133
  358. package/dist/chunk-6X2NV665.js +0 -33
  359. package/dist/chunk-7Q2VPKCD.js +0 -181
  360. package/dist/chunk-7XJHI5H5.js +0 -709
  361. package/dist/chunk-A54HHCWW.js +0 -67
  362. package/dist/chunk-B2QHP6UF.js +0 -159
  363. package/dist/chunk-B3DP42OM.js +0 -55
  364. package/dist/chunk-BJGOSM76.js +0 -18
  365. package/dist/chunk-BJWSOQUC.js +0 -133
  366. package/dist/chunk-CJYCVNW2.js +0 -7
  367. package/dist/chunk-CM5CWO4K.js +0 -735
  368. package/dist/chunk-DEEHHLAP.js +0 -271
  369. package/dist/chunk-DPUJDOKV.js +0 -365
  370. package/dist/chunk-EJD47JHL.js +0 -1838
  371. package/dist/chunk-EJP263OP.js +0 -186
  372. package/dist/chunk-EVMUJYUD.js +0 -195
  373. package/dist/chunk-EYX4JMAU.js +0 -101
  374. package/dist/chunk-FC4IGH5Y.js +0 -18
  375. package/dist/chunk-FJYBLXV7.js +0 -89
  376. package/dist/chunk-FMUD3LDV.js +0 -19
  377. package/dist/chunk-FMYWORTP.js +0 -93
  378. package/dist/chunk-FVXLP7P3.js +0 -18
  379. package/dist/chunk-G6MHJDVT.js +0 -41
  380. package/dist/chunk-GVWEFECG.js +0 -18
  381. package/dist/chunk-HHBD4SQ6.js +0 -24
  382. package/dist/chunk-HS6FIOLP.js +0 -52
  383. package/dist/chunk-HY2SRSVM.js +0 -23
  384. package/dist/chunk-IHE6KVC3.js +0 -13
  385. package/dist/chunk-IN4M4X7P.js +0 -34
  386. package/dist/chunk-IUAAXXNO.js +0 -58
  387. package/dist/chunk-JXWNXIIZ.js +0 -219
  388. package/dist/chunk-K5NJBTE2.js +0 -18
  389. package/dist/chunk-KR6JF3BF.js +0 -14
  390. package/dist/chunk-KSTV7J2U.js +0 -112
  391. package/dist/chunk-KU3YLF6D.js +0 -106
  392. package/dist/chunk-LBEXLN6I.js +0 -91
  393. package/dist/chunk-LHZXYFBU.js +0 -94
  394. package/dist/chunk-LICYHPI3.js +0 -237
  395. package/dist/chunk-LNT64X7C.js +0 -81
  396. package/dist/chunk-LSLSG67V.js +0 -31
  397. package/dist/chunk-LVQLWRCU.js +0 -15
  398. package/dist/chunk-MYY2C5MB.js +0 -233
  399. package/dist/chunk-NKZMQV2C.js +0 -19
  400. package/dist/chunk-NTU2DXNG.js +0 -355
  401. package/dist/chunk-NXUY5XQN.js +0 -1062
  402. package/dist/chunk-NZO7M5GV.js +0 -18
  403. package/dist/chunk-OOL4KMG2.js +0 -71
  404. package/dist/chunk-OOSRUJBI.js +0 -19
  405. package/dist/chunk-PDJSUH24.js +0 -110
  406. package/dist/chunk-PTXBIDG7.js +0 -63
  407. package/dist/chunk-PVCEA4HZ.js +0 -6
  408. package/dist/chunk-QA3YCOML.js +0 -101
  409. package/dist/chunk-QFWQKS3M.js +0 -110
  410. package/dist/chunk-QS5L5YTJ.js +0 -24
  411. package/dist/chunk-QYZV2MQA.js +0 -97
  412. package/dist/chunk-RD2MID3M.js +0 -292
  413. package/dist/chunk-S3YUXDSC.js +0 -278
  414. package/dist/chunk-S7REMWW4.js +0 -21
  415. package/dist/chunk-TOM66P2P.js +0 -38
  416. package/dist/chunk-TRBGC4ZG.js +0 -112
  417. package/dist/chunk-UA5KS2PL.js +0 -26
  418. package/dist/chunk-UJCK5IW4.js +0 -187
  419. package/dist/chunk-UNYR5GLI.js +0 -23
  420. package/dist/chunk-UZXG6QSY.js +0 -58
  421. package/dist/chunk-VN5DLURA.js +0 -158
  422. package/dist/chunk-VP5TIXDK.js +0 -178
  423. package/dist/chunk-VPYBK2MG.js +0 -18
  424. package/dist/chunk-VTTA2ALZ.js +0 -16
  425. package/dist/chunk-W6GC6OKK.js +0 -16
  426. package/dist/chunk-WELIKLZF.js +0 -256
  427. package/dist/chunk-WOHX7YTH.js +0 -165
  428. package/dist/chunk-WSVMLNTO.js +0 -31
  429. package/dist/chunk-WYGD2UGN.js +0 -14
  430. package/dist/chunk-XCFC7LGF.js +0 -122
  431. package/dist/chunk-XJ2F2WO6.js +0 -8
  432. package/dist/chunk-XTEFPUSN.js +0 -23
  433. package/dist/chunk-YBLDE5CG.js +0 -42
  434. package/dist/chunk-YDGMBMYI.js +0 -25
  435. package/dist/chunk-YHYTW5QA.js +0 -20
  436. package/dist/chunk-ZCTUYGNV.js +0 -26
  437. package/dist/chunk-ZDAEGJH4.js +0 -102
  438. package/dist/chunk-ZJXSXVFP.js +0 -58
  439. package/dist/chunk-ZOWKWMD2.js +0 -18
  440. package/dist/chunk-ZUQW5VBZ.js +0 -89
@@ -1,178 +0,0 @@
1
- import {
2
- featureObjectSchema
3
- } from "./chunk-B2QHP6UF.js";
4
- import {
5
- imageField
6
- } from "./chunk-UA5KS2PL.js";
7
-
8
- // src/monster/monster.schema.ts
9
- import { z } from "zod";
10
- var str = z.string();
11
- var num = z.number();
12
- var bool = z.boolean();
13
- var strArr = z.array(z.string());
14
- var damageQualifierSchema = z.object({
15
- get types() {
16
- return z.array(z.union([str, damageQualifierSchema])).optional();
17
- },
18
- note: str.optional(),
19
- pre_note: str.optional(),
20
- cond: bool.optional(),
21
- special: str.optional()
22
- });
23
- var qualifierList = z.array(z.union([str, damageQualifierSchema])).optional();
24
- var speedValue = z.union([num, z.object({ number: num, condition: str.optional() })]);
25
- var monsterSpeedSchema = z.object({
26
- walk: speedValue.optional(),
27
- fly: speedValue.optional(),
28
- swim: speedValue.optional(),
29
- climb: speedValue.optional(),
30
- burrow: speedValue.optional(),
31
- hover: bool.optional(),
32
- can_hover: bool.optional(),
33
- alternate: z.record(str, z.array(z.object({ number: num, condition: str.optional() }))).optional(),
34
- choose: z.object({ from: strArr, amount: num, note: str.optional() }).optional()
35
- });
36
- var monsterTypeSchema = z.object({
37
- type: z.union([str, z.object({ choose: strArr })]),
38
- tags: z.array(z.union([str, z.object({ tag: str, prefix: str, prefix_hidden: bool.optional() })])).optional(),
39
- sidekick_type: str.optional(),
40
- sidekick_tags: strArr.optional(),
41
- swarm_size: str.optional(),
42
- sidekick_hidden: bool.optional()
43
- });
44
- var monsterCRSchema = z.object({ cr: str, lair: str.optional(), coven: str.optional(), xp: num.optional(), xp_lair: num.optional() });
45
- var monsterACSchema = z.object({ ac: num.optional(), from: strArr.optional(), condition: str.optional(), braces: bool.optional(), special: str.optional() });
46
- var monsterHPSchema = z.object({ average: num.optional(), formula: str.optional(), special: str.optional() });
47
- var alignmentEntrySchema = z.object({ alignment: strArr.optional(), chance: num.optional(), note: str.optional(), special: str.optional() });
48
- var spellEntry = z.union([str, z.object({ entry: str, hidden: bool.optional() })]);
49
- var spellList = z.array(spellEntry);
50
- var spellLevel = z.object({ slots: num.optional(), lower: num.optional(), spells: strArr });
51
- var monsterSpellcastingSchema = z.object({
52
- name: str.optional(),
53
- type: str.optional(),
54
- headerEntries: strArr.optional(),
55
- footerEntries: strArr.optional(),
56
- ability: str.optional(),
57
- displayAs: str.optional(),
58
- hidden: strArr.optional(),
59
- spells: z.record(str, spellLevel).optional(),
60
- will: spellList.optional(),
61
- ritual: spellList.optional(),
62
- daily: z.record(str, spellList).optional(),
63
- rest: z.record(str, spellList).optional(),
64
- restLong: z.record(str, spellList).optional(),
65
- recharge: z.record(str, spellList).optional(),
66
- legendary: z.record(str, spellList).optional(),
67
- charges: z.record(str, spellList).optional(),
68
- chargesItem: str.optional()
69
- });
70
- var initiativeSchema = z.union([num, z.object({ proficiency: num.optional(), advantage_mode: str.optional() })]);
71
- var gearEntrySchema = z.union([str, z.object({ item: str, quantity: num.optional(), displayName: str.optional() })]);
72
- var featureArr = z.array(featureObjectSchema).optional();
73
- var monsterSchema = z.object({
74
- name: str.min(1),
75
- size: z.union([str, strArr]).optional(),
76
- size_note: str.optional(),
77
- type: z.union([str, monsterTypeSchema]).optional(),
78
- subtype: str.optional(),
79
- alignment: z.union([str, z.array(z.union([str, alignmentEntrySchema]))]).optional(),
80
- alignment_prefix: str.optional(),
81
- cr: z.union([str, monsterCRSchema]).optional(),
82
- pb_note: str.optional(),
83
- ac: z.array(monsterACSchema).optional(),
84
- hp: monsterHPSchema.optional(),
85
- speed: monsterSpeedSchema.optional(),
86
- abilities: z.object({ str: num, dex: num, con: num, int: num, wis: num, cha: num }).optional(),
87
- saves: z.record(str, num).optional(),
88
- skills: z.record(str, num).optional(),
89
- skills_other: z.array(z.unknown()).optional(),
90
- senses: strArr.nullable().optional(),
91
- passive_perception: num.optional(),
92
- languages: strArr.nullable().optional(),
93
- damage_vulnerabilities: qualifierList,
94
- damage_resistances: qualifierList,
95
- damage_immunities: qualifierList,
96
- condition_immunities: qualifierList,
97
- traits: featureArr,
98
- actions: featureArr,
99
- bonus_actions: featureArr,
100
- reactions: featureArr,
101
- legendary_actions: featureArr,
102
- mythic: featureArr,
103
- mythic_header: strArr.optional(),
104
- legendary_action_uses: num.optional(),
105
- legendary_resistance: num.optional(),
106
- legendary_actions_lair_count: num.optional(),
107
- section_headers: z.array(z.object({ section: str, header: strArr })).optional(),
108
- action_note: str.optional(),
109
- reaction_note: str.optional(),
110
- spellcasting: z.array(monsterSpellcastingSchema).optional(),
111
- legendary_group: z.object({ name: str, source: str }).optional(),
112
- lair_actions: z.array(z.unknown()).optional(),
113
- regional_actions: z.array(z.unknown()).optional(),
114
- variant: z.array(z.unknown()).optional(),
115
- initiative: initiativeSchema.optional(),
116
- gear: z.array(gearEntrySchema).optional(),
117
- is_named_creature: bool.optional(),
118
- is_npc: bool.optional(),
119
- familiar: bool.optional(),
120
- short_name: z.union([str, bool]).optional(),
121
- level: num.optional(),
122
- dragon_age: str.optional(),
123
- dragon_casting_color: str.optional(),
124
- environment: strArr.optional(),
125
- treasure: strArr.optional(),
126
- attached_items: strArr.optional(),
127
- group: strArr.nullable().optional(),
128
- summoned_by_spell: str.optional(),
129
- summoned_by_spell_level: num.optional(),
130
- summoned_by_class: str.optional(),
131
- trait_tags: strArr.optional(),
132
- action_tags: strArr.optional(),
133
- sense_tags: strArr.optional(),
134
- language_tags: strArr.optional(),
135
- spellcasting_tags: strArr.optional(),
136
- misc_tags: strArr.optional(),
137
- damage_tags: strArr.optional(),
138
- damage_tags_spell: strArr.optional(),
139
- damage_tags_legendary: strArr.optional(),
140
- condition_inflict: strArr.optional(),
141
- condition_inflict_spell: strArr.optional(),
142
- condition_inflict_legendary: strArr.optional(),
143
- saving_throw_forced: strArr.optional(),
144
- saving_throw_forced_spell: strArr.optional(),
145
- saving_throw_forced_legendary: strArr.optional(),
146
- has_fluff: bool.optional(),
147
- has_fluff_images: bool.optional(),
148
- has_token: bool.optional(),
149
- token_credit: str.optional(),
150
- token_custom: bool.optional(),
151
- foundry_token_scale: num.optional(),
152
- sound_clip: z.object({ type: str, path: str }).optional(),
153
- alt_art: z.array(z.object({ name: str, source: str.optional(), page: num.optional() })).optional(),
154
- image: imageField,
155
- thumbnail: imageField,
156
- rendering_hint: str.optional(),
157
- columns: num.optional(),
158
- slug: str.optional(),
159
- edition: str.optional(),
160
- source: str.optional(),
161
- raw: z.record(str, z.unknown()).optional()
162
- });
163
- var MONSTER_KNOWN_KEYS = new Set(Object.keys(monsterSchema.shape));
164
-
165
- export {
166
- damageQualifierSchema,
167
- monsterSpeedSchema,
168
- monsterTypeSchema,
169
- monsterCRSchema,
170
- monsterACSchema,
171
- monsterHPSchema,
172
- alignmentEntrySchema,
173
- monsterSpellcastingSchema,
174
- initiativeSchema,
175
- gearEntrySchema,
176
- monsterSchema,
177
- MONSTER_KNOWN_KEYS
178
- };
@@ -1,18 +0,0 @@
1
- import {
2
- parseItem
3
- } from "./chunk-EYX4JMAU.js";
4
-
5
- // src/item/item.codec.ts
6
- import yaml from "js-yaml";
7
- var itemCodec = {
8
- parse(doc) {
9
- return parseItem(doc.body);
10
- },
11
- serialize(item) {
12
- return yaml.dump(item, { lineWidth: -1, sortKeys: false });
13
- }
14
- };
15
-
16
- export {
17
- itemCodec
18
- };
@@ -1,16 +0,0 @@
1
- // src/class/class.slug.ts
2
- function bareSlug(ref) {
3
- if (typeof ref !== "string") return "";
4
- const m = ref.match(/^\[\[(.+?)\]\]$/);
5
- return (m ? m[1] : ref).toLowerCase();
6
- }
7
- function baseClassName(ref) {
8
- const bare = bareSlug(ref);
9
- const p = bare.split("_");
10
- return p.length >= 3 ? p.slice(2).join("_") : p[p.length - 1];
11
- }
12
-
13
- export {
14
- bareSlug,
15
- baseClassName
16
- };
@@ -1,16 +0,0 @@
1
- // src/spell/casting-time.ts
2
- function parseCastingTime(token) {
3
- var _a;
4
- const t = (_a = token == null ? void 0 : token.trim()) != null ? _a : "";
5
- if (!t) return null;
6
- if (/^(?:1\s*)?reaction\b/i.test(t)) return { kind: "reaction", count: 1 };
7
- if (/^(?:1\s*)?bonus(?:[\s-]*action)?\b/i.test(t)) return { kind: "bonus", count: 1 };
8
- if (/^(?:1\s*)?action\b/i.test(t)) return { kind: "action", count: 1 };
9
- const m = /^(\d+)?[\s-]*(minute|min|hour|hr)s?\b/i.exec(t);
10
- if (m) return { kind: "time", count: m[1] ? Number(m[1]) : 1, unit: /^h/i.test(m[2]) ? "hour" : "minute" };
11
- return null;
12
- }
13
-
14
- export {
15
- parseCastingTime
16
- };
@@ -1,256 +0,0 @@
1
- // src/dnd/constants.ts
2
- var CR_PROFICIENCY = {
3
- "0": 2,
4
- "1/8": 2,
5
- "1/4": 2,
6
- "1/2": 2,
7
- "1": 2,
8
- "2": 2,
9
- "3": 2,
10
- "4": 2,
11
- "5": 3,
12
- "6": 3,
13
- "7": 3,
14
- "8": 3,
15
- "9": 4,
16
- "10": 4,
17
- "11": 4,
18
- "12": 4,
19
- "13": 5,
20
- "14": 5,
21
- "15": 5,
22
- "16": 5,
23
- "17": 6,
24
- "18": 6,
25
- "19": 6,
26
- "20": 6,
27
- "21": 7,
28
- "22": 7,
29
- "23": 7,
30
- "24": 7,
31
- "25": 8,
32
- "26": 8,
33
- "27": 8,
34
- "28": 8,
35
- "29": 9,
36
- "30": 9
37
- };
38
- var CR_XP = {
39
- "0": 10,
40
- "1/8": 25,
41
- "1/4": 50,
42
- "1/2": 100,
43
- "1": 200,
44
- "2": 450,
45
- "3": 700,
46
- "4": 1100,
47
- "5": 1800,
48
- "6": 2300,
49
- "7": 2900,
50
- "8": 3900,
51
- "9": 5e3,
52
- "10": 5900,
53
- "11": 7200,
54
- "12": 8400,
55
- "13": 1e4,
56
- "14": 11500,
57
- "15": 13e3,
58
- "16": 15e3,
59
- "17": 18e3,
60
- "18": 2e4,
61
- "19": 22e3,
62
- "20": 25e3,
63
- "21": 33e3,
64
- "22": 41e3,
65
- "23": 5e4,
66
- "24": 62e3,
67
- "25": 75e3,
68
- "26": 9e4,
69
- "27": 105e3,
70
- "28": 12e4,
71
- "29": 135e3,
72
- "30": 155e3
73
- };
74
- var ALL_CR_VALUES = [
75
- "0",
76
- "1/8",
77
- "1/4",
78
- "1/2",
79
- "1",
80
- "2",
81
- "3",
82
- "4",
83
- "5",
84
- "6",
85
- "7",
86
- "8",
87
- "9",
88
- "10",
89
- "11",
90
- "12",
91
- "13",
92
- "14",
93
- "15",
94
- "16",
95
- "17",
96
- "18",
97
- "19",
98
- "20",
99
- "21",
100
- "22",
101
- "23",
102
- "24",
103
- "25",
104
- "26",
105
- "27",
106
- "28",
107
- "29",
108
- "30"
109
- ];
110
- var SIZE_HIT_DICE = {
111
- tiny: 4,
112
- small: 6,
113
- medium: 8,
114
- large: 10,
115
- huge: 12,
116
- gargantuan: 20
117
- };
118
- var ALL_SIZES = ["Tiny", "Small", "Medium", "Large", "Huge", "Gargantuan"];
119
- var SKILL_ABILITY = {
120
- "acrobatics": "dex",
121
- "animal handling": "wis",
122
- "arcana": "int",
123
- "athletics": "str",
124
- "deception": "cha",
125
- "history": "int",
126
- "insight": "wis",
127
- "intimidation": "cha",
128
- "investigation": "int",
129
- "medicine": "wis",
130
- "nature": "int",
131
- "perception": "wis",
132
- "performance": "cha",
133
- "persuasion": "cha",
134
- "religion": "int",
135
- "sleight of hand": "dex",
136
- "stealth": "dex",
137
- "survival": "wis"
138
- };
139
- var ALL_SKILLS = [
140
- "Acrobatics",
141
- "Animal Handling",
142
- "Arcana",
143
- "Athletics",
144
- "Deception",
145
- "History",
146
- "Insight",
147
- "Intimidation",
148
- "Investigation",
149
- "Medicine",
150
- "Nature",
151
- "Perception",
152
- "Performance",
153
- "Persuasion",
154
- "Religion",
155
- "Sleight of Hand",
156
- "Stealth",
157
- "Survival"
158
- ];
159
- var ABILITY_KEYS = ["str", "dex", "con", "int", "wis", "cha"];
160
- var ABILITY_NAMES = {
161
- str: "STR",
162
- dex: "DEX",
163
- con: "CON",
164
- int: "INT",
165
- wis: "WIS",
166
- cha: "CHA"
167
- };
168
- var DAMAGE_TYPES = [
169
- "Acid",
170
- "Bludgeoning",
171
- "Cold",
172
- "Fire",
173
- "Force",
174
- "Lightning",
175
- "Necrotic",
176
- "Piercing",
177
- "Poison",
178
- "Psychic",
179
- "Radiant",
180
- "Slashing",
181
- "Thunder"
182
- ];
183
- var DAMAGE_NONMAGICAL_VARIANTS = [
184
- "Bludgeoning, Piercing, and Slashing from Nonmagical Attacks",
185
- "Bludgeoning, Piercing, and Slashing from Nonmagical Attacks not made with Silvered Weapons",
186
- "Bludgeoning, Piercing, and Slashing from Nonmagical Attacks not made with Adamantine Weapons"
187
- ];
188
- var CONDITIONS = [
189
- "Blinded",
190
- "Charmed",
191
- "Deafened",
192
- "Exhaustion",
193
- "Frightened",
194
- "Grappled",
195
- "Incapacitated",
196
- "Invisible",
197
- "Paralyzed",
198
- "Petrified",
199
- "Poisoned",
200
- "Prone",
201
- "Restrained",
202
- "Stunned",
203
- "Unconscious"
204
- ];
205
- var STANDARD_SENSES = ["Blindsight", "Darkvision", "Tremorsense", "Truesight"];
206
- var STANDARD_ACTIONS = {
207
- "2014": ["Attack", "Cast a Spell", "Dash", "Disengage", "Dodge", "Help", "Hide", "Ready", "Search", "Use an Object"],
208
- "2024": ["Attack", "Dash", "Disengage", "Dodge", "Help", "Hide", "Influence", "Magic", "Ready", "Search", "Study", "Utilize"]
209
- };
210
- var ALIGNMENT_ETHICAL = ["Lawful", "Neutral", "Chaotic", "Unaligned", "Any"];
211
- var ALIGNMENT_MORAL = ["Good", "Neutral", "Evil"];
212
- var ALL_SECTIONS = [
213
- "Traits",
214
- "Actions",
215
- "Reactions",
216
- "Bonus Actions",
217
- "Legendary Actions",
218
- "Lair Actions",
219
- "Mythic Actions"
220
- ];
221
- var ABILITY_NAME_TO_KEY = {
222
- strength: "str",
223
- dexterity: "dex",
224
- constitution: "con",
225
- intelligence: "int",
226
- wisdom: "wis",
227
- charisma: "cha"
228
- };
229
- function normalizeAbility(value) {
230
- var _a;
231
- const k = value.trim().toLowerCase();
232
- if (ABILITY_KEYS.includes(k)) return k;
233
- return (_a = ABILITY_NAME_TO_KEY[k]) != null ? _a : null;
234
- }
235
-
236
- export {
237
- CR_PROFICIENCY,
238
- CR_XP,
239
- ALL_CR_VALUES,
240
- SIZE_HIT_DICE,
241
- ALL_SIZES,
242
- SKILL_ABILITY,
243
- ALL_SKILLS,
244
- ABILITY_KEYS,
245
- ABILITY_NAMES,
246
- DAMAGE_TYPES,
247
- DAMAGE_NONMAGICAL_VARIANTS,
248
- CONDITIONS,
249
- STANDARD_SENSES,
250
- STANDARD_ACTIONS,
251
- ALIGNMENT_ETHICAL,
252
- ALIGNMENT_MORAL,
253
- ALL_SECTIONS,
254
- ABILITY_NAME_TO_KEY,
255
- normalizeAbility
256
- };
@@ -1,165 +0,0 @@
1
- import {
2
- evaluateMaxFormula,
3
- isValidMaxFormula
4
- } from "./chunk-EVMUJYUD.js";
5
-
6
- // src/dnd/amount-text.ts
7
- var ABILITY_WORD = {
8
- strength: "str",
9
- dexterity: "dex",
10
- constitution: "con",
11
- intelligence: "int",
12
- wisdom: "wis",
13
- charisma: "cha",
14
- str: "str",
15
- dex: "dex",
16
- con: "con",
17
- int: "int",
18
- wis: "wis",
19
- cha: "cha"
20
- };
21
- var ABILITY_RE = "(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)";
22
- var CLASS_RE = "(Artificer|Barbarian|Bard|Cleric|Druid|Fighter|Monk|Paladin|Ranger|Rogue|Sorcerer|Warlock|Wizard)";
23
- var TOKEN_ALIAS = {
24
- prof_bonus: "prof",
25
- proficiency_bonus: "prof",
26
- spellcasting_mod: "spell_mod",
27
- spell_save_dc: "spell_dc"
28
- };
29
- var IDENT_LABEL = {
30
- level: "level",
31
- class_level: "class level",
32
- prof: "PB",
33
- str_mod: "STR mod",
34
- dex_mod: "DEX mod",
35
- con_mod: "CON mod",
36
- int_mod: "INT mod",
37
- wis_mod: "WIS mod",
38
- cha_mod: "CHA mod",
39
- spell_mod: "spellcasting mod",
40
- spell_dc: "spell save DC"
41
- };
42
- var abilityToken = (word) => `{${ABILITY_WORD[word.toLowerCase()]}_mod}`;
43
- var PHRASES = [
44
- // Save DCs: "your spell save DC", "your sorcerer spell save DC", "the spell save DC from this class's Spellcasting feature".
45
- [/\b(?:your|the)\s+(?:[a-z]+\s+)?spell save DC(?:\s+from this class's Spellcasting feature)?/gi, "{spell_dc}"],
46
- // "8 plus your Wisdom modifier and Proficiency Bonus" (2024) / the 2014 order is caught by the rows below.
47
- [
48
- new RegExp(`\\b8 plus your ${ABILITY_RE} modifier and (?:your )?Proficiency Bonus`, "gi"),
49
- (_m, a) => `8 + ${abilityToken(a)} + {prof}`
50
- ],
51
- // The spellcasting modifier, in every spelling the notes carry.
52
- [/\b(?:your\s+)?spellcasting ability modifier\b/gi, "{spell_mod}"],
53
- [/\b(?:your\s+)?spellcasting modifier\b/gi, "{spell_mod}"],
54
- [/\b(?:your\s+)?spell(?:casting)? mod\b/gi, "{spell_mod}"],
55
- // An ability modifier: "your Wisdom modifier", "Intelligence modifier", "WIS mod".
56
- [new RegExp(`\\b(?:your\\s+)?${ABILITY_RE} modifier\\b`, "gi"), (_m, a) => abilityToken(a)],
57
- [/\b(STR|DEX|CON|INT|WIS|CHA) mod(?:ifier)?\b/g, (_m, a) => abilityToken(a)],
58
- // Class level: "half your Warlock level", "your fighter level"; the character's level.
59
- [new RegExp(`\\bhalf your ${CLASS_RE} level(?:\\s*\\(round(?:ed)? up\\))`, "gi"), "ceil({class_level} / 2)"],
60
- [new RegExp(`\\bhalf your ${CLASS_RE} level(?:\\s*\\(round(?:ed)? down\\))?`, "gi"), "floor({class_level} / 2)"],
61
- [/\bhalf your level in this class(?:\s*\(round(?:ed)? up\))/gi, "ceil({class_level} / 2)"],
62
- [/\bhalf your level in this class(?:\s*\(round(?:ed)? down\))?/gi, "floor({class_level} / 2)"],
63
- [new RegExp(`\\byour ${CLASS_RE} level\\b`, "gi"), "{class_level}"],
64
- [/\byour level in this class\b/gi, "{class_level}"],
65
- [/\byour (?:character )?level\b/gi, "{level}"],
66
- // Proficiency bonus.
67
- [/\b(?:your\s+)?proficiency bonus\b/gi, "{prof}"],
68
- [/\bPB\b/g, "{prof}"]
69
- ];
70
- function normalizeAmountPhrases(text) {
71
- let out = text;
72
- for (const [re, to] of PHRASES) out = out.replace(re, to);
73
- if (out === text) return text;
74
- out = out.replace(/\s+plus\s+/gi, " + ").replace(/\s+minus\s+/gi, " - ").replace(/\btwice (\{[a-z_]+\})/gi, "2 * $1");
75
- return out;
76
- }
77
- var TRAILING_MIN = /\s*\(minimum(?: bonus)? of \+?(\d+)[^)]*\)\s*$/i;
78
- var DICE = /^\d*d\d+$/i;
79
- function tidySigns(s) {
80
- return s.replace(/\+\s*-\s*/g, "- ").replace(/-\s*-\s*/g, "+ ");
81
- }
82
- function foldDice(expr) {
83
- const parts = expr.replace(/\s+/g, "").match(/[+-]?[^+-]+/g);
84
- if (!parts) return null;
85
- const dice = [];
86
- let sum = 0;
87
- for (const raw of parts) {
88
- const sign = raw.startsWith("-") ? -1 : 1;
89
- const body = raw.replace(/^[+-]/, "");
90
- if (DICE.test(body)) {
91
- if (sign < 0) return null;
92
- dice.push(body.toLowerCase());
93
- continue;
94
- }
95
- if (!isValidMaxFormula(body)) return null;
96
- sum += sign * evaluateMaxFormula(body, ZERO_BINDINGS);
97
- }
98
- if (dice.length === 0) return null;
99
- const n = Math.trunc(sum);
100
- return `${dice.join("+")}${n > 0 ? `+${n}` : n < 0 ? `${n}` : ""}`;
101
- }
102
- var ZERO_BINDINGS = {
103
- level: 0,
104
- class_level: 0,
105
- prof: 0,
106
- str_mod: 0,
107
- dex_mod: 0,
108
- con_mod: 0,
109
- int_mod: 0,
110
- wis_mod: 0,
111
- cha_mod: 0,
112
- columns: {}
113
- };
114
- function resolveAmountText(text, b) {
115
- const normalized = normalizeAmountPhrases(text);
116
- if (!normalized.includes("{")) return text;
117
- const values = b;
118
- let unbound = false;
119
- const substitute = (numeric2) => normalized.replace(/\{([a-z_]+)\}/g, (_m, raw) => {
120
- var _a, _b;
121
- const id = (_a = TOKEN_ALIAS[raw]) != null ? _a : raw;
122
- const v = values[id];
123
- if (typeof v !== "number" || !Number.isFinite(v)) {
124
- unbound = true;
125
- return (_b = IDENT_LABEL[id]) != null ? _b : raw;
126
- }
127
- return numeric2 && v < 0 ? `(0 - ${-v})` : String(v);
128
- });
129
- const display = tidySigns(substitute(false));
130
- if (unbound) return text.includes("{") ? display : text;
131
- const min = TRAILING_MIN.exec(display);
132
- const minText = min ? display.slice(min.index) : "";
133
- const numeric = substitute(true);
134
- const numericCore = numeric.replace(TRAILING_MIN, "");
135
- if (isValidMaxFormula(numericCore)) {
136
- const v = evaluateMaxFormula(numericCore, ZERO_BINDINGS);
137
- return String(Math.trunc(min ? Math.max(Number(min[1]), v) : v));
138
- }
139
- const roll = foldDice(min ? display.slice(0, min.index) : display);
140
- if (roll) return `${roll}${minText}`;
141
- if (/\b(?:floor|ceil|max|min)\(/.test(display)) return text;
142
- return display;
143
- }
144
- function addToRoll(roll, amounts) {
145
- var _a;
146
- if (!amounts.length) return roll;
147
- const text = tidySigns([roll, ...amounts].join(" + "));
148
- return (_a = foldDice(text)) != null ? _a : text;
149
- }
150
- function diceRollOf(resolved) {
151
- var _a, _b;
152
- return (_b = (_a = diceRollPrefix(resolved)) == null ? void 0 : _a.notation) != null ? _b : null;
153
- }
154
- function diceRollPrefix(text) {
155
- const m = /^(\d*d\d+(?:\s*[+-]\s*\d+)*)(?=\s|$)/i.exec(text);
156
- return m ? { raw: m[1], notation: m[1].replace(/\s+/g, "") } : null;
157
- }
158
-
159
- export {
160
- normalizeAmountPhrases,
161
- resolveAmountText,
162
- addToRoll,
163
- diceRollOf,
164
- diceRollPrefix
165
- };
@@ -1,31 +0,0 @@
1
- import {
2
- STATIC_FALLBACK_CONTEXT,
3
- convertDescToTags
4
- } from "./chunk-DEEHHLAP.js";
5
-
6
- // src/spell/spell.enrichment.ts
7
- function enrichSpell(raw) {
8
- var _a, _b, _c, _d;
9
- const duration = raw.duration;
10
- const concentration = (_b = raw.concentration) != null ? _b : (_a = duration == null ? void 0 : duration.toLowerCase().includes("concentration")) != null ? _a : false;
11
- const classes = ((_c = raw.classes) == null ? void 0 : _c.length) ? raw.classes : ["Wizard", "Sorcerer"];
12
- const enriched = {
13
- ...raw,
14
- concentration,
15
- ritual: (_d = raw.ritual) != null ? _d : false,
16
- classes
17
- };
18
- if (typeof enriched.description === "string") {
19
- enriched.description = convertDescToTags(enriched.description, STATIC_FALLBACK_CONTEXT);
20
- }
21
- if (Array.isArray(enriched.at_higher_levels)) {
22
- enriched.at_higher_levels = enriched.at_higher_levels.map(
23
- (p) => convertDescToTags(p, STATIC_FALLBACK_CONTEXT)
24
- );
25
- }
26
- return enriched;
27
- }
28
-
29
- export {
30
- enrichSpell
31
- };
@@ -1,14 +0,0 @@
1
- // src/schemas/duration-schema.ts
2
- import { z } from "zod";
3
- var durationSchema = z.union([
4
- z.literal("instantaneous"),
5
- z.literal("until-dispelled"),
6
- z.object({
7
- amount: z.number().int().positive(),
8
- unit: z.enum(["round", "minute", "hour", "day"])
9
- }).strict()
10
- ]);
11
-
12
- export {
13
- durationSchema
14
- };