@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.
- 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 +3 -30
- package/dist/dnd/amount-text.js +1 -15
- 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 +0 -15
- package/dist/entities/registry-revision.js +1 -10
- 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 +22 -1
- package/dist/feat/feat.schema.js +1 -10
- package/dist/feat/feat.types.d.ts +0 -6
- package/dist/index.js +45 -141495
- 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 +21 -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 +0 -24
- package/dist/pc/pc.additional-spells.js +1 -26
- package/dist/pc/pc.amount-bindings.d.ts +0 -25
- package/dist/pc/pc.amount-bindings.js +1 -28
- 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 +0 -145
- package/dist/pc/pc.decision-engine.js +1 -55
- 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 -41
- package/dist/pc/pc.equipment.d.ts +2 -22
- package/dist/pc/pc.equipment.js +1 -34
- package/dist/pc/pc.feature-effects.d.ts +22 -281
- package/dist/pc/pc.feature-effects.js +1 -39
- 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 -65
- package/dist/pc/pc.item-effects.d.ts +18 -0
- package/dist/pc/pc.member-choices.d.ts +3 -66
- package/dist/pc/pc.member-choices.js +1 -39
- package/dist/pc/pc.parser.js +1 -58
- package/dist/pc/pc.pools.d.ts +7 -10
- package/dist/pc/pc.pools.js +1 -27
- package/dist/pc/pc.proficiencies.d.ts +0 -40
- package/dist/pc/pc.proficiencies.js +1 -156
- package/dist/pc/pc.proficiency-grants.d.ts +0 -26
- package/dist/pc/pc.proficiency-normalize.d.ts +0 -35
- package/dist/pc/pc.proficiency-normalize.js +1 -18
- 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 -1042
- package/dist/pc/pc.resolver.d.ts +0 -107
- package/dist/pc/pc.resolver.js +1 -60
- 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 -231
- package/dist/pc/pc.schema.d.ts +0 -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 +0 -16
- 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 +54 -374
- 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 +21 -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 +4 -22
- 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-2LULMQTF.js +0 -14
- package/dist/chunk-3LWMFYKS.js +0 -57
- package/dist/chunk-3SFGWFVQ.js +0 -19
- package/dist/chunk-3SIUAFDQ.js +0 -18
- package/dist/chunk-3TM34RSJ.js +0 -23
- package/dist/chunk-4J6DS3EJ.js +0 -30
- package/dist/chunk-4U55VNC7.js +0 -22
- package/dist/chunk-5GKJAUMX.js +0 -59
- package/dist/chunk-5JXFJ5AU.js +0 -26
- package/dist/chunk-64VNLMSG.js +0 -375
- package/dist/chunk-656QCX4U.js +0 -22
- package/dist/chunk-6GNXYAYP.js +0 -25
- package/dist/chunk-6PXTNCBP.js +0 -133
- package/dist/chunk-6X2NV665.js +0 -33
- package/dist/chunk-7Q2VPKCD.js +0 -181
- package/dist/chunk-7XJHI5H5.js +0 -709
- package/dist/chunk-A54HHCWW.js +0 -67
- package/dist/chunk-B2QHP6UF.js +0 -159
- package/dist/chunk-B3DP42OM.js +0 -55
- package/dist/chunk-BJGOSM76.js +0 -18
- package/dist/chunk-BJWSOQUC.js +0 -133
- package/dist/chunk-CJYCVNW2.js +0 -7
- package/dist/chunk-CM5CWO4K.js +0 -735
- package/dist/chunk-DEEHHLAP.js +0 -271
- package/dist/chunk-DPUJDOKV.js +0 -365
- package/dist/chunk-EJD47JHL.js +0 -1838
- package/dist/chunk-EJP263OP.js +0 -186
- package/dist/chunk-EVMUJYUD.js +0 -195
- package/dist/chunk-EYX4JMAU.js +0 -101
- package/dist/chunk-FC4IGH5Y.js +0 -18
- package/dist/chunk-FJYBLXV7.js +0 -89
- package/dist/chunk-FMUD3LDV.js +0 -19
- package/dist/chunk-FMYWORTP.js +0 -93
- package/dist/chunk-FVXLP7P3.js +0 -18
- package/dist/chunk-G6MHJDVT.js +0 -41
- package/dist/chunk-GVWEFECG.js +0 -18
- package/dist/chunk-HHBD4SQ6.js +0 -24
- package/dist/chunk-HS6FIOLP.js +0 -52
- package/dist/chunk-HY2SRSVM.js +0 -23
- package/dist/chunk-IHE6KVC3.js +0 -13
- package/dist/chunk-IN4M4X7P.js +0 -34
- package/dist/chunk-IUAAXXNO.js +0 -58
- package/dist/chunk-JXWNXIIZ.js +0 -219
- 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-LHZXYFBU.js +0 -94
- package/dist/chunk-LICYHPI3.js +0 -237
- package/dist/chunk-LNT64X7C.js +0 -81
- package/dist/chunk-LSLSG67V.js +0 -31
- package/dist/chunk-LVQLWRCU.js +0 -15
- package/dist/chunk-MYY2C5MB.js +0 -233
- package/dist/chunk-NKZMQV2C.js +0 -19
- package/dist/chunk-NTU2DXNG.js +0 -355
- package/dist/chunk-NXUY5XQN.js +0 -1062
- package/dist/chunk-NZO7M5GV.js +0 -18
- package/dist/chunk-OOL4KMG2.js +0 -71
- package/dist/chunk-OOSRUJBI.js +0 -19
- package/dist/chunk-PDJSUH24.js +0 -110
- package/dist/chunk-PTXBIDG7.js +0 -63
- package/dist/chunk-PVCEA4HZ.js +0 -6
- package/dist/chunk-QA3YCOML.js +0 -101
- package/dist/chunk-QFWQKS3M.js +0 -110
- package/dist/chunk-QS5L5YTJ.js +0 -24
- package/dist/chunk-QYZV2MQA.js +0 -97
- package/dist/chunk-RD2MID3M.js +0 -292
- package/dist/chunk-S3YUXDSC.js +0 -278
- package/dist/chunk-S7REMWW4.js +0 -21
- package/dist/chunk-TOM66P2P.js +0 -38
- package/dist/chunk-TRBGC4ZG.js +0 -112
- package/dist/chunk-UA5KS2PL.js +0 -26
- package/dist/chunk-UJCK5IW4.js +0 -187
- package/dist/chunk-UNYR5GLI.js +0 -23
- package/dist/chunk-UZXG6QSY.js +0 -58
- package/dist/chunk-VN5DLURA.js +0 -158
- package/dist/chunk-VP5TIXDK.js +0 -178
- package/dist/chunk-VPYBK2MG.js +0 -18
- package/dist/chunk-VTTA2ALZ.js +0 -16
- package/dist/chunk-W6GC6OKK.js +0 -16
- package/dist/chunk-WELIKLZF.js +0 -256
- package/dist/chunk-WOHX7YTH.js +0 -165
- 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-XTEFPUSN.js +0 -23
- package/dist/chunk-YBLDE5CG.js +0 -42
- package/dist/chunk-YDGMBMYI.js +0 -25
- package/dist/chunk-YHYTW5QA.js +0 -20
- package/dist/chunk-ZCTUYGNV.js +0 -26
- package/dist/chunk-ZDAEGJH4.js +0 -102
- package/dist/chunk-ZJXSXVFP.js +0 -58
- package/dist/chunk-ZOWKWMD2.js +0 -18
- package/dist/chunk-ZUQW5VBZ.js +0 -89
|
@@ -1,41 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* D2b-A · an AMOUNT that names a modifier prints the number (design §1.2 A, user rulings 2026-09-27).
|
|
3
|
-
*
|
|
4
|
-
* An effect amount, a rider amount or a save DC formula is written in the book's words ("1d8 plus your Wisdom
|
|
5
|
-
* modifier", "your spell save DC") or with a `{token}` ("2d4 + {spell_mod}"). Nothing rendered it as a number: the
|
|
6
|
-
* resource DSL (`resource-formula.ts`) has no dice production and no spellcasting idents. This module reads both at
|
|
7
|
-
* READ time, so existing notes and homebrew need no re-import:
|
|
8
|
-
* 1. `normalizeAmountPhrases` turns the closed phrase table below into tokens;
|
|
9
|
-
* 2. `resolveAmountText` substitutes each `{ident}` with its number and folds: a pure numeric result is evaluated by
|
|
10
|
-
* the resource DSL (so `floor`, `max`, `ceil` keep working) and a trailing "(minimum of N)" is applied;
|
|
11
|
-
* `<dice> +/- <numbers>` folds to one roll ("1d8+3"); anything else keeps its words with the numbers in place
|
|
12
|
-
* ("one roll of your Martial Arts die + 3").
|
|
13
|
-
* The phrase table is the ONE place the book's English is read; an unmapped phrase stays as written.
|
|
14
|
-
*/
|
|
15
1
|
import { type FormulaBindings } from "./resource-formula.js";
|
|
16
|
-
/** The DSL bindings plus the owner's spellcasting modifier and save DC (absent when the owner casts no spells). */
|
|
17
2
|
export interface AmountBindings extends FormulaBindings {
|
|
18
3
|
spell_mod?: number;
|
|
19
4
|
spell_dc?: number;
|
|
5
|
+
class_name?: string;
|
|
6
|
+
class_names?: readonly string[];
|
|
20
7
|
}
|
|
21
|
-
|
|
22
|
-
export declare function normalizeAmountPhrases(text: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* The amount as the sheet prints it: the phrases and tokens of `text` resolved against `b`. A pure number is
|
|
25
|
-
* evaluated ("13"); a roll plus numbers folds ("1d8+3"); other words keep their place with the numbers in ("the roll + 2
|
|
26
|
-
* (minimum of 1)"). An UNBOUND token prints its short label when the note wrote the token, and a book phrase whose
|
|
27
|
-
* token is unbound keeps the note's own words. Text with no phrase and no token comes back unchanged.
|
|
28
|
-
*/
|
|
8
|
+
export declare function normalizeAmountPhrases(text: string, ownClass?: string, classNames?: readonly string[]): string;
|
|
29
9
|
export declare function resolveAmountText(text: string, b: AmountBindings): string;
|
|
30
|
-
/** `roll` with each RESOLVED amount added (a spell's damage riders, already resolved against their owners): dice plus
|
|
31
|
-
* numbers fold to one roll ("2d4+5" and "2" read "2d4+7", "1d10" and "-1" read "1d10-1"); anything that does not fold
|
|
32
|
-
* keeps its words, joined by " + ". No amount returns `roll` unchanged. */
|
|
33
10
|
export declare function addToRoll(roll: string, amounts: readonly string[]): string;
|
|
34
|
-
/** The leading dice roll of a resolved amount ("1d8+3" of "1d8+3 (minimum of 1)"), which the sheet makes rollable; null
|
|
35
|
-
* when the amount does not open with a roll. */
|
|
36
11
|
export declare function diceRollOf(resolved: string): string | null;
|
|
37
|
-
/** The leading roll of `text` as the RAW characters it spans (`raw`, which the caller cuts the text by) and as a notation
|
|
38
|
-
* with no spaces (`notation`, which the roller reads): "2d4 + 2 more" is { raw: "2d4 + 2", notation: "2d4+2" }. */
|
|
39
12
|
export declare function diceRollPrefix(text: string): {
|
|
40
13
|
raw: string;
|
|
41
14
|
notation: string;
|
package/dist/dnd/amount-text.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
addToRoll,
|
|
3
|
-
diceRollOf,
|
|
4
|
-
diceRollPrefix,
|
|
5
|
-
normalizeAmountPhrases,
|
|
6
|
-
resolveAmountText
|
|
7
|
-
} from "../chunk-WOHX7YTH.js";
|
|
8
|
-
import "../chunk-EVMUJYUD.js";
|
|
9
|
-
export {
|
|
10
|
-
addToRoll,
|
|
11
|
-
diceRollOf,
|
|
12
|
-
diceRollPrefix,
|
|
13
|
-
normalizeAmountPhrases,
|
|
14
|
-
resolveAmountText
|
|
15
|
-
};
|
|
1
|
+
import{addToRoll,diceRollOf,diceRollPrefix,normalizeAmountPhrases,resolveAmountText}from"../chunk-VIP3FH2O.js";import"../chunk-EAARMPCW.js";export{addToRoll,diceRollOf,diceRollPrefix,normalizeAmountPhrases,resolveAmountText};
|
package/dist/dnd/constants.d.ts
CHANGED
|
@@ -12,27 +12,9 @@ export declare const DAMAGE_TYPES: string[];
|
|
|
12
12
|
export declare const DAMAGE_NONMAGICAL_VARIANTS: string[];
|
|
13
13
|
export declare const CONDITIONS: string[];
|
|
14
14
|
export declare const STANDARD_SENSES: string[];
|
|
15
|
-
/** R4-G7 T8 RIDER-22 (F-STDACT) · the standard combat actions any character can take, per rules edition, in the book's
|
|
16
|
-
* alphabetical order. The plugin's Actions tab reads the character's edition, so this is rendering data, never a
|
|
17
|
-
* renderer constant (it printed ONE union of both editions). 2014 is the PHB chapter 9 list; 2024 is the 2024 action
|
|
18
|
-
* list, which drops Cast a Spell (now Magic) and Use an Object (now Utilize) and adds Influence and Study. No rules
|
|
19
|
-
* glossary ships in the SRD 2024 bundle; its prose names ten of the twelve as "the <X> action" and none of the 2014-only
|
|
20
|
-
* names (measured 2026-09-15 over the plugin repo's `.compendium-bundle/SRD 2024`). */
|
|
21
15
|
export declare const STANDARD_ACTIONS: Record<Edition, readonly string[]>;
|
|
22
16
|
export declare const ALIGNMENT_ETHICAL: string[];
|
|
23
17
|
export declare const ALIGNMENT_MORAL: string[];
|
|
24
18
|
export declare const ALL_SECTIONS: string[];
|
|
25
|
-
/**
|
|
26
|
-
* Full ability NAME (lower-case) → canonical three-letter key. Distinct from `ABILITY_NAMES`
|
|
27
|
-
* above, which is the OTHER direction and yields the display casing ("str" → "STR").
|
|
28
|
-
*
|
|
29
|
-
* Moved here from `pc/pc.feature-effects.ts` in R4-G3a §6.2.3, where it was private: the scope
|
|
30
|
-
* normaliser (`pc/roll-scope.ts`) needs exactly the same vocabulary, and a second copy is the
|
|
31
|
-
* defect class this phase exists to remove. `src/dnd/*` imports nothing from `src/pc/*`, so the
|
|
32
|
-
* move introduces no cycle; the type is spelled `(typeof ABILITY_KEYS)[number]` rather than the
|
|
33
|
-
* `Ability` alias so this module keeps its zero imports.
|
|
34
|
-
*/
|
|
35
19
|
export declare const ABILITY_NAME_TO_KEY: Record<string, (typeof ABILITY_KEYS)[number]>;
|
|
36
|
-
/** Accepts a canonical key ("dex") or a full ability name ("Dexterity"), any casing / padding;
|
|
37
|
-
* returns the canonical key, or null when the value is neither. */
|
|
38
20
|
export declare function normalizeAbility(value: string): (typeof ABILITY_KEYS)[number] | null;
|
package/dist/dnd/constants.js
CHANGED
|
@@ -1,42 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
ABILITY_KEYS,
|
|
3
|
-
ABILITY_NAMES,
|
|
4
|
-
ABILITY_NAME_TO_KEY,
|
|
5
|
-
ALIGNMENT_ETHICAL,
|
|
6
|
-
ALIGNMENT_MORAL,
|
|
7
|
-
ALL_CR_VALUES,
|
|
8
|
-
ALL_SECTIONS,
|
|
9
|
-
ALL_SIZES,
|
|
10
|
-
ALL_SKILLS,
|
|
11
|
-
CONDITIONS,
|
|
12
|
-
CR_PROFICIENCY,
|
|
13
|
-
CR_XP,
|
|
14
|
-
DAMAGE_NONMAGICAL_VARIANTS,
|
|
15
|
-
DAMAGE_TYPES,
|
|
16
|
-
SIZE_HIT_DICE,
|
|
17
|
-
SKILL_ABILITY,
|
|
18
|
-
STANDARD_ACTIONS,
|
|
19
|
-
STANDARD_SENSES,
|
|
20
|
-
normalizeAbility
|
|
21
|
-
} from "../chunk-WELIKLZF.js";
|
|
22
|
-
export {
|
|
23
|
-
ABILITY_KEYS,
|
|
24
|
-
ABILITY_NAMES,
|
|
25
|
-
ABILITY_NAME_TO_KEY,
|
|
26
|
-
ALIGNMENT_ETHICAL,
|
|
27
|
-
ALIGNMENT_MORAL,
|
|
28
|
-
ALL_CR_VALUES,
|
|
29
|
-
ALL_SECTIONS,
|
|
30
|
-
ALL_SIZES,
|
|
31
|
-
ALL_SKILLS,
|
|
32
|
-
CONDITIONS,
|
|
33
|
-
CR_PROFICIENCY,
|
|
34
|
-
CR_XP,
|
|
35
|
-
DAMAGE_NONMAGICAL_VARIANTS,
|
|
36
|
-
DAMAGE_TYPES,
|
|
37
|
-
SIZE_HIT_DICE,
|
|
38
|
-
SKILL_ABILITY,
|
|
39
|
-
STANDARD_ACTIONS,
|
|
40
|
-
STANDARD_SENSES,
|
|
41
|
-
normalizeAbility
|
|
42
|
-
};
|
|
1
|
+
import{ABILITY_KEYS,ABILITY_NAMES,ABILITY_NAME_TO_KEY,ALIGNMENT_ETHICAL,ALIGNMENT_MORAL,ALL_CR_VALUES,ALL_SECTIONS,ALL_SIZES,ALL_SKILLS,CONDITIONS,CR_PROFICIENCY,CR_XP,DAMAGE_NONMAGICAL_VARIANTS,DAMAGE_TYPES,SIZE_HIT_DICE,SKILL_ABILITY,STANDARD_ACTIONS,STANDARD_SENSES,normalizeAbility}from"../chunk-EVT7MGAC.js";export{ABILITY_KEYS,ABILITY_NAMES,ABILITY_NAME_TO_KEY,ALIGNMENT_ETHICAL,ALIGNMENT_MORAL,ALL_CR_VALUES,ALL_SECTIONS,ALL_SIZES,ALL_SKILLS,CONDITIONS,CR_PROFICIENCY,CR_XP,DAMAGE_NONMAGICAL_VARIANTS,DAMAGE_TYPES,SIZE_HIT_DICE,SKILL_ABILITY,STANDARD_ACTIONS,STANDARD_SENSES,normalizeAbility};
|
|
@@ -10,7 +10,5 @@ export interface ResolvedTag {
|
|
|
10
10
|
rollable: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare function resolveTag(tagType: string, content: string, ctx: FormulaContext): ResolvedTag;
|
|
13
|
-
/** @deprecated use parseTagTerms directly */
|
|
14
13
|
export declare function detectFormula(tagType: string, content: string): FormulaRef | null;
|
|
15
|
-
/** @deprecated use resolveTag */
|
|
16
14
|
export declare function resolveFormulaTag(tagType: string, content: string, abilities: Abilities, profBonus: number): string;
|
package/dist/dnd/formula-tags.js
CHANGED
|
@@ -1,119 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
normalizeTagType,
|
|
3
|
-
parseTagTerms
|
|
4
|
-
} from "../chunk-QYZV2MQA.js";
|
|
5
|
-
import {
|
|
6
|
-
abilityModifier,
|
|
7
|
-
formatModifier
|
|
8
|
-
} from "../chunk-PDJSUH24.js";
|
|
9
|
-
import {
|
|
10
|
-
ABILITY_KEYS
|
|
11
|
-
} from "../chunk-WELIKLZF.js";
|
|
12
|
-
|
|
13
|
-
// src/dnd/formula-tags.ts
|
|
14
|
-
function resolveSlugForTag(slug, tagType, registry) {
|
|
15
|
-
var _a, _b, _c, _d;
|
|
16
|
-
if (!registry) return { value: 0, missing: true };
|
|
17
|
-
const found = registry.getBySlug(slug);
|
|
18
|
-
if (!found) return { value: 0, missing: true };
|
|
19
|
-
const data = found.data;
|
|
20
|
-
const b = data.bonuses;
|
|
21
|
-
switch (tagType) {
|
|
22
|
-
case "atk":
|
|
23
|
-
return { value: (_b = (_a = b == null ? void 0 : b.weapon_attack) != null ? _a : b == null ? void 0 : b.spell_attack) != null ? _b : 0, missing: false };
|
|
24
|
-
case "dmg":
|
|
25
|
-
return { value: (_c = b == null ? void 0 : b.weapon_damage) != null ? _c : 0, missing: false };
|
|
26
|
-
case "dc":
|
|
27
|
-
return { value: (_d = b == null ? void 0 : b.spell_save_dc) != null ? _d : 0, missing: false };
|
|
28
|
-
case "dice":
|
|
29
|
-
return { value: 0, missing: false };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function resolveTag(tagType, content, ctx) {
|
|
33
|
-
const canonical = normalizeTagType(tagType);
|
|
34
|
-
if (!canonical) return { display: content, rollable: false };
|
|
35
|
-
const parsed = parseTagTerms(content);
|
|
36
|
-
if ("error" in parsed) {
|
|
37
|
-
if (typeof console !== "undefined") {
|
|
38
|
-
console.warn(`tag parse error for ${canonical}:${content} \u2014 ${parsed.error}`);
|
|
39
|
-
}
|
|
40
|
-
return { display: content, rollable: false };
|
|
41
|
-
}
|
|
42
|
-
if (canonical === "dc" && parsed.pbTerm) {
|
|
43
|
-
if (typeof console !== "undefined") {
|
|
44
|
-
console.warn(`dc:${content} \u2014 explicit +PB is redundant; dc tags always include PB`);
|
|
45
|
-
}
|
|
46
|
-
return { display: content, rollable: false };
|
|
47
|
-
}
|
|
48
|
-
if (canonical === "dmg" && parsed.pbTerm) {
|
|
49
|
-
if (typeof console !== "undefined") {
|
|
50
|
-
console.warn(`dmg:${content} \u2014 PB not applicable to damage`);
|
|
51
|
-
}
|
|
52
|
-
return { display: content, rollable: false };
|
|
53
|
-
}
|
|
54
|
-
if (canonical === "dice" && (parsed.abilityTerm || parsed.pbTerm)) {
|
|
55
|
-
if (typeof console !== "undefined") {
|
|
56
|
-
console.warn(`dice:${content} \u2014 abilities/PB not allowed in dice tags`);
|
|
57
|
-
}
|
|
58
|
-
return { display: content, rollable: false };
|
|
59
|
-
}
|
|
60
|
-
const abilityMod = parsed.abilityTerm ? abilityModifier(ctx.abilities[parsed.abilityTerm]) : 0;
|
|
61
|
-
const literalSum = parsed.literalTerms.reduce((a, b) => a + b, 0);
|
|
62
|
-
let slugSum = 0;
|
|
63
|
-
let anySlugMissing = false;
|
|
64
|
-
for (const slug of parsed.slugTerms) {
|
|
65
|
-
const r = resolveSlugForTag(slug, canonical, ctx.compendium);
|
|
66
|
-
if (r.missing) anySlugMissing = true;
|
|
67
|
-
else slugSum += r.value;
|
|
68
|
-
}
|
|
69
|
-
switch (canonical) {
|
|
70
|
-
case "atk": {
|
|
71
|
-
const value = abilityMod + (parsed.pbTerm ? ctx.proficiencyBonus : 0) + literalSum + slugSum;
|
|
72
|
-
const display = anySlugMissing ? `${formatModifier(value)}?` : formatModifier(value);
|
|
73
|
-
return { display, value, rollable: true };
|
|
74
|
-
}
|
|
75
|
-
case "dc": {
|
|
76
|
-
if (!parsed.abilityTerm && parsed.literalTerms.length === 1 && parsed.literalTerms[0] >= 0 && parsed.slugTerms.length === 0) {
|
|
77
|
-
return { display: `DC ${parsed.literalTerms[0]}`, value: parsed.literalTerms[0], rollable: false };
|
|
78
|
-
}
|
|
79
|
-
const value = 8 + ctx.proficiencyBonus + abilityMod + literalSum + slugSum;
|
|
80
|
-
const display = anySlugMissing ? `DC ${value}?` : `DC ${value}`;
|
|
81
|
-
return { display, value, rollable: false };
|
|
82
|
-
}
|
|
83
|
-
case "dmg": {
|
|
84
|
-
const dicePart = parsed.diceTerms.map((d) => `${d.count}d${d.sides}`).join("+");
|
|
85
|
-
const modPart = abilityMod + literalSum + slugSum;
|
|
86
|
-
let display = dicePart;
|
|
87
|
-
if (modPart !== 0) display += modPart >= 0 ? `+${modPart}` : `${modPart}`;
|
|
88
|
-
if (display === "") display = String(modPart);
|
|
89
|
-
if (anySlugMissing) display += "?";
|
|
90
|
-
return { display, rollable: true };
|
|
91
|
-
}
|
|
92
|
-
case "dice": {
|
|
93
|
-
const dicePart = parsed.diceTerms.map((d) => `${d.count}d${d.sides}`).join("+");
|
|
94
|
-
return { display: dicePart || content, rollable: true };
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
var ABILITY_PATTERN = /\b(str|dex|con|int|wis|cha)\b/i;
|
|
99
|
-
function detectFormula(tagType, content) {
|
|
100
|
-
const canonical = normalizeTagType(tagType);
|
|
101
|
-
if (!canonical || canonical === "dice") return null;
|
|
102
|
-
const match = content.match(ABILITY_PATTERN);
|
|
103
|
-
if (!match) return null;
|
|
104
|
-
const ability = match[1].toLowerCase();
|
|
105
|
-
if (!ABILITY_KEYS.includes(ability)) return null;
|
|
106
|
-
const kind = canonical === "atk" ? "attack" : canonical === "dc" ? "dc" : "damage";
|
|
107
|
-
return { ability, kind };
|
|
108
|
-
}
|
|
109
|
-
function resolveFormulaTag(tagType, content, abilities, profBonus) {
|
|
110
|
-
const r = resolveTag(tagType, content, { abilities, proficiencyBonus: profBonus });
|
|
111
|
-
return r.display;
|
|
112
|
-
}
|
|
113
|
-
export {
|
|
114
|
-
detectFormula,
|
|
115
|
-
normalizeTagType,
|
|
116
|
-
parseTagTerms,
|
|
117
|
-
resolveFormulaTag,
|
|
118
|
-
resolveTag
|
|
119
|
-
};
|
|
1
|
+
import{normalizeTagType,parseTagTerms}from"../chunk-2HRRH3WL.js";import{abilityModifier,formatModifier}from"../chunk-7FPQJDFD.js";import{ABILITY_KEYS}from"../chunk-EVT7MGAC.js";function resolveSlugForTag(slug,tagType,registry){var _a,_b,_c,_d;if(!registry)return{value:0,missing:true};const found=registry.getBySlug(slug);if(!found)return{value:0,missing:true};const data=found.data;const b=data.bonuses;switch(tagType){case"atk":return{value:(_b=(_a=b==null?void 0:b.weapon_attack)!=null?_a:b==null?void 0:b.spell_attack)!=null?_b:0,missing:false};case"dmg":return{value:(_c=b==null?void 0:b.weapon_damage)!=null?_c:0,missing:false};case"dc":return{value:(_d=b==null?void 0:b.spell_save_dc)!=null?_d:0,missing:false};case"dice":return{value:0,missing:false}}}function resolveTag(tagType,content,ctx){const canonical=normalizeTagType(tagType);if(!canonical)return{display:content,rollable:false};const parsed=parseTagTerms(content);if("error"in parsed){if(typeof console!=="undefined"){console.warn(`tag parse error for ${canonical}:${content} \u2014 ${parsed.error}`)}return{display:content,rollable:false}}if(canonical==="dc"&&parsed.pbTerm){if(typeof console!=="undefined"){console.warn(`dc:${content} \u2014 explicit +PB is redundant; dc tags always include PB`)}return{display:content,rollable:false}}if(canonical==="dmg"&&parsed.pbTerm){if(typeof console!=="undefined"){console.warn(`dmg:${content} \u2014 PB not applicable to damage`)}return{display:content,rollable:false}}if(canonical==="dice"&&(parsed.abilityTerm||parsed.pbTerm)){if(typeof console!=="undefined"){console.warn(`dice:${content} \u2014 abilities/PB not allowed in dice tags`)}return{display:content,rollable:false}}const abilityMod=parsed.abilityTerm?abilityModifier(ctx.abilities[parsed.abilityTerm]):0;const literalSum=parsed.literalTerms.reduce((a,b)=>a+b,0);let slugSum=0;let anySlugMissing=false;for(const slug of parsed.slugTerms){const r=resolveSlugForTag(slug,canonical,ctx.compendium);if(r.missing)anySlugMissing=true;else slugSum+=r.value}switch(canonical){case"atk":{const value=abilityMod+(parsed.pbTerm?ctx.proficiencyBonus:0)+literalSum+slugSum;const display=anySlugMissing?`${formatModifier(value)}?`:formatModifier(value);return{display,value,rollable:true}}case"dc":{if(!parsed.abilityTerm&&parsed.literalTerms.length===1&&parsed.literalTerms[0]>=0&&parsed.slugTerms.length===0){return{display:`DC ${parsed.literalTerms[0]}`,value:parsed.literalTerms[0],rollable:false}}const value=8+ctx.proficiencyBonus+abilityMod+literalSum+slugSum;const display=anySlugMissing?`DC ${value}?`:`DC ${value}`;return{display,value,rollable:false}}case"dmg":{const dicePart=parsed.diceTerms.map(d=>`${d.count}d${d.sides}`).join("+");const modPart=abilityMod+literalSum+slugSum;let display=dicePart;if(modPart!==0)display+=modPart>=0?`+${modPart}`:`${modPart}`;if(display==="")display=String(modPart);if(anySlugMissing)display+="?";return{display,rollable:true}}case"dice":{const dicePart=parsed.diceTerms.map(d=>`${d.count}d${d.sides}`).join("+");return{display:dicePart||content,rollable:true}}}}var ABILITY_PATTERN=/\b(str|dex|con|int|wis|cha)\b/i;function detectFormula(tagType,content){const canonical=normalizeTagType(tagType);if(!canonical||canonical==="dice")return null;const match=content.match(ABILITY_PATTERN);if(!match)return null;const ability=match[1].toLowerCase();if(!ABILITY_KEYS.includes(ability))return null;const kind=canonical==="atk"?"attack":canonical==="dc"?"dc":"damage";return{ability,kind}}function resolveFormulaTag(tagType,content,abilities,profBonus){const r=resolveTag(tagType,content,{abilities,proficiencyBonus:profBonus});return r.display}export{detectFormula,normalizeTagType,parseTagTerms,resolveFormulaTag,resolveTag};
|
package/dist/dnd/math.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { ABILITY_KEYS } from "./constants.js";
|
|
|
2
2
|
export declare function abilityModifier(score: number): number;
|
|
3
3
|
export declare function formatModifier(mod: number): string;
|
|
4
4
|
export declare function proficiencyBonusFromCR(cr: string): number;
|
|
5
|
-
/** Proficiency bonus by total character level (1-20) */
|
|
6
5
|
export declare function proficiencyFromLevel(level: number): number;
|
|
7
6
|
export declare function crToXP(cr: string): number;
|
|
8
7
|
export declare function hitDiceSizeFromCreatureSize(size: string): number;
|
|
@@ -13,38 +12,13 @@ export declare function parseHitDiceFormula(formula: string): {
|
|
|
13
12
|
} | null;
|
|
14
13
|
export declare function savingThrow(abilityScore: number, isProficient: boolean, profBonus: number): number;
|
|
15
14
|
export declare function skillBonus(abilityScore: number, proficiency: "none" | "proficient" | "expertise", profBonus: number): number;
|
|
16
|
-
/**
|
|
17
|
-
* Passive score for any skill: 10 + skill bonus. Generalizes `passivePerception`.
|
|
18
|
-
* Use this for Passive Investigation (INT) and Passive Insight (WIS).
|
|
19
|
-
*/
|
|
20
15
|
export declare function passive(abilityScore: number, proficiency: "none" | "proficient" | "expertise", profBonus: number): number;
|
|
21
16
|
export declare function passivePerception(wisScore: number, perceptionProf: "none" | "proficient" | "expertise", profBonus: number): number;
|
|
22
17
|
export declare function attackBonus(abilityScore: number, profBonus: number): number;
|
|
23
18
|
export declare function saveDC(abilityScore: number, profBonus: number): number;
|
|
24
19
|
export declare function abilityNameToKey(name: string): (typeof ABILITY_KEYS)[number] | null;
|
|
25
|
-
/** Is `type` one of the canonical damage types, whatever its casing? A rider whose declared type is
|
|
26
|
-
* anything else, a sentinel (`weapon`) or prose ("same as the weapon's type"), INHERITS the weapon row's
|
|
27
|
-
* own damage type; `pc.recalc.ts` resolves that where the rider is merged onto the row, never in a
|
|
28
|
-
* renderer, and never from a list of prose spellings. The ONE exception is the schema's own sentinel
|
|
29
|
-
* {@link CHOSEN_DAMAGE_TYPE}, which means the player's choice, not the row's type (R4-G7 T8 RIDER-13). */
|
|
30
20
|
export declare function isCanonicalDamageType(type: string): boolean;
|
|
31
|
-
/** The schema's own damage-type sentinel for a rider whose type the PLAYER picks when the damage is dealt
|
|
32
|
-
* (`feature-effect-schema.ts`, the `damage-bonus` arm: "player-selected damage type at action time"). It is a
|
|
33
|
-
* declared schema value, not a prose spelling, so it never inherits the weapon row's type: the rider keeps it,
|
|
34
|
-
* and the sheet prints the amount with no type and {@link CHOSEN_DAMAGE_TYPE_NOTE} in the row's caption
|
|
35
|
-
* (R4-G7 T8 RIDER-13). */
|
|
36
21
|
export declare const CHOSEN_DAMAGE_TYPE = "chosen";
|
|
37
|
-
/** The caption words a renderer prints for a {@link CHOSEN_DAMAGE_TYPE} rider in place of a damage type. One
|
|
38
|
-
* constant, so no renderer spells the phrase itself. */
|
|
39
22
|
export declare const CHOSEN_DAMAGE_TYPE_NOTE = "damage type of your choice";
|
|
40
|
-
/** Is `type` the {@link CHOSEN_DAMAGE_TYPE} sentinel, whatever its casing or surrounding space? */
|
|
41
23
|
export declare function isChosenDamageType(type: string | undefined): boolean;
|
|
42
|
-
/** Can a damage rider be printed INSIDE the damage text, as a dice chip? Only when it reads as a dice
|
|
43
|
-
* expression or a (signed) number, optionally followed by ONE canonical damage type: `1d6`, `+2`,
|
|
44
|
-
* `1d6 fire`. Anything else is prose ("your Wisdom modifier necrotic", "half your fighter level
|
|
45
|
-
* slashing") and belongs in the row's caption instead (R4-G7 T6a E-4 (c)).
|
|
46
|
-
*
|
|
47
|
-
* `text` is the rider's PRINTED form, its amount plus its resolved damage type, because a shipped
|
|
48
|
-
* rider may carry the type inside the amount itself (`{amount: "1d6 fire"}` with no `damage_type`, the
|
|
49
|
-
* migrated manual override of `pc.equipment.ts`). */
|
|
50
24
|
export declare function isRenderableDamageText(text: string): boolean;
|
package/dist/dnd/math.js
CHANGED
|
@@ -1,45 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
CHOSEN_DAMAGE_TYPE,
|
|
3
|
-
CHOSEN_DAMAGE_TYPE_NOTE,
|
|
4
|
-
abilityModifier,
|
|
5
|
-
abilityNameToKey,
|
|
6
|
-
attackBonus,
|
|
7
|
-
crToXP,
|
|
8
|
-
formatModifier,
|
|
9
|
-
hitDiceSizeFromCreatureSize,
|
|
10
|
-
hpFromHitDice,
|
|
11
|
-
isCanonicalDamageType,
|
|
12
|
-
isChosenDamageType,
|
|
13
|
-
isRenderableDamageText,
|
|
14
|
-
parseHitDiceFormula,
|
|
15
|
-
passive,
|
|
16
|
-
passivePerception,
|
|
17
|
-
proficiencyBonusFromCR,
|
|
18
|
-
proficiencyFromLevel,
|
|
19
|
-
saveDC,
|
|
20
|
-
savingThrow,
|
|
21
|
-
skillBonus
|
|
22
|
-
} from "../chunk-PDJSUH24.js";
|
|
23
|
-
import "../chunk-WELIKLZF.js";
|
|
24
|
-
export {
|
|
25
|
-
CHOSEN_DAMAGE_TYPE,
|
|
26
|
-
CHOSEN_DAMAGE_TYPE_NOTE,
|
|
27
|
-
abilityModifier,
|
|
28
|
-
abilityNameToKey,
|
|
29
|
-
attackBonus,
|
|
30
|
-
crToXP,
|
|
31
|
-
formatModifier,
|
|
32
|
-
hitDiceSizeFromCreatureSize,
|
|
33
|
-
hpFromHitDice,
|
|
34
|
-
isCanonicalDamageType,
|
|
35
|
-
isChosenDamageType,
|
|
36
|
-
isRenderableDamageText,
|
|
37
|
-
parseHitDiceFormula,
|
|
38
|
-
passive,
|
|
39
|
-
passivePerception,
|
|
40
|
-
proficiencyBonusFromCR,
|
|
41
|
-
proficiencyFromLevel,
|
|
42
|
-
saveDC,
|
|
43
|
-
savingThrow,
|
|
44
|
-
skillBonus
|
|
45
|
-
};
|
|
1
|
+
import{CHOSEN_DAMAGE_TYPE,CHOSEN_DAMAGE_TYPE_NOTE,abilityModifier,abilityNameToKey,attackBonus,crToXP,formatModifier,hitDiceSizeFromCreatureSize,hpFromHitDice,isCanonicalDamageType,isChosenDamageType,isRenderableDamageText,parseHitDiceFormula,passive,passivePerception,proficiencyBonusFromCR,proficiencyFromLevel,saveDC,savingThrow,skillBonus}from"../chunk-7FPQJDFD.js";import"../chunk-EVT7MGAC.js";export{CHOSEN_DAMAGE_TYPE,CHOSEN_DAMAGE_TYPE_NOTE,abilityModifier,abilityNameToKey,attackBonus,crToXP,formatModifier,hitDiceSizeFromCreatureSize,hpFromHitDice,isCanonicalDamageType,isChosenDamageType,isRenderableDamageText,parseHitDiceFormula,passive,passivePerception,proficiencyBonusFromCR,proficiencyFromLevel,saveDC,savingThrow,skillBonus};
|
package/dist/dnd/prose-tags.d.ts
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Convert 5etools-style {@...} tags to the plugin's backtick inline-tag format.
|
|
3
|
-
* Called before backtick regex processing so AI-generated 5etools markup renders correctly.
|
|
4
|
-
*/
|
|
5
|
-
export declare function convert5eToolsTags(text: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* Wrap bare dice notation (e.g. `1d6`, `2d6+3`, `37d8 + 259`) in synthetic
|
|
8
|
-
* `dice:…` backtick tags so the existing stat-block pill renderer picks them up.
|
|
9
|
-
*
|
|
10
|
-
* Skips dice notation that is already inside a backtick tag (the first
|
|
11
|
-
* alternation branch consumes backtick-delimited spans and returns them
|
|
12
|
-
* untouched) or embedded inside an identifier (word-character boundary).
|
|
13
|
-
*
|
|
14
|
-
* Pure. No state. No side effects.
|
|
15
|
-
*/
|
|
1
|
+
export declare function convertBraceTags(text: string): string;
|
|
16
2
|
export declare function decorateProseDice(text: string): string;
|
package/dist/dnd/prose-tags.js
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function convert5eToolsTags(text) {
|
|
3
|
-
const rewritten = text.replace(/\{@atk\s+mw,rw\}/gi, "Melee or Ranged Weapon Attack:").replace(/\{@atk\s+mws\}/gi, "Melee or Ranged Weapon Attack:").replace(/\{@atk\s+msw\}/gi, "Melee or Ranged Spell Attack:").replace(/\{@atk\s+mw\}/gi, "Melee Weapon Attack:").replace(/\{@atk\s+rw\}/gi, "Ranged Weapon Attack:").replace(/\{@atk\s+ms\}/gi, "Melee Spell Attack:").replace(/\{@atk\s+rs\}/gi, "Ranged Spell Attack:").replace(/\{@hit\s+(\d+)\}/gi, "`atk:+$1`").replace(/\{@h\}\s*/gi, "Hit: ").replace(/\{@damage\s+([^}]+)\}/gi, "`damage:$1`").replace(/\{@dice\s+([^}]+)\}/gi, "`roll:$1`").replace(/\{@d20\s+([^}]+)\}/gi, "`roll:d20$1`").replace(/\{@dc\s+(\d+)\}/gi, "`dc:$1`").replace(/\{@recharge\s+(\d)\}/gi, "(Recharge $1-6)").replace(/\{@recharge\}/gi, "(Recharge)").replace(/\{@chance\s+(\d+)\}/gi, "$1% chance").replace(/\{@b(?:old)?\s+([^}]+)\}/gi, "**$1**").replace(/\{@i(?:talic)?\s+([^}]+)\}/gi, "_$1_").replace(/\{@s(?:trike)?\s+([^}]+)\}/gi, "~~$1~~").replace(/\{@note\s+([^}]+)\}/gi, "($1)").replace(/\{@spell\s+([^|}]+)[^}]*\}/gi, "_$1_").replace(/\{@item\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@creature\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@condition\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@skill\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@sense\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@action\s+([^|}]+)[^}]*\}/gi, "**$1**").replace(/\{@status\s+([^|}]+)[^}]*\}/gi, "**$1**").replace(/\{@ability\s+([^|}]+)[^}]*\}/gi, "**$1**").replace(/\{@class\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@feat\s+([^|}]+)[^}]*\}/gi, "**$1**").replace(/\{@background\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@race\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@disease\s+([^|}]+)[^}]*\}/gi, "**$1**").replace(/\{@hazard\s+([^|}]+)[^}]*\}/gi, "**$1**").replace(/\{@plane\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@language\s+([^|}]+)[^}]*\}/gi, "$1").replace(/\{@book\s+([^|}]+)[^}]*\}/gi, "_$1_").replace(/\{@adventure\s+([^|}]+)[^}]*\}/gi, "_$1_").replace(/\{@\w+\s+([^}]+)\}/g, "$1");
|
|
4
|
-
return decorateProseDice(rewritten);
|
|
5
|
-
}
|
|
6
|
-
function decorateProseDice(text) {
|
|
7
|
-
return text.replace(
|
|
8
|
-
/`[^`]*`|(?<!\w)(\d+d\d+(?:\s*[+-]\s*\d+)?)(?!\w)/g,
|
|
9
|
-
(match, dice) => {
|
|
10
|
-
if (dice) return `\`dice:${dice.replace(/\s+/g, "")}\``;
|
|
11
|
-
return match;
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
convert5eToolsTags,
|
|
17
|
-
decorateProseDice
|
|
18
|
-
};
|
|
1
|
+
function convertBraceTags(text){const rewritten=text.replace(/\{@atk\s+mw,rw\}/gi,"Melee or Ranged Weapon Attack:").replace(/\{@atk\s+mws\}/gi,"Melee or Ranged Weapon Attack:").replace(/\{@atk\s+msw\}/gi,"Melee or Ranged Spell Attack:").replace(/\{@atk\s+mw\}/gi,"Melee Weapon Attack:").replace(/\{@atk\s+rw\}/gi,"Ranged Weapon Attack:").replace(/\{@atk\s+ms\}/gi,"Melee Spell Attack:").replace(/\{@atk\s+rs\}/gi,"Ranged Spell Attack:").replace(/\{@hit\s+(\d+)\}/gi,"`atk:+$1`").replace(/\{@h\}\s*/gi,"Hit: ").replace(/\{@damage\s+([^}]+)\}/gi,"`damage:$1`").replace(/\{@dice\s+([^}]+)\}/gi,"`roll:$1`").replace(/\{@d20\s+([^}]+)\}/gi,"`roll:d20$1`").replace(/\{@dc\s+(\d+)\}/gi,"`dc:$1`").replace(/\{@recharge\s+(\d)\}/gi,"(Recharge $1-6)").replace(/\{@recharge\}/gi,"(Recharge)").replace(/\{@chance\s+(\d+)\}/gi,"$1% chance").replace(/\{@b(?:old)?\s+([^}]+)\}/gi,"**$1**").replace(/\{@i(?:talic)?\s+([^}]+)\}/gi,"_$1_").replace(/\{@s(?:trike)?\s+([^}]+)\}/gi,"~~$1~~").replace(/\{@note\s+([^}]+)\}/gi,"($1)").replace(/\{@spell\s+([^|}]+)[^}]*\}/gi,"_$1_").replace(/\{@item\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@creature\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@condition\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@skill\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@sense\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@action\s+([^|}]+)[^}]*\}/gi,"**$1**").replace(/\{@status\s+([^|}]+)[^}]*\}/gi,"**$1**").replace(/\{@ability\s+([^|}]+)[^}]*\}/gi,"**$1**").replace(/\{@class\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@feat\s+([^|}]+)[^}]*\}/gi,"**$1**").replace(/\{@background\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@race\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@disease\s+([^|}]+)[^}]*\}/gi,"**$1**").replace(/\{@hazard\s+([^|}]+)[^}]*\}/gi,"**$1**").replace(/\{@plane\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@language\s+([^|}]+)[^}]*\}/gi,"$1").replace(/\{@book\s+([^|}]+)[^}]*\}/gi,"_$1_").replace(/\{@adventure\s+([^|}]+)[^}]*\}/gi,"_$1_").replace(/\{@\w+\s+([^}]+)\}/g,"$1");return decorateProseDice(rewritten)}function decorateProseDice(text){return text.replace(/`[^`]*`|(?<!\w)(\d+d\d+(?:\s*[+-]\s*\d+)?)(?!\w)/g,(match,dice)=>{if(dice)return`\`dice:${dice.replace(/\s+/g,"")}\``;return match})}export{convertBraceTags,decorateProseDice};
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import type { ResourceDie } from "../types/resource.js";
|
|
2
|
-
/** The die face in effect at `level`: the value of the highest `scaling` key
|
|
3
|
-
* ≤ level, else `die.base`. Keys are level thresholds as strings (JSON/YAML
|
|
4
|
-
* object keys are strings). Extracted from the resource badge so feature-attack
|
|
5
|
-
* damage can scale identically. Non-numeric scaling keys coerce to NaN and are skipped. */
|
|
6
2
|
export declare function resolveScalingDie(die: ResourceDie, level: number): string;
|
package/dist/dnd/resource-die.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function resolveScalingDie(die, level) {
|
|
3
|
-
var _a;
|
|
4
|
-
let face = die.base;
|
|
5
|
-
let best = 0;
|
|
6
|
-
for (const [lvl, f] of Object.entries((_a = die.scaling) != null ? _a : {})) {
|
|
7
|
-
const n = Number(lvl);
|
|
8
|
-
if (n <= level && n > best) {
|
|
9
|
-
best = n;
|
|
10
|
-
face = f;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return face;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
resolveScalingDie
|
|
17
|
-
};
|
|
1
|
+
function resolveScalingDie(die,level){var _a;let face=die.base;let best=0;for(const[lvl,f]of Object.entries((_a=die.scaling)!=null?_a:{})){const n=Number(lvl);if(n<=level&&n>best){best=n;face=f}}return face}export{resolveScalingDie};
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tiny DSL for Resource.max_formula and Resource.recovery[].amount (SP4d; R4-G4 §6 added max / min). Grammar:
|
|
3
|
-
* expr := term (('+' | '-') term)*
|
|
4
|
-
* term := factor (('*' | '/') factor)*
|
|
5
|
-
* factor := number | string-arg-only | ident | '{' ident '}' | fn1 '(' expr ')' | fnN '(' expr (',' expr)+ ')'
|
|
6
|
-
* | "column" '(' string ')' | '(' expr ')'
|
|
7
|
-
* fn1 := 'ceil' | 'floor' (exactly one argument)
|
|
8
|
-
* fnN := 'max' | 'min' (two or more comma-separated arguments)
|
|
9
|
-
* ident := level | class_level | prof | <abil>_mod
|
|
10
|
-
* The single-quoted string literal (e.g. 'Seals') is valid ONLY as the argument to column(...).
|
|
11
|
-
* '*' and '/' bind tighter than '+'/'-'. '/' is real division; wrap in ceil()/floor() for integer
|
|
12
|
-
* results (e.g. "ceil({class_level}/2)"). "max(1, {cha_mod})" is how the data says "a minimum of once".
|
|
13
|
-
* `AT_WILL_MAX` (999) is the at-will sentinel: it evaluates as the literal 999; R4-G4 T3 (§5) taught
|
|
14
|
-
* the plugin's charge boxes to render "at will" for it instead of 999 boxes (the `opts.atWill` branch
|
|
15
|
-
* at the head of `renderChargeBoxes`, fed by the `atWill: fu.max === AT_WILL_MAX` opt its callers
|
|
16
|
-
* pass). Measured 2026-09-05 on the plugin tree that carries T7b with
|
|
17
|
-
* `grep -rn "atWill:" packages/obsidian/src`: FOUR lines, the two T3 feature trackers
|
|
18
|
-
* `renderCardResource` and `renderFirstResourceTracker`, T5's pool-tab dice head `renderPoolHead`,
|
|
19
|
-
* and T7b's `renderPickTracker`, which draws a pool pick's own `uses` on the pool row, the granted
|
|
20
|
-
* row and the boon row.
|
|
21
|
-
*/
|
|
22
1
|
export interface FormulaBindings {
|
|
23
2
|
level: number;
|
|
24
3
|
class_level: number;
|
|
@@ -29,9 +8,6 @@ export interface FormulaBindings {
|
|
|
29
8
|
int_mod: number;
|
|
30
9
|
wis_mod: number;
|
|
31
10
|
cha_mod: number;
|
|
32
|
-
/** Numeric values of the owning (sub)class table row at the current class
|
|
33
|
-
* level, keyed by column name (e.g. "Seals"). Empty when no table/row.
|
|
34
|
-
* Read by the `column('Name')` accessor; missing name → 0. */
|
|
35
11
|
columns: Record<string, number>;
|
|
36
12
|
}
|
|
37
13
|
export declare const AT_WILL_MAX = 999;
|
|
@@ -44,24 +20,5 @@ export interface ScalableResource {
|
|
|
44
20
|
max: string;
|
|
45
21
|
}[];
|
|
46
22
|
}
|
|
47
|
-
/** The max-formula string in effect at `totalLevel`: the highest `scales_at` step whose level
|
|
48
|
-
* ≤ totalLevel (the FIRST declaration wins on a duplicate level; a `level: 0` step is skipped), else
|
|
49
|
-
* the base `max_formula`. Parse-free, so a die-string step comes back as the die string. Its one
|
|
50
|
-
* production caller, the plugin's `seedFeatureUses` (`pc.resource-seed.ts`), moved to
|
|
51
|
-
* `resolveMaxCountAt` in R4-G4 T3, so it is now TEST-ONLY: zero callers in this repo's `src/` and zero
|
|
52
|
-
* in the plugin's `packages/obsidian/src/`, pinned by this repo's `tests/resource-formula.test.ts`
|
|
53
|
-
* (its Bardic-Die-2024 and duplicate-level-tie cases) and by the plugin's cross-repo file of the same
|
|
54
|
-
* name (its `describe("resolveMaxAt")` block). */
|
|
55
23
|
export declare function resolveMaxAt(totalLevel: number, resource: ScalableResource): string;
|
|
56
|
-
/** The max COUNT in effect at `level`: the highest `scales_at` step at or below `level` whose `max`
|
|
57
|
-
* PARSES under the DSL, else the base `max_formula` if it parses, else null. Ties break exactly as
|
|
58
|
-
* `resolveMaxAt` breaks them (the FIRST declaration at a duplicate level wins, a `level: 0` step is
|
|
59
|
-
* skipped), so a duplicate-level pair of PARSING steps cannot make the count and the die label pick
|
|
60
|
-
* different steps; where one member of the pair is a die string they DO pick different steps
|
|
61
|
-
* (`[{level:3,max:"1d8"},{level:3,max:"3"}]` at 3 reads 3 here and "1d8" there), which is the same
|
|
62
|
-
* parse-vs-string divergence described next. A step that does not parse is a die size (Bardic Die
|
|
63
|
-
* 2024: "1d8" at 5), not a count, and is skipped HERE while `resolveMaxAt` still returns it; a base
|
|
64
|
-
* that does not parse (Sneak Attack "1d6") is a damage die, correctly no tracker. `resolveMaxAt`
|
|
65
|
-
* keeps the parse-free string lookup; R4-G4 T3 handed its one production caller, the plugin seed, to
|
|
66
|
-
* this function (see its docblock), so a null here is what the seed warns on and leaves un-seeded. */
|
|
67
24
|
export declare function resolveMaxCountAt(level: number, resource: ScalableResource, bindings: FormulaBindings): number | null;
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
AT_WILL_MAX,
|
|
3
|
-
evaluateMaxFormula,
|
|
4
|
-
isValidMaxFormula,
|
|
5
|
-
resolveMaxAt,
|
|
6
|
-
resolveMaxCountAt
|
|
7
|
-
} from "../chunk-EVMUJYUD.js";
|
|
8
|
-
export {
|
|
9
|
-
AT_WILL_MAX,
|
|
10
|
-
evaluateMaxFormula,
|
|
11
|
-
isValidMaxFormula,
|
|
12
|
-
resolveMaxAt,
|
|
13
|
-
resolveMaxCountAt
|
|
14
|
-
};
|
|
1
|
+
import{AT_WILL_MAX,evaluateMaxFormula,isValidMaxFormula,resolveMaxAt,resolveMaxCountAt}from"../chunk-EAARMPCW.js";export{AT_WILL_MAX,evaluateMaxFormula,isValidMaxFormula,resolveMaxAt,resolveMaxCountAt};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
/** The resource's name worded for `amount`: the last word singular for one, plural otherwise, when it is a count noun. */
|
|
2
1
|
export declare function resourceCountWord(name: string, amount: number): string;
|
|
3
|
-
/** "<amount> <name worded for it>" ("1 Superiority Die"). */
|
|
4
2
|
export declare function countedResource(amount: number, name: string): string;
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var COUNT_NOUNS = [
|
|
3
|
-
["Die", "Dice"],
|
|
4
|
-
["Point", "Points"],
|
|
5
|
-
["Use", "Uses"],
|
|
6
|
-
["Seal", "Seals"],
|
|
7
|
-
["Rage", "Rages"],
|
|
8
|
-
["Cast", "Casts"],
|
|
9
|
-
["Casting", "Castings"],
|
|
10
|
-
["Scroll", "Scrolls"],
|
|
11
|
-
["Charge", "Charges"],
|
|
12
|
-
["Token", "Tokens"],
|
|
13
|
-
["Slot", "Slots"]
|
|
14
|
-
];
|
|
15
|
-
var BY_WORD = new Map(
|
|
16
|
-
COUNT_NOUNS.flatMap((pair) => [[pair[0], pair], [pair[1], pair]])
|
|
17
|
-
);
|
|
18
|
-
function resourceCountWord(name, amount) {
|
|
19
|
-
const at = name.lastIndexOf(" ") + 1;
|
|
20
|
-
const pair = BY_WORD.get(name.slice(at));
|
|
21
|
-
if (!pair) return name;
|
|
22
|
-
return name.slice(0, at) + (amount === 1 ? pair[0] : pair[1]);
|
|
23
|
-
}
|
|
24
|
-
function countedResource(amount, name) {
|
|
25
|
-
return `${amount} ${resourceCountWord(name, amount)}`;
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
countedResource,
|
|
29
|
-
resourceCountWord
|
|
30
|
-
};
|
|
1
|
+
var COUNT_NOUNS=[["Die","Dice"],["Point","Points"],["Use","Uses"],["Seal","Seals"],["Rage","Rages"],["Cast","Casts"],["Casting","Castings"],["Scroll","Scrolls"],["Charge","Charges"],["Token","Tokens"],["Slot","Slots"]];var BY_WORD=new Map(COUNT_NOUNS.flatMap(pair=>[[pair[0],pair],[pair[1],pair]]));function resourceCountWord(name,amount){const at=name.lastIndexOf(" ")+1;const pair=BY_WORD.get(name.slice(at));if(!pair)return name;return name.slice(0,at)+(amount===1?pair[0]:pair[1])}function countedResource(amount,name){return`${amount} ${resourceCountWord(name,amount)}`}export{countedResource,resourceCountWord};
|
|
@@ -15,29 +15,8 @@ export interface ConversionContext {
|
|
|
15
15
|
actionCategory: ActionCategory;
|
|
16
16
|
spellAbility?: "int" | "wis" | "cha";
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Shared static-fallback context for callers that enrich creature-agnostic
|
|
20
|
-
* content (spells, magic items) where no real ability mods / prof bonus exist.
|
|
21
|
-
*
|
|
22
|
-
* All ability mods = 0 and prof = 0, so no computed target matches any
|
|
23
|
-
* reasonable value and every pattern falls to the static fallback path
|
|
24
|
-
* (e.g. `dc:15`, `atk:+7`).
|
|
25
|
-
*/
|
|
26
18
|
export declare const STATIC_FALLBACK_CONTEXT: ConversionContext;
|
|
27
|
-
/**
|
|
28
|
-
* Convert SRD plain-English descriptions (e.g. "Melee Weapon Attack: +14 to hit,
|
|
29
|
-
* Hit: 21 (3d8 + 8) slashing damage") into backtick formula tags
|
|
30
|
-
* (e.g. "Melee Weapon Attack: `atk:STR+PB`, Hit: `dmg:3d8+STR` slashing damage")
|
|
31
|
-
* by reverse-inferring which ability mod + prof produced the static value.
|
|
32
|
-
*
|
|
33
|
-
* Pure. Deterministic. Never throws: wraps everything in try/catch and returns
|
|
34
|
-
* the original desc on any failure.
|
|
35
|
-
*/
|
|
36
19
|
export declare function convertDescToTags(desc: string, ctx: ConversionContext): string;
|
|
37
|
-
/**
|
|
38
|
-
* Scan a monster's trait list for a spellcasting ability declaration like
|
|
39
|
-
* "Its spellcasting ability is Wisdom". Returns undefined for non-casters.
|
|
40
|
-
*/
|
|
41
20
|
export declare function detectSpellcastingAbility(traits: {
|
|
42
21
|
name: string;
|
|
43
22
|
entries: string[];
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
STATIC_FALLBACK_CONTEXT,
|
|
3
|
-
convertDescToTags,
|
|
4
|
-
detectSpellcastingAbility
|
|
5
|
-
} from "../chunk-DEEHHLAP.js";
|
|
6
|
-
import "../chunk-PDJSUH24.js";
|
|
7
|
-
import "../chunk-WELIKLZF.js";
|
|
8
|
-
export {
|
|
9
|
-
STATIC_FALLBACK_CONTEXT,
|
|
10
|
-
convertDescToTags,
|
|
11
|
-
detectSpellcastingAbility
|
|
12
|
-
};
|
|
1
|
+
import{STATIC_FALLBACK_CONTEXT,convertDescToTags,detectSpellcastingAbility}from"../chunk-MGGKZGLG.js";import"../chunk-7FPQJDFD.js";import"../chunk-EVT7MGAC.js";export{STATIC_FALLBACK_CONTEXT,convertDescToTags,detectSpellcastingAbility};
|
package/dist/dnd/tag-grammar.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
normalizeTagType,
|
|
3
|
-
parseTagTerms
|
|
4
|
-
} from "../chunk-QYZV2MQA.js";
|
|
5
|
-
import {
|
|
6
|
-
ABILITY_KEYS
|
|
7
|
-
} from "../chunk-WELIKLZF.js";
|
|
8
|
-
export {
|
|
9
|
-
ABILITY_KEYS as ABILITIES,
|
|
10
|
-
normalizeTagType,
|
|
11
|
-
parseTagTerms
|
|
12
|
-
};
|
|
1
|
+
import{normalizeTagType,parseTagTerms}from"../chunk-2HRRH3WL.js";import{ABILITY_KEYS}from"../chunk-EVT7MGAC.js";export{ABILITY_KEYS as ABILITIES,normalizeTagType,parseTagTerms};
|
package/dist/dnd/warn-once.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
encounterInputSchema,
|
|
3
|
-
encounterOutputSchema
|
|
4
|
-
} from "../chunk-LSLSG67V.js";
|
|
5
|
-
export {
|
|
6
|
-
encounterInputSchema,
|
|
7
|
-
encounterOutputSchema
|
|
8
|
-
};
|
|
1
|
+
import{encounterInputSchema,encounterOutputSchema}from"../chunk-M6RPOLKS.js";export{encounterInputSchema,encounterOutputSchema};
|