@archivist-gg/dnd5e 0.3.11 → 0.3.17
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/LICENSES/SRD.md +38 -3
- package/dist/armor/armor.codec.js +3 -3
- package/dist/armor/armor.parser.js +2 -2
- package/dist/armor/armor.schema.d.ts +1 -0
- package/dist/armor/armor.schema.js +1 -1
- package/dist/armor/armor.types.d.ts +2 -0
- package/dist/background/background.codec.js +5 -5
- package/dist/background/background.parser.js +4 -4
- package/dist/background/background.schema.js +3 -3
- package/dist/{chunk-XTRDCSJB.js → chunk-2JSQE3DD.js} +15 -1
- package/dist/chunk-2LULMQTF.js +14 -0
- package/dist/{chunk-MAH6DCRI.js → chunk-2UDSN6VW.js} +1 -1
- package/dist/chunk-3LWMFYKS.js +57 -0
- package/dist/{chunk-JCEV7KYN.js → chunk-3MGQFFNE.js} +1 -1
- package/dist/chunk-3VZZDKRA.js +1014 -0
- package/dist/{chunk-2DFENQIJ.js → chunk-5GKJAUMX.js} +2 -0
- package/dist/{chunk-2M34FLAY.js → chunk-5MXFW4O3.js} +9 -3
- package/dist/{chunk-4DOMDEBZ.js → chunk-6EI737IO.js} +1 -1
- package/dist/{chunk-G247QXWW.js → chunk-7ATNGKBS.js} +1 -1
- package/dist/{chunk-XY6X2APM.js → chunk-7Q2VPKCD.js} +17 -0
- package/dist/{chunk-T2SNEJOE.js → chunk-7QN7XSAK.js} +1 -1
- package/dist/{chunk-DNAJRMNN.js → chunk-A54HHCWW.js} +6 -7
- package/dist/{chunk-7YU4NPKR.js → chunk-AZRGFUSR.js} +1 -1
- package/dist/{chunk-PP2UHLBA.js → chunk-B3DP42OM.js} +5 -0
- package/dist/chunk-CM5CWO4K.js +735 -0
- package/dist/{chunk-MQ747UCR.js → chunk-DOXSFYLH.js} +70 -2
- package/dist/chunk-EJP263OP.js +186 -0
- package/dist/{chunk-SMLXZUBH.js → chunk-EYX4JMAU.js} +4 -1
- package/dist/{chunk-V6LJFP4R.js → chunk-FANQVQ3D.js} +2 -2
- package/dist/{chunk-AW3EHF3L.js → chunk-FC4IGH5Y.js} +1 -1
- package/dist/{chunk-23LZLBJK.js → chunk-G6MHJDVT.js} +6 -2
- package/dist/{chunk-JANNRGJC.js → chunk-G6PBI2BU.js} +1 -1
- package/dist/chunk-H5PTKYXL.js +101 -0
- package/dist/{chunk-LWFTHJIE.js → chunk-HHBD4SQ6.js} +1 -1
- package/dist/{chunk-JC5UNIVM.js → chunk-HS6FIOLP.js} +2 -0
- package/dist/chunk-HTYMW5CH.js +228 -0
- package/dist/chunk-IHE6KVC3.js +13 -0
- package/dist/{chunk-QHMWA3SZ.js → chunk-JCMUVZIK.js} +1 -1
- package/dist/{chunk-V373TRJE.js → chunk-JSM6JFZR.js} +198 -125
- package/dist/{chunk-LDDCNPHD.js → chunk-K5NJBTE2.js} +1 -1
- package/dist/chunk-KR6JF3BF.js +14 -0
- package/dist/{chunk-4ISR76DH.js → chunk-KSTV7J2U.js} +9 -3
- package/dist/chunk-LBEXLN6I.js +91 -0
- package/dist/{chunk-BLRW2UU6.js → chunk-LF5AGJA4.js} +2 -2
- package/dist/{chunk-UBBKSYBY.js → chunk-LHZXYFBU.js} +30 -1
- package/dist/{chunk-BIA32MQ5.js → chunk-MBX25B6D.js} +1 -1
- package/dist/{chunk-R2ZV233X.js → chunk-MYY2C5MB.js} +3 -3
- package/dist/{chunk-J77CKYV3.js → chunk-OFCSP6MT.js} +1 -1
- package/dist/{chunk-2INMRR3Q.js → chunk-ONTGZR5T.js} +326 -149
- package/dist/{chunk-MWCCGPG3.js → chunk-OOSRUJBI.js} +3 -2
- package/dist/{chunk-U3BABVJF.js → chunk-PKX6TGRE.js} +2 -2
- package/dist/{chunk-PJMG5XV3.js → chunk-PQZ4LM4Z.js} +1 -1
- package/dist/chunk-PXVNAY7T.js +84 -0
- package/dist/chunk-QH36K2PU.js +158 -0
- package/dist/{chunk-R747YKS7.js → chunk-QZSWN2KT.js} +1 -1
- package/dist/{chunk-CHUALUIX.js → chunk-RYLXAYIQ.js} +1 -1
- package/dist/{chunk-GFZ7PITJ.js → chunk-S3YUXDSC.js} +6 -1
- package/dist/{chunk-PZCE7DJM.js → chunk-T6QIF5XR.js} +31 -1
- package/dist/{chunk-CBEKVAX4.js → chunk-TULQ4FFX.js} +41 -13
- package/dist/{chunk-S56D6B6C.js → chunk-UUBJCNQU.js} +12 -3
- package/dist/{chunk-5N2GW72F.js → chunk-UZXG6QSY.js} +2 -1
- package/dist/{chunk-4XTNPNQB.js → chunk-VPYBK2MG.js} +1 -1
- package/dist/{chunk-3HX5VLWP.js → chunk-VRV3NNTA.js} +2 -2
- package/dist/{chunk-HZA7OE7N.js → chunk-XCFC7LGF.js} +2 -1
- package/dist/{chunk-BL3VELKP.js → chunk-Y5VVP73C.js} +1 -1
- package/dist/{chunk-PI4LLJG4.js → chunk-YD2VAHA6.js} +2 -2
- package/dist/{chunk-UIRMA5KM.js → chunk-YDGMBMYI.js} +1 -1
- package/dist/{chunk-NWDF5HG3.js → chunk-YKL6SHRJ.js} +1 -1
- package/dist/{chunk-6X4KUDMU.js → chunk-ZCTUYGNV.js} +7 -2
- package/dist/chunk-ZUQW5VBZ.js +89 -0
- package/dist/class/class.codec.js +7 -7
- package/dist/class/class.parser.js +6 -6
- package/dist/class/class.schema.d.ts +18 -0
- package/dist/class/class.schema.js +5 -5
- package/dist/class/class.standard-array.d.ts +16 -0
- package/dist/class/class.standard-array.js +20 -0
- package/dist/class/class.types.d.ts +3 -0
- package/dist/dnd/amount-text.d.ts +38 -0
- package/dist/dnd/amount-text.js +13 -0
- package/dist/dnd/resource-words.d.ts +4 -0
- package/dist/dnd/resource-words.js +30 -0
- package/dist/entities/base-item-resolver.js +2 -2
- package/dist/entities/slug.d.ts +18 -8
- package/dist/entities/slug.js +3 -1
- package/dist/feat/feat.codec.js +5 -5
- package/dist/feat/feat.parser.js +4 -4
- package/dist/feat/feat.schema.d.ts +41 -3
- package/dist/feat/feat.schema.js +3 -3
- package/dist/index.js +7513 -4177
- package/dist/item/item.actions-map.d.ts +40 -5
- package/dist/item/item.actions-map.js +5 -84
- package/dist/item/item.attunement.js +3 -9
- package/dist/item/item.bonuses.js +5 -2
- package/dist/item/item.codec.js +3 -3
- package/dist/item/item.conditions.js +4 -1
- package/dist/item/item.conditions.types.d.ts +4 -0
- package/dist/item/item.cost.d.ts +3 -0
- package/dist/item/item.cost.js +29 -0
- package/dist/item/item.icon.d.ts +15 -0
- package/dist/item/item.icon.js +211 -0
- package/dist/item/item.parser.js +2 -2
- package/dist/item/item.schema.d.ts +16 -1
- package/dist/item/item.schema.js +3 -1
- package/dist/item/item.types.d.ts +9 -2
- package/dist/monster/monster.parser.js +5 -5
- package/dist/monster/monster.schema.js +4 -4
- package/dist/optional-feature/optional-feature.codec.js +5 -4
- package/dist/optional-feature/optional-feature.parser.js +4 -3
- package/dist/optional-feature/optional-feature.schema.d.ts +255 -3
- package/dist/optional-feature/optional-feature.schema.js +7 -2
- package/dist/pc/pc.additional-spells.js +3 -3
- package/dist/pc/pc.amount-bindings.d.ts +32 -0
- package/dist/pc/pc.amount-bindings.js +23 -0
- package/dist/pc/pc.asi-flatten.d.ts +62 -1
- package/dist/pc/pc.asi-flatten.js +16 -0
- package/dist/pc/pc.conditions.js +1 -1
- package/dist/pc/pc.containment.d.ts +45 -0
- package/dist/pc/pc.containment.js +24 -0
- package/dist/pc/pc.decision-engine.d.ts +24 -3
- package/dist/pc/pc.decision-engine.js +26 -16
- package/dist/pc/pc.entry-overrides.d.ts +79 -0
- package/dist/pc/pc.entry-overrides.js +40 -0
- package/dist/pc/pc.equipment.d.ts +2 -2
- package/dist/pc/pc.equipment.js +19 -7
- package/dist/pc/pc.feature-effects.d.ts +12 -0
- package/dist/pc/pc.feature-effects.js +2 -2
- package/dist/pc/pc.infusions.d.ts +228 -0
- package/dist/pc/pc.infusions.js +64 -0
- package/dist/pc/pc.member-choices.d.ts +90 -0
- package/dist/pc/pc.member-choices.js +32 -0
- package/dist/pc/pc.parser.js +18 -1
- package/dist/pc/pc.pools.d.ts +8 -1
- package/dist/pc/pc.pools.js +13 -3
- package/dist/pc/pc.proficiencies.js +23 -15
- package/dist/pc/pc.proficiency-query.js +6 -0
- package/dist/pc/pc.recalc.d.ts +39 -36
- package/dist/pc/pc.recalc.js +115 -70
- package/dist/pc/pc.resolver.d.ts +2 -1
- package/dist/pc/pc.resolver.js +22 -14
- package/dist/pc/pc.resource-seed.js +1 -1
- package/dist/pc/pc.resources.d.ts +6 -1
- package/dist/pc/pc.resources.js +3 -1
- package/dist/pc/pc.rest.d.ts +21 -1
- package/dist/pc/pc.rest.js +52 -19
- package/dist/pc/pc.schema.d.ts +43 -2
- package/dist/pc/pc.schema.js +1 -1
- package/dist/pc/pc.slotting.d.ts +36 -3
- package/dist/pc/pc.slotting.js +13 -5
- package/dist/pc/pc.tool-picks.d.ts +51 -0
- package/dist/pc/pc.tool-picks.js +18 -0
- package/dist/pc/pc.types.d.ts +115 -14
- package/dist/pc/pc.weapon-grant.d.ts +15 -0
- package/dist/pc/pool-layout.d.ts +8 -0
- package/dist/pc/pool-layout.js +5 -3
- package/dist/pc/resource-equivalents.d.ts +44 -0
- package/dist/pc/spell-source.js +4 -9
- package/dist/race/race.codec.js +6 -6
- package/dist/race/race.parser.js +5 -5
- package/dist/race/race.schema.js +4 -4
- package/dist/schemas/attack-schema.d.ts +1 -1
- package/dist/schemas/choice-schema.js +2 -2
- package/dist/schemas/feature-effect-schema.d.ts +41 -3
- package/dist/schemas/feature-effect-schema.js +1 -1
- package/dist/schemas/feature-schema.js +3 -3
- package/dist/schemas/selection-pool-schema.d.ts +10 -0
- package/dist/schemas/selection-pool-schema.js +1 -1
- package/dist/spell/spell.codec.js +2 -2
- package/dist/spell/spell.parser.d.ts +6 -1
- package/dist/spell/spell.parser.js +5 -3
- package/dist/spell/spell.types.d.ts +10 -0
- package/dist/srd/retired-items.d.ts +14 -0
- package/dist/srd/retired-items.js +11 -0
- package/dist/subclass/subclass.codec.js +7 -7
- package/dist/subclass/subclass.parser.js +6 -6
- package/dist/subclass/subclass.schema.d.ts +10 -0
- package/dist/subclass/subclass.schema.js +5 -5
- package/dist/types/choice.d.ts +13 -0
- package/dist/types/equipment-grant.d.ts +18 -1
- package/dist/types/equipment-grant.js +12 -0
- package/dist/types/feature-effect.d.ts +12 -1
- package/dist/types/optional-feature.types.d.ts +84 -1
- package/dist/types/selection-pool.d.ts +18 -3
- package/dist/weapon/weapon.classify.d.ts +10 -8
- package/dist/weapon/weapon.classify.js +2 -2
- package/dist/weapon/weapon.codec.js +3 -3
- package/dist/weapon/weapon.parser.js +2 -2
- package/dist/weapon/weapon.schema.d.ts +1 -0
- package/dist/weapon/weapon.schema.js +1 -1
- package/dist/weapon/weapon.types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunk-O4SRD3J5.js +0 -165
- package/dist/chunk-WXWPK3LI.js +0 -55
|
@@ -40,6 +40,8 @@ var weaponEntitySchema = z.object({
|
|
|
40
40
|
// string today, so `.min(1)` is forbidden here.
|
|
41
41
|
rendering_hint: z.string().optional(),
|
|
42
42
|
// 98
|
|
43
|
+
// The icon key (I3): a key of the renderer's icon set or a Lucide name; itemIconKey reads it first.
|
|
44
|
+
icon: z.string().optional(),
|
|
43
45
|
has_fluff: z.boolean().optional(),
|
|
44
46
|
// 1
|
|
45
47
|
has_fluff_images: z.boolean().optional(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
featureEffectSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2JSQE3DD.js";
|
|
4
4
|
|
|
5
5
|
// src/schemas/choice-schema.ts
|
|
6
6
|
import { z } from "zod";
|
|
@@ -12,9 +12,13 @@ var entityFilterSchema = z.object({
|
|
|
12
12
|
available_to: z.literal("self").optional(),
|
|
13
13
|
weapon_category: z.enum(["simple", "martial"]).optional(),
|
|
14
14
|
armor_category: z.enum(["light", "medium", "heavy", "shield"]).optional(),
|
|
15
|
+
item_type: z.array(z.string().min(1)).nonempty().optional(),
|
|
16
|
+
mundane: z.boolean().optional(),
|
|
15
17
|
list: z.string().min(1).optional(),
|
|
16
18
|
level: z.number().int().min(0).max(9).optional(),
|
|
17
|
-
edition: z.string().min(1).optional()
|
|
19
|
+
edition: z.string().min(1).optional(),
|
|
20
|
+
// D2b-A (design §2.2 step 1): Pact of the Tome's "level 1 ritual spells".
|
|
21
|
+
ritual: z.boolean().optional()
|
|
18
22
|
}).strict();
|
|
19
23
|
var inlineOptionSchema = z.lazy(() => z.object({
|
|
20
24
|
value: z.string().min(1),
|
|
@@ -38,7 +42,9 @@ var choiceSchema = z.lazy(() => z.discriminatedUnion("kind", [
|
|
|
38
42
|
count: z.number().int().positive().optional(),
|
|
39
43
|
entity_type: z.string().min(1),
|
|
40
44
|
from: z.array(z.string().min(1)).nonempty().optional(),
|
|
41
|
-
where: entityFilterSchema.optional()
|
|
45
|
+
where: entityFilterSchema.optional(),
|
|
46
|
+
// D2b-A: a pick that names a target (a blast's cantrip), never a grant.
|
|
47
|
+
target: z.literal(true).optional()
|
|
42
48
|
}).strict(),
|
|
43
49
|
z.object({
|
|
44
50
|
kind: z.literal("select-proficiency"),
|
|
@@ -59,6 +59,18 @@ function normalizeSpellComponents(value) {
|
|
|
59
59
|
if (c.r === true) parts.push("R");
|
|
60
60
|
return parts.join(", ");
|
|
61
61
|
}
|
|
62
|
+
function spellMaterialOf(value) {
|
|
63
|
+
if (value == null || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
64
|
+
const m = value.m;
|
|
65
|
+
if (m == null || typeof m !== "object" || Array.isArray(m)) return void 0;
|
|
66
|
+
const { text, cost, consume } = m;
|
|
67
|
+
if (typeof text !== "string") return void 0;
|
|
68
|
+
return {
|
|
69
|
+
text,
|
|
70
|
+
...typeof cost === "number" ? { cost } : {},
|
|
71
|
+
...typeof consume === "boolean" || typeof consume === "string" ? { consume } : {}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
62
74
|
function normalizeSpellDurationEntry(entry) {
|
|
63
75
|
if (entry == null || typeof entry !== "object") return toStringSafe(entry);
|
|
64
76
|
const e = entry;
|
|
@@ -84,9 +96,11 @@ function normalizeSpellDuration(value) {
|
|
|
84
96
|
return value.map((entry) => normalizeSpellDurationEntry(entry)).join("; ");
|
|
85
97
|
}
|
|
86
98
|
function mirrorSpellShapes(entity) {
|
|
99
|
+
const material = spellMaterialOf(entity.components);
|
|
87
100
|
return {
|
|
88
101
|
...entity,
|
|
89
102
|
...entity.components != null ? { components: normalizeSpellComponents(entity.components) } : {},
|
|
103
|
+
...material ? { material } : {},
|
|
90
104
|
...entity.duration != null ? { duration: normalizeSpellDuration(entity.duration) } : {}
|
|
91
105
|
};
|
|
92
106
|
}
|
|
@@ -116,6 +130,8 @@ function parseSpell(source) {
|
|
|
116
130
|
if (raw.range != null) spell.range = toStringSafe(raw.range);
|
|
117
131
|
if (raw.components != null) spell.components = normalizeSpellComponents(raw.components);
|
|
118
132
|
if (raw.duration != null) spell.duration = normalizeSpellDuration(raw.duration);
|
|
133
|
+
const material = spellMaterialOf(raw.components);
|
|
134
|
+
if (material) spell.material = material;
|
|
119
135
|
if (raw.concentration != null) spell.concentration = Boolean(raw.concentration);
|
|
120
136
|
if (raw.ritual != null) spell.ritual = Boolean(raw.ritual);
|
|
121
137
|
if (raw.classes) spell.classes = raw.classes.map(String);
|
|
@@ -158,6 +174,7 @@ function parseSpell(source) {
|
|
|
158
174
|
|
|
159
175
|
export {
|
|
160
176
|
normalizeSpellComponents,
|
|
177
|
+
spellMaterialOf,
|
|
161
178
|
normalizeSpellDuration,
|
|
162
179
|
mirrorSpellShapes,
|
|
163
180
|
parseSpell
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isTwoHandedWeapon
|
|
3
|
+
} from "./chunk-LHZXYFBU.js";
|
|
4
|
+
|
|
1
5
|
// src/item/item.conditions.ts
|
|
2
6
|
function unwrapSlug(maybeWiki) {
|
|
3
7
|
if (!maybeWiki) return "";
|
|
@@ -11,13 +15,8 @@ function evaluateCondition(cond, ctx) {
|
|
|
11
15
|
return ctx.derived.equippedSlots.armor === void 0 ? "true" : "false";
|
|
12
16
|
case "no_shield":
|
|
13
17
|
return ctx.derived.equippedSlots.shield === void 0 ? "true" : "false";
|
|
14
|
-
case "wielding_two_handed":
|
|
15
|
-
|
|
16
|
-
if (!main || typeof main !== "object" || !("properties" in main)) return "false";
|
|
17
|
-
const props = main.properties;
|
|
18
|
-
if (!Array.isArray(props)) return "false";
|
|
19
|
-
return props.some((p) => p === "two_handed") ? "true" : "false";
|
|
20
|
-
}
|
|
18
|
+
case "wielding_two_handed":
|
|
19
|
+
return isTwoHandedWeapon((_a = ctx.derived.equippedSlots.mainhand) == null ? void 0 : _a.entity, ctx.registry) ? "true" : "false";
|
|
21
20
|
case "is_class": {
|
|
22
21
|
const target = cond.value.toLowerCase();
|
|
23
22
|
return ctx.classList.some((c) => unwrapSlug(c.name) === target) ? "true" : "false";
|
|
@@ -24,6 +24,10 @@ function derivePoolLayout(entries) {
|
|
|
24
24
|
}
|
|
25
25
|
return tied ? void 0 : best;
|
|
26
26
|
}
|
|
27
|
+
function poolPresentation(authored, derived) {
|
|
28
|
+
const head = authored === "point-pool" ? "points" : authored === "dice-pool" ? "dice" : derived === "point-pool" ? "points" : "dice";
|
|
29
|
+
return { head };
|
|
30
|
+
}
|
|
27
31
|
var RENDERING_HINT_AFFORDANCE = {
|
|
28
32
|
"granted-die-to-ally": "granted-die"
|
|
29
33
|
};
|
|
@@ -43,6 +47,7 @@ function formatAffordanceCaption(affordance, values) {
|
|
|
43
47
|
export {
|
|
44
48
|
RENDERING_HINT_LAYOUT,
|
|
45
49
|
derivePoolLayout,
|
|
50
|
+
poolPresentation,
|
|
46
51
|
RENDERING_HINT_AFFORDANCE,
|
|
47
52
|
deriveEntryAffordance,
|
|
48
53
|
AFFORDANCE_CAPTIONS,
|