@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
package/dist/chunk-EJP263OP.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveBaseItem
|
|
3
|
-
} from "./chunk-CM5CWO4K.js";
|
|
4
|
-
import {
|
|
5
|
-
bareEntitySlug,
|
|
6
|
-
slugify,
|
|
7
|
-
wikilinkTailSlug
|
|
8
|
-
} from "./chunk-ZCTUYGNV.js";
|
|
9
|
-
|
|
10
|
-
// src/pc/pc.containment.ts
|
|
11
|
-
function nonEmptyRef(v) {
|
|
12
|
-
return typeof v === "string" && v.length > 0 ? v : null;
|
|
13
|
-
}
|
|
14
|
-
function isContainerItem(entity) {
|
|
15
|
-
if (!entity || typeof entity !== "object") return false;
|
|
16
|
-
const c = entity.container;
|
|
17
|
-
if (!c || typeof c !== "object") return false;
|
|
18
|
-
const container = c;
|
|
19
|
-
if (typeof container.holds_items === "boolean") return container.holds_items;
|
|
20
|
-
if (typeof container.capacity_weight === "number" && container.capacity_weight > 0) return true;
|
|
21
|
-
const cap = container.capacity;
|
|
22
|
-
if (!cap || typeof cap !== "object") return false;
|
|
23
|
-
const k = cap;
|
|
24
|
-
if (Array.isArray(k.weight) && k.weight.length > 0) return true;
|
|
25
|
-
if (Array.isArray(k.item) && k.item.length > 0) return true;
|
|
26
|
-
return k.weightless === true;
|
|
27
|
-
}
|
|
28
|
-
function idOwners(equipment) {
|
|
29
|
-
const ownerOfId = /* @__PURE__ */ new Map();
|
|
30
|
-
const duplicateIds = [];
|
|
31
|
-
equipment.forEach((entry, i) => {
|
|
32
|
-
const id = nonEmptyRef(entry.id);
|
|
33
|
-
if (id === null) return;
|
|
34
|
-
if (ownerOfId.has(id)) duplicateIds.push(i);
|
|
35
|
-
else ownerOfId.set(id, i);
|
|
36
|
-
});
|
|
37
|
-
return { ownerOfId, duplicateIds };
|
|
38
|
-
}
|
|
39
|
-
function entityOfEntry(entry, registry) {
|
|
40
|
-
var _a, _b;
|
|
41
|
-
if (!registry) return null;
|
|
42
|
-
return (_b = (_a = resolveBaseItem(entry.item, registry)) == null ? void 0 : _a.data) != null ? _b : null;
|
|
43
|
-
}
|
|
44
|
-
function resolveContainment(equipment, registry) {
|
|
45
|
-
const n = equipment.length;
|
|
46
|
-
const { ownerOfId, duplicateIds } = idOwners(equipment);
|
|
47
|
-
const entities = equipment.map((entry) => entityOfEntry(entry, registry));
|
|
48
|
-
const isContainer = entities.map((entity) => isContainerItem(entity));
|
|
49
|
-
const parentOf = new Array(n).fill(null);
|
|
50
|
-
const broken = [];
|
|
51
|
-
const closesCycle = (child, owner) => {
|
|
52
|
-
for (let cur = owner; cur !== null; cur = parentOf[cur]) if (cur === child) return true;
|
|
53
|
-
return false;
|
|
54
|
-
};
|
|
55
|
-
for (let i = 0; i < n; i++) {
|
|
56
|
-
const target = nonEmptyRef(equipment[i].in);
|
|
57
|
-
if (target === null) continue;
|
|
58
|
-
const owner = ownerOfId.get(target);
|
|
59
|
-
let reason = null;
|
|
60
|
-
if (equipment[i].equipped === true) reason = "equipped";
|
|
61
|
-
else if (owner === void 0) reason = "missing";
|
|
62
|
-
else if (owner === i) reason = "self";
|
|
63
|
-
else if (entities[owner] === null) reason = "unresolved";
|
|
64
|
-
else if (!isContainer[owner]) reason = "not-container";
|
|
65
|
-
else if (closesCycle(i, owner)) reason = "cycle";
|
|
66
|
-
if (reason !== null) {
|
|
67
|
-
broken.push({ index: i, reason });
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
parentOf[i] = owner;
|
|
71
|
-
}
|
|
72
|
-
const childrenOf = Array.from({ length: n }, () => []);
|
|
73
|
-
parentOf.forEach((p, i) => {
|
|
74
|
-
if (p !== null) childrenOf[p].push(i);
|
|
75
|
-
});
|
|
76
|
-
return { parentOf, childrenOf, isContainer, ownerOfId, duplicateIds, broken };
|
|
77
|
-
}
|
|
78
|
-
function mintBase(entry, registry) {
|
|
79
|
-
var _a, _b, _c;
|
|
80
|
-
const found = registry ? resolveBaseItem(entry.item, registry) : null;
|
|
81
|
-
const byName = found ? slugify((_a = found.name) != null ? _a : "") : "";
|
|
82
|
-
if (byName) return byName;
|
|
83
|
-
const inner = (_c = (_b = /^\[\[(.+?)\]\]$/.exec(entry.item.trim())) == null ? void 0 : _b[1]) != null ? _c : entry.item.trim();
|
|
84
|
-
const ref = inner.split("|")[0].trim();
|
|
85
|
-
const byRef = ref.includes("/") ? wikilinkTailSlug(ref) : slugify(bareEntitySlug(ref));
|
|
86
|
-
return byRef || "item";
|
|
87
|
-
}
|
|
88
|
-
function ensureEntryId(equipment, index, registry) {
|
|
89
|
-
const { ownerOfId } = idOwners(equipment);
|
|
90
|
-
const own = nonEmptyRef(equipment[index].id);
|
|
91
|
-
if (own !== null && ownerOfId.get(own) === index) return own;
|
|
92
|
-
const taken = /* @__PURE__ */ new Set();
|
|
93
|
-
for (const entry of equipment) {
|
|
94
|
-
const a = nonEmptyRef(entry.id);
|
|
95
|
-
if (a !== null) taken.add(a);
|
|
96
|
-
const b = nonEmptyRef(entry.in);
|
|
97
|
-
if (b !== null) taken.add(b);
|
|
98
|
-
}
|
|
99
|
-
const base = mintBase(equipment[index], registry);
|
|
100
|
-
let id = base;
|
|
101
|
-
for (let k = 2; taken.has(id); k++) id = `${base}-${k}`;
|
|
102
|
-
equipment[index].id = id;
|
|
103
|
-
return id;
|
|
104
|
-
}
|
|
105
|
-
function canMoveInto(equipment, index, target, registry) {
|
|
106
|
-
var _a;
|
|
107
|
-
const inRange = (i) => Number.isInteger(i) && i >= 0 && i < equipment.length;
|
|
108
|
-
if (!inRange(index) || target !== null && !inRange(target)) return { ok: false, reason: "out-of-range" };
|
|
109
|
-
if (target === null) return { ok: true };
|
|
110
|
-
if (equipment[index].equipped === true) return { ok: false, reason: "equipped" };
|
|
111
|
-
if (target === index) return { ok: false, reason: "self" };
|
|
112
|
-
const view = resolveContainment(equipment, registry);
|
|
113
|
-
const unresolvedLink = new Set(view.broken.filter((b) => b.reason === "unresolved").map((b) => b.index));
|
|
114
|
-
const seen = /* @__PURE__ */ new Set();
|
|
115
|
-
for (let cur = target; cur !== null && !seen.has(cur); ) {
|
|
116
|
-
if (cur === index) return { ok: false, reason: "descendant" };
|
|
117
|
-
seen.add(cur);
|
|
118
|
-
const up = view.parentOf[cur];
|
|
119
|
-
if (up !== null) {
|
|
120
|
-
cur = up;
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
if (unresolvedLink.has(cur)) {
|
|
124
|
-
const raw = nonEmptyRef(equipment[cur].in);
|
|
125
|
-
cur = raw === null ? null : (_a = view.ownerOfId.get(raw)) != null ? _a : null;
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
cur = null;
|
|
129
|
-
}
|
|
130
|
-
const entity = entityOfEntry(equipment[target], registry);
|
|
131
|
-
if (entity === null) return { ok: false, reason: "unresolved" };
|
|
132
|
-
if (!isContainerItem(entity)) return { ok: false, reason: "not-container" };
|
|
133
|
-
return { ok: true };
|
|
134
|
-
}
|
|
135
|
-
function moveInto(equipment, index, target, registry) {
|
|
136
|
-
const check = canMoveInto(equipment, index, target, registry);
|
|
137
|
-
if (!check.ok) return check;
|
|
138
|
-
const entry = equipment[index];
|
|
139
|
-
if (target === null) {
|
|
140
|
-
const had = entry.in !== void 0;
|
|
141
|
-
delete entry.in;
|
|
142
|
-
return { ok: true, changed: had };
|
|
143
|
-
}
|
|
144
|
-
const wasHonoured = resolveContainment(equipment, registry).parentOf[index] === target;
|
|
145
|
-
const idBefore = equipment[target].id;
|
|
146
|
-
const id = ensureEntryId(equipment, target, registry);
|
|
147
|
-
entry.in = id;
|
|
148
|
-
return { ok: true, changed: idBefore !== id || !wasHonoured };
|
|
149
|
-
}
|
|
150
|
-
function repairContainment(equipment, registry) {
|
|
151
|
-
if (!registry) return 0;
|
|
152
|
-
let removed = 0;
|
|
153
|
-
for (const entry of equipment) {
|
|
154
|
-
if (entry.id === "") {
|
|
155
|
-
delete entry.id;
|
|
156
|
-
removed++;
|
|
157
|
-
}
|
|
158
|
-
if (entry.in === "") {
|
|
159
|
-
delete entry.in;
|
|
160
|
-
removed++;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
const view = resolveContainment(equipment, registry);
|
|
164
|
-
for (const b of view.broken) {
|
|
165
|
-
if (b.reason === "unresolved") continue;
|
|
166
|
-
delete equipment[b.index].in;
|
|
167
|
-
removed++;
|
|
168
|
-
}
|
|
169
|
-
for (const i of view.duplicateIds) {
|
|
170
|
-
delete equipment[i].id;
|
|
171
|
-
removed++;
|
|
172
|
-
}
|
|
173
|
-
return removed;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export {
|
|
177
|
-
nonEmptyRef,
|
|
178
|
-
isContainerItem,
|
|
179
|
-
idOwners,
|
|
180
|
-
entityOfEntry,
|
|
181
|
-
resolveContainment,
|
|
182
|
-
ensureEntryId,
|
|
183
|
-
canMoveInto,
|
|
184
|
-
moveInto,
|
|
185
|
-
repairContainment
|
|
186
|
-
};
|
package/dist/chunk-EVMUJYUD.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
// src/dnd/resource-formula.ts
|
|
2
|
-
var IDENTS = /* @__PURE__ */ new Set([
|
|
3
|
-
"level",
|
|
4
|
-
"class_level",
|
|
5
|
-
"prof",
|
|
6
|
-
"str_mod",
|
|
7
|
-
"dex_mod",
|
|
8
|
-
"con_mod",
|
|
9
|
-
"int_mod",
|
|
10
|
-
"wis_mod",
|
|
11
|
-
"cha_mod"
|
|
12
|
-
]);
|
|
13
|
-
var AT_WILL_MAX = 999;
|
|
14
|
-
var FUNCS = /* @__PURE__ */ new Set(["ceil", "floor", "max", "min"]);
|
|
15
|
-
function tokenize(input) {
|
|
16
|
-
input = input.trim();
|
|
17
|
-
const tokens = [];
|
|
18
|
-
const re = /\s*('[^']*'|\{[a-z_]+\}|[a-z_]+|\d+|[+\-*/(),])/y;
|
|
19
|
-
let i = 0;
|
|
20
|
-
while (i < input.length) {
|
|
21
|
-
re.lastIndex = i;
|
|
22
|
-
const m = re.exec(input);
|
|
23
|
-
if (!m || m.index !== i) return null;
|
|
24
|
-
const raw = m[1];
|
|
25
|
-
i = re.lastIndex;
|
|
26
|
-
if (/^\d+$/.test(raw)) tokens.push({ kind: "num", value: parseInt(raw, 10) });
|
|
27
|
-
else if (raw.startsWith("'")) tokens.push({ kind: "str", value: raw.slice(1, -1) });
|
|
28
|
-
else if (raw === "(") tokens.push({ kind: "lparen" });
|
|
29
|
-
else if (raw === ")") tokens.push({ kind: "rparen" });
|
|
30
|
-
else if (raw === ",") tokens.push({ kind: "comma" });
|
|
31
|
-
else if (raw === "+" || raw === "-" || raw === "*" || raw === "/") tokens.push({ kind: "op", op: raw });
|
|
32
|
-
else {
|
|
33
|
-
const braced = raw.startsWith("{");
|
|
34
|
-
const name = braced ? raw.slice(1, -1) : raw;
|
|
35
|
-
if (!braced && FUNCS.has(name)) tokens.push({ kind: "fn", name });
|
|
36
|
-
else if (!braced && name === "column") tokens.push({ kind: "col" });
|
|
37
|
-
else if (IDENTS.has(name)) tokens.push({ kind: "id", name });
|
|
38
|
-
else return null;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return tokens.length > 0 ? tokens : null;
|
|
42
|
-
}
|
|
43
|
-
function evalTokens(tokens, b) {
|
|
44
|
-
let pos = 0;
|
|
45
|
-
const peek = () => tokens[pos];
|
|
46
|
-
const factor = () => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
48
|
-
const t = peek();
|
|
49
|
-
if (!t) return null;
|
|
50
|
-
if (t.kind === "num") {
|
|
51
|
-
pos++;
|
|
52
|
-
return t.value;
|
|
53
|
-
}
|
|
54
|
-
if (t.kind === "id") {
|
|
55
|
-
const val = b[t.name];
|
|
56
|
-
if (val === void 0) return null;
|
|
57
|
-
pos++;
|
|
58
|
-
return val;
|
|
59
|
-
}
|
|
60
|
-
if (t.kind === "fn") {
|
|
61
|
-
pos++;
|
|
62
|
-
if (((_a = peek()) == null ? void 0 : _a.kind) !== "lparen") return null;
|
|
63
|
-
pos++;
|
|
64
|
-
const args = [];
|
|
65
|
-
const first = expr();
|
|
66
|
-
if (first === null) return null;
|
|
67
|
-
args.push(first);
|
|
68
|
-
while (((_b = peek()) == null ? void 0 : _b.kind) === "comma") {
|
|
69
|
-
pos++;
|
|
70
|
-
const next = expr();
|
|
71
|
-
if (next === null) return null;
|
|
72
|
-
args.push(next);
|
|
73
|
-
}
|
|
74
|
-
if (((_c = peek()) == null ? void 0 : _c.kind) !== "rparen") return null;
|
|
75
|
-
pos++;
|
|
76
|
-
if (t.name === "ceil" || t.name === "floor") {
|
|
77
|
-
if (args.length !== 1) return null;
|
|
78
|
-
return t.name === "ceil" ? Math.ceil(args[0]) : Math.floor(args[0]);
|
|
79
|
-
}
|
|
80
|
-
if (args.length < 2) return null;
|
|
81
|
-
return t.name === "max" ? Math.max(...args) : Math.min(...args);
|
|
82
|
-
}
|
|
83
|
-
if (t.kind === "col") {
|
|
84
|
-
pos++;
|
|
85
|
-
if (((_d = peek()) == null ? void 0 : _d.kind) !== "lparen") return null;
|
|
86
|
-
pos++;
|
|
87
|
-
const s = peek();
|
|
88
|
-
if (!s || s.kind !== "str") return null;
|
|
89
|
-
pos++;
|
|
90
|
-
if (((_e = peek()) == null ? void 0 : _e.kind) !== "rparen") return null;
|
|
91
|
-
pos++;
|
|
92
|
-
return (_g = (_f = b.columns) == null ? void 0 : _f[s.value]) != null ? _g : 0;
|
|
93
|
-
}
|
|
94
|
-
if (t.kind === "lparen") {
|
|
95
|
-
pos++;
|
|
96
|
-
const inner = expr();
|
|
97
|
-
if (inner === null) return null;
|
|
98
|
-
if (((_h = peek()) == null ? void 0 : _h.kind) !== "rparen") return null;
|
|
99
|
-
pos++;
|
|
100
|
-
return inner;
|
|
101
|
-
}
|
|
102
|
-
return null;
|
|
103
|
-
};
|
|
104
|
-
const term = () => {
|
|
105
|
-
var _a;
|
|
106
|
-
let v = factor();
|
|
107
|
-
if (v === null) return null;
|
|
108
|
-
while (((_a = peek()) == null ? void 0 : _a.kind) === "op" && (peek().op === "*" || peek().op === "/")) {
|
|
109
|
-
const op = peek().op;
|
|
110
|
-
pos++;
|
|
111
|
-
const r = factor();
|
|
112
|
-
if (r === null) return null;
|
|
113
|
-
v = op === "*" ? v * r : v / r;
|
|
114
|
-
}
|
|
115
|
-
return v;
|
|
116
|
-
};
|
|
117
|
-
const expr = () => {
|
|
118
|
-
var _a;
|
|
119
|
-
let v = term();
|
|
120
|
-
if (v === null) return null;
|
|
121
|
-
while (((_a = peek()) == null ? void 0 : _a.kind) === "op" && (peek().op === "+" || peek().op === "-")) {
|
|
122
|
-
const op = peek().op;
|
|
123
|
-
pos++;
|
|
124
|
-
const r = term();
|
|
125
|
-
if (r === null) return null;
|
|
126
|
-
v = op === "+" ? v + r : v - r;
|
|
127
|
-
}
|
|
128
|
-
return v;
|
|
129
|
-
};
|
|
130
|
-
const result = expr();
|
|
131
|
-
if (result === null || pos !== tokens.length) return null;
|
|
132
|
-
return result;
|
|
133
|
-
}
|
|
134
|
-
var ZERO = {
|
|
135
|
-
level: 1,
|
|
136
|
-
class_level: 1,
|
|
137
|
-
prof: 2,
|
|
138
|
-
str_mod: 0,
|
|
139
|
-
dex_mod: 0,
|
|
140
|
-
con_mod: 0,
|
|
141
|
-
int_mod: 0,
|
|
142
|
-
wis_mod: 0,
|
|
143
|
-
cha_mod: 0,
|
|
144
|
-
columns: {}
|
|
145
|
-
};
|
|
146
|
-
function isValidMaxFormula(formula) {
|
|
147
|
-
const toks = tokenize(formula);
|
|
148
|
-
if (!toks) return false;
|
|
149
|
-
return evalTokens(toks, ZERO) !== null;
|
|
150
|
-
}
|
|
151
|
-
function evaluateMaxFormula(formula, bindings) {
|
|
152
|
-
const toks = tokenize(formula);
|
|
153
|
-
if (!toks) throw new Error(`invalid max_formula: ${JSON.stringify(formula)}`);
|
|
154
|
-
const v = evalTokens(toks, bindings);
|
|
155
|
-
if (v === null) throw new Error(`invalid max_formula: ${JSON.stringify(formula)}`);
|
|
156
|
-
return v;
|
|
157
|
-
}
|
|
158
|
-
function resolveMaxAt(totalLevel, resource) {
|
|
159
|
-
var _a;
|
|
160
|
-
let chosen = resource.max_formula;
|
|
161
|
-
let best = 0;
|
|
162
|
-
for (const step of (_a = resource.scales_at) != null ? _a : []) {
|
|
163
|
-
if (step.level <= totalLevel && step.level > best) {
|
|
164
|
-
best = step.level;
|
|
165
|
-
chosen = step.max;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return chosen;
|
|
169
|
-
}
|
|
170
|
-
function resolveMaxCountAt(level, resource, bindings) {
|
|
171
|
-
var _a;
|
|
172
|
-
const tryEval = (s) => {
|
|
173
|
-
const toks = tokenize(s);
|
|
174
|
-
return toks ? evalTokens(toks, bindings) : null;
|
|
175
|
-
};
|
|
176
|
-
let best = 0;
|
|
177
|
-
let chosen = null;
|
|
178
|
-
for (const step of (_a = resource.scales_at) != null ? _a : []) {
|
|
179
|
-
if (step.level > level || step.level <= best) continue;
|
|
180
|
-
const v = tryEval(step.max);
|
|
181
|
-
if (v === null) continue;
|
|
182
|
-
best = step.level;
|
|
183
|
-
chosen = v;
|
|
184
|
-
}
|
|
185
|
-
if (chosen !== null) return chosen;
|
|
186
|
-
return tryEval(resource.max_formula);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export {
|
|
190
|
-
AT_WILL_MAX,
|
|
191
|
-
isValidMaxFormula,
|
|
192
|
-
evaluateMaxFormula,
|
|
193
|
-
resolveMaxAt,
|
|
194
|
-
resolveMaxCountAt
|
|
195
|
-
};
|
package/dist/chunk-EYX4JMAU.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
itemEntitySchema
|
|
3
|
-
} from "./chunk-S3YUXDSC.js";
|
|
4
|
-
|
|
5
|
-
// src/item/item.parser.ts
|
|
6
|
-
import { parseYaml } from "@archivist-gg/core";
|
|
7
|
-
var KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
8
|
-
"name",
|
|
9
|
-
"slug",
|
|
10
|
-
"type",
|
|
11
|
-
"rarity",
|
|
12
|
-
"base_item",
|
|
13
|
-
"bonuses",
|
|
14
|
-
"resist",
|
|
15
|
-
"immune",
|
|
16
|
-
"vulnerable",
|
|
17
|
-
"condition_immune",
|
|
18
|
-
"charges",
|
|
19
|
-
"attached_spells",
|
|
20
|
-
"attunement",
|
|
21
|
-
"grants",
|
|
22
|
-
"container",
|
|
23
|
-
"light",
|
|
24
|
-
"cursed",
|
|
25
|
-
"sentient",
|
|
26
|
-
"focus",
|
|
27
|
-
"tier",
|
|
28
|
-
"tattoo",
|
|
29
|
-
// declared I2a; the converter emits it (27 carriers)
|
|
30
|
-
"damage",
|
|
31
|
-
"weapon_category",
|
|
32
|
-
"armor_category",
|
|
33
|
-
"weight",
|
|
34
|
-
"cost",
|
|
35
|
-
"source",
|
|
36
|
-
"page",
|
|
37
|
-
"edition",
|
|
38
|
-
"description",
|
|
39
|
-
"entries",
|
|
40
|
-
"effects",
|
|
41
|
-
"damage_riders",
|
|
42
|
-
"raw",
|
|
43
|
-
"scroll_level",
|
|
44
|
-
"unidentified",
|
|
45
|
-
"masked_category",
|
|
46
|
-
// Modelled top-level converter keys (spec §4). The schema declaring them is NOT
|
|
47
|
-
// enough: this set is the second, independent gate — a key missing here is
|
|
48
|
-
// copied into `raw` as well, so the two lists must move together.
|
|
49
|
-
"modify_speed",
|
|
50
|
-
"rendering_hint",
|
|
51
|
-
"icon",
|
|
52
|
-
"has_fluff",
|
|
53
|
-
"has_fluff_images",
|
|
54
|
-
"image",
|
|
55
|
-
// Legacy fields kept (removed in Slice 7 after grep verifies no consumer)
|
|
56
|
-
"damage_dice",
|
|
57
|
-
"damage_type",
|
|
58
|
-
"properties",
|
|
59
|
-
"recharge",
|
|
60
|
-
"curse"
|
|
61
|
-
]);
|
|
62
|
-
function migrateAttunement(raw) {
|
|
63
|
-
const legacy = raw.requires_attunement;
|
|
64
|
-
if (raw.attunement === void 0 && typeof legacy === "boolean") {
|
|
65
|
-
raw.attunement = { required: legacy };
|
|
66
|
-
}
|
|
67
|
-
if (legacy !== void 0) {
|
|
68
|
-
delete raw.requires_attunement;
|
|
69
|
-
}
|
|
70
|
-
const v = raw.attunement;
|
|
71
|
-
if (v === void 0 || v === null) return;
|
|
72
|
-
if (typeof v === "object" && !Array.isArray(v)) return;
|
|
73
|
-
if (typeof v === "boolean") {
|
|
74
|
-
raw.attunement = { required: v };
|
|
75
|
-
} else if (typeof v === "string") {
|
|
76
|
-
raw.attunement = { required: true, restriction: v };
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function parseItem(source) {
|
|
80
|
-
var _a;
|
|
81
|
-
const raw = parseYaml(source, ["name"]);
|
|
82
|
-
if (!raw.success) return raw;
|
|
83
|
-
migrateAttunement(raw.data);
|
|
84
|
-
const result = itemEntitySchema.safeParse(raw.data);
|
|
85
|
-
if (!result.success) {
|
|
86
|
-
return { success: false, error: `item schema validation failed: ${result.error.message}` };
|
|
87
|
-
}
|
|
88
|
-
const entity = result.data;
|
|
89
|
-
const extras = {};
|
|
90
|
-
for (const [k, v] of Object.entries(raw.data)) {
|
|
91
|
-
if (!KNOWN_KEYS.has(k)) extras[k] = v;
|
|
92
|
-
}
|
|
93
|
-
if (Object.keys(extras).length > 0) {
|
|
94
|
-
entity.raw = { ...(_a = entity.raw) != null ? _a : {}, ...extras };
|
|
95
|
-
}
|
|
96
|
-
return { success: true, data: entity };
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export {
|
|
100
|
-
parseItem
|
|
101
|
-
};
|
package/dist/chunk-FC4IGH5Y.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
parseArmor
|
|
3
|
-
} from "./chunk-UZXG6QSY.js";
|
|
4
|
-
|
|
5
|
-
// src/armor/armor.codec.ts
|
|
6
|
-
import yaml from "js-yaml";
|
|
7
|
-
var armorCodec = {
|
|
8
|
-
parse(doc) {
|
|
9
|
-
return parseArmor(doc.body);
|
|
10
|
-
},
|
|
11
|
-
serialize(entity) {
|
|
12
|
-
return yaml.dump(entity, { lineWidth: -1, sortKeys: false });
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
armorCodec
|
|
18
|
-
};
|
package/dist/chunk-FJYBLXV7.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
featureSchema
|
|
3
|
-
} from "./chunk-B2QHP6UF.js";
|
|
4
|
-
import {
|
|
5
|
-
choiceSchema
|
|
6
|
-
} from "./chunk-OOL4KMG2.js";
|
|
7
|
-
import {
|
|
8
|
-
additionalSpellsEntrySchema,
|
|
9
|
-
imageField
|
|
10
|
-
} from "./chunk-UA5KS2PL.js";
|
|
11
|
-
|
|
12
|
-
// src/race/race.schema.ts
|
|
13
|
-
import { z } from "zod";
|
|
14
|
-
var abilityEnum = z.enum(["str", "dex", "con", "int", "wis", "cha"]);
|
|
15
|
-
var editionEnum = z.enum(["2014", "2024"]);
|
|
16
|
-
var sizeEnum = z.enum(["tiny", "small", "medium", "large", "huge"]);
|
|
17
|
-
var wikilinkRegex = /^\[\[[^[\]]+\]\]$/;
|
|
18
|
-
var speedSchema = z.object({
|
|
19
|
-
walk: z.number().int().nonnegative().optional(),
|
|
20
|
-
fly: z.number().int().nonnegative().optional(),
|
|
21
|
-
swim: z.number().int().nonnegative().optional(),
|
|
22
|
-
climb: z.number().int().nonnegative().optional(),
|
|
23
|
-
burrow: z.number().int().nonnegative().optional(),
|
|
24
|
-
hover: z.boolean().optional()
|
|
25
|
-
});
|
|
26
|
-
var visionSchema = z.object({
|
|
27
|
-
darkvision: z.number().int().nonnegative().optional(),
|
|
28
|
-
blindsight: z.number().int().nonnegative().optional(),
|
|
29
|
-
tremorsense: z.number().int().nonnegative().optional(),
|
|
30
|
-
truesight: z.number().int().nonnegative().optional()
|
|
31
|
-
});
|
|
32
|
-
var fixedAsiSchema = z.object({ ability: abilityEnum, amount: z.number().int() });
|
|
33
|
-
var choiceAsiSchema = z.object({
|
|
34
|
-
choose: z.number().int().positive(),
|
|
35
|
-
pool: z.array(abilityEnum).nonempty(),
|
|
36
|
-
amount: z.number().int()
|
|
37
|
-
});
|
|
38
|
-
var asiSchema = z.union([fixedAsiSchema, choiceAsiSchema]);
|
|
39
|
-
var languagesSchema = z.object({
|
|
40
|
-
fixed: z.array(z.string()),
|
|
41
|
-
choice: z.object({
|
|
42
|
-
count: z.number().int().positive(),
|
|
43
|
-
from: z.union([z.string(), z.array(z.string())])
|
|
44
|
-
}).optional()
|
|
45
|
-
});
|
|
46
|
-
var raceEntitySchema = z.object({
|
|
47
|
-
slug: z.string().min(1),
|
|
48
|
-
name: z.string().min(1),
|
|
49
|
-
edition: editionEnum,
|
|
50
|
-
source: z.string().min(1),
|
|
51
|
-
description: z.string(),
|
|
52
|
-
size: sizeEnum,
|
|
53
|
-
speed: speedSchema,
|
|
54
|
-
ability_score_increases: z.array(asiSchema),
|
|
55
|
-
age: z.string(),
|
|
56
|
-
alignment: z.string(),
|
|
57
|
-
vision: visionSchema,
|
|
58
|
-
languages: languagesSchema,
|
|
59
|
-
variant_label: z.string().min(1),
|
|
60
|
-
traits: z.array(featureSchema),
|
|
61
|
-
choices: z.array(choiceSchema).optional(),
|
|
62
|
-
subspecies_of: z.string().regex(wikilinkRegex).optional(),
|
|
63
|
-
rendering_hint: z.string().optional(),
|
|
64
|
-
has_fluff: z.boolean().optional(),
|
|
65
|
-
has_fluff_images: z.boolean().optional(),
|
|
66
|
-
creature_type: z.array(z.string().min(1)).optional(),
|
|
67
|
-
// guarded non-empty at the emitter (finding 24)
|
|
68
|
-
creature_type_tags: z.array(z.string().min(1)).optional(),
|
|
69
|
-
additional_spells: z.union([
|
|
70
|
-
z.array(additionalSpellsEntrySchema),
|
|
71
|
-
// converter form, 109 docs
|
|
72
|
-
additionalSpellsEntrySchema
|
|
73
|
-
// SHIPPED-BUNDLE bare-object form, 3 docs (§2.8)
|
|
74
|
-
]).optional(),
|
|
75
|
-
// The four RAW 5etools PASSTHROUGHS (race-mapper.ts D13 block copies them VERBATIM, no shape
|
|
76
|
-
// guard — finding 24): today's variant set is a snapshot, not a contract (lineage is already
|
|
77
|
-
// string|null|boolean), and NO G row ever reads them. Maximally loose by ruling; the guard
|
|
78
|
-
// test §9.5 pins today's variant classes since the census goes blind under z.unknown().
|
|
79
|
-
trait_tags: z.unknown().optional(),
|
|
80
|
-
lineage: z.unknown().optional(),
|
|
81
|
-
height_and_weight: z.unknown().optional(),
|
|
82
|
-
sound_clip: z.unknown().optional(),
|
|
83
|
-
image: imageField
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
export {
|
|
87
|
-
fixedAsiSchema,
|
|
88
|
-
raceEntitySchema
|
|
89
|
-
};
|
package/dist/chunk-FMUD3LDV.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
optionalFeatureEntitySchema
|
|
3
|
-
} from "./chunk-VN5DLURA.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
|
-
};
|