@archivist-gg/dnd5e 0.1.0
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 +21 -0
- package/LICENSES/SRD.md +37 -0
- package/README.md +65 -0
- package/dist/armor/armor.codec.d.ts +10 -0
- package/dist/armor/armor.codec.js +8 -0
- package/dist/armor/armor.entity-type.d.ts +2 -0
- package/dist/armor/armor.parser.d.ts +3 -0
- package/dist/armor/armor.parser.js +7 -0
- package/dist/armor/armor.schema.d.ts +25 -0
- package/dist/armor/armor.schema.js +6 -0
- package/dist/armor/armor.types.d.ts +26 -0
- package/dist/armor/armor.types.js +0 -0
- package/dist/background/background.codec.d.ts +9 -0
- package/dist/background/background.codec.js +11 -0
- package/dist/background/background.entity-type.d.ts +2 -0
- package/dist/background/background.parser.d.ts +3 -0
- package/dist/background/background.parser.js +10 -0
- package/dist/background/background.schema.d.ts +74 -0
- package/dist/background/background.schema.js +9 -0
- package/dist/background/background.types.d.ts +52 -0
- package/dist/background/background.types.js +0 -0
- package/dist/chunk-24GFQU7T.js +18 -0
- package/dist/chunk-3DZ74AKK.js +28 -0
- package/dist/chunk-3TM34RSJ.js +23 -0
- package/dist/chunk-3TRGRSCH.js +8 -0
- package/dist/chunk-4C2KOKLF.js +185 -0
- package/dist/chunk-4F6AIZ36.js +19 -0
- package/dist/chunk-4SSDYJS2.js +86 -0
- package/dist/chunk-4TIJKN6O.js +37 -0
- package/dist/chunk-537BHVSH.js +18 -0
- package/dist/chunk-5INR4NSL.js +18 -0
- package/dist/chunk-5XUXXAQJ.js +30 -0
- package/dist/chunk-656QCX4U.js +22 -0
- package/dist/chunk-66XXW2Z2.js +133 -0
- package/dist/chunk-6NK2MUD3.js +114 -0
- package/dist/chunk-6PXE7T7C.js +79 -0
- package/dist/chunk-7P65Q426.js +158 -0
- package/dist/chunk-A7T5L7SS.js +83 -0
- package/dist/chunk-AFKTJXRA.js +39 -0
- package/dist/chunk-B7UXKNLD.js +46 -0
- package/dist/chunk-BAXWWGFJ.js +45 -0
- package/dist/chunk-BH6AMZVY.js +25 -0
- package/dist/chunk-CDW7R2QT.js +62 -0
- package/dist/chunk-DABBCYTT.js +68 -0
- package/dist/chunk-DC74TZNA.js +46 -0
- package/dist/chunk-DNAJRMNN.js +68 -0
- package/dist/chunk-DRNZJNJP.js +19 -0
- package/dist/chunk-FEOB24KP.js +18 -0
- package/dist/chunk-FFULAF2P.js +63 -0
- package/dist/chunk-FUK7QSN5.js +19 -0
- package/dist/chunk-GIOH5JB5.js +19 -0
- package/dist/chunk-GJOI2GHP.js +25 -0
- package/dist/chunk-GZ46OVGZ.js +31 -0
- package/dist/chunk-HCP3GMHS.js +44 -0
- package/dist/chunk-IDTDACM6.js +19 -0
- package/dist/chunk-IKSMX4TN.js +0 -0
- package/dist/chunk-IXZXFFFW.js +269 -0
- package/dist/chunk-J2RYSZMQ.js +16 -0
- package/dist/chunk-JEYQU3JT.js +36 -0
- package/dist/chunk-LSLSG67V.js +31 -0
- package/dist/chunk-LWFTHJIE.js +24 -0
- package/dist/chunk-MDEJHMKK.js +52 -0
- package/dist/chunk-N2JE7BWL.js +81 -0
- package/dist/chunk-NAEPSZAM.js +88 -0
- package/dist/chunk-NXR3BD2V.js +90 -0
- package/dist/chunk-PKC77VZP.js +18 -0
- package/dist/chunk-PMADYMUI.js +19 -0
- package/dist/chunk-PTXBIDG7.js +63 -0
- package/dist/chunk-PZOWBI3B.js +49 -0
- package/dist/chunk-QQ5W2AZP.js +515 -0
- package/dist/chunk-QS5L5YTJ.js +24 -0
- package/dist/chunk-QYZV2MQA.js +97 -0
- package/dist/chunk-R2ZV233X.js +233 -0
- package/dist/chunk-RAWJTA45.js +271 -0
- package/dist/chunk-RSDRMH54.js +18 -0
- package/dist/chunk-RVYYKYFL.js +18 -0
- package/dist/chunk-SSXBYF3P.js +18 -0
- package/dist/chunk-TJCNX6UZ.js +521 -0
- package/dist/chunk-TZK36BU7.js +38 -0
- package/dist/chunk-UC4FE5X3.js +65 -0
- package/dist/chunk-WP2CX2JO.js +235 -0
- package/dist/chunk-WYGD2UGN.js +14 -0
- package/dist/chunk-XJNECUPT.js +31 -0
- package/dist/chunk-XURS6Q6Q.js +127 -0
- package/dist/chunk-Y4I74YEG.js +33 -0
- package/dist/chunk-Z4TL2V7S.js +18 -0
- package/dist/chunk-Z6GXV2GO.js +121 -0
- package/dist/chunk-ZLG6FQFB.js +237 -0
- package/dist/chunk-ZMR77DDL.js +18 -0
- package/dist/class/class.codec.d.ts +10 -0
- package/dist/class/class.codec.js +15 -0
- package/dist/class/class.entity-type.d.ts +2 -0
- package/dist/class/class.parser.d.ts +3 -0
- package/dist/class/class.parser.js +14 -0
- package/dist/class/class.schema.d.ts +202 -0
- package/dist/class/class.schema.js +13 -0
- package/dist/class/class.slug.d.ts +11 -0
- package/dist/class/class.slug.js +8 -0
- package/dist/class/class.types.d.ts +74 -0
- package/dist/class/class.types.js +0 -0
- package/dist/data-srd/index.generated.d.ts +7 -0
- package/dist/data-srd/index.generated.js +146 -0
- package/dist/dnd/constants.d.ts +16 -0
- package/dist/dnd/constants.js +36 -0
- package/dist/dnd/formula-tags.d.ts +16 -0
- package/dist/dnd/formula-tags.js +119 -0
- package/dist/dnd/math.d.ts +24 -0
- package/dist/dnd/math.js +35 -0
- package/dist/dnd/prose-tags.d.ts +16 -0
- package/dist/dnd/prose-tags.js +18 -0
- package/dist/dnd/resource-die.d.ts +6 -0
- package/dist/dnd/resource-die.js +17 -0
- package/dist/dnd/resource-formula.d.ts +41 -0
- package/dist/dnd/resource-formula.js +159 -0
- package/dist/dnd/srd-tag-converter.d.ts +44 -0
- package/dist/dnd/srd-tag-converter.js +12 -0
- package/dist/dnd/tag-grammar.d.ts +19 -0
- package/dist/dnd/tag-grammar.js +12 -0
- package/dist/encounter/encounter.ai-schema.d.ts +29 -0
- package/dist/encounter/encounter.ai-schema.js +8 -0
- package/dist/encounter/encounter.entity-type.d.ts +2 -0
- package/dist/encounter/encounter.generatable.d.ts +2 -0
- package/dist/entities/base-item-resolver.d.ts +21 -0
- package/dist/entities/base-item-resolver.js +9 -0
- package/dist/entities/slug.d.ts +5 -0
- package/dist/entities/slug.js +6 -0
- package/dist/feat/feat.codec.d.ts +9 -0
- package/dist/feat/feat.codec.js +10 -0
- package/dist/feat/feat.entity-type.d.ts +2 -0
- package/dist/feat/feat.parser.d.ts +3 -0
- package/dist/feat/feat.parser.js +9 -0
- package/dist/feat/feat.schema.d.ts +194 -0
- package/dist/feat/feat.schema.js +8 -0
- package/dist/feat/feat.types.d.ts +42 -0
- package/dist/feat/feat.types.js +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +139149 -0
- package/dist/inline-tag-parser.d.ts +11 -0
- package/dist/inline-tag-parser.js +6 -0
- package/dist/item/item.actions-map.d.ts +41 -0
- package/dist/item/item.actions-map.js +85 -0
- package/dist/item/item.ai-schema.d.ts +35 -0
- package/dist/item/item.ai-schema.js +6 -0
- package/dist/item/item.attunement.d.ts +18 -0
- package/dist/item/item.attunement.js +12 -0
- package/dist/item/item.bonuses.d.ts +2 -0
- package/dist/item/item.bonuses.js +7 -0
- package/dist/item/item.codec.d.ts +3 -0
- package/dist/item/item.codec.js +8 -0
- package/dist/item/item.conditions.d.ts +10 -0
- package/dist/item/item.conditions.js +8 -0
- package/dist/item/item.conditions.types.d.ts +28 -0
- package/dist/item/item.conditions.types.js +0 -0
- package/dist/item/item.enrichment.d.ts +4 -0
- package/dist/item/item.enrichment.js +9 -0
- package/dist/item/item.entity-type.d.ts +2 -0
- package/dist/item/item.generatable.d.ts +2 -0
- package/dist/item/item.parser.d.ts +3 -0
- package/dist/item/item.parser.js +7 -0
- package/dist/item/item.schema.d.ts +174 -0
- package/dist/item/item.schema.js +8 -0
- package/dist/item/item.types.d.ts +108 -0
- package/dist/item/item.types.js +0 -0
- package/dist/monster/monster.ai-schema.d.ts +67 -0
- package/dist/monster/monster.ai-schema.js +6 -0
- package/dist/monster/monster.codec.d.ts +13 -0
- package/dist/monster/monster.enrichment.d.ts +10 -0
- package/dist/monster/monster.enrichment.js +19 -0
- package/dist/monster/monster.entity-type.d.ts +2 -0
- package/dist/monster/monster.generatable.d.ts +2 -0
- package/dist/monster/monster.parser.d.ts +3 -0
- package/dist/monster/monster.parser.js +6 -0
- package/dist/monster/monster.resolve.d.ts +10 -0
- package/dist/monster/monster.types.d.ts +29 -0
- package/dist/monster/monster.types.js +1 -0
- package/dist/npc/npc.ai-schema.d.ts +6 -0
- package/dist/npc/npc.entity-type.d.ts +2 -0
- package/dist/npc/npc.generatable.d.ts +2 -0
- package/dist/optional-feature/optional-feature.codec.d.ts +14 -0
- package/dist/optional-feature/optional-feature.codec.js +11 -0
- package/dist/optional-feature/optional-feature.entity-type.d.ts +2 -0
- package/dist/optional-feature/optional-feature.parser.d.ts +3 -0
- package/dist/optional-feature/optional-feature.parser.js +10 -0
- package/dist/optional-feature/optional-feature.schema.d.ts +236 -0
- package/dist/optional-feature/optional-feature.schema.js +9 -0
- package/dist/pack.d.ts +11 -0
- package/dist/pc/conditions.constants.d.ts +3 -0
- package/dist/pc/conditions.constants.js +8 -0
- package/dist/pc/decision-recognizer.d.ts +4 -0
- package/dist/pc/decision-recognizer.js +8 -0
- package/dist/pc/pc.conditions.d.ts +3 -0
- package/dist/pc/pc.conditions.js +6 -0
- package/dist/pc/pc.decision-engine.d.ts +97 -0
- package/dist/pc/pc.decision-engine.js +19 -0
- package/dist/pc/pc.equipment.d.ts +12 -0
- package/dist/pc/pc.equipment.js +15 -0
- package/dist/pc/pc.feature-effects.d.ts +95 -0
- package/dist/pc/pc.feature-effects.js +9 -0
- package/dist/pc/pc.formula-context.d.ts +4 -0
- package/dist/pc/pc.formula-context.js +11 -0
- package/dist/pc/pc.parser.d.ts +3 -0
- package/dist/pc/pc.parser.js +41 -0
- package/dist/pc/pc.pools.d.ts +12 -0
- package/dist/pc/pc.pools.js +15 -0
- package/dist/pc/pc.proficiencies.d.ts +8 -0
- package/dist/pc/pc.proficiencies.js +47 -0
- package/dist/pc/pc.proficiency-query.d.ts +11 -0
- package/dist/pc/pc.proficiency-query.js +17 -0
- package/dist/pc/pc.recalc.d.ts +105 -0
- package/dist/pc/pc.recalc.js +662 -0
- package/dist/pc/pc.resolver.d.ts +34 -0
- package/dist/pc/pc.resolver.js +267 -0
- package/dist/pc/pc.resource-seed.d.ts +10 -0
- package/dist/pc/pc.resource-seed.js +40 -0
- package/dist/pc/pc.rest.d.ts +23 -0
- package/dist/pc/pc.rest.js +128 -0
- package/dist/pc/pc.schema.d.ts +294 -0
- package/dist/pc/pc.schema.js +7 -0
- package/dist/pc/pc.slotting.d.ts +22 -0
- package/dist/pc/pc.slotting.js +20 -0
- package/dist/pc/pc.spellcasting.d.ts +56 -0
- package/dist/pc/pc.spellcasting.js +16 -0
- package/dist/pc/pc.table-column.d.ts +12 -0
- package/dist/pc/pc.table-column.js +8 -0
- package/dist/pc/pc.types.d.ts +514 -0
- package/dist/pc/pc.types.js +0 -0
- package/dist/race/race.codec.d.ts +9 -0
- package/dist/race/race.codec.js +13 -0
- package/dist/race/race.entity-type.d.ts +2 -0
- package/dist/race/race.parser.d.ts +3 -0
- package/dist/race/race.parser.js +12 -0
- package/dist/race/race.schema.d.ts +67 -0
- package/dist/race/race.schema.js +11 -0
- package/dist/race/race.types.d.ts +44 -0
- package/dist/race/race.types.js +0 -0
- package/dist/schemas/attack-schema.d.ts +38 -0
- package/dist/schemas/choice-schema.d.ts +5 -0
- package/dist/schemas/choice-schema.js +7 -0
- package/dist/schemas/duration-schema.d.ts +13 -0
- package/dist/schemas/duration-schema.js +6 -0
- package/dist/schemas/equipment-grant-schema.d.ts +6 -0
- package/dist/schemas/equipment-grant-schema.js +12 -0
- package/dist/schemas/feature-effect-schema.d.ts +131 -0
- package/dist/schemas/feature-effect-schema.js +6 -0
- package/dist/schemas/feature-schema.d.ts +2 -0
- package/dist/schemas/feature-schema.js +10 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/resource-schema.d.ts +95 -0
- package/dist/schemas/resource-schema.js +12 -0
- package/dist/schemas/selection-pool-schema.d.ts +34 -0
- package/dist/schemas/selection-pool-schema.js +10 -0
- package/dist/spell/spell.access.d.ts +15 -0
- package/dist/spell/spell.access.js +25 -0
- package/dist/spell/spell.ai-schema.d.ts +24 -0
- package/dist/spell/spell.ai-schema.js +6 -0
- package/dist/spell/spell.codec.d.ts +3 -0
- package/dist/spell/spell.codec.js +8 -0
- package/dist/spell/spell.enrichment.d.ts +2 -0
- package/dist/spell/spell.enrichment.js +9 -0
- package/dist/spell/spell.entity-type.d.ts +2 -0
- package/dist/spell/spell.filter.d.ts +15 -0
- package/dist/spell/spell.filter.js +87 -0
- package/dist/spell/spell.generatable.d.ts +2 -0
- package/dist/spell/spell.parser.d.ts +3 -0
- package/dist/spell/spell.parser.js +7 -0
- package/dist/spell/spell.scaling.d.ts +14 -0
- package/dist/spell/spell.scaling.js +28 -0
- package/dist/spell/spell.schema.d.ts +31 -0
- package/dist/spell/spell.schema.js +6 -0
- package/dist/spell/spell.types.d.ts +25 -0
- package/dist/spell/spell.types.js +0 -0
- package/dist/srd-store.d.ts +53 -0
- package/dist/subclass/subclass.codec.d.ts +11 -0
- package/dist/subclass/subclass.codec.js +14 -0
- package/dist/subclass/subclass.entity-type.d.ts +2 -0
- package/dist/subclass/subclass.parser.d.ts +3 -0
- package/dist/subclass/subclass.parser.js +13 -0
- package/dist/subclass/subclass.schema.d.ts +118 -0
- package/dist/subclass/subclass.schema.js +12 -0
- package/dist/subclass/subclass.types.d.ts +20 -0
- package/dist/subclass/subclass.types.js +0 -0
- package/dist/types/abilities.d.ts +8 -0
- package/dist/types/abilities.js +0 -0
- package/dist/types/ac.d.ts +5 -0
- package/dist/types/attack.d.ts +22 -0
- package/dist/types/attack.js +0 -0
- package/dist/types/casting-option.d.ts +14 -0
- package/dist/types/casting-option.js +0 -0
- package/dist/types/choice.d.ts +66 -0
- package/dist/types/choice.js +6 -0
- package/dist/types/edition.d.ts +4 -0
- package/dist/types/edition.js +0 -0
- package/dist/types/equipment-grant.d.ts +41 -0
- package/dist/types/equipment-grant.js +0 -0
- package/dist/types/feature-effect.d.ts +79 -0
- package/dist/types/feature-effect.js +0 -0
- package/dist/types/feature.d.ts +41 -0
- package/dist/types/feature.js +0 -0
- package/dist/types/formula-context.d.ts +7 -0
- package/dist/types/formula-context.js +0 -0
- package/dist/types/hp.d.ts +4 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/item-conditions.types.d.ts +63 -0
- package/dist/types/item-conditions.types.js +0 -0
- package/dist/types/optional-feature.types.d.ts +60 -0
- package/dist/types/optional-feature.types.js +0 -0
- package/dist/types/resource.d.ts +44 -0
- package/dist/types/resource.js +0 -0
- package/dist/types/selection-pool.d.ts +37 -0
- package/dist/types/selection-pool.js +0 -0
- package/dist/types/speed.d.ts +8 -0
- package/dist/weapon/weapon.codec.d.ts +12 -0
- package/dist/weapon/weapon.codec.js +8 -0
- package/dist/weapon/weapon.entity-type.d.ts +2 -0
- package/dist/weapon/weapon.parser.d.ts +3 -0
- package/dist/weapon/weapon.parser.js +7 -0
- package/dist/weapon/weapon.schema.d.ts +34 -0
- package/dist/weapon/weapon.schema.js +6 -0
- package/dist/weapon/weapon.types.d.ts +36 -0
- package/dist/weapon/weapon.types.js +0 -0
- package/package.json +32 -0
- package/src/data-srd/ATTRIBUTION.md +2 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONDITION_SLUGS
|
|
3
|
+
} from "./chunk-TZK36BU7.js";
|
|
4
|
+
|
|
5
|
+
// src/pc/pc.schema.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
var conditionSlugEnum = z.enum(CONDITION_SLUGS);
|
|
8
|
+
var abilityEnum = z.enum(["str", "dex", "con", "int", "wis", "cha"]);
|
|
9
|
+
var skillEnum = z.enum([
|
|
10
|
+
"acrobatics",
|
|
11
|
+
"animal-handling",
|
|
12
|
+
"arcana",
|
|
13
|
+
"athletics",
|
|
14
|
+
"deception",
|
|
15
|
+
"history",
|
|
16
|
+
"insight",
|
|
17
|
+
"intimidation",
|
|
18
|
+
"investigation",
|
|
19
|
+
"medicine",
|
|
20
|
+
"nature",
|
|
21
|
+
"perception",
|
|
22
|
+
"performance",
|
|
23
|
+
"persuasion",
|
|
24
|
+
"religion",
|
|
25
|
+
"sleight-of-hand",
|
|
26
|
+
"stealth",
|
|
27
|
+
"survival"
|
|
28
|
+
]);
|
|
29
|
+
var proficiencyTri = z.enum(["none", "proficient", "expertise"]);
|
|
30
|
+
var slotEnum = z.enum(["mainhand", "offhand", "armor", "shield"]);
|
|
31
|
+
var equipmentEntryOverridesSchema = z.object({
|
|
32
|
+
name: z.string().optional(),
|
|
33
|
+
bonus: z.number().int().optional(),
|
|
34
|
+
damage_bonus: z.number().int().optional(),
|
|
35
|
+
extra_damage: z.string().optional(),
|
|
36
|
+
ac_bonus: z.number().int().optional(),
|
|
37
|
+
action: z.enum(["action", "bonus-action", "reaction", "free", "special"]).optional(),
|
|
38
|
+
range: z.string().optional()
|
|
39
|
+
}).strict();
|
|
40
|
+
var equipmentEntryStateSchema = z.object({
|
|
41
|
+
charges: z.object({
|
|
42
|
+
current: z.number().int().nonnegative(),
|
|
43
|
+
max: z.number().int().nonnegative()
|
|
44
|
+
}).optional(),
|
|
45
|
+
recovery: z.object({
|
|
46
|
+
amount: z.string(),
|
|
47
|
+
reset: z.enum(["dawn", "short", "long", "special"])
|
|
48
|
+
}).optional(),
|
|
49
|
+
depletion_risk: z.object({
|
|
50
|
+
trigger: z.string(),
|
|
51
|
+
roll: z.string(),
|
|
52
|
+
threshold: z.number().int(),
|
|
53
|
+
effect: z.string()
|
|
54
|
+
}).optional()
|
|
55
|
+
}).strict();
|
|
56
|
+
var equipmentEntrySchema = z.object({
|
|
57
|
+
item: z.string().min(1),
|
|
58
|
+
equipped: z.boolean().optional(),
|
|
59
|
+
attuned: z.boolean().optional(),
|
|
60
|
+
qty: z.number().int().positive().optional(),
|
|
61
|
+
notes: z.string().optional(),
|
|
62
|
+
slot: slotEnum.nullable().optional(),
|
|
63
|
+
overrides: equipmentEntryOverridesSchema.optional(),
|
|
64
|
+
state: equipmentEntryStateSchema.optional(),
|
|
65
|
+
// Build-only provenance for Equipment-step-seeded gear (e.g. "builder:starting",
|
|
66
|
+
// "builder:gold-buy"). Permissive plain string; stripped by finishBuild so a
|
|
67
|
+
// finished file never carries it.
|
|
68
|
+
granted_by: z.string().optional()
|
|
69
|
+
});
|
|
70
|
+
var characterOverridesSchema = z.object({
|
|
71
|
+
scores: z.partialRecord(abilityEnum, z.number().int()).optional(),
|
|
72
|
+
saves: z.partialRecord(abilityEnum, z.object({
|
|
73
|
+
bonus: z.number().int().optional(),
|
|
74
|
+
proficient: z.boolean().optional()
|
|
75
|
+
})).optional(),
|
|
76
|
+
skills: z.partialRecord(skillEnum, z.object({
|
|
77
|
+
bonus: z.number().int(),
|
|
78
|
+
proficiency: proficiencyTri.optional()
|
|
79
|
+
})).optional(),
|
|
80
|
+
passives: z.object({
|
|
81
|
+
perception: z.number().int().optional(),
|
|
82
|
+
investigation: z.number().int().optional(),
|
|
83
|
+
insight: z.number().int().optional()
|
|
84
|
+
}).partial().optional(),
|
|
85
|
+
hp: z.object({ max: z.number().int().positive().optional() }).optional(),
|
|
86
|
+
ac: z.number().int().optional(),
|
|
87
|
+
speed: z.number().int().optional(),
|
|
88
|
+
initiative: z.number().int().optional(),
|
|
89
|
+
spellcasting: z.object({
|
|
90
|
+
saveDC: z.number().int().optional(),
|
|
91
|
+
attackBonus: z.number().int().optional()
|
|
92
|
+
}).optional(),
|
|
93
|
+
spell_slots: z.record(z.coerce.number().int(), z.number().int().nonnegative()).optional(),
|
|
94
|
+
attunement_limit: z.number().int().nonnegative().optional()
|
|
95
|
+
}).default({});
|
|
96
|
+
var characterStateSchema = z.object({
|
|
97
|
+
hp: z.object({
|
|
98
|
+
current: z.number().int(),
|
|
99
|
+
max: z.number().int(),
|
|
100
|
+
temp: z.number().int().nonnegative()
|
|
101
|
+
}),
|
|
102
|
+
hit_dice: z.record(z.string(), z.object({
|
|
103
|
+
used: z.number().int().nonnegative(),
|
|
104
|
+
total: z.number().int().nonnegative()
|
|
105
|
+
})).default({}),
|
|
106
|
+
spell_slots: z.record(z.coerce.number().int(), z.object({
|
|
107
|
+
used: z.number().int().nonnegative(),
|
|
108
|
+
total: z.number().int().nonnegative()
|
|
109
|
+
})).default({}),
|
|
110
|
+
spell_slots_pact: z.object({
|
|
111
|
+
level: z.number().int().nonnegative(),
|
|
112
|
+
used: z.number().int().nonnegative(),
|
|
113
|
+
total: z.number().int().nonnegative()
|
|
114
|
+
}).optional(),
|
|
115
|
+
concentration: z.string().nullable().default(null),
|
|
116
|
+
conditions: z.array(conditionSlugEnum).default([]),
|
|
117
|
+
exhaustion: z.number().int().min(0).max(6).default(0),
|
|
118
|
+
death_saves: z.object({
|
|
119
|
+
successes: z.number().int().min(0).max(3),
|
|
120
|
+
failures: z.number().int().min(0).max(3)
|
|
121
|
+
}).optional(),
|
|
122
|
+
inspiration: z.number().int().nonnegative().default(0),
|
|
123
|
+
currency: z.object({
|
|
124
|
+
cp: z.number().int().nonnegative(),
|
|
125
|
+
sp: z.number().int().nonnegative(),
|
|
126
|
+
ep: z.number().int().nonnegative(),
|
|
127
|
+
gp: z.number().int().nonnegative(),
|
|
128
|
+
pp: z.number().int().nonnegative()
|
|
129
|
+
}).optional(),
|
|
130
|
+
feature_uses: z.record(z.string(), z.object({
|
|
131
|
+
used: z.number().int().nonnegative(),
|
|
132
|
+
max: z.number().int().nonnegative()
|
|
133
|
+
})).default({}),
|
|
134
|
+
// Phase 3 activatable buffs: ids/slugs of activatable features/boons that are
|
|
135
|
+
// currently toggled on. Their effects fold into recalc only while listed here.
|
|
136
|
+
active_buffs: z.array(z.string()).optional(),
|
|
137
|
+
attuned_items: z.array(z.string()).optional()
|
|
138
|
+
});
|
|
139
|
+
var choiceValueSchema = z.union([
|
|
140
|
+
z.string(),
|
|
141
|
+
z.array(z.string()),
|
|
142
|
+
z.record(z.string(), z.unknown())
|
|
143
|
+
]).catch((ctx) => ctx.value);
|
|
144
|
+
var classEntrySchema = z.object({
|
|
145
|
+
name: z.string().min(1),
|
|
146
|
+
level: z.number().int().min(1).max(20),
|
|
147
|
+
subclass: z.string().nullable().default(null),
|
|
148
|
+
// Per-level record is also catch-guarded so a non-object level value
|
|
149
|
+
// (e.g. `choices: {1: null}` or `{1: "foo"}`) survives the parse instead
|
|
150
|
+
// of failing the whole character.
|
|
151
|
+
choices: z.record(
|
|
152
|
+
z.coerce.number().int(),
|
|
153
|
+
z.record(z.string(), choiceValueSchema).catch((ctx) => ctx.value)
|
|
154
|
+
// type-only cast; value preserved at runtime
|
|
155
|
+
).default({})
|
|
156
|
+
});
|
|
157
|
+
var spellOverrideSchema = z.object({
|
|
158
|
+
slug: z.string().min(1),
|
|
159
|
+
overrides: z.record(z.string(), z.unknown()).default({})
|
|
160
|
+
});
|
|
161
|
+
var knownSpellObjectSchema = z.object({
|
|
162
|
+
spell: z.string().min(1),
|
|
163
|
+
class: z.string().optional(),
|
|
164
|
+
source: z.enum(["class", "feat", "item", "race", "domain"]).optional(),
|
|
165
|
+
prepared: z.boolean().optional(),
|
|
166
|
+
always_prepared: z.boolean().optional()
|
|
167
|
+
}).strict();
|
|
168
|
+
var knownSpellEntrySchema = z.union([z.string().min(1), knownSpellObjectSchema]);
|
|
169
|
+
var characterSchema = z.object({
|
|
170
|
+
name: z.string().min(1),
|
|
171
|
+
edition: z.enum(["2014", "2024"]),
|
|
172
|
+
// Builder-draft marker (SP2 Plan 3). NO default: absent on every existing
|
|
173
|
+
// file and stays absent on save; present+true only while the file is an
|
|
174
|
+
// unfinished Builder draft. Finish deletes the key (see finishBuild).
|
|
175
|
+
builder: z.boolean().optional(),
|
|
176
|
+
alignment: z.string().optional(),
|
|
177
|
+
age: z.string().optional(),
|
|
178
|
+
race: z.string().nullable().default(null),
|
|
179
|
+
subrace: z.string().nullable().default(null),
|
|
180
|
+
background: z.string().nullable().default(null),
|
|
181
|
+
// Relaxed from .min(1) for build-in-progress drafts: the Builder is the only
|
|
182
|
+
// producer of class-less files, and recalc degrades gracefully (HP/derivation
|
|
183
|
+
// fall back with warnings) when no class is present. See SP2 spec §5/§9.
|
|
184
|
+
class: z.array(classEntrySchema).default([]),
|
|
185
|
+
// Race/background decision selections, keyed `race:<id>` / `background:<id>`
|
|
186
|
+
// (SP2 Plan 3). Permissive value arm mirrors per-level class choices.
|
|
187
|
+
origin_choices: z.record(z.string(), choiceValueSchema).default({}),
|
|
188
|
+
abilities: z.object({
|
|
189
|
+
str: z.number().int(),
|
|
190
|
+
dex: z.number().int(),
|
|
191
|
+
con: z.number().int(),
|
|
192
|
+
int: z.number().int(),
|
|
193
|
+
wis: z.number().int(),
|
|
194
|
+
cha: z.number().int()
|
|
195
|
+
}),
|
|
196
|
+
ability_method: z.enum(["standard-array", "point-buy", "archivist-point-buy", "rolled", "manual"]),
|
|
197
|
+
// Persisted Roll-method ability pool (SP2 Plan 5). NO default — absent on
|
|
198
|
+
// every existing/finished file and stays absent on save; present only while
|
|
199
|
+
// the file is an unfinished Builder draft in `rolled` mode. Finish deletes
|
|
200
|
+
// the key (see finishBuild). Permissive: a plain int array, no length pin
|
|
201
|
+
// (re-rolls always write six, but legacy/hand-edited files may vary).
|
|
202
|
+
builder_rolls: z.array(z.number().int()).optional(),
|
|
203
|
+
// Persisted Equipment-step mode (SP2). NO default — absent on every
|
|
204
|
+
// existing/finished file and stays absent on save; present only while the file
|
|
205
|
+
// is an unfinished Builder draft. Finish deletes the key (see finishBuild).
|
|
206
|
+
builder_equipment_mode: z.enum(["starting", "gold", "empty"]).optional(),
|
|
207
|
+
skills: z.object({
|
|
208
|
+
proficient: z.array(skillEnum).default([]),
|
|
209
|
+
expertise: z.array(skillEnum).default([])
|
|
210
|
+
}).default({ proficient: [], expertise: [] }),
|
|
211
|
+
spells: z.object({
|
|
212
|
+
known: z.array(knownSpellEntrySchema).default([]),
|
|
213
|
+
overrides: z.array(spellOverrideSchema).default([]),
|
|
214
|
+
view: z.enum(["by-level", "table"]).optional()
|
|
215
|
+
}).default({ known: [], overrides: [] }),
|
|
216
|
+
equipment: z.array(equipmentEntrySchema).default([]),
|
|
217
|
+
overrides: characterOverridesSchema,
|
|
218
|
+
currency: z.object({
|
|
219
|
+
cp: z.number().int().nonnegative(),
|
|
220
|
+
sp: z.number().int().nonnegative(),
|
|
221
|
+
ep: z.number().int().nonnegative(),
|
|
222
|
+
gp: z.number().int().nonnegative(),
|
|
223
|
+
pp: z.number().int().nonnegative()
|
|
224
|
+
}).optional(),
|
|
225
|
+
notes: z.string().optional(),
|
|
226
|
+
defenses: z.object({
|
|
227
|
+
resistances: z.array(z.string()).default([]),
|
|
228
|
+
immunities: z.array(z.string()).default([]),
|
|
229
|
+
vulnerabilities: z.array(z.string()).default([]),
|
|
230
|
+
condition_immunities: z.array(z.string()).default([])
|
|
231
|
+
}).partial().optional(),
|
|
232
|
+
state: characterStateSchema
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
export {
|
|
236
|
+
characterSchema
|
|
237
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseArmor
|
|
3
|
+
} from "./chunk-HCP3GMHS.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
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DocCodec } from "@archivist-gg/core";
|
|
2
|
+
import type { ClassEntity } from "./class.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Normalizing codec (0c.1a). `parse` delegates to `parseClass`, which validates
|
|
5
|
+
* against `classEntitySchema`. `class.types` is this entity's dnd5e home for
|
|
6
|
+
* `SpellcastingConfig`/`ClassEntity` (consumed by PC + all subclass files).
|
|
7
|
+
* `serialize` stays `yaml.dump` (the edit-save path uses obsidian's separate
|
|
8
|
+
* serializer; gate (d) verifies `yaml.dump` round-trips through `parseClass`).
|
|
9
|
+
*/
|
|
10
|
+
export declare const classCodec: DocCodec<ClassEntity>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classCodec
|
|
3
|
+
} from "../chunk-RVYYKYFL.js";
|
|
4
|
+
import "../chunk-FUK7QSN5.js";
|
|
5
|
+
import "../chunk-Z6GXV2GO.js";
|
|
6
|
+
import "../chunk-4TIJKN6O.js";
|
|
7
|
+
import "../chunk-DABBCYTT.js";
|
|
8
|
+
import "../chunk-WYGD2UGN.js";
|
|
9
|
+
import "../chunk-PZOWBI3B.js";
|
|
10
|
+
import "../chunk-3DZ74AKK.js";
|
|
11
|
+
import "../chunk-CDW7R2QT.js";
|
|
12
|
+
import "../chunk-NXR3BD2V.js";
|
|
13
|
+
export {
|
|
14
|
+
classCodec
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseClass
|
|
3
|
+
} from "../chunk-FUK7QSN5.js";
|
|
4
|
+
import "../chunk-Z6GXV2GO.js";
|
|
5
|
+
import "../chunk-4TIJKN6O.js";
|
|
6
|
+
import "../chunk-DABBCYTT.js";
|
|
7
|
+
import "../chunk-WYGD2UGN.js";
|
|
8
|
+
import "../chunk-PZOWBI3B.js";
|
|
9
|
+
import "../chunk-3DZ74AKK.js";
|
|
10
|
+
import "../chunk-CDW7R2QT.js";
|
|
11
|
+
import "../chunk-NXR3BD2V.js";
|
|
12
|
+
export {
|
|
13
|
+
parseClass
|
|
14
|
+
};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const classEntitySchema: z.ZodObject<{
|
|
3
|
+
slug: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
edition: z.ZodEnum<{
|
|
6
|
+
2014: "2014";
|
|
7
|
+
2024: "2024";
|
|
8
|
+
}>;
|
|
9
|
+
source: z.ZodString;
|
|
10
|
+
description: z.ZodString;
|
|
11
|
+
hit_die: z.ZodEnum<{
|
|
12
|
+
d6: "d6";
|
|
13
|
+
d8: "d8";
|
|
14
|
+
d10: "d10";
|
|
15
|
+
d12: "d12";
|
|
16
|
+
}>;
|
|
17
|
+
primary_abilities: z.ZodArray<z.ZodEnum<{
|
|
18
|
+
str: "str";
|
|
19
|
+
dex: "dex";
|
|
20
|
+
con: "con";
|
|
21
|
+
int: "int";
|
|
22
|
+
wis: "wis";
|
|
23
|
+
cha: "cha";
|
|
24
|
+
}>>;
|
|
25
|
+
saving_throws: z.ZodArray<z.ZodEnum<{
|
|
26
|
+
str: "str";
|
|
27
|
+
dex: "dex";
|
|
28
|
+
con: "con";
|
|
29
|
+
int: "int";
|
|
30
|
+
wis: "wis";
|
|
31
|
+
cha: "cha";
|
|
32
|
+
}>>;
|
|
33
|
+
proficiencies: z.ZodObject<{
|
|
34
|
+
armor: z.ZodArray<z.ZodEnum<{
|
|
35
|
+
light: "light";
|
|
36
|
+
medium: "medium";
|
|
37
|
+
heavy: "heavy";
|
|
38
|
+
shield: "shield";
|
|
39
|
+
}>>;
|
|
40
|
+
weapons: z.ZodObject<{
|
|
41
|
+
fixed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
43
|
+
simple: "simple";
|
|
44
|
+
martial: "martial";
|
|
45
|
+
}>>>;
|
|
46
|
+
conditional: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
47
|
+
category: z.ZodEnum<{
|
|
48
|
+
simple: "simple";
|
|
49
|
+
martial: "martial";
|
|
50
|
+
}>;
|
|
51
|
+
where_property: z.ZodArray<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
fixed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
choice: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
count: z.ZodNumber;
|
|
58
|
+
from: z.ZodArray<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
skill_choices: z.ZodObject<{
|
|
63
|
+
count: z.ZodNumber;
|
|
64
|
+
from: z.ZodArray<z.ZodEnum<{
|
|
65
|
+
acrobatics: "acrobatics";
|
|
66
|
+
"animal-handling": "animal-handling";
|
|
67
|
+
arcana: "arcana";
|
|
68
|
+
athletics: "athletics";
|
|
69
|
+
deception: "deception";
|
|
70
|
+
history: "history";
|
|
71
|
+
insight: "insight";
|
|
72
|
+
intimidation: "intimidation";
|
|
73
|
+
investigation: "investigation";
|
|
74
|
+
medicine: "medicine";
|
|
75
|
+
nature: "nature";
|
|
76
|
+
perception: "perception";
|
|
77
|
+
performance: "performance";
|
|
78
|
+
persuasion: "persuasion";
|
|
79
|
+
religion: "religion";
|
|
80
|
+
"sleight-of-hand": "sleight-of-hand";
|
|
81
|
+
stealth: "stealth";
|
|
82
|
+
survival: "survival";
|
|
83
|
+
}>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
starting_equipment: z.ZodArray<z.ZodType<import("./class.types.js").StartingEquipmentEntry, unknown, z.core.$ZodTypeInternals<import("./class.types.js").StartingEquipmentEntry, unknown>>>;
|
|
86
|
+
starting_gold: z.ZodOptional<z.ZodType<import("./class.types.js").StartingGold, unknown, z.core.$ZodTypeInternals<import("./class.types.js").StartingGold, unknown>>>;
|
|
87
|
+
spellcasting: z.ZodNullable<z.ZodObject<{
|
|
88
|
+
caster_type: z.ZodEnum<{
|
|
89
|
+
pact: "pact";
|
|
90
|
+
full: "full";
|
|
91
|
+
half: "half";
|
|
92
|
+
third: "third";
|
|
93
|
+
}>;
|
|
94
|
+
ability: z.ZodEnum<{
|
|
95
|
+
str: "str";
|
|
96
|
+
dex: "dex";
|
|
97
|
+
con: "con";
|
|
98
|
+
int: "int";
|
|
99
|
+
wis: "wis";
|
|
100
|
+
cha: "cha";
|
|
101
|
+
}>;
|
|
102
|
+
preparation: z.ZodEnum<{
|
|
103
|
+
known: "known";
|
|
104
|
+
prepared: "prepared";
|
|
105
|
+
}>;
|
|
106
|
+
spell_list: z.ZodString;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
subclass_level: z.ZodNumber;
|
|
109
|
+
subclass_feature_name: z.ZodString;
|
|
110
|
+
weapon_mastery: z.ZodNullable<z.ZodObject<{
|
|
111
|
+
starting_count: z.ZodNumber;
|
|
112
|
+
scaling: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
epic_boon_level: z.ZodNullable<z.ZodNumber>;
|
|
115
|
+
table: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
116
|
+
prof_bonus: z.ZodNumber;
|
|
117
|
+
columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
118
|
+
feature_ids: z.ZodArray<z.ZodString>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
features_by_level: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
121
|
+
resources: z.ZodArray<z.ZodObject<{
|
|
122
|
+
id: z.ZodString;
|
|
123
|
+
name: z.ZodString;
|
|
124
|
+
max_formula: z.ZodString;
|
|
125
|
+
scales_at: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
126
|
+
level: z.ZodNumber;
|
|
127
|
+
max: z.ZodString;
|
|
128
|
+
}, z.core.$strict>>>;
|
|
129
|
+
die: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
base: z.ZodString;
|
|
131
|
+
scaling: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
reset: z.ZodEnum<{
|
|
134
|
+
"short-rest": "short-rest";
|
|
135
|
+
"long-rest": "long-rest";
|
|
136
|
+
dawn: "dawn";
|
|
137
|
+
dusk: "dusk";
|
|
138
|
+
turn: "turn";
|
|
139
|
+
round: "round";
|
|
140
|
+
custom: "custom";
|
|
141
|
+
}>;
|
|
142
|
+
consumes: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
resource: z.ZodString;
|
|
144
|
+
amount: z.ZodNumber;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
recovery: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
name: z.ZodString;
|
|
149
|
+
amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
150
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
151
|
+
action: "action";
|
|
152
|
+
"bonus-action": "bonus-action";
|
|
153
|
+
reaction: "reaction";
|
|
154
|
+
free: "free";
|
|
155
|
+
special: "special";
|
|
156
|
+
}>>;
|
|
157
|
+
uses: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
reset: z.ZodEnum<{
|
|
159
|
+
"short-rest": "short-rest";
|
|
160
|
+
"long-rest": "long-rest";
|
|
161
|
+
dawn: "dawn";
|
|
162
|
+
dusk: "dusk";
|
|
163
|
+
turn: "turn";
|
|
164
|
+
round: "round";
|
|
165
|
+
custom: "custom";
|
|
166
|
+
}>;
|
|
167
|
+
}, z.core.$strip>>>;
|
|
168
|
+
}, z.core.$strip>>;
|
|
169
|
+
selection_pools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
label: z.ZodString;
|
|
172
|
+
source: z.ZodObject<{
|
|
173
|
+
entity_type: z.ZodLiteral<"optional-feature">;
|
|
174
|
+
where: z.ZodObject<{
|
|
175
|
+
feature_type: z.ZodString;
|
|
176
|
+
available_to: z.ZodLiteral<"self">;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
count: z.ZodObject<{
|
|
180
|
+
column: z.ZodString;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
replaceable: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
}, z.core.$strip>>>;
|
|
184
|
+
pool_grants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
185
|
+
pool: z.ZodString;
|
|
186
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
187
|
+
feature: z.ZodString;
|
|
188
|
+
at_level: z.ZodNumber;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
}, z.core.$strip>>>;
|
|
191
|
+
tabs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
192
|
+
id: z.ZodString;
|
|
193
|
+
label: z.ZodString;
|
|
194
|
+
renders: z.ZodObject<{
|
|
195
|
+
pool: z.ZodString;
|
|
196
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
197
|
+
"spell-like": "spell-like";
|
|
198
|
+
blocks: "blocks";
|
|
199
|
+
}>>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
}, z.core.$strip>>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classEntitySchema
|
|
3
|
+
} from "../chunk-Z6GXV2GO.js";
|
|
4
|
+
import "../chunk-4TIJKN6O.js";
|
|
5
|
+
import "../chunk-DABBCYTT.js";
|
|
6
|
+
import "../chunk-WYGD2UGN.js";
|
|
7
|
+
import "../chunk-PZOWBI3B.js";
|
|
8
|
+
import "../chunk-3DZ74AKK.js";
|
|
9
|
+
import "../chunk-CDW7R2QT.js";
|
|
10
|
+
import "../chunk-NXR3BD2V.js";
|
|
11
|
+
export {
|
|
12
|
+
classEntitySchema
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function bareSlug(ref: string): string;
|
|
2
|
+
/**
|
|
3
|
+
* Bare class name for profile / spell-`classes` lookups.
|
|
4
|
+
*
|
|
5
|
+
* Compendium-qualified slugs are `<compendium>_<name>` — e.g. `srd-5e_wizard`,
|
|
6
|
+
* `srd-2024_bard` (compendium slugs are hyphen-cased, so `_` only ever separates
|
|
7
|
+
* the compendium from the entity name). Strip that prefix to get the canonical
|
|
8
|
+
* class key (`wizard`). Hand-written/test slugs without a `_` pass through
|
|
9
|
+
* unchanged (`wizard` → `wizard`).
|
|
10
|
+
*/
|
|
11
|
+
export declare function baseClassName(ref: string): string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Feature, Ability, SkillSlug, Resource } from "@archivist-gg/dnd5e";
|
|
2
|
+
import type { StartingEquipmentEntry, StartingGold } from "@archivist-gg/dnd5e/types/equipment-grant";
|
|
3
|
+
export type { StartingEquipmentEntry, StartingGold } from "@archivist-gg/dnd5e/types/equipment-grant";
|
|
4
|
+
import type { SelectionPool, PoolGrant, TabDecl } from "@archivist-gg/dnd5e/types/selection-pool";
|
|
5
|
+
import type { Edition } from "@archivist-gg/dnd5e/types/edition";
|
|
6
|
+
export type { Edition };
|
|
7
|
+
export type ArmorCategory = "light" | "medium" | "heavy" | "shield";
|
|
8
|
+
export type WeaponCategory = "simple" | "martial";
|
|
9
|
+
export interface WeaponProficiency {
|
|
10
|
+
fixed?: string[];
|
|
11
|
+
categories?: WeaponCategory[];
|
|
12
|
+
conditional?: Array<{
|
|
13
|
+
category: WeaponCategory;
|
|
14
|
+
where_property: string[];
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export interface ToolProficiency {
|
|
18
|
+
fixed?: string[];
|
|
19
|
+
choice?: {
|
|
20
|
+
count: number;
|
|
21
|
+
from: string[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface ClassProficiencies {
|
|
25
|
+
armor: ArmorCategory[];
|
|
26
|
+
weapons: WeaponProficiency;
|
|
27
|
+
tools?: ToolProficiency;
|
|
28
|
+
}
|
|
29
|
+
export interface SkillChoices {
|
|
30
|
+
count: number;
|
|
31
|
+
from: SkillSlug[];
|
|
32
|
+
}
|
|
33
|
+
export type CasterType = "full" | "half" | "third" | "pact";
|
|
34
|
+
export type SpellcastingPreparation = "known" | "prepared";
|
|
35
|
+
export interface SpellcastingConfig {
|
|
36
|
+
caster_type: CasterType;
|
|
37
|
+
ability: Ability;
|
|
38
|
+
preparation: SpellcastingPreparation;
|
|
39
|
+
spell_list: string;
|
|
40
|
+
}
|
|
41
|
+
export interface WeaponMasteryConfig {
|
|
42
|
+
starting_count: number;
|
|
43
|
+
scaling?: Record<number, number>;
|
|
44
|
+
}
|
|
45
|
+
export interface ClassTableRow {
|
|
46
|
+
prof_bonus: number;
|
|
47
|
+
columns?: Record<string, string | number>;
|
|
48
|
+
feature_ids: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface ClassEntity {
|
|
51
|
+
slug: string;
|
|
52
|
+
name: string;
|
|
53
|
+
edition: Edition;
|
|
54
|
+
source: string;
|
|
55
|
+
description: string;
|
|
56
|
+
hit_die: string;
|
|
57
|
+
primary_abilities: Ability[];
|
|
58
|
+
saving_throws: Ability[];
|
|
59
|
+
proficiencies: ClassProficiencies;
|
|
60
|
+
skill_choices: SkillChoices;
|
|
61
|
+
starting_equipment: StartingEquipmentEntry[];
|
|
62
|
+
starting_gold?: StartingGold;
|
|
63
|
+
spellcasting: SpellcastingConfig | null;
|
|
64
|
+
subclass_level: number;
|
|
65
|
+
subclass_feature_name: string;
|
|
66
|
+
weapon_mastery: WeaponMasteryConfig | null;
|
|
67
|
+
epic_boon_level: number | null;
|
|
68
|
+
table: Record<number, ClassTableRow>;
|
|
69
|
+
features_by_level: Record<number, Feature[]>;
|
|
70
|
+
resources: Resource[];
|
|
71
|
+
selection_pools?: SelectionPool[];
|
|
72
|
+
pool_grants?: PoolGrant[];
|
|
73
|
+
tabs?: TabDecl[];
|
|
74
|
+
}
|
|
File without changes
|