@archivist-gg/dnd5e 0.3.1 → 0.3.4
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 +25 -6
- package/dist/armor/armor.codec.js +4 -3
- package/dist/armor/armor.parser.js +3 -2
- package/dist/armor/armor.schema.d.ts +4 -0
- package/dist/armor/armor.schema.js +2 -1
- package/dist/armor/armor.types.d.ts +8 -0
- package/dist/background/background.codec.js +7 -6
- package/dist/background/background.parser.js +6 -5
- package/dist/background/background.schema.d.ts +26 -0
- package/dist/background/background.schema.js +5 -4
- package/dist/background/background.types.d.ts +22 -0
- package/dist/{chunk-4TIJKN6O.js → chunk-23LZLBJK.js} +1 -1
- package/dist/{chunk-AFKTJXRA.js → chunk-2DFENQIJ.js} +18 -0
- package/dist/chunk-2FRUSVZS.js +489 -0
- package/dist/chunk-4FWNK4FD.js +159 -0
- package/dist/chunk-4U55VNC7.js +22 -0
- package/dist/{chunk-4JHOHWBI.js → chunk-4XTNPNQB.js} +1 -1
- package/dist/{chunk-HCP3GMHS.js → chunk-5N2GW72F.js} +15 -2
- package/dist/{chunk-42Y5IJKT.js → chunk-5U5FFFA3.js} +5 -1
- package/dist/{chunk-4F6AIZ36.js → chunk-5XMQPTHD.js} +1 -1
- package/dist/{chunk-GJOI2GHP.js → chunk-6GNXYAYP.js} +1 -1
- package/dist/chunk-6PKV5V2H.js +178 -0
- package/dist/{chunk-66XXW2Z2.js → chunk-6PXTNCBP.js} +2 -2
- package/dist/chunk-6X2NV665.js +33 -0
- package/dist/{chunk-LV4SNWZQ.js → chunk-6X4KUDMU.js} +8 -1
- package/dist/{chunk-ZMR77DDL.js → chunk-AW3EHF3L.js} +1 -1
- package/dist/chunk-CJYCVNW2.js +7 -0
- package/dist/chunk-COEOOQX2.js +133 -0
- package/dist/{chunk-XTIQWSFM.js → chunk-D5U7GMPX.js} +1 -1
- package/dist/{chunk-RAWJTA45.js → chunk-DEEHHLAP.js} +1 -1
- package/dist/{chunk-6IRYTM5V.js → chunk-DPUJDOKV.js} +119 -28
- package/dist/{chunk-73HOFQQ5.js → chunk-ESS46GR4.js} +1 -1
- package/dist/chunk-EVMUJYUD.js +195 -0
- package/dist/{chunk-2BWAID3Y.js → chunk-FDBWYMZK.js} +29 -3
- package/dist/{chunk-K6Q5OUGK.js → chunk-GFZ7PITJ.js} +86 -10
- package/dist/chunk-H7KBLR4X.js +81 -0
- package/dist/{chunk-L7E2UT5A.js → chunk-HB7XZXDK.js} +5 -1
- package/dist/{chunk-BIK4DFWK.js → chunk-HJ5EEZ47.js} +1 -1
- package/dist/{chunk-6NK2MUD3.js → chunk-HZA7OE7N.js} +9 -2
- package/dist/{chunk-TN6ZLTNU.js → chunk-I2NDWFDD.js} +51 -4
- package/dist/{chunk-RSDRMH54.js → chunk-IMZFOOVL.js} +1 -1
- package/dist/{chunk-3DZ74AKK.js → chunk-IN4M4X7P.js} +8 -2
- package/dist/chunk-IUAAXXNO.js +58 -0
- package/dist/{chunk-XJNECUPT.js → chunk-JC5UNIVM.js} +19 -0
- package/dist/chunk-JJ46T5XX.js +297 -0
- package/dist/{chunk-SE7AZDR3.js → chunk-JRDPUDT5.js} +29 -3
- package/dist/{chunk-24GFQU7T.js → chunk-JSZ4H6AQ.js} +1 -1
- package/dist/chunk-KU3YLF6D.js +106 -0
- package/dist/{chunk-5INR4NSL.js → chunk-LDDCNPHD.js} +1 -1
- package/dist/{chunk-5ZBE4CWV.js → chunk-LMBAEIP6.js} +1 -1
- package/dist/chunk-LVQLWRCU.js +15 -0
- package/dist/chunk-MI7P3NX3.js +161 -0
- package/dist/chunk-O4SRD3J5.js +165 -0
- package/dist/{chunk-D3CLOBE3.js → chunk-OSQFPGLM.js} +44 -8
- package/dist/chunk-OZP6JFGT.js +162 -0
- package/dist/{chunk-NAEPSZAM.js → chunk-PDJSUH24.js} +24 -2
- package/dist/chunk-PP2UHLBA.js +50 -0
- package/dist/chunk-PVCEA4HZ.js +6 -0
- package/dist/{chunk-XLSVNUTK.js → chunk-R3VAKWKW.js} +1 -1
- package/dist/chunk-RIXI5D3R.js +89 -0
- package/dist/chunk-RLGQ5PZZ.js +16 -0
- package/dist/chunk-S7REMWW4.js +21 -0
- package/dist/{chunk-7VJ6BOA5.js → chunk-SMLXZUBH.js} +9 -1
- package/dist/{chunk-NXSWH3AE.js → chunk-T26ZVCL5.js} +1 -1
- package/dist/chunk-TOM66P2P.js +38 -0
- package/dist/chunk-UA5KS2PL.js +26 -0
- package/dist/{chunk-N6N74K6X.js → chunk-UBBKSYBY.js} +1 -1
- package/dist/{chunk-353WXS6S.js → chunk-UIRMA5KM.js} +1 -1
- package/dist/{chunk-GE4TLPWM.js → chunk-US5IKYCW.js} +1 -1
- package/dist/chunk-UXPGW4TI.js +101 -0
- package/dist/chunk-VQAXTIBW.js +100 -0
- package/dist/{chunk-WP2CX2JO.js → chunk-WELIKLZF.js} +22 -1
- package/dist/chunk-WPWOHGPI.js +172 -0
- package/dist/{chunk-GZ46OVGZ.js → chunk-WSVMLNTO.js} +1 -1
- package/dist/{chunk-4LZJXJJS.js → chunk-WXWPK3LI.js} +6 -2
- package/dist/{chunk-ZZGEVJKX.js → chunk-XBQMCEI2.js} +1 -1
- package/dist/{chunk-PHQRGDRQ.js → chunk-XGOFP7AQ.js} +5 -1
- package/dist/chunk-XJ2F2WO6.js +8 -0
- package/dist/chunk-XQCSGNXE.js +1580 -0
- package/dist/chunk-YBLDE5CG.js +42 -0
- package/dist/{chunk-JEYQU3JT.js → chunk-YHYTW5QA.js} +2 -18
- package/dist/{chunk-TLYDBT5F.js → chunk-YJJTISBN.js} +64 -7
- package/dist/{chunk-PZOWBI3B.js → chunk-YLL2QXY2.js} +7 -2
- package/dist/{chunk-MDEJHMKK.js → chunk-ZONJ66NE.js} +26 -5
- package/dist/class/class.codec.js +12 -9
- package/dist/class/class.parser.js +11 -8
- package/dist/class/class.schema.d.ts +55 -3
- package/dist/class/class.schema.js +9 -7
- package/dist/class/class.types.d.ts +48 -3
- package/dist/condition/condition.codec.d.ts +9 -0
- package/dist/condition/condition.entity-type.d.ts +2 -0
- package/dist/condition/condition.parser.d.ts +13 -0
- package/dist/condition/condition.parser.js +7 -0
- package/dist/condition/condition.schema.d.ts +29 -0
- package/dist/condition/condition.types.d.ts +15 -0
- package/dist/condition/condition.types.js +0 -0
- package/dist/dnd/constants.d.ts +22 -0
- package/dist/dnd/constants.js +9 -3
- package/dist/dnd/formula-tags.js +2 -2
- package/dist/dnd/math.d.ts +26 -0
- package/dist/dnd/math.js +12 -2
- package/dist/dnd/prose-tags.js +1 -1
- package/dist/dnd/resource-formula.d.ts +36 -10
- package/dist/dnd/resource-formula.js +10 -155
- package/dist/dnd/srd-tag-converter.js +3 -3
- package/dist/dnd/tag-grammar.js +1 -1
- package/dist/dnd/warn-once.d.ts +2 -0
- package/dist/dnd/warn-once.js +8 -0
- package/dist/entities/base-item-resolver.js +2 -2
- package/dist/entities/slug.d.ts +13 -0
- package/dist/entities/slug.js +5 -3
- package/dist/entities/wikilink-display.d.ts +3 -0
- package/dist/entities/wikilink-display.js +10 -0
- package/dist/feat/feat.category-codes.d.ts +32 -0
- package/dist/feat/feat.category-codes.js +14 -0
- package/dist/feat/feat.codec.js +7 -5
- package/dist/feat/feat.parser.js +6 -4
- package/dist/feat/feat.schema.d.ts +230 -0
- package/dist/feat/feat.schema.js +5 -3
- package/dist/feat/feat.types.d.ts +37 -1
- package/dist/index.js +2033 -6907
- package/dist/item/item.codec.js +4 -3
- package/dist/item/item.enrichment.js +4 -4
- package/dist/item/item.parser.js +3 -2
- package/dist/item/item.schema.d.ts +69 -3
- package/dist/item/item.schema.js +2 -1
- package/dist/item/item.types.d.ts +69 -3
- package/dist/monster/monster.codec.d.ts +7 -6
- package/dist/monster/monster.enrichment.js +4 -4
- package/dist/monster/monster.format.d.ts +135 -0
- package/dist/monster/monster.format.js +78 -0
- package/dist/monster/monster.parser.d.ts +6 -1
- package/dist/monster/monster.parser.js +10 -1
- package/dist/monster/monster.schema.d.ts +369 -0
- package/dist/monster/monster.schema.js +34 -0
- package/dist/monster/monster.types.d.ts +200 -14
- package/dist/optional-feature/optional-feature.codec.js +6 -5
- package/dist/optional-feature/optional-feature.parser.js +5 -4
- package/dist/optional-feature/optional-feature.schema.d.ts +176 -0
- package/dist/optional-feature/optional-feature.schema.js +4 -3
- package/dist/pack.d.ts +1 -1
- package/dist/pc/conditions.constants.d.ts +0 -1
- package/dist/pc/conditions.constants.js +1 -3
- package/dist/pc/decision-recognizer.js +1 -1
- package/dist/pc/pc.additional-spells.d.ts +47 -0
- package/dist/pc/pc.additional-spells.js +23 -0
- package/dist/pc/pc.asi-flatten.d.ts +18 -0
- package/dist/pc/pc.decision-engine.d.ts +105 -17
- package/dist/pc/pc.decision-engine.js +28 -12
- package/dist/pc/pc.defense-normalize.d.ts +11 -0
- package/dist/pc/pc.defense-normalize.js +6 -0
- package/dist/pc/pc.equipment.d.ts +30 -1
- package/dist/pc/pc.equipment.js +12 -8
- package/dist/pc/pc.feature-effects.d.ts +225 -11
- package/dist/pc/pc.feature-effects.js +21 -5
- package/dist/pc/pc.parser.js +2 -2
- package/dist/pc/pc.pools.d.ts +11 -3
- package/dist/pc/pc.pools.js +9 -13
- package/dist/pc/pc.proficiencies.d.ts +54 -29
- package/dist/pc/pc.proficiencies.js +74 -95
- package/dist/pc/pc.proficiency-grants.d.ts +58 -0
- package/dist/pc/pc.proficiency-normalize.d.ts +24 -0
- package/dist/pc/pc.proficiency-normalize.js +12 -0
- package/dist/pc/pc.proficiency-query.d.ts +13 -0
- package/dist/pc/pc.proficiency-query.js +1 -1
- package/dist/pc/pc.recalc.d.ts +69 -14
- package/dist/pc/pc.recalc.js +261 -122
- package/dist/pc/pc.resolver.d.ts +34 -8
- package/dist/pc/pc.resolver.js +27 -12
- package/dist/pc/pc.resource-seed.d.ts +3 -2
- package/dist/pc/pc.resource-seed.js +19 -17
- package/dist/pc/pc.resources.d.ts +87 -0
- package/dist/pc/pc.resources.js +21 -0
- package/dist/pc/pc.rest.d.ts +10 -1
- package/dist/pc/pc.rest.js +66 -12
- package/dist/pc/pc.schema.d.ts +139 -3
- package/dist/pc/pc.schema.js +4 -2
- package/dist/pc/pc.slotting.js +3 -3
- package/dist/pc/pc.spellcasting.d.ts +75 -6
- package/dist/pc/pc.spellcasting.js +16 -6
- package/dist/pc/pc.table-column.d.ts +23 -0
- package/dist/pc/pc.table-column.js +13 -3
- package/dist/pc/pc.types.d.ts +251 -12
- package/dist/pc/pool-layout.d.ts +47 -0
- package/dist/pc/pool-layout.js +16 -0
- package/dist/pc/roll-scope.d.ts +2 -0
- package/dist/pc/roll-scope.js +8 -0
- package/dist/pc/roll-tag-labels.d.ts +40 -0
- package/dist/pc/roll-tag-labels.js +17 -0
- package/dist/pc/spell-source.d.ts +21 -0
- package/dist/pc/spell-source.js +13 -0
- package/dist/race/race.codec.js +9 -7
- package/dist/race/race.parser.js +8 -6
- package/dist/race/race.schema.d.ts +51 -1
- package/dist/race/race.schema.js +8 -5
- package/dist/race/race.structural.d.ts +7 -0
- package/dist/race/race.structural.js +6 -0
- package/dist/race/race.types.d.ts +20 -0
- package/dist/schemas/attack-schema.d.ts +5 -0
- package/dist/schemas/caster-type-schema.d.ts +14 -0
- package/dist/schemas/caster-type-schema.js +6 -0
- package/dist/schemas/choice-schema.js +2 -2
- package/dist/schemas/entity-extras-schema.d.ts +53 -0
- package/dist/schemas/entity-extras-schema.js +10 -0
- package/dist/schemas/equipment-grant-schema.d.ts +2 -0
- package/dist/schemas/equipment-grant-schema.js +1 -1
- package/dist/schemas/feature-alias.d.ts +34 -0
- package/dist/schemas/feature-effect-schema.d.ts +124 -0
- package/dist/schemas/feature-effect-schema.js +1 -1
- package/dist/schemas/feature-schema.d.ts +8 -0
- package/dist/schemas/feature-schema.js +6 -4
- package/dist/schemas/resource-schema.d.ts +43 -0
- package/dist/schemas/resource-schema.js +1 -1
- package/dist/schemas/selection-pool-schema.d.ts +2 -0
- package/dist/schemas/selection-pool-schema.js +1 -1
- package/dist/spell/spell.access.js +23 -3
- package/dist/spell/spell.codec.js +4 -3
- package/dist/spell/spell.enrichment.js +4 -4
- package/dist/spell/spell.parser.d.ts +30 -0
- package/dist/spell/spell.parser.js +9 -2
- package/dist/spell/spell.scaling.d.ts +27 -6
- package/dist/spell/spell.scaling.js +25 -6
- package/dist/spell/spell.schema.d.ts +44 -2
- package/dist/spell/spell.schema.js +2 -1
- package/dist/spell/spell.types.d.ts +14 -0
- package/dist/subclass/subclass.codec.d.ts +1 -1
- package/dist/subclass/subclass.codec.js +11 -8
- package/dist/subclass/subclass.parser.js +10 -7
- package/dist/subclass/subclass.schema.d.ts +54 -7
- package/dist/subclass/subclass.schema.js +8 -6
- package/dist/subclass/subclass.types.d.ts +20 -2
- package/dist/types/choice.d.ts +53 -2
- package/dist/types/choice.js +13 -1
- package/dist/types/equipment-grant.d.ts +8 -1
- package/dist/types/feature-effect.d.ts +78 -23
- package/dist/types/feature.d.ts +70 -1
- package/dist/types/optional-feature.types.d.ts +28 -0
- package/dist/types/resource.d.ts +21 -1
- package/dist/types/selection-pool.d.ts +17 -2
- package/dist/weapon/weapon.classify.js +2 -2
- package/dist/weapon/weapon.codec.js +4 -3
- package/dist/weapon/weapon.parser.js +3 -2
- package/dist/weapon/weapon.schema.d.ts +4 -0
- package/dist/weapon/weapon.schema.js +2 -1
- package/dist/weapon/weapon.types.d.ts +8 -0
- package/package.json +2 -2
- package/dist/chunk-5XUXXAQJ.js +0 -30
- package/dist/chunk-7P65Q426.js +0 -158
- package/dist/chunk-7TEK5KK7.js +0 -49
- package/dist/chunk-AIRFC5NQ.js +0 -143
- package/dist/chunk-CZPMTQOY.js +0 -68
- package/dist/chunk-N2JE7BWL.js +0 -81
- package/dist/chunk-NXR3BD2V.js +0 -90
- package/dist/chunk-O5EYMKFH.js +0 -6
- package/dist/chunk-Q5K6LWBZ.js +0 -45
- package/dist/chunk-TNUFPIXI.js +0 -1110
- package/dist/chunk-TZK36BU7.js +0 -38
- package/dist/chunk-W7HWMMBF.js +0 -46
- package/dist/chunk-Y4I74YEG.js +0 -33
package/dist/item/item.codec.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
itemCodec
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-4XTNPNQB.js";
|
|
4
|
+
import "../chunk-SMLXZUBH.js";
|
|
5
|
+
import "../chunk-GFZ7PITJ.js";
|
|
6
|
+
import "../chunk-UA5KS2PL.js";
|
|
6
7
|
export {
|
|
7
8
|
itemCodec
|
|
8
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
enrichItem
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-6GNXYAYP.js";
|
|
4
|
+
import "../chunk-DEEHHLAP.js";
|
|
5
|
+
import "../chunk-PDJSUH24.js";
|
|
6
|
+
import "../chunk-WELIKLZF.js";
|
|
7
7
|
export {
|
|
8
8
|
enrichItem
|
|
9
9
|
};
|
package/dist/item/item.parser.js
CHANGED
|
@@ -32,6 +32,22 @@ export declare const itemEntitySchema: z.ZodObject<{
|
|
|
32
32
|
value: z.ZodNumber;
|
|
33
33
|
when: z.ZodArray<z.ZodType<Condition, unknown, z.core.$ZodTypeInternals<Condition, unknown>>>;
|
|
34
34
|
}, z.core.$strip>]>>;
|
|
35
|
+
spell_damage: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
36
|
+
value: z.ZodNumber;
|
|
37
|
+
when: z.ZodArray<z.ZodType<Condition, unknown, z.core.$ZodTypeInternals<Condition, unknown>>>;
|
|
38
|
+
}, z.core.$strip>]>>;
|
|
39
|
+
ability_check: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
40
|
+
value: z.ZodNumber;
|
|
41
|
+
when: z.ZodArray<z.ZodType<Condition, unknown, z.core.$ZodTypeInternals<Condition, unknown>>>;
|
|
42
|
+
}, z.core.$strip>]>>;
|
|
43
|
+
proficiency_bonus: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
44
|
+
value: z.ZodNumber;
|
|
45
|
+
when: z.ZodArray<z.ZodType<Condition, unknown, z.core.$ZodTypeInternals<Condition, unknown>>>;
|
|
46
|
+
}, z.core.$strip>]>>;
|
|
47
|
+
saving_throw_concentration: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
48
|
+
value: z.ZodNumber;
|
|
49
|
+
when: z.ZodArray<z.ZodType<Condition, unknown, z.core.$ZodTypeInternals<Condition, unknown>>>;
|
|
50
|
+
}, z.core.$strip>]>>;
|
|
35
51
|
ability_scores: z.ZodOptional<z.ZodObject<{
|
|
36
52
|
static: z.ZodOptional<z.ZodObject<{
|
|
37
53
|
str: z.ZodOptional<z.ZodNumber>;
|
|
@@ -67,6 +83,18 @@ export declare const itemEntitySchema: z.ZodObject<{
|
|
|
67
83
|
when: z.ZodArray<z.ZodType<Condition, unknown, z.core.$ZodTypeInternals<Condition, unknown>>>;
|
|
68
84
|
}, z.core.$strip>]>>;
|
|
69
85
|
}, z.core.$strip>>;
|
|
86
|
+
choose: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
87
|
+
from: z.ZodArray<z.ZodEnum<{
|
|
88
|
+
str: "str";
|
|
89
|
+
dex: "dex";
|
|
90
|
+
con: "con";
|
|
91
|
+
int: "int";
|
|
92
|
+
wis: "wis";
|
|
93
|
+
cha: "cha";
|
|
94
|
+
}>>;
|
|
95
|
+
count: z.ZodNumber;
|
|
96
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
}, z.core.$strict>>>;
|
|
70
98
|
}, z.core.$strip>>;
|
|
71
99
|
speed: z.ZodOptional<z.ZodObject<{
|
|
72
100
|
walk: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
@@ -93,6 +121,7 @@ export declare const itemEntitySchema: z.ZodObject<{
|
|
|
93
121
|
condition_immune: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
122
|
charges: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
95
123
|
max: z.ZodNumber;
|
|
124
|
+
dice: z.ZodOptional<z.ZodString>;
|
|
96
125
|
recharge: z.ZodOptional<z.ZodString>;
|
|
97
126
|
recharge_amount: z.ZodOptional<z.ZodString>;
|
|
98
127
|
destroy_on_empty: z.ZodOptional<z.ZodObject<{
|
|
@@ -107,6 +136,9 @@ export declare const itemEntitySchema: z.ZodObject<{
|
|
|
107
136
|
will: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
108
137
|
rest: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
109
138
|
limited: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
139
|
+
other: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
|
+
ability: z.ZodOptional<z.ZodString>;
|
|
141
|
+
ritual: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
110
142
|
}, z.core.$strip>>;
|
|
111
143
|
attunement: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
112
144
|
required: z.ZodBoolean;
|
|
@@ -114,14 +146,28 @@ export declare const itemEntitySchema: z.ZodObject<{
|
|
|
114
146
|
tags: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
115
147
|
class: z.ZodString;
|
|
116
148
|
subclass: z.ZodOptional<z.ZodString>;
|
|
149
|
+
alignment: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
117
150
|
}, z.core.$strip>, z.ZodObject<{
|
|
118
151
|
alignment: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
152
|
+
race: z.ZodOptional<z.ZodString>;
|
|
119
153
|
}, z.core.$strip>, z.ZodObject<{
|
|
120
154
|
race: z.ZodString;
|
|
155
|
+
alignment: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
121
156
|
}, z.core.$strip>, z.ZodObject<{
|
|
122
157
|
creature_type: z.ZodString;
|
|
158
|
+
size: z.ZodOptional<z.ZodString>;
|
|
123
159
|
}, z.core.$strip>, z.ZodObject<{
|
|
124
160
|
spellcasting: z.ZodBoolean;
|
|
161
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
162
|
+
background: z.ZodString;
|
|
163
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
164
|
+
psionics: z.ZodBoolean;
|
|
165
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
166
|
+
int: z.ZodNumber;
|
|
167
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
+
skill_proficiency: z.ZodArray<z.ZodString>;
|
|
169
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
170
|
+
language_proficiency: z.ZodArray<z.ZodString>;
|
|
125
171
|
}, z.core.$strip>]>>>;
|
|
126
172
|
}, z.core.$strip>, z.ZodBoolean, z.ZodString]>>;
|
|
127
173
|
grants: z.ZodOptional<z.ZodObject<{
|
|
@@ -138,14 +184,24 @@ export declare const itemEntitySchema: z.ZodObject<{
|
|
|
138
184
|
capacity_weight: z.ZodOptional<z.ZodNumber>;
|
|
139
185
|
weightless: z.ZodOptional<z.ZodBoolean>;
|
|
140
186
|
pack_contents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
187
|
+
capacity: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
weight: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
189
|
+
item: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
|
|
190
|
+
weightless: z.ZodOptional<z.ZodBoolean>;
|
|
191
|
+
volume: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
192
|
+
}, z.core.$strict>>;
|
|
141
193
|
}, z.core.$strip>>;
|
|
142
|
-
light: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
light: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
143
195
|
bright_radius: z.ZodNumber;
|
|
144
196
|
dim_radius: z.ZodNumber;
|
|
145
|
-
}, z.core.$strip
|
|
197
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
198
|
+
bright: z.ZodOptional<z.ZodNumber>;
|
|
199
|
+
dim: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
201
|
+
}, z.core.$strict>>]>>;
|
|
146
202
|
cursed: z.ZodOptional<z.ZodBoolean>;
|
|
147
203
|
sentient: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
-
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
204
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
149
205
|
tier: z.ZodOptional<z.ZodEnum<{
|
|
150
206
|
major: "major";
|
|
151
207
|
minor: "minor";
|
|
@@ -178,6 +234,16 @@ export declare const itemEntitySchema: z.ZodObject<{
|
|
|
178
234
|
scroll_level: z.ZodOptional<z.ZodNumber>;
|
|
179
235
|
unidentified: z.ZodOptional<z.ZodBoolean>;
|
|
180
236
|
masked_category: z.ZodOptional<z.ZodString>;
|
|
237
|
+
modify_speed: z.ZodOptional<z.ZodObject<{
|
|
238
|
+
equal: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
239
|
+
static: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
240
|
+
multiply: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
241
|
+
bonus: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
242
|
+
}, z.core.$strict>>;
|
|
243
|
+
rendering_hint: z.ZodOptional<z.ZodString>;
|
|
244
|
+
has_fluff: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
has_fluff_images: z.ZodOptional<z.ZodBoolean>;
|
|
246
|
+
image: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
181
247
|
raw: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
182
248
|
damage_dice: z.ZodOptional<z.ZodString>;
|
|
183
249
|
damage_type: z.ZodOptional<z.ZodString>;
|
package/dist/item/item.schema.js
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
import type { Ability, ArmorCategory } from "@archivist-gg/dnd5e/armor/armor.types";
|
|
2
2
|
import type { WeaponCategory, WeaponEntity } from "@archivist-gg/dnd5e/weapon/weapon.types";
|
|
3
3
|
import type { ConditionalBonus } from "@archivist-gg/dnd5e/types/item-conditions.types";
|
|
4
|
+
import type { imageField } from "@archivist-gg/dnd5e/schemas/entity-extras-schema";
|
|
5
|
+
import type { z } from "zod";
|
|
4
6
|
export type ItemRarity = "common" | "uncommon" | "rare" | "very rare" | "legendary" | "artifact" | string;
|
|
5
7
|
export type AttunementTag = {
|
|
6
8
|
class: string;
|
|
7
9
|
subclass?: string;
|
|
10
|
+
alignment?: string | string[];
|
|
8
11
|
} | {
|
|
9
|
-
alignment: string;
|
|
12
|
+
alignment: string | string[];
|
|
13
|
+
race?: string;
|
|
10
14
|
} | {
|
|
11
15
|
race: string;
|
|
16
|
+
alignment?: string | string[];
|
|
12
17
|
} | {
|
|
13
18
|
creature_type: string;
|
|
19
|
+
size?: string;
|
|
20
|
+
} | {
|
|
21
|
+
spellcasting: boolean;
|
|
22
|
+
} | {
|
|
23
|
+
background: string;
|
|
24
|
+
} | {
|
|
25
|
+
psionics: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
int: number;
|
|
28
|
+
} | {
|
|
29
|
+
skill_proficiency: string[];
|
|
30
|
+
} | {
|
|
31
|
+
language_proficiency: string[];
|
|
14
32
|
};
|
|
15
33
|
export interface ItemEntity {
|
|
16
34
|
name: string;
|
|
@@ -25,9 +43,20 @@ export interface ItemEntity {
|
|
|
25
43
|
spell_attack?: number | ConditionalBonus;
|
|
26
44
|
spell_save_dc?: number | ConditionalBonus;
|
|
27
45
|
saving_throws?: number | ConditionalBonus;
|
|
46
|
+
spell_damage?: number | ConditionalBonus;
|
|
47
|
+
ability_check?: number | ConditionalBonus;
|
|
48
|
+
proficiency_bonus?: number | ConditionalBonus;
|
|
49
|
+
saving_throw_concentration?: number | ConditionalBonus;
|
|
28
50
|
ability_scores?: {
|
|
29
51
|
static?: Partial<Record<Ability, number>>;
|
|
30
52
|
bonus?: Partial<Record<Ability, number | ConditionalBonus>>;
|
|
53
|
+
/** "choose `count` of `from`, each +`amount`". `amount` is OPTIONAL — the
|
|
54
|
+
* Kwalish Deck of Several Things carries `count` with no `amount`. */
|
|
55
|
+
choose?: Array<{
|
|
56
|
+
from: Ability[];
|
|
57
|
+
count: number;
|
|
58
|
+
amount?: number;
|
|
59
|
+
}>;
|
|
31
60
|
};
|
|
32
61
|
speed?: {
|
|
33
62
|
walk?: number | ConditionalBonus;
|
|
@@ -42,6 +71,8 @@ export interface ItemEntity {
|
|
|
42
71
|
condition_immune?: string[];
|
|
43
72
|
charges?: {
|
|
44
73
|
max: number;
|
|
74
|
+
/** Dice regained per recharge, e.g. "1d4 - 1". */
|
|
75
|
+
dice?: string;
|
|
45
76
|
recharge?: string;
|
|
46
77
|
recharge_amount?: string;
|
|
47
78
|
destroy_on_empty?: {
|
|
@@ -57,6 +88,11 @@ export interface ItemEntity {
|
|
|
57
88
|
rest?: Record<string, string[]>;
|
|
58
89
|
/** Total uses with no recharge — item often consumed when empty. */
|
|
59
90
|
limited?: Record<string, string[]>;
|
|
91
|
+
/** Spells the document lists without a cost model. */
|
|
92
|
+
other?: string[];
|
|
93
|
+
/** Casting ability for the item's attached spells. */
|
|
94
|
+
ability?: string;
|
|
95
|
+
ritual?: string[];
|
|
60
96
|
};
|
|
61
97
|
attunement?: {
|
|
62
98
|
required: boolean;
|
|
@@ -77,14 +113,29 @@ export interface ItemEntity {
|
|
|
77
113
|
capacity_weight?: number;
|
|
78
114
|
weightless?: boolean;
|
|
79
115
|
pack_contents?: string[];
|
|
116
|
+
/** Structured 5etools capacity. `item` entries are records of
|
|
117
|
+
* "<item tag>": <count>, e.g. {"sling bullet|xphb": 20}. */
|
|
118
|
+
capacity?: {
|
|
119
|
+
weight?: number[];
|
|
120
|
+
item?: Array<Record<string, number>>;
|
|
121
|
+
weightless?: boolean;
|
|
122
|
+
volume?: number[];
|
|
123
|
+
};
|
|
80
124
|
};
|
|
125
|
+
/** Two DIFFERENT spellings, never unified: the object form
|
|
126
|
+
* {bright_radius, dim_radius} (173 carriers) and the converter's array of
|
|
127
|
+
* per-source entries keyed bright/dim/shape (97 entries over 81 docs). */
|
|
81
128
|
light?: {
|
|
82
129
|
bright_radius: number;
|
|
83
130
|
dim_radius: number;
|
|
84
|
-
}
|
|
131
|
+
} | Array<{
|
|
132
|
+
bright?: number;
|
|
133
|
+
dim?: number;
|
|
134
|
+
shape?: string;
|
|
135
|
+
}>;
|
|
85
136
|
cursed?: boolean;
|
|
86
137
|
sentient?: boolean;
|
|
87
|
-
focus?: boolean | "arcane" | "druid" | "holy";
|
|
138
|
+
focus?: boolean | "arcane" | "druid" | "holy" | string[];
|
|
88
139
|
tier?: "major" | "minor";
|
|
89
140
|
damage?: WeaponEntity["damage"] | string;
|
|
90
141
|
weapon_category?: WeaponCategory;
|
|
@@ -114,6 +165,21 @@ export interface ItemEntity {
|
|
|
114
165
|
/** Generic category label shown for an unidentified item (e.g. "potion",
|
|
115
166
|
* "scroll", "wand") in place of its real name. */
|
|
116
167
|
masked_category?: string;
|
|
168
|
+
/** Speed overrides the item applies. `equal` maps a mode to another mode's
|
|
169
|
+
* value (e.g. {fly: "walk"}); static/multiply/bonus are numeric, and `bonus`
|
|
170
|
+
* is keyed "*" on its single carrier. */
|
|
171
|
+
modify_speed?: {
|
|
172
|
+
equal?: Record<string, string>;
|
|
173
|
+
static?: Record<string, number>;
|
|
174
|
+
multiply?: Record<string, number>;
|
|
175
|
+
bonus?: Record<string, number>;
|
|
176
|
+
};
|
|
177
|
+
/** Carried by every converter item doc, always as "" today. */
|
|
178
|
+
rendering_hint?: string;
|
|
179
|
+
has_fluff?: boolean;
|
|
180
|
+
has_fluff_images?: boolean;
|
|
181
|
+
/** One wikilink, or an array for >= 2 fluff images (images-ON emit). */
|
|
182
|
+
image?: z.infer<typeof imageField>;
|
|
117
183
|
raw?: Record<string, unknown>;
|
|
118
184
|
damage_dice?: string;
|
|
119
185
|
damage_type?: string;
|
|
@@ -3,11 +3,12 @@ import type { Monster } from "./monster.types.js";
|
|
|
3
3
|
/** Deprecated alias kept for the barrel re-export (`index.ts:7`) + `monster.resolve.ts:2`. */
|
|
4
4
|
export type MonsterRaw = Monster;
|
|
5
5
|
/**
|
|
6
|
-
* Normalizing codec (0c.1a B8). `parse` delegates to `parseMonster`, which
|
|
7
|
-
* the `legendary` alias
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
11
|
-
*
|
|
6
|
+
* Normalizing codec (0c.1a B8). `parse` delegates to `parseMonster`, which runs the legacy migrations of R4-G6 §4.1
|
|
7
|
+
* (the `legendary` alias, scalar `ac` / `hp`, numeric-string coercion, the non-finite scrub, the null step, the
|
|
8
|
+
* `senses` / `languages` string lift, `desc`, a malformed `recharge`), validates against `monsterSchema`, relocates
|
|
9
|
+
* undeclared top-level keys into `raw`, and extracts Legendary-Resistance from trait text into the canonical
|
|
10
|
+
* `legendary_resistance` field. All of it is intended and persists on save (B3); resolve-derived PB/XP are NOT added
|
|
11
|
+
* here. `serialize` stays `yaml.dump` (the edit-save path uses obsidian's separate `editableToYaml`: that
|
|
12
|
+
* two-serializer split is documented here; gate (d) Step 6 verifies `yaml.dump` round-trips).
|
|
12
13
|
*/
|
|
13
14
|
export declare const monsterCodec: DocCodec<Monster>;
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
getChallengeRatingXP,
|
|
6
6
|
getProficiencyBonus,
|
|
7
7
|
parseCR
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-6PXTNCBP.js";
|
|
9
|
+
import "../chunk-DEEHHLAP.js";
|
|
10
|
+
import "../chunk-PDJSUH24.js";
|
|
11
|
+
import "../chunk-WELIKLZF.js";
|
|
12
12
|
export {
|
|
13
13
|
CR_TO_XP,
|
|
14
14
|
convertMonsterEntries,
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* R4-G6 §6 · READ-time decoding of the converter's 5etools-shaped monster leaves. Pure functions; every table is
|
|
3
|
+
* DATA in this module (memory: rendering policy from the schema / data, never a switch on game vocabulary in a
|
|
4
|
+
* renderer). Every function accepts the authored string / number shape AND the structured shape, and on the
|
|
5
|
+
* string / number arms reproduces the plugin renderer's historical output byte for byte (invariant 5: the SRD
|
|
6
|
+
* render pins are the proof).
|
|
7
|
+
*/
|
|
8
|
+
import type { Abilities } from "../types/index.js";
|
|
9
|
+
import type { AlignmentEntry, DamageQualifier, MonsterAC, MonsterCRStructured, MonsterGearEntry, MonsterHP, MonsterInitiative, MonsterSectionHeader, MonsterSpeed, MonsterSpellcasting, MonsterTypeStructured } from "./monster.types.js";
|
|
10
|
+
/** The plugin renderer's historical helper, byte for byte (`/\b\w/g`), so `player's` becomes `Player'S`. */
|
|
11
|
+
export declare function capitalizeWords(str: string): string;
|
|
12
|
+
/** `capitalizeWords` applied OUTSIDE wikilink targets: the plain text and the ALIAS of `[[target|alias]]` are
|
|
13
|
+
* title-cased, the target never is (1,202 `ac[].from` links carry an apostrophe the plain helper mangles). */
|
|
14
|
+
export declare function capitalizeOutsideLinks(str: string): string;
|
|
15
|
+
export declare const SIZE_CODES: Readonly<Record<string, string>>;
|
|
16
|
+
export declare function formatSize(size: string | string[] | undefined, note?: string): string;
|
|
17
|
+
/** The FIRST decoded size word, lower-cased: the hit-die table and the edit-mode size select key on it. */
|
|
18
|
+
export declare function sizeWord(size: string | string[] | undefined): string;
|
|
19
|
+
export declare const ALIGNMENT_CODES: Readonly<Record<string, string>>;
|
|
20
|
+
/** The multi-code SETS 5etools prints as a phrase, keyed by the sorted code set (the measured combos). */
|
|
21
|
+
export declare const ALIGNMENT_SETS: Readonly<Record<string, string>>;
|
|
22
|
+
export declare function formatAlignment(alignment: string | (string | AlignmentEntry)[] | undefined, prefix?: string): string;
|
|
23
|
+
/** The decoded text lower-cased: the edit-mode alignment selects match on it. */
|
|
24
|
+
export declare function alignmentWords(alignment: string | (string | AlignmentEntry)[] | undefined): string;
|
|
25
|
+
export declare const IRREGULAR_PLURALS: Readonly<Record<string, string>>;
|
|
26
|
+
export declare function formatType(type: string | MonsterTypeStructured | undefined, level?: number): string;
|
|
27
|
+
export interface FormattedCR {
|
|
28
|
+
crText: string;
|
|
29
|
+
xp: number;
|
|
30
|
+
pb: number;
|
|
31
|
+
tableMiss: boolean;
|
|
32
|
+
lair?: string;
|
|
33
|
+
coven?: string;
|
|
34
|
+
xpLair?: number;
|
|
35
|
+
xpOverride?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function formatCR(cr: string | MonsterCRStructured | undefined): FormattedCR | undefined;
|
|
38
|
+
/** Thousands-separated without `toLocaleString` (ICU-independent, deterministic across Node and Electron). */
|
|
39
|
+
export declare function formatXP(xp: number): string;
|
|
40
|
+
/** The bare `cr` text (today's Challenge value; `formatCR` normalises it before the PB / XP table reads). */
|
|
41
|
+
export declare function crString(cr: string | MonsterCRStructured | undefined): string | undefined;
|
|
42
|
+
export declare function challengeLine(cr: string | MonsterCRStructured | undefined, pbNote?: string): string | undefined;
|
|
43
|
+
/** R4 {G5, G6} live rider N-3-3: a BRACED entry joins with a SPACE, every other with ", ". The braces
|
|
44
|
+
* flag marks an entry that reads as a parenthetical on the one before it ("15 (17 with mage armor)"),
|
|
45
|
+
* so emitting the list comma as well gave the Archmage and the converter's Feonor
|
|
46
|
+
* `Armor Class. 12, (15 with mage armor)`. The separator therefore belongs to the entry that FOLLOWS
|
|
47
|
+
* it, not to the list, which is why this joins by hand rather than with `Array.join`. A braced entry
|
|
48
|
+
* that opens the line still stands alone, and two unbraced entries still take the comma. */
|
|
49
|
+
export declare function formatAC(ac: MonsterAC[] | undefined): string;
|
|
50
|
+
export declare function formatHP(hp: MonsterHP | undefined): {
|
|
51
|
+
text: string;
|
|
52
|
+
formula?: string;
|
|
53
|
+
};
|
|
54
|
+
export declare const SPEED_MODES: readonly ["walk", "fly", "swim", "climb", "burrow"];
|
|
55
|
+
export type SpeedMode = (typeof SPEED_MODES)[number];
|
|
56
|
+
export declare function formatSpeed(speed: MonsterSpeed | undefined): string;
|
|
57
|
+
/** The numeric part of a speed value, or 0 (the edit-mode number inputs and the `> 0` gates read this). */
|
|
58
|
+
export declare function speedNumber(speed: MonsterSpeed | undefined, mode: SpeedMode): number;
|
|
59
|
+
export declare function formatQualifiers(list: (string | DamageQualifier)[] | null | undefined): string[];
|
|
60
|
+
/** The STRING entries only (the edit-mode multi-selects are `string[]`; structured entries are merged back on save). */
|
|
61
|
+
export declare function qualifierStrings(list: (string | DamageQualifier)[] | null | undefined): string[];
|
|
62
|
+
export declare const INITIATIVE_MODES: Readonly<Record<string, string>>;
|
|
63
|
+
export declare function formatInitiative(initiative: number | MonsterInitiative | undefined, abilities: Abilities | undefined, pb: number): string | undefined;
|
|
64
|
+
export declare function formatGear(gear: (string | MonsterGearEntry)[] | undefined): string;
|
|
65
|
+
/**
|
|
66
|
+
* The Languages line (R4 {G5, G6} live rider 3, Z-9-9). Each entry is title-cased, as this line has always
|
|
67
|
+
* been, EXCEPT that the word immediately following an amount keeps the case it was authored in: that word is
|
|
68
|
+
* the amount's unit. `capitalizeWords` reached it too, so a block read `Deep Speech; Telepathy 120 Ft.` while
|
|
69
|
+
* the Senses line right above printed its own `darkvision 120 ft.` verbatim (Aboleth, Baphomet).
|
|
70
|
+
*
|
|
71
|
+
* The rule is a SHAPE, not a list of unit words: no vocabulary table enters this formatter. Measured over the
|
|
72
|
+
* converter corpus' 4,042 monster notes that carry a `languages` block, the words that follow an amount there
|
|
73
|
+
* are `ft` (527), `mile` (10), `miles` (7), `feet` (1), the conjunctions `and` (7) and `or` (2), and NINE
|
|
74
|
+
* language names already authored with a capital (`Elvish`, `Common`, `Terran`, `Druidic`, `Ignan`, `Sylvan`,
|
|
75
|
+
* `Celestial`, `Draconic`, `Auran`). Keeping the AUTHORED case rather than lower-casing is what leaves those
|
|
76
|
+
* language names alone; the two conjunctions stop being title-cased, which is correct English and reaches no
|
|
77
|
+
* SRD bundle document (there, `ft` is the only word that ever follows an amount).
|
|
78
|
+
*
|
|
79
|
+
* What this does NOT change: the rest of an entry's free prose is still title-cased, so
|
|
80
|
+
* "understands Common and Deep Speech but can't speak" still renders with each word capitalised. That is the
|
|
81
|
+
* line's shipped register and a separate copy question, recorded rather than changed here.
|
|
82
|
+
*/
|
|
83
|
+
export declare function formatLanguages(list: string[] | undefined): string;
|
|
84
|
+
/**
|
|
85
|
+
* A monster's `skills` (and `skills_other.one_of`) KEY to the name a reader sees (R4 {G5, G6} live rider 3,
|
|
86
|
+
* Z-9-8). Those keys are written with a separator · the SRD bundle's Donkey carries `animal_handling` and
|
|
87
|
+
* `sleight_of_hand` · and `capitalizeWords` only upper-cases the first letter of each WORD, so the separator
|
|
88
|
+
* survived and the line read `Animal_handling +0`. The separator is normalised and the CANONICAL list answers;
|
|
89
|
+
* a key the list does not know keeps `capitalizeWords`, which is byte for byte what every key rendered before
|
|
90
|
+
* (invariant 5: the sixteen one-word skills already agreed with the list, so only the two-word two move).
|
|
91
|
+
*/
|
|
92
|
+
export declare function skillDisplayName(key: string): string;
|
|
93
|
+
export declare function formatSkillsOther(list: unknown[] | undefined): string | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* The generated legendary-action sentence (R4-G6 spec §6), used only when the document authors no
|
|
96
|
+
* `section_headers` row for the section (plugin `monster.sections.ts`).
|
|
97
|
+
*
|
|
98
|
+
* `short_name` is read exactly as authored: a STRING is the subject verbatim; `true` and `false` both say "this
|
|
99
|
+
* document has no separate short name", so the whole name prints; only an ABSENT key derives one through
|
|
100
|
+
* `shortNameOfNamed`. Measured over the two shipped corpora (`g7-t8-wE-f1-d9-corpus.txt`): 24 monster documents carry
|
|
101
|
+
* a `short_name` (11 `true`, 13 a string) and NONE carries `false`, so the false arm is a contract read from the type,
|
|
102
|
+
* not an observed rendering.
|
|
103
|
+
*/
|
|
104
|
+
export declare function legendaryIntro(m: {
|
|
105
|
+
name: string;
|
|
106
|
+
is_named_creature?: boolean;
|
|
107
|
+
short_name?: string | boolean;
|
|
108
|
+
legendary_actions_lair_count?: number;
|
|
109
|
+
}, count: number): string;
|
|
110
|
+
export declare function sectionHeader(m: {
|
|
111
|
+
section_headers?: MonsterSectionHeader[];
|
|
112
|
+
mythic_header?: string[];
|
|
113
|
+
}, section: "legendary_actions" | "mythic" | "reactions"): string[] | undefined;
|
|
114
|
+
export type PlacedSection = "traits" | "actions" | "bonus_actions" | "reactions" | "legendary_actions";
|
|
115
|
+
/** ONE object: the 5etools `displayAs` vocabulary to the stat-block section (the plugin never switches on it). */
|
|
116
|
+
export declare const DISPLAY_AS_SECTION: Readonly<Record<string, Exclude<PlacedSection, "traits">>>;
|
|
117
|
+
export declare function displayAsSection(displayAs: string | undefined): PlacedSection;
|
|
118
|
+
declare const GROUP_ORDER: readonly ["will", "daily", "rest", "restLong", "recharge", "legendary", "charges", "ritual"];
|
|
119
|
+
/** ONE label table: EVERY group of `GROUP_ORDER` owns its label text here, so the eight FREQUENCY-group labels are
|
|
120
|
+
* DATA; the slot-table wording (`Cantrips (At Will):`, `N Level (N Slots):`) is generated in `spellcastingLines`
|
|
121
|
+
* and deliberately outside this table. Title-cased to match the SRD 2024 statblock prose the vault already
|
|
122
|
+
* shows beside these entries. `plain` is a plain sub-key's label, and the whole label of the two count-less groups
|
|
123
|
+
* `will` and `ritual`; `each` is its `Ne` twin, absent where a group has no twin; `six` is `recharge`'s
|
|
124
|
+
* already-at-6 form. `N` stands for the sub-key's count. `charges` alone ends without a colon: `spellcastingLines`
|
|
125
|
+
* appends ` (chargesItem):` after it (§8.2). The KEY type is `GROUP_ORDER`'s union, so a ninth group without a row
|
|
126
|
+
* is a compile error rather than a runtime `undefined`. */
|
|
127
|
+
export declare const SPELLCASTING_LABELS: Readonly<Record<(typeof GROUP_ORDER)[number], {
|
|
128
|
+
plain: string;
|
|
129
|
+
each?: string;
|
|
130
|
+
six?: string;
|
|
131
|
+
}>>;
|
|
132
|
+
export declare function spellcastingLines(block: MonsterSpellcasting): string[];
|
|
133
|
+
/** The measured node vocabulary to markdown; never throws; an unknown type recurses into its children only. */
|
|
134
|
+
export declare function entriesToMarkdown(tree: unknown): string;
|
|
135
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ALIGNMENT_CODES,
|
|
3
|
+
ALIGNMENT_SETS,
|
|
4
|
+
DISPLAY_AS_SECTION,
|
|
5
|
+
INITIATIVE_MODES,
|
|
6
|
+
IRREGULAR_PLURALS,
|
|
7
|
+
SIZE_CODES,
|
|
8
|
+
SPEED_MODES,
|
|
9
|
+
SPELLCASTING_LABELS,
|
|
10
|
+
alignmentWords,
|
|
11
|
+
capitalizeOutsideLinks,
|
|
12
|
+
capitalizeWords,
|
|
13
|
+
challengeLine,
|
|
14
|
+
crString,
|
|
15
|
+
displayAsSection,
|
|
16
|
+
entriesToMarkdown,
|
|
17
|
+
formatAC,
|
|
18
|
+
formatAlignment,
|
|
19
|
+
formatCR,
|
|
20
|
+
formatGear,
|
|
21
|
+
formatHP,
|
|
22
|
+
formatInitiative,
|
|
23
|
+
formatLanguages,
|
|
24
|
+
formatQualifiers,
|
|
25
|
+
formatSize,
|
|
26
|
+
formatSkillsOther,
|
|
27
|
+
formatSpeed,
|
|
28
|
+
formatType,
|
|
29
|
+
formatXP,
|
|
30
|
+
legendaryIntro,
|
|
31
|
+
qualifierStrings,
|
|
32
|
+
sectionHeader,
|
|
33
|
+
sizeWord,
|
|
34
|
+
skillDisplayName,
|
|
35
|
+
speedNumber,
|
|
36
|
+
spellcastingLines
|
|
37
|
+
} from "../chunk-2FRUSVZS.js";
|
|
38
|
+
import "../chunk-6PXTNCBP.js";
|
|
39
|
+
import "../chunk-DEEHHLAP.js";
|
|
40
|
+
import "../chunk-PDJSUH24.js";
|
|
41
|
+
import "../chunk-WELIKLZF.js";
|
|
42
|
+
export {
|
|
43
|
+
ALIGNMENT_CODES,
|
|
44
|
+
ALIGNMENT_SETS,
|
|
45
|
+
DISPLAY_AS_SECTION,
|
|
46
|
+
INITIATIVE_MODES,
|
|
47
|
+
IRREGULAR_PLURALS,
|
|
48
|
+
SIZE_CODES,
|
|
49
|
+
SPEED_MODES,
|
|
50
|
+
SPELLCASTING_LABELS,
|
|
51
|
+
alignmentWords,
|
|
52
|
+
capitalizeOutsideLinks,
|
|
53
|
+
capitalizeWords,
|
|
54
|
+
challengeLine,
|
|
55
|
+
crString,
|
|
56
|
+
displayAsSection,
|
|
57
|
+
entriesToMarkdown,
|
|
58
|
+
formatAC,
|
|
59
|
+
formatAlignment,
|
|
60
|
+
formatCR,
|
|
61
|
+
formatGear,
|
|
62
|
+
formatHP,
|
|
63
|
+
formatInitiative,
|
|
64
|
+
formatLanguages,
|
|
65
|
+
formatQualifiers,
|
|
66
|
+
formatSize,
|
|
67
|
+
formatSkillsOther,
|
|
68
|
+
formatSpeed,
|
|
69
|
+
formatType,
|
|
70
|
+
formatXP,
|
|
71
|
+
legendaryIntro,
|
|
72
|
+
qualifierStrings,
|
|
73
|
+
sectionHeader,
|
|
74
|
+
sizeWord,
|
|
75
|
+
skillDisplayName,
|
|
76
|
+
speedNumber,
|
|
77
|
+
spellcastingLines
|
|
78
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import { Monster } from "./monster.types.js";
|
|
1
|
+
import type { Monster } from "./monster.types.js";
|
|
2
2
|
import type { ParseResult } from "@archivist-gg/core";
|
|
3
|
+
/**
|
|
4
|
+
* R4-G6 §4.1 · the hand parser's tolerances made explicit, BEFORE `safeParse`. Each step rewrites only a shape the
|
|
5
|
+
* old parser already rewrote, coerced or dropped; the converter corpora are untouched by it (0 / 0 / 0 measured).
|
|
6
|
+
*/
|
|
7
|
+
export declare function migrateLegacy(raw: Record<string, unknown>): void;
|
|
3
8
|
export declare function parseMonster(source: string): ParseResult<Monster>;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
+
migrateLegacy,
|
|
2
3
|
parseMonster
|
|
3
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-COEOOQX2.js";
|
|
5
|
+
import "../chunk-6PKV5V2H.js";
|
|
6
|
+
import "../chunk-4FWNK4FD.js";
|
|
7
|
+
import "../chunk-WYGD2UGN.js";
|
|
8
|
+
import "../chunk-YLL2QXY2.js";
|
|
9
|
+
import "../chunk-T26ZVCL5.js";
|
|
10
|
+
import "../chunk-WPWOHGPI.js";
|
|
11
|
+
import "../chunk-UA5KS2PL.js";
|
|
4
12
|
export {
|
|
13
|
+
migrateLegacy,
|
|
5
14
|
parseMonster
|
|
6
15
|
};
|