@archivist-gg/dnd5e 0.3.17 → 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.
- package/LICENSE +48 -21
- package/README.md +26 -48
- package/dist/armor/armor.codec.d.ts +0 -7
- package/dist/armor/armor.codec.js +1 -9
- package/dist/armor/armor.parser.js +1 -8
- package/dist/armor/armor.schema.js +1 -7
- package/dist/armor/armor.types.d.ts +0 -3
- package/dist/background/background.codec.d.ts +0 -6
- package/dist/background/background.codec.js +1 -12
- package/dist/background/background.parser.js +1 -11
- package/dist/background/background.schema.js +1 -12
- package/dist/background/background.types.d.ts +0 -5
- package/dist/chunk-2EOGK6R6.js +1 -0
- package/dist/chunk-2HRRH3WL.js +1 -0
- package/dist/chunk-2LCGKNVM.js +1 -0
- package/dist/chunk-2NUDWOFG.js +1 -0
- package/dist/chunk-334WLI7V.js +1 -0
- package/dist/chunk-3LWOVRLA.js +1 -0
- package/dist/chunk-3QQOATV3.js +1 -0
- package/dist/chunk-4E2GIWJE.js +1 -0
- package/dist/chunk-4GN3GYMP.js +1 -0
- package/dist/chunk-4IAMSRHD.js +1 -0
- package/dist/chunk-4JEF3CET.js +1 -0
- package/dist/chunk-4KVVAENP.js +1 -0
- package/dist/chunk-56JK6VCL.js +1 -0
- package/dist/chunk-5FEXHY4U.js +1 -0
- package/dist/chunk-63YJPWTM.js +1 -0
- package/dist/chunk-6ASJ3MVB.js +1 -0
- package/dist/chunk-6IC53O3Q.js +1 -0
- package/dist/chunk-6LCNV26D.js +1 -0
- package/dist/chunk-6W253VHH.js +1 -0
- package/dist/chunk-7AKJBRBD.js +1 -0
- package/dist/chunk-7EL3GWWJ.js +1 -0
- package/dist/chunk-7FPQJDFD.js +1 -0
- package/dist/chunk-7J5BNH2D.js +1 -0
- package/dist/chunk-7LPKI27J.js +1 -0
- package/dist/chunk-7UPYRKMF.js +1 -0
- package/dist/chunk-A7H6LX47.js +1 -0
- package/dist/chunk-AINRPPLH.js +1 -0
- package/dist/chunk-BC52J4LA.js +1 -0
- package/dist/chunk-BCXGB4HP.js +1 -0
- package/dist/chunk-BGX36NPE.js +1 -0
- package/dist/chunk-BPKG6RZ7.js +1 -0
- package/dist/chunk-BREHZNTL.js +1 -0
- package/dist/chunk-BZ6BGGZS.js +1 -0
- package/dist/chunk-CAPYNIGK.js +1 -0
- package/dist/chunk-CCFIINBA.js +1 -0
- package/dist/chunk-CMIEZQL4.js +1 -0
- package/dist/chunk-DVUXUIPV.js +1 -0
- package/dist/chunk-DY6FVAGA.js +1 -0
- package/dist/chunk-DZITM5AG.js +1 -0
- package/dist/chunk-DZKSXSJF.js +1 -0
- package/dist/chunk-EAARMPCW.js +1 -0
- package/dist/chunk-EVT7MGAC.js +1 -0
- package/dist/chunk-FOLHTMSC.js +1 -0
- package/dist/chunk-GCYUCIDN.js +1 -0
- package/dist/chunk-GIOV6JW7.js +1 -0
- package/dist/chunk-HCK6IUB3.js +1 -0
- package/dist/chunk-HR5MKCP2.js +1 -0
- package/dist/chunk-I26FHSI6.js +1 -0
- package/dist/chunk-I4O2FIDT.js +1 -0
- package/dist/chunk-IGVRLGLM.js +1 -0
- package/dist/chunk-IHPLT2ZT.js +1 -0
- package/dist/chunk-IOCJIWCV.js +1 -0
- package/dist/chunk-JXDX2DKF.js +1 -0
- package/dist/chunk-KBFSJ5WE.js +1 -0
- package/dist/chunk-KM75CC6Q.js +1 -0
- package/dist/chunk-KZDDFG4O.js +1 -0
- package/dist/chunk-LJNT3PJP.js +1 -0
- package/dist/chunk-LR6UMA5V.js +1 -0
- package/dist/chunk-M6RPOLKS.js +1 -0
- package/dist/chunk-MC6PLWRZ.js +1 -0
- package/dist/chunk-MGGKZGLG.js +1 -0
- package/dist/chunk-N3RYJ7RE.js +1 -0
- package/dist/chunk-NEMX7QGG.js +1 -0
- package/dist/chunk-NI364WV7.js +1 -0
- package/dist/chunk-O2QZ73GA.js +1 -0
- package/dist/chunk-O776WL7O.js +1 -0
- package/dist/chunk-OTFNINUY.js +1 -0
- package/dist/chunk-PQAVMK3T.js +1 -0
- package/dist/chunk-PZ3ZZ5H5.js +1 -0
- package/dist/chunk-PZ4L2EEG.js +1 -0
- package/dist/chunk-PZUPZBTN.js +1 -0
- package/dist/chunk-QBA757AU.js +1 -0
- package/dist/chunk-QFIGPOFW.js +1 -0
- package/dist/chunk-QMEKQTUT.js +1 -0
- package/dist/chunk-QVWT67WA.js +1 -0
- package/dist/chunk-RDXQAZBA.js +1 -0
- package/dist/chunk-RE5Z5RNK.js +1 -0
- package/dist/chunk-RL4VY2AL.js +1 -0
- package/dist/chunk-RQGTBHJW.js +1 -0
- package/dist/chunk-RQZCGXUZ.js +1 -0
- package/dist/chunk-S5UCI27C.js +1 -0
- package/dist/chunk-SEOASDO4.js +1 -0
- package/dist/chunk-SU4MEZ5P.js +1 -0
- package/dist/chunk-T55DELVL.js +1 -0
- package/dist/chunk-TKIEPC6F.js +1 -0
- package/dist/chunk-TLXFGGWH.js +1 -0
- package/dist/chunk-UBUKCRZ3.js +1 -0
- package/dist/chunk-V6NQ547U.js +1 -0
- package/dist/chunk-VA3ZWV7C.js +1 -0
- package/dist/chunk-VIP3FH2O.js +1 -0
- package/dist/chunk-VTQ4RWEG.js +1 -0
- package/dist/chunk-WUHTSLG4.js +1 -0
- package/dist/chunk-X22SISGM.js +1 -0
- package/dist/chunk-XKJXT2PN.js +1 -0
- package/dist/chunk-XQMKH4R4.js +1 -0
- package/dist/chunk-YGH7S5ZF.js +1 -0
- package/dist/chunk-ZE46ADXS.js +1 -0
- package/dist/chunk-ZI3FEUX3.js +1 -0
- package/dist/class/class.codec.d.ts +0 -7
- package/dist/class/class.codec.js +1 -18
- package/dist/class/class.parser.js +1 -17
- package/dist/class/class.schema.d.ts +2 -1
- package/dist/class/class.schema.js +1 -15
- package/dist/class/class.slug.d.ts +0 -11
- package/dist/class/class.slug.js +1 -8
- package/dist/class/class.standard-array.d.ts +0 -7
- package/dist/class/class.standard-array.js +1 -20
- package/dist/class/class.types.d.ts +0 -20
- package/dist/condition/condition.codec.d.ts +0 -6
- package/dist/condition/condition.parser.d.ts +0 -10
- package/dist/condition/condition.parser.js +1 -7
- package/dist/condition/condition.schema.d.ts +0 -16
- package/dist/condition/condition.types.d.ts +0 -3
- package/dist/data-srd/index.generated.js +1 -146
- package/dist/dnd/amount-text.d.ts +4 -27
- package/dist/dnd/amount-text.js +1 -13
- package/dist/dnd/constants.d.ts +0 -18
- package/dist/dnd/constants.js +1 -42
- package/dist/dnd/formula-tags.d.ts +0 -2
- package/dist/dnd/formula-tags.js +1 -119
- package/dist/dnd/math.d.ts +0 -26
- package/dist/dnd/math.js +1 -45
- package/dist/dnd/prose-tags.d.ts +1 -15
- package/dist/dnd/prose-tags.js +1 -18
- package/dist/dnd/resource-die.d.ts +0 -4
- package/dist/dnd/resource-die.js +1 -17
- package/dist/dnd/resource-formula.d.ts +0 -43
- package/dist/dnd/resource-formula.js +1 -14
- package/dist/dnd/resource-words.d.ts +0 -2
- package/dist/dnd/resource-words.js +1 -30
- package/dist/dnd/srd-tag-converter.d.ts +0 -21
- package/dist/dnd/srd-tag-converter.js +1 -12
- package/dist/dnd/tag-grammar.js +1 -12
- package/dist/dnd/warn-once.js +1 -8
- package/dist/encounter/encounter.ai-schema.js +1 -8
- package/dist/entities/base-item-resolver.d.ts +0 -26
- package/dist/entities/base-item-resolver.js +1 -11
- package/dist/entities/registry-revision.d.ts +10 -0
- package/dist/entities/registry-revision.js +1 -0
- package/dist/entities/slug.d.ts +1 -31
- package/dist/entities/slug.js +1 -12
- package/dist/entities/wikilink-display.d.ts +0 -2
- package/dist/entities/wikilink-display.js +1 -10
- package/dist/feat/feat.category-codes.d.ts +1 -26
- package/dist/feat/feat.category-codes.js +1 -14
- package/dist/feat/feat.codec.d.ts +0 -6
- package/dist/feat/feat.codec.js +1 -12
- package/dist/feat/feat.parser.js +1 -11
- package/dist/feat/feat.schema.d.ts +31 -1
- package/dist/feat/feat.schema.js +1 -10
- package/dist/feat/feat.types.d.ts +0 -6
- package/dist/index.js +45 -138113
- package/dist/inline-tag-parser.js +1 -6
- package/dist/item/item.actions-map.d.ts +4 -63
- package/dist/item/item.actions-map.js +1 -10
- package/dist/item/item.ai-schema.js +1 -6
- package/dist/item/item.attunement.d.ts +0 -14
- package/dist/item/item.attunement.js +1 -6
- package/dist/item/item.bonuses.js +1 -10
- package/dist/item/item.codec.js +1 -9
- package/dist/item/item.conditions.d.ts +0 -7
- package/dist/item/item.conditions.js +1 -11
- package/dist/item/item.conditions.types.d.ts +0 -2
- package/dist/item/item.cost.js +1 -29
- package/dist/item/item.enrichment.js +1 -9
- package/dist/item/item.icon.d.ts +0 -8
- package/dist/item/item.icon.js +1 -211
- package/dist/item/item.parser.js +1 -8
- package/dist/item/item.schema.d.ts +2 -0
- package/dist/item/item.schema.js +1 -11
- package/dist/item/item.types.d.ts +2 -28
- package/dist/monster/monster.ai-schema.js +1 -6
- package/dist/monster/monster.codec.d.ts +0 -10
- package/dist/monster/monster.enrichment.js +1 -19
- package/dist/monster/monster.format.d.ts +0 -69
- package/dist/monster/monster.format.js +1 -78
- package/dist/monster/monster.parser.d.ts +0 -4
- package/dist/monster/monster.parser.js +1 -15
- package/dist/monster/monster.resolve.d.ts +0 -4
- package/dist/monster/monster.schema.d.ts +0 -9
- package/dist/monster/monster.schema.js +1 -34
- package/dist/monster/monster.types.d.ts +0 -3
- package/dist/monster/monster.types.js +1 -1
- package/dist/optional-feature/optional-feature.codec.d.ts +0 -11
- package/dist/optional-feature/optional-feature.codec.js +1 -13
- package/dist/optional-feature/optional-feature.parser.js +1 -12
- package/dist/optional-feature/optional-feature.schema.d.ts +30 -1
- package/dist/optional-feature/optional-feature.schema.js +1 -15
- package/dist/pack.d.ts +0 -9
- package/dist/pc/conditions.constants.js +1 -6
- package/dist/pc/decision-recognizer.js +1 -8
- package/dist/pc/pc.additional-spells.d.ts +4 -14
- package/dist/pc/pc.additional-spells.js +1 -23
- package/dist/pc/pc.amount-bindings.d.ts +4 -20
- package/dist/pc/pc.amount-bindings.js +1 -23
- package/dist/pc/pc.asi-flatten.d.ts +0 -59
- package/dist/pc/pc.asi-flatten.js +1 -16
- package/dist/pc/pc.conditions.d.ts +1 -0
- package/dist/pc/pc.conditions.js +1 -6
- package/dist/pc/pc.containment.d.ts +0 -5
- package/dist/pc/pc.containment.js +1 -24
- package/dist/pc/pc.decision-engine.d.ts +4 -141
- package/dist/pc/pc.decision-engine.js +1 -52
- package/dist/pc/pc.defense-normalize.d.ts +0 -10
- package/dist/pc/pc.defense-normalize.js +1 -6
- package/dist/pc/pc.entry-overrides.d.ts +0 -58
- package/dist/pc/pc.entry-overrides.js +1 -40
- package/dist/pc/pc.equipment.d.ts +2 -22
- package/dist/pc/pc.equipment.js +1 -33
- package/dist/pc/pc.feature-effects.d.ts +23 -275
- package/dist/pc/pc.feature-effects.js +1 -26
- package/dist/pc/pc.formula-context.js +1 -11
- package/dist/pc/pc.infusions.d.ts +0 -65
- package/dist/pc/pc.infusions.js +1 -64
- package/dist/pc/pc.item-effects.d.ts +18 -0
- package/dist/pc/pc.member-choices.d.ts +18 -49
- package/dist/pc/pc.member-choices.js +1 -32
- package/dist/pc/pc.parser.js +1 -58
- package/dist/pc/pc.pools.d.ts +7 -10
- package/dist/pc/pc.pools.js +1 -26
- package/dist/pc/pc.proficiencies.d.ts +7 -33
- package/dist/pc/pc.proficiencies.js +1 -107
- package/dist/pc/pc.proficiency-grants.d.ts +0 -26
- package/dist/pc/pc.proficiency-normalize.d.ts +4 -25
- package/dist/pc/pc.proficiency-normalize.js +1 -12
- package/dist/pc/pc.proficiency-query.d.ts +0 -13
- package/dist/pc/pc.proficiency-query.js +1 -27
- package/dist/pc/pc.recalc.d.ts +7 -131
- package/dist/pc/pc.recalc.js +1 -946
- package/dist/pc/pc.resolver.d.ts +0 -104
- package/dist/pc/pc.resolver.js +1 -59
- package/dist/pc/pc.resource-seed.d.ts +0 -8
- package/dist/pc/pc.resource-seed.js +1 -42
- package/dist/pc/pc.resources.d.ts +1 -59
- package/dist/pc/pc.resources.js +1 -23
- package/dist/pc/pc.rest.d.ts +1 -20
- package/dist/pc/pc.rest.js +1 -230
- package/dist/pc/pc.schema.d.ts +19 -2
- package/dist/pc/pc.schema.js +1 -9
- package/dist/pc/pc.slotting.d.ts +0 -29
- package/dist/pc/pc.slotting.js +1 -28
- package/dist/pc/pc.speeds.d.ts +19 -0
- package/dist/pc/pc.spell-scope.d.ts +6 -0
- package/dist/pc/pc.spellcasting.d.ts +0 -70
- package/dist/pc/pc.spellcasting.js +1 -28
- package/dist/pc/pc.table-column.d.ts +0 -22
- package/dist/pc/pc.table-column.js +1 -18
- package/dist/pc/pc.tool-picks.d.ts +0 -27
- package/dist/pc/pc.tool-picks.js +1 -18
- package/dist/pc/pc.types.d.ts +85 -344
- package/dist/pc/pc.weapon-grant.d.ts +0 -6
- package/dist/pc/pool-layout.d.ts +0 -39
- package/dist/pc/pool-layout.js +1 -18
- package/dist/pc/resource-equivalents.d.ts +2 -40
- package/dist/pc/roll-scope.js +1 -8
- package/dist/pc/roll-tag-labels.d.ts +0 -32
- package/dist/pc/roll-tag-labels.js +1 -17
- package/dist/pc/spell-source.d.ts +0 -11
- package/dist/pc/spell-source.js +1 -8
- package/dist/race/race.codec.d.ts +0 -6
- package/dist/race/race.codec.js +1 -15
- package/dist/race/race.parser.js +1 -14
- package/dist/race/race.schema.d.ts +0 -8
- package/dist/race/race.schema.js +1 -14
- package/dist/race/race.structural.d.ts +0 -6
- package/dist/race/race.structural.js +1 -6
- package/dist/race/race.types.d.ts +0 -8
- package/dist/schemas/attack-schema.d.ts +5 -0
- package/dist/schemas/caster-type-schema.d.ts +1 -6
- package/dist/schemas/caster-type-schema.js +1 -6
- package/dist/schemas/choice-schema.js +1 -7
- package/dist/schemas/duration-schema.d.ts +0 -2
- package/dist/schemas/duration-schema.js +1 -6
- package/dist/schemas/entity-extras-schema.d.ts +0 -30
- package/dist/schemas/entity-extras-schema.js +1 -10
- package/dist/schemas/equipment-grant-schema.d.ts +0 -2
- package/dist/schemas/equipment-grant-schema.js +1 -12
- package/dist/schemas/feature-alias.d.ts +0 -27
- package/dist/schemas/feature-effect-schema.d.ts +30 -1
- package/dist/schemas/feature-effect-schema.js +1 -6
- package/dist/schemas/feature-schema.d.ts +0 -6
- package/dist/schemas/feature-schema.js +1 -12
- package/dist/schemas/resource-schema.d.ts +1 -34
- package/dist/schemas/resource-schema.js +1 -12
- package/dist/schemas/selection-pool-schema.js +1 -10
- package/dist/spell/casting-time.d.ts +0 -15
- package/dist/spell/casting-time.js +1 -6
- package/dist/spell/spell.access.d.ts +0 -6
- package/dist/spell/spell.access.js +1 -45
- package/dist/spell/spell.ai-schema.js +1 -6
- package/dist/spell/spell.codec.js +1 -9
- package/dist/spell/spell.enrichment.js +1 -9
- package/dist/spell/spell.filter.d.ts +0 -5
- package/dist/spell/spell.filter.js +1 -75
- package/dist/spell/spell.parser.d.ts +0 -31
- package/dist/spell/spell.parser.js +1 -16
- package/dist/spell/spell.scaling.d.ts +0 -46
- package/dist/spell/spell.scaling.js +1 -79
- package/dist/spell/spell.schema.js +1 -7
- package/dist/spell/spell.types.d.ts +0 -7
- package/dist/srd/retired-items.d.ts +0 -4
- package/dist/srd/retired-items.js +1 -11
- package/dist/srd-store.d.ts +0 -33
- package/dist/subclass/subclass.codec.d.ts +0 -8
- package/dist/subclass/subclass.codec.js +1 -17
- package/dist/subclass/subclass.parser.js +1 -16
- package/dist/subclass/subclass.schema.d.ts +2 -1
- package/dist/subclass/subclass.schema.js +1 -14
- package/dist/subclass/subclass.types.d.ts +0 -3
- package/dist/types/attack.d.ts +2 -0
- package/dist/types/casting-option.d.ts +0 -4
- package/dist/types/choice.d.ts +1 -72
- package/dist/types/choice.js +1 -24
- package/dist/types/edition.d.ts +0 -3
- package/dist/types/equipment-grant.d.ts +1 -27
- package/dist/types/equipment-grant.js +1 -12
- package/dist/types/feature-effect.d.ts +14 -14
- package/dist/types/feature.d.ts +0 -22
- package/dist/types/optional-feature.types.d.ts +1 -31
- package/dist/types/resource.d.ts +1 -21
- package/dist/types/selection-pool.d.ts +0 -24
- package/dist/weapon/weapon-mastery.d.ts +0 -1
- package/dist/weapon/weapon.classify.d.ts +0 -11
- package/dist/weapon/weapon.classify.js +1 -7
- package/dist/weapon/weapon.codec.d.ts +0 -9
- package/dist/weapon/weapon.codec.js +1 -9
- package/dist/weapon/weapon.parser.js +1 -8
- package/dist/weapon/weapon.schema.js +1 -7
- package/dist/weapon/weapon.types.d.ts +0 -3
- package/package.json +3 -3
- package/src/data-srd/ATTRIBUTION.md +1 -1
- package/dist/chunk-2FRUSVZS.js +0 -489
- package/dist/chunk-2JSQE3DD.js +0 -206
- package/dist/chunk-2LULMQTF.js +0 -14
- package/dist/chunk-2UDSN6VW.js +0 -18
- package/dist/chunk-3LWMFYKS.js +0 -57
- package/dist/chunk-3MGQFFNE.js +0 -110
- package/dist/chunk-3TM34RSJ.js +0 -23
- package/dist/chunk-3VZZDKRA.js +0 -1014
- package/dist/chunk-4U55VNC7.js +0 -22
- package/dist/chunk-5GKJAUMX.js +0 -59
- package/dist/chunk-5MXFW4O3.js +0 -71
- package/dist/chunk-656QCX4U.js +0 -22
- package/dist/chunk-6EI737IO.js +0 -19
- package/dist/chunk-6GNXYAYP.js +0 -25
- package/dist/chunk-6PXTNCBP.js +0 -133
- package/dist/chunk-6X2NV665.js +0 -33
- package/dist/chunk-7ATNGKBS.js +0 -178
- package/dist/chunk-7Q2VPKCD.js +0 -181
- package/dist/chunk-7QN7XSAK.js +0 -19
- package/dist/chunk-A54HHCWW.js +0 -67
- package/dist/chunk-AZRGFUSR.js +0 -18
- package/dist/chunk-B3DP42OM.js +0 -55
- package/dist/chunk-CJYCVNW2.js +0 -7
- package/dist/chunk-CM5CWO4K.js +0 -735
- package/dist/chunk-DEEHHLAP.js +0 -271
- package/dist/chunk-DOXSFYLH.js +0 -158
- package/dist/chunk-DPUJDOKV.js +0 -365
- package/dist/chunk-EJP263OP.js +0 -186
- package/dist/chunk-EVMUJYUD.js +0 -195
- package/dist/chunk-EYX4JMAU.js +0 -101
- package/dist/chunk-FANQVQ3D.js +0 -89
- package/dist/chunk-FC4IGH5Y.js +0 -18
- package/dist/chunk-G6MHJDVT.js +0 -41
- package/dist/chunk-G6PBI2BU.js +0 -18
- package/dist/chunk-H5PTKYXL.js +0 -101
- package/dist/chunk-HHBD4SQ6.js +0 -24
- package/dist/chunk-HS6FIOLP.js +0 -52
- package/dist/chunk-HTYMW5CH.js +0 -228
- package/dist/chunk-IHE6KVC3.js +0 -13
- package/dist/chunk-IN4M4X7P.js +0 -34
- package/dist/chunk-IUAAXXNO.js +0 -58
- package/dist/chunk-JCMUVZIK.js +0 -133
- package/dist/chunk-JSM6JFZR.js +0 -709
- package/dist/chunk-K5NJBTE2.js +0 -18
- package/dist/chunk-KR6JF3BF.js +0 -14
- package/dist/chunk-KSTV7J2U.js +0 -112
- package/dist/chunk-KU3YLF6D.js +0 -106
- package/dist/chunk-LBEXLN6I.js +0 -91
- package/dist/chunk-LF5AGJA4.js +0 -81
- package/dist/chunk-LHZXYFBU.js +0 -94
- package/dist/chunk-LSLSG67V.js +0 -31
- package/dist/chunk-LVQLWRCU.js +0 -15
- package/dist/chunk-MBX25B6D.js +0 -18
- package/dist/chunk-MYY2C5MB.js +0 -233
- package/dist/chunk-OFCSP6MT.js +0 -23
- package/dist/chunk-ONTGZR5T.js +0 -1806
- package/dist/chunk-OOSRUJBI.js +0 -19
- package/dist/chunk-PDJSUH24.js +0 -110
- package/dist/chunk-PKX6TGRE.js +0 -93
- package/dist/chunk-PQZ4LM4Z.js +0 -19
- package/dist/chunk-PTXBIDG7.js +0 -63
- package/dist/chunk-PVCEA4HZ.js +0 -6
- package/dist/chunk-PXVNAY7T.js +0 -84
- package/dist/chunk-QH36K2PU.js +0 -158
- package/dist/chunk-QS5L5YTJ.js +0 -24
- package/dist/chunk-QYZV2MQA.js +0 -97
- package/dist/chunk-QZSWN2KT.js +0 -18
- package/dist/chunk-RLGQ5PZZ.js +0 -16
- package/dist/chunk-RYLXAYIQ.js +0 -18
- package/dist/chunk-S3YUXDSC.js +0 -278
- package/dist/chunk-S7REMWW4.js +0 -21
- package/dist/chunk-T6QIF5XR.js +0 -348
- package/dist/chunk-TOM66P2P.js +0 -38
- package/dist/chunk-TULQ4FFX.js +0 -353
- package/dist/chunk-UA5KS2PL.js +0 -26
- package/dist/chunk-UUBJCNQU.js +0 -187
- package/dist/chunk-UZXG6QSY.js +0 -58
- package/dist/chunk-VPYBK2MG.js +0 -18
- package/dist/chunk-VRV3NNTA.js +0 -161
- package/dist/chunk-VTTA2ALZ.js +0 -16
- package/dist/chunk-W6GC6OKK.js +0 -16
- package/dist/chunk-WELIKLZF.js +0 -256
- package/dist/chunk-WSVMLNTO.js +0 -31
- package/dist/chunk-WYGD2UGN.js +0 -14
- package/dist/chunk-XCFC7LGF.js +0 -122
- package/dist/chunk-XJ2F2WO6.js +0 -8
- package/dist/chunk-Y5VVP73C.js +0 -23
- package/dist/chunk-YBLDE5CG.js +0 -42
- package/dist/chunk-YD2VAHA6.js +0 -159
- package/dist/chunk-YDGMBMYI.js +0 -25
- package/dist/chunk-YHYTW5QA.js +0 -20
- package/dist/chunk-YKL6SHRJ.js +0 -23
- package/dist/chunk-ZCTUYGNV.js +0 -26
- package/dist/chunk-ZDAEGJH4.js +0 -102
- package/dist/chunk-ZJXSXVFP.js +0 -58
- package/dist/chunk-ZUQW5VBZ.js +0 -89
package/dist/chunk-OOSRUJBI.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
parseSpell
|
|
3
|
-
} from "./chunk-7Q2VPKCD.js";
|
|
4
|
-
|
|
5
|
-
// src/spell/spell.codec.ts
|
|
6
|
-
import yaml from "js-yaml";
|
|
7
|
-
var spellCodec = {
|
|
8
|
-
parse(doc) {
|
|
9
|
-
return parseSpell(doc.body);
|
|
10
|
-
},
|
|
11
|
-
serialize(spell) {
|
|
12
|
-
const { material: _material, ...doc } = spell;
|
|
13
|
-
return yaml.dump(doc, { lineWidth: -1, sortKeys: false });
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
spellCodec
|
|
19
|
-
};
|
package/dist/chunk-PDJSUH24.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ABILITY_KEYS,
|
|
3
|
-
CR_PROFICIENCY,
|
|
4
|
-
CR_XP,
|
|
5
|
-
DAMAGE_TYPES,
|
|
6
|
-
SIZE_HIT_DICE
|
|
7
|
-
} from "./chunk-WELIKLZF.js";
|
|
8
|
-
|
|
9
|
-
// src/dnd/math.ts
|
|
10
|
-
function abilityModifier(score) {
|
|
11
|
-
return Math.floor((score - 10) / 2);
|
|
12
|
-
}
|
|
13
|
-
function formatModifier(mod) {
|
|
14
|
-
return mod >= 0 ? `+${mod}` : `${mod}`;
|
|
15
|
-
}
|
|
16
|
-
function proficiencyBonusFromCR(cr) {
|
|
17
|
-
var _a;
|
|
18
|
-
return (_a = CR_PROFICIENCY[cr]) != null ? _a : 2;
|
|
19
|
-
}
|
|
20
|
-
function proficiencyFromLevel(level) {
|
|
21
|
-
if (level < 5) return 2;
|
|
22
|
-
if (level < 9) return 3;
|
|
23
|
-
if (level < 13) return 4;
|
|
24
|
-
if (level < 17) return 5;
|
|
25
|
-
return 6;
|
|
26
|
-
}
|
|
27
|
-
function crToXP(cr) {
|
|
28
|
-
var _a;
|
|
29
|
-
return (_a = CR_XP[cr]) != null ? _a : 0;
|
|
30
|
-
}
|
|
31
|
-
function hitDiceSizeFromCreatureSize(size) {
|
|
32
|
-
var _a;
|
|
33
|
-
return (_a = SIZE_HIT_DICE[size.toLowerCase()]) != null ? _a : 8;
|
|
34
|
-
}
|
|
35
|
-
function hpFromHitDice(hitDiceCount, hitDiceSize, conMod) {
|
|
36
|
-
const avg = Math.floor(hitDiceCount * (hitDiceSize + 1) / 2 + hitDiceCount * conMod);
|
|
37
|
-
return Math.max(1, avg);
|
|
38
|
-
}
|
|
39
|
-
function parseHitDiceFormula(formula) {
|
|
40
|
-
const match = formula.match(/^(\d+)d(\d+)/i);
|
|
41
|
-
if (!match) return null;
|
|
42
|
-
return { count: parseInt(match[1], 10), size: parseInt(match[2], 10) };
|
|
43
|
-
}
|
|
44
|
-
function savingThrow(abilityScore, isProficient, profBonus) {
|
|
45
|
-
return abilityModifier(abilityScore) + (isProficient ? profBonus : 0);
|
|
46
|
-
}
|
|
47
|
-
function skillBonus(abilityScore, proficiency, profBonus) {
|
|
48
|
-
const mod = abilityModifier(abilityScore);
|
|
49
|
-
if (proficiency === "expertise") return mod + profBonus * 2;
|
|
50
|
-
if (proficiency === "proficient") return mod + profBonus;
|
|
51
|
-
return mod;
|
|
52
|
-
}
|
|
53
|
-
function passive(abilityScore, proficiency, profBonus) {
|
|
54
|
-
return 10 + skillBonus(abilityScore, proficiency, profBonus);
|
|
55
|
-
}
|
|
56
|
-
function passivePerception(wisScore, perceptionProf, profBonus) {
|
|
57
|
-
return passive(wisScore, perceptionProf, profBonus);
|
|
58
|
-
}
|
|
59
|
-
function attackBonus(abilityScore, profBonus) {
|
|
60
|
-
return abilityModifier(abilityScore) + profBonus;
|
|
61
|
-
}
|
|
62
|
-
function saveDC(abilityScore, profBonus) {
|
|
63
|
-
return 8 + profBonus + abilityModifier(abilityScore);
|
|
64
|
-
}
|
|
65
|
-
function abilityNameToKey(name) {
|
|
66
|
-
const lower = name.toLowerCase();
|
|
67
|
-
if (ABILITY_KEYS.includes(lower)) {
|
|
68
|
-
return lower;
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
var CANONICAL_DAMAGE_TYPES = new Set(DAMAGE_TYPES.map((t) => t.toLowerCase()));
|
|
73
|
-
function isCanonicalDamageType(type) {
|
|
74
|
-
return CANONICAL_DAMAGE_TYPES.has(type.trim().toLowerCase());
|
|
75
|
-
}
|
|
76
|
-
var CHOSEN_DAMAGE_TYPE = "chosen";
|
|
77
|
-
var CHOSEN_DAMAGE_TYPE_NOTE = "damage type of your choice";
|
|
78
|
-
function isChosenDamageType(type) {
|
|
79
|
-
return type !== void 0 && type.trim().toLowerCase() === CHOSEN_DAMAGE_TYPE;
|
|
80
|
-
}
|
|
81
|
-
function isRenderableDamageText(text) {
|
|
82
|
-
var _a;
|
|
83
|
-
const m = /^(?:\d*d\d+(?:\s*[+-]\s*\d+)?|[+-]?\d+)(?:\s+(.*))?$/i.exec(text.trim());
|
|
84
|
-
if (!m) return false;
|
|
85
|
-
const type = ((_a = m[1]) != null ? _a : "").trim();
|
|
86
|
-
return type === "" || isCanonicalDamageType(type);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
abilityModifier,
|
|
91
|
-
formatModifier,
|
|
92
|
-
proficiencyBonusFromCR,
|
|
93
|
-
proficiencyFromLevel,
|
|
94
|
-
crToXP,
|
|
95
|
-
hitDiceSizeFromCreatureSize,
|
|
96
|
-
hpFromHitDice,
|
|
97
|
-
parseHitDiceFormula,
|
|
98
|
-
savingThrow,
|
|
99
|
-
skillBonus,
|
|
100
|
-
passive,
|
|
101
|
-
passivePerception,
|
|
102
|
-
attackBonus,
|
|
103
|
-
saveDC,
|
|
104
|
-
abilityNameToKey,
|
|
105
|
-
isCanonicalDamageType,
|
|
106
|
-
CHOSEN_DAMAGE_TYPE,
|
|
107
|
-
CHOSEN_DAMAGE_TYPE_NOTE,
|
|
108
|
-
isChosenDamageType,
|
|
109
|
-
isRenderableDamageText
|
|
110
|
-
};
|
package/dist/chunk-PKX6TGRE.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
actionCostEnum,
|
|
3
|
-
resourceSchema
|
|
4
|
-
} from "./chunk-ZJXSXVFP.js";
|
|
5
|
-
import {
|
|
6
|
-
choiceSchema
|
|
7
|
-
} from "./chunk-5MXFW4O3.js";
|
|
8
|
-
import {
|
|
9
|
-
featureEffectSchema
|
|
10
|
-
} from "./chunk-2JSQE3DD.js";
|
|
11
|
-
import {
|
|
12
|
-
additionalSpellsEntrySchema,
|
|
13
|
-
imageField,
|
|
14
|
-
progressionSchema
|
|
15
|
-
} from "./chunk-UA5KS2PL.js";
|
|
16
|
-
|
|
17
|
-
// src/feat/feat.schema.ts
|
|
18
|
-
import { z } from "zod";
|
|
19
|
-
var abilityEnum = z.enum(["str", "dex", "con", "int", "wis", "cha"]);
|
|
20
|
-
var editionEnum = z.enum(["2014", "2024"]);
|
|
21
|
-
var categoryEnum = z.enum(["origin", "general", "fighting-style", "epic-boon"]);
|
|
22
|
-
var prerequisiteSchema = z.discriminatedUnion("kind", [
|
|
23
|
-
z.object({ kind: z.literal("ability"), ability: abilityEnum, min: z.number().int().positive() }),
|
|
24
|
-
z.object({ kind: z.literal("level"), min: z.number().int().positive() }),
|
|
25
|
-
z.object({ kind: z.literal("spellcaster") }),
|
|
26
|
-
z.object({
|
|
27
|
-
kind: z.literal("proficiency"),
|
|
28
|
-
proficiency_type: z.enum(["armor", "weapon", "tool", "skill", "saving-throw"]),
|
|
29
|
-
value: z.string().min(1)
|
|
30
|
-
}),
|
|
31
|
-
z.object({ kind: z.literal("race"), slug: z.string().min(1) }),
|
|
32
|
-
z.object({ kind: z.literal("class"), slug: z.string().min(1) }),
|
|
33
|
-
// The exclusive-feat-category and feat-category arms carry a raw 5etools category code, not a
|
|
34
|
-
// slug; featCategoryLabel names it. The rest carry slugs the renderer humanizes, except other,
|
|
35
|
-
// which carries free prose that prereqText returns verbatim.
|
|
36
|
-
z.object({ kind: z.literal("feat"), slug: z.string().min(1) }),
|
|
37
|
-
z.object({ kind: z.literal("campaign"), slug: z.string().min(1) }),
|
|
38
|
-
z.object({ kind: z.literal("exclusive-feat-category"), slug: z.string().min(1) }),
|
|
39
|
-
z.object({ kind: z.literal("feature"), slug: z.string().min(1) }),
|
|
40
|
-
z.object({ kind: z.literal("other"), detail: z.string().min(1) }),
|
|
41
|
-
z.object({ kind: z.literal("feat-category"), slug: z.string().min(1) }),
|
|
42
|
-
z.object({ kind: z.literal("background"), slug: z.string().min(1) })
|
|
43
|
-
]);
|
|
44
|
-
var featEntitySchema = z.object({
|
|
45
|
-
slug: z.string().min(1),
|
|
46
|
-
name: z.string().min(1),
|
|
47
|
-
edition: editionEnum,
|
|
48
|
-
source: z.string().min(1),
|
|
49
|
-
category: categoryEnum,
|
|
50
|
-
description: z.string(),
|
|
51
|
-
prerequisites: z.array(prerequisiteSchema),
|
|
52
|
-
benefits: z.array(z.string()),
|
|
53
|
-
effects: z.array(featureEffectSchema),
|
|
54
|
-
grants_asi: z.object({
|
|
55
|
-
amount: z.number().int().positive(),
|
|
56
|
-
pool: z.array(abilityEnum).optional()
|
|
57
|
-
}).nullable(),
|
|
58
|
-
repeatable: z.boolean(),
|
|
59
|
-
choices: z.array(choiceSchema),
|
|
60
|
-
rendering_hint: z.string().optional(),
|
|
61
|
-
additional_spells: z.array(additionalSpellsEntrySchema).optional(),
|
|
62
|
-
// 71
|
|
63
|
-
has_fluff: z.boolean().optional(),
|
|
64
|
-
// 0 carriers — symmetry, §9.4
|
|
65
|
-
has_fluff_images: z.boolean().optional(),
|
|
66
|
-
// 41
|
|
67
|
-
trait_tags: z.unknown().optional(),
|
|
68
|
-
// 7, nullable measured — same passthrough family
|
|
69
|
-
optionalfeature_progression: z.array(progressionSchema).optional(),
|
|
70
|
-
// 4
|
|
71
|
-
resources: z.array(resourceSchema).optional(),
|
|
72
|
-
// closes the feat.types.ts `Feat.resources` schema/type asymmetry (C).
|
|
73
|
-
// CONVERTER carriers since import-5etools cb382b6 (feat-mapper `mapFeatEconomy`): 69 of 287 feat docs,
|
|
74
|
-
// 72 entries (41 `prof`, 29 `1`, Lucky PHB `3`, Boon of Recovery `10` + die d10), ids owner-namespaced
|
|
75
|
-
// `<feat-slug-tail>:<tracker-slug>`; 0 SRD-bundle carriers. The resolver carries them onto the
|
|
76
|
-
// synthesized feat feature, so each draws a tracker. Import resourceSchema.
|
|
77
|
-
action_cost: actionCostEnum.optional(),
|
|
78
|
-
// ruling R-G1b-5 (gate1-r1 f1): a TOP-LEVEL entity key. SRD bundle:
|
|
79
|
-
// one feat per edition (`SRD 2024/Feats/Boon of the Night Spirit.md` bonus-action; SRD 5e Grappler
|
|
80
|
-
// `action` through the `feat_features` overlay since 0.3.11). CONVERTER: 76 of 287 feat docs since
|
|
81
|
-
// import-5etools 1002a6c (31 bonus-action, 34 reaction, 11 action). Top-level at entity level
|
|
82
|
-
// — the ninth SRD-control non-kept row: top-level on the ENTITY, not featureSchema-shaped
|
|
83
|
-
// (finding 14's nine rows split 4 featureSchema / 4 §2.8-arity / this one, which needed its own
|
|
84
|
-
// declaration — gate1-r4 R4-1). `actionCostEnum` is exported from
|
|
85
|
-
// `schemas/resource-schema.ts` (optionalFeatureEntitySchema already imports it). MAPPED since
|
|
86
|
-
// R4-G3a §10.2.3: the resolver aliases it onto the resolved feature's `action`, which is what
|
|
87
|
-
// draws the feat note's Action line and files the row under that economy.
|
|
88
|
-
image: imageField
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
featEntitySchema
|
|
93
|
-
};
|
package/dist/chunk-PQZ4LM4Z.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
optionalFeatureEntitySchema
|
|
3
|
-
} from "./chunk-DOXSFYLH.js";
|
|
4
|
-
|
|
5
|
-
// src/optional-feature/optional-feature.parser.ts
|
|
6
|
-
import { parseYaml } from "@archivist-gg/core";
|
|
7
|
-
function parseOptionalFeature(source) {
|
|
8
|
-
const raw = parseYaml(source, ["name", "slug", "feature_type"]);
|
|
9
|
-
if (!raw.success) return raw;
|
|
10
|
-
const result = optionalFeatureEntitySchema.safeParse({ edition: "2014", ...raw.data });
|
|
11
|
-
if (!result.success) {
|
|
12
|
-
return { success: false, error: `optional-feature schema validation failed: ${result.error.message}` };
|
|
13
|
-
}
|
|
14
|
-
return { success: true, data: result.data };
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
parseOptionalFeature
|
|
19
|
-
};
|
package/dist/chunk-PTXBIDG7.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// src/monster/monster.ai-schema.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var abilitiesSchema = z.object({
|
|
4
|
-
str: z.number().min(1).max(30),
|
|
5
|
-
dex: z.number().min(1).max(30),
|
|
6
|
-
con: z.number().min(1).max(30),
|
|
7
|
-
int: z.number().min(1).max(30),
|
|
8
|
-
wis: z.number().min(1).max(30),
|
|
9
|
-
cha: z.number().min(1).max(30)
|
|
10
|
-
});
|
|
11
|
-
var acSchema = z.object({
|
|
12
|
-
ac: z.number(),
|
|
13
|
-
from: z.array(z.string()).optional(),
|
|
14
|
-
condition: z.string().optional()
|
|
15
|
-
});
|
|
16
|
-
var hpSchema = z.object({
|
|
17
|
-
average: z.number(),
|
|
18
|
-
formula: z.string()
|
|
19
|
-
});
|
|
20
|
-
var speedSchema = z.object({
|
|
21
|
-
walk: z.number().optional(),
|
|
22
|
-
fly: z.number().optional(),
|
|
23
|
-
swim: z.number().optional(),
|
|
24
|
-
climb: z.number().optional(),
|
|
25
|
-
burrow: z.number().optional()
|
|
26
|
-
});
|
|
27
|
-
var featureSchema = z.object({
|
|
28
|
-
name: z.string(),
|
|
29
|
-
entries: z.array(z.string().describe(
|
|
30
|
-
"Inline tag forms: `atk:ABILITY` for non-proficient attacks (ability mod alone), `atk:ABILITY+PB` for proficient attacks (ability mod + proficiency), `atk:+N` for literal attack bonuses, `dmg:DICE+ABILITY` for damage rolls (PB never added to damage), `dc:ABILITY` for save DCs (proficiency always included implicitly)."
|
|
31
|
-
))
|
|
32
|
-
});
|
|
33
|
-
var monsterInputSchema = z.object({
|
|
34
|
-
name: z.string().describe("Monster name"),
|
|
35
|
-
size: z.enum(["Tiny", "Small", "Medium", "Large", "Huge", "Gargantuan"]),
|
|
36
|
-
type: z.string().describe("Creature type (e.g., aberration, beast, dragon)"),
|
|
37
|
-
subtype: z.string().optional(),
|
|
38
|
-
alignment: z.string(),
|
|
39
|
-
cr: z.string().describe('Challenge rating (e.g., "0", "1/8", "1/4", "1/2", "1" through "30")'),
|
|
40
|
-
abilities: abilitiesSchema,
|
|
41
|
-
ac: z.array(acSchema),
|
|
42
|
-
hp: hpSchema,
|
|
43
|
-
speed: speedSchema,
|
|
44
|
-
saves: z.record(z.string(), z.number()).optional(),
|
|
45
|
-
skills: z.record(z.string(), z.number()).optional(),
|
|
46
|
-
damage_vulnerabilities: z.array(z.string()).optional(),
|
|
47
|
-
damage_resistances: z.array(z.string()).optional(),
|
|
48
|
-
damage_immunities: z.array(z.string()).optional(),
|
|
49
|
-
condition_immunities: z.array(z.string()).optional(),
|
|
50
|
-
senses: z.array(z.string()).optional(),
|
|
51
|
-
passive_perception: z.number().optional(),
|
|
52
|
-
languages: z.array(z.string()).optional(),
|
|
53
|
-
traits: z.array(featureSchema).optional(),
|
|
54
|
-
actions: z.array(featureSchema).optional(),
|
|
55
|
-
reactions: z.array(featureSchema).optional(),
|
|
56
|
-
legendary_actions: z.array(featureSchema).optional(),
|
|
57
|
-
legendary_action_uses: z.number().optional(),
|
|
58
|
-
legendary_resistance: z.number().optional()
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
monsterInputSchema
|
|
63
|
-
};
|
package/dist/chunk-PVCEA4HZ.js
DELETED
package/dist/chunk-PXVNAY7T.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
spellSource
|
|
3
|
-
} from "./chunk-KR6JF3BF.js";
|
|
4
|
-
import {
|
|
5
|
-
resourceLevelFor
|
|
6
|
-
} from "./chunk-KSTV7J2U.js";
|
|
7
|
-
import {
|
|
8
|
-
baseClassName
|
|
9
|
-
} from "./chunk-VTTA2ALZ.js";
|
|
10
|
-
|
|
11
|
-
// src/pc/pc.amount-bindings.ts
|
|
12
|
-
function ownerClassSlug(source, resolved) {
|
|
13
|
-
var _a, _b, _c;
|
|
14
|
-
if (!source) return null;
|
|
15
|
-
if (source.kind === "class") return source.slug;
|
|
16
|
-
if (source.kind === "subclass") return (_c = (_b = (_a = resolved.classes.find((c) => {
|
|
17
|
-
var _a2;
|
|
18
|
-
return ((_a2 = c.subclass) == null ? void 0 : _a2.slug) === source.slug;
|
|
19
|
-
})) == null ? void 0 : _a.entity) == null ? void 0 : _b.slug) != null ? _c : null;
|
|
20
|
-
if (source.kind === "feat" && source.via) {
|
|
21
|
-
if (source.via.kind === "class") return source.via.slug;
|
|
22
|
-
if (source.via.kind === "pool") return source.via.classSlug;
|
|
23
|
-
}
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
function casterRow(classSlug, derived) {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const rows = (_a = derived.spellcastingClasses) != null ? _a : [];
|
|
29
|
-
const own = classSlug ? rows.find((c) => baseClassName(c.classSlug) === baseClassName(classSlug)) : void 0;
|
|
30
|
-
return (_b = own != null ? own : rows[0]) != null ? _b : null;
|
|
31
|
-
}
|
|
32
|
-
function amountBindingsFor(owner, resolved, derived) {
|
|
33
|
-
const classSlug = ownerClassSlug(owner, resolved);
|
|
34
|
-
const classSource = classSlug ? { kind: "class", slug: classSlug, level: 0 } : owner;
|
|
35
|
-
const classLevel = classSource ? resourceLevelFor(classSource, resolved) : resolved.totalLevel;
|
|
36
|
-
const row = casterRow(classSlug, derived);
|
|
37
|
-
return {
|
|
38
|
-
level: resolved.totalLevel,
|
|
39
|
-
class_level: classLevel,
|
|
40
|
-
prof: derived.proficiencyBonus,
|
|
41
|
-
str_mod: derived.mods.str,
|
|
42
|
-
dex_mod: derived.mods.dex,
|
|
43
|
-
con_mod: derived.mods.con,
|
|
44
|
-
int_mod: derived.mods.int,
|
|
45
|
-
wis_mod: derived.mods.wis,
|
|
46
|
-
cha_mod: derived.mods.cha,
|
|
47
|
-
columns: {},
|
|
48
|
-
...row ? { spell_mod: derived.mods[row.ability], spell_dc: row.saveDC } : {}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function spellcastingFor(spell, derived) {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
if ((spellSource(spell).ownAbility || spell.classSlug == null) && spell.ability) {
|
|
54
|
-
const own = (_a = derived.abilitySpellcasting) == null ? void 0 : _a[spell.ability];
|
|
55
|
-
if (own) return { ability: spell.ability, saveDC: own.saveDC, attackBonus: own.attackBonus };
|
|
56
|
-
}
|
|
57
|
-
const row = casterRow((_b = spell.classSlug) != null ? _b : null, derived);
|
|
58
|
-
return row ? { ability: row.ability, saveDC: row.saveDC, attackBonus: row.attackBonus } : null;
|
|
59
|
-
}
|
|
60
|
-
function spellAmountBindings(spell, resolved, derived) {
|
|
61
|
-
const cast = spellcastingFor(spell, derived);
|
|
62
|
-
const base = amountBindingsFor(spell.classSlug ? { kind: "class", slug: spell.classSlug, level: 0 } : void 0, resolved, derived);
|
|
63
|
-
const out = { ...base };
|
|
64
|
-
delete out.spell_mod;
|
|
65
|
-
delete out.spell_dc;
|
|
66
|
-
return cast ? { ...out, spell_mod: derived.mods[cast.ability], spell_dc: cast.saveDC } : out;
|
|
67
|
-
}
|
|
68
|
-
function spellRollBonus(spell) {
|
|
69
|
-
var _a;
|
|
70
|
-
const roll = (_a = spell.damage_roll) == null ? void 0 : _a.trim();
|
|
71
|
-
const text = spell.description;
|
|
72
|
-
if (!roll || !text) return null;
|
|
73
|
-
const esc = roll.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
74
|
-
const re = new RegExp(`(?<![\\w])${esc}\`?\\s*(?:plus|\\+)\\s*your\\s+spellcasting\\s+(?:ability\\s+)?modifier`, "i");
|
|
75
|
-
return re.test(text) ? "{spell_mod}" : null;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
ownerClassSlug,
|
|
80
|
-
amountBindingsFor,
|
|
81
|
-
spellcastingFor,
|
|
82
|
-
spellAmountBindings,
|
|
83
|
-
spellRollBonus
|
|
84
|
-
};
|
package/dist/chunk-QH36K2PU.js
DELETED
|
@@ -1,158 +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 diceRollOf(resolved) {
|
|
145
|
-
var _a, _b;
|
|
146
|
-
return (_b = (_a = diceRollPrefix(resolved)) == null ? void 0 : _a.notation) != null ? _b : null;
|
|
147
|
-
}
|
|
148
|
-
function diceRollPrefix(text) {
|
|
149
|
-
const m = /^(\d*d\d+(?:\s*[+-]\s*\d+)*)(?=\s|$)/i.exec(text);
|
|
150
|
-
return m ? { raw: m[1], notation: m[1].replace(/\s+/g, "") } : null;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export {
|
|
154
|
-
normalizeAmountPhrases,
|
|
155
|
-
resolveAmountText,
|
|
156
|
-
diceRollOf,
|
|
157
|
-
diceRollPrefix
|
|
158
|
-
};
|
package/dist/chunk-QS5L5YTJ.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// src/item/item.ai-schema.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var itemInputSchema = z.object({
|
|
4
|
-
name: z.string().describe("Item name"),
|
|
5
|
-
type: z.enum(["weapon", "armor", "potion", "ring", "rod", "scroll", "staff", "wand", "wondrous item", "shield"]),
|
|
6
|
-
rarity: z.enum(["common", "uncommon", "rare", "very rare", "legendary", "artifact"]),
|
|
7
|
-
entries: z.array(z.string()).optional().describe(
|
|
8
|
-
"Item description and properties. Use inline formula tags for attack rolls, damage, and save DCs: `atk:ABILITY` for attack bonus, `damage:DICE+ABILITY` for damage (e.g. `damage:2d6`), `dc:ABILITY` for save DCs. Valid abilities: STR, DEX, CON, INT, WIS, CHA."
|
|
9
|
-
),
|
|
10
|
-
weight: z.number().optional(),
|
|
11
|
-
value: z.number().optional(),
|
|
12
|
-
attunement: z.union([z.boolean(), z.string()]).optional(),
|
|
13
|
-
properties: z.array(z.string()).optional(),
|
|
14
|
-
damage: z.string().optional(),
|
|
15
|
-
damage_type: z.string().optional(),
|
|
16
|
-
ac: z.number().optional(),
|
|
17
|
-
charges: z.number().optional(),
|
|
18
|
-
recharge: z.string().optional(),
|
|
19
|
-
curse: z.boolean().optional()
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
itemInputSchema
|
|
24
|
-
};
|
package/dist/chunk-QYZV2MQA.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
// src/dnd/tag-grammar.ts
|
|
2
|
-
var TAG_TYPE_ALIASES = {
|
|
3
|
-
atk: "atk",
|
|
4
|
-
attack: "atk",
|
|
5
|
-
dmg: "dmg",
|
|
6
|
-
damage: "dmg",
|
|
7
|
-
dc: "dc",
|
|
8
|
-
dice: "dice"
|
|
9
|
-
};
|
|
10
|
-
function normalizeTagType(input) {
|
|
11
|
-
var _a;
|
|
12
|
-
const lower = input.toLowerCase().trim();
|
|
13
|
-
return (_a = TAG_TYPE_ALIASES[lower]) != null ? _a : null;
|
|
14
|
-
}
|
|
15
|
-
var ABILITY_RE = /^(str|dex|con|int|wis|cha)$/i;
|
|
16
|
-
var PB_RE = /^pb$/i;
|
|
17
|
-
var DICE_RE = /^(\d+)d(\d+)$/;
|
|
18
|
-
var LITERAL_RE = /^([+-]?\d+)$/;
|
|
19
|
-
var SLUG_RE = /^\[\[([^[\]]+)\]\]$/;
|
|
20
|
-
function parseTagTerms(content) {
|
|
21
|
-
const out = {
|
|
22
|
-
pbTerm: false,
|
|
23
|
-
literalTerms: [],
|
|
24
|
-
diceTerms: [],
|
|
25
|
-
slugTerms: []
|
|
26
|
-
};
|
|
27
|
-
const trimmed = content.trim();
|
|
28
|
-
if (trimmed.length === 0) return { error: "empty content" };
|
|
29
|
-
const tokens = [];
|
|
30
|
-
let i = 0;
|
|
31
|
-
const advancePastTerm = (start) => {
|
|
32
|
-
let j = start;
|
|
33
|
-
while (j < trimmed.length && trimmed[j] !== "+" && trimmed[j] !== "-") {
|
|
34
|
-
if (trimmed[j] === "[" && trimmed[j + 1] === "[") {
|
|
35
|
-
const close = trimmed.indexOf("]]", j + 2);
|
|
36
|
-
if (close === -1) return trimmed.length;
|
|
37
|
-
j = close + 2;
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
j++;
|
|
41
|
-
}
|
|
42
|
-
return j;
|
|
43
|
-
};
|
|
44
|
-
while (i < trimmed.length) {
|
|
45
|
-
if (trimmed[i] === "+" || trimmed[i] === "-") {
|
|
46
|
-
const j = advancePastTerm(i + 1);
|
|
47
|
-
tokens.push(trimmed.slice(i, j));
|
|
48
|
-
i = j;
|
|
49
|
-
} else {
|
|
50
|
-
const j = advancePastTerm(i);
|
|
51
|
-
tokens.push(trimmed.slice(i, j));
|
|
52
|
-
i = j;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
for (let raw of tokens) {
|
|
56
|
-
raw = raw.trim();
|
|
57
|
-
if (raw.length === 0) return { error: "empty term" };
|
|
58
|
-
let signed = raw;
|
|
59
|
-
let body = raw;
|
|
60
|
-
if (raw[0] === "+" || raw[0] === "-") {
|
|
61
|
-
body = raw.slice(1).trim();
|
|
62
|
-
} else {
|
|
63
|
-
signed = "+" + raw;
|
|
64
|
-
}
|
|
65
|
-
if (DICE_RE.test(body)) {
|
|
66
|
-
const m = body.match(DICE_RE);
|
|
67
|
-
out.diceTerms.push({ count: Number.parseInt(m[1], 10), sides: Number.parseInt(m[2], 10) });
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
if (ABILITY_RE.test(body)) {
|
|
71
|
-
if (out.abilityTerm) return { error: `multiple ability terms (${out.abilityTerm}, ${body.toLowerCase()})` };
|
|
72
|
-
out.abilityTerm = body.toLowerCase();
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
if (PB_RE.test(body)) {
|
|
76
|
-
if (out.pbTerm) return { error: "duplicate PB term" };
|
|
77
|
-
out.pbTerm = true;
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
const slugMatch = body.match(SLUG_RE);
|
|
81
|
-
if (slugMatch) {
|
|
82
|
-
out.slugTerms.push(slugMatch[1]);
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
if (LITERAL_RE.test(signed)) {
|
|
86
|
-
out.literalTerms.push(Number.parseInt(signed, 10));
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
return { error: `unrecognized term: ${raw}` };
|
|
90
|
-
}
|
|
91
|
-
return out;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export {
|
|
95
|
-
normalizeTagType,
|
|
96
|
-
parseTagTerms
|
|
97
|
-
};
|