@archivist-gg/dnd5e 0.3.1 → 0.3.5
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-2VDTW7QO.js +1580 -0
- package/dist/{chunk-ZZGEVJKX.js → chunk-3JOTQW7A.js} +1 -1
- package/dist/{chunk-5ZBE4CWV.js → chunk-3PZHBLFG.js} +1 -1
- 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-5RKLL2AD.js} +5 -1
- package/dist/{chunk-SE7AZDR3.js → chunk-63XQXPZL.js} +29 -3
- package/dist/{chunk-4F6AIZ36.js → chunk-6BFWZW6T.js} +1 -1
- package/dist/{chunk-GJOI2GHP.js → chunk-6GNXYAYP.js} +1 -1
- 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-TLYDBT5F.js → chunk-CGRLQ34U.js} +64 -7
- package/dist/chunk-CJYCVNW2.js +7 -0
- package/dist/{chunk-XLSVNUTK.js → chunk-CV5XDJKU.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-GE4TLPWM.js → chunk-EHDATXP7.js} +1 -1
- package/dist/chunk-EVMUJYUD.js +195 -0
- package/dist/{chunk-K6Q5OUGK.js → chunk-GFZ7PITJ.js} +86 -10
- package/dist/{chunk-6NK2MUD3.js → chunk-HZA7OE7N.js} +9 -2
- package/dist/{chunk-TN6ZLTNU.js → chunk-I2NDWFDD.js} +51 -4
- package/dist/{chunk-3DZ74AKK.js → chunk-IN4M4X7P.js} +8 -2
- package/dist/chunk-IUAAXXNO.js +58 -0
- package/dist/{chunk-NXSWH3AE.js → chunk-IWRVOCT5.js} +1 -1
- package/dist/{chunk-XJNECUPT.js → chunk-JC5UNIVM.js} +19 -0
- package/dist/{chunk-24GFQU7T.js → chunk-JSZ4H6AQ.js} +1 -1
- package/dist/{chunk-XTIQWSFM.js → chunk-KADJZGZY.js} +1 -1
- package/dist/{chunk-L7E2UT5A.js → chunk-KK33PIDN.js} +5 -1
- package/dist/chunk-KPEJMNRD.js +302 -0
- package/dist/chunk-KU3YLF6D.js +106 -0
- package/dist/{chunk-5INR4NSL.js → chunk-LDDCNPHD.js} +1 -1
- package/dist/chunk-LVQLWRCU.js +15 -0
- package/dist/chunk-MI7P3NX3.js +161 -0
- package/dist/{chunk-PHQRGDRQ.js → chunk-N3A5ICBO.js} +5 -1
- package/dist/chunk-O4SRD3J5.js +165 -0
- package/dist/chunk-OAXWSVJB.js +81 -0
- 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-RSDRMH54.js → chunk-RF4TYCA2.js} +1 -1
- package/dist/chunk-RLGQ5PZZ.js +16 -0
- package/dist/chunk-RVXC6ZHY.js +89 -0
- package/dist/chunk-S7REMWW4.js +21 -0
- package/dist/{chunk-7VJ6BOA5.js → chunk-SMLXZUBH.js} +9 -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-BIK4DFWK.js → chunk-ULCQ73LA.js} +1 -1
- package/dist/{chunk-2BWAID3Y.js → chunk-UMWIPLLM.js} +29 -3
- package/dist/chunk-UQ3ZFCWD.js +178 -0
- package/dist/chunk-UXPGW4TI.js +101 -0
- package/dist/chunk-V2MJE6NC.js +133 -0
- package/dist/{chunk-D3CLOBE3.js → chunk-V373TRJE.js} +48 -10
- package/dist/chunk-VQAXTIBW.js +100 -0
- package/dist/chunk-W74BCA7V.js +159 -0
- package/dist/{chunk-WP2CX2JO.js → chunk-WELIKLZF.js} +22 -1
- package/dist/{chunk-MDEJHMKK.js → chunk-WHVLNFTG.js} +26 -5
- package/dist/{chunk-GZ46OVGZ.js → chunk-WSVMLNTO.js} +1 -1
- package/dist/{chunk-4LZJXJJS.js → chunk-WXWPK3LI.js} +6 -2
- package/dist/chunk-X3D6LXUU.js +185 -0
- package/dist/chunk-XJ2F2WO6.js +8 -0
- package/dist/{chunk-73HOFQQ5.js → chunk-Y4AGLCY6.js} +1 -1
- package/dist/chunk-YBLDE5CG.js +42 -0
- package/dist/{chunk-JEYQU3JT.js → chunk-YHYTW5QA.js} +2 -18
- package/dist/{chunk-PZOWBI3B.js → chunk-YLL2QXY2.js} +7 -2
- 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 +239 -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 +185 -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 +31 -2
- package/dist/pc/pc.equipment.js +12 -8
- package/dist/pc/pc.feature-effects.d.ts +234 -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 +133 -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 +85 -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/chunk-AIRFC5NQ.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
bareEntitySlug
|
|
3
|
-
} from "./chunk-LV4SNWZQ.js";
|
|
4
|
-
import {
|
|
5
|
-
ABILITY_KEYS
|
|
6
|
-
} from "./chunk-WP2CX2JO.js";
|
|
7
|
-
|
|
8
|
-
// src/pc/pc.feature-effects.ts
|
|
9
|
-
function emptyFeatureEffectTotals() {
|
|
10
|
-
return {
|
|
11
|
-
initiative_bonus: 0,
|
|
12
|
-
hp_per_level_bonus: 0,
|
|
13
|
-
hp_per_level_terms: [],
|
|
14
|
-
speed_walk_bonus: 0,
|
|
15
|
-
speed_walk_set: 0,
|
|
16
|
-
senses: { darkvision: 0, blindsight: 0, tremorsense: 0, truesight: 0 },
|
|
17
|
-
ac_terms: [],
|
|
18
|
-
resistances: [],
|
|
19
|
-
condition_immunities: [],
|
|
20
|
-
proficiencies: { skills: [], tools: [], languages: [], saves: [], armor: [], weapons: [] },
|
|
21
|
-
weaponAbilities: [],
|
|
22
|
-
rollModifiers: [],
|
|
23
|
-
critRange: 20,
|
|
24
|
-
extraAttack: 0,
|
|
25
|
-
attackNotes: [],
|
|
26
|
-
damageBonuses: []
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
var ABILITY_NAME_TO_KEY = {
|
|
30
|
-
strength: "str",
|
|
31
|
-
dexterity: "dex",
|
|
32
|
-
constitution: "con",
|
|
33
|
-
intelligence: "int",
|
|
34
|
-
wisdom: "wis",
|
|
35
|
-
charisma: "cha"
|
|
36
|
-
};
|
|
37
|
-
function normalizeAbility(value) {
|
|
38
|
-
var _a;
|
|
39
|
-
const k = value.trim().toLowerCase();
|
|
40
|
-
if (ABILITY_KEYS.includes(k)) return k;
|
|
41
|
-
return (_a = ABILITY_NAME_TO_KEY[k]) != null ? _a : null;
|
|
42
|
-
}
|
|
43
|
-
function pushUnique(list, value) {
|
|
44
|
-
const key = value.trim().toLowerCase();
|
|
45
|
-
if (!key) return;
|
|
46
|
-
if (!list.some((v) => v.trim().toLowerCase() === key)) list.push(value.trim());
|
|
47
|
-
}
|
|
48
|
-
function computeFeatureEffects(features, opts) {
|
|
49
|
-
var _a, _b, _c;
|
|
50
|
-
const out = emptyFeatureEffectTotals();
|
|
51
|
-
for (const rf of features) {
|
|
52
|
-
if (rf.feature.activatable === true) {
|
|
53
|
-
const id = rf.feature.id;
|
|
54
|
-
if (!id || !((_a = opts == null ? void 0 : opts.activeBuffs) == null ? void 0 : _a.has(id))) continue;
|
|
55
|
-
}
|
|
56
|
-
for (const eff of (_b = rf.feature.effects) != null ? _b : []) {
|
|
57
|
-
applyEffect(out, eff, (_c = rf.feature.name) != null ? _c : "Feature");
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return out;
|
|
61
|
-
}
|
|
62
|
-
function applyEffect(out, eff, label) {
|
|
63
|
-
var _a, _b;
|
|
64
|
-
switch (eff.kind) {
|
|
65
|
-
case "initiative-bonus":
|
|
66
|
-
out.initiative_bonus += eff.value;
|
|
67
|
-
break;
|
|
68
|
-
case "hp-per-level-bonus":
|
|
69
|
-
out.hp_per_level_bonus += eff.value;
|
|
70
|
-
out.hp_per_level_terms.push({ label, value: eff.value });
|
|
71
|
-
break;
|
|
72
|
-
case "speed-bonus":
|
|
73
|
-
if (eff.mode === "walk") {
|
|
74
|
-
if (eff.set) out.speed_walk_set = Math.max(out.speed_walk_set, eff.value);
|
|
75
|
-
else out.speed_walk_bonus += eff.value;
|
|
76
|
-
}
|
|
77
|
-
break;
|
|
78
|
-
case "sense":
|
|
79
|
-
out.senses[eff.type] = Math.max(out.senses[eff.type], eff.range);
|
|
80
|
-
break;
|
|
81
|
-
case "resistance":
|
|
82
|
-
pushUnique(out.resistances, eff.damage_type);
|
|
83
|
-
break;
|
|
84
|
-
case "immune-condition":
|
|
85
|
-
if (!eff.while) pushUnique(out.condition_immunities, eff.condition);
|
|
86
|
-
break;
|
|
87
|
-
case "proficiency": {
|
|
88
|
-
if (eff.proficiency_type === "skill") {
|
|
89
|
-
pushUnique(out.proficiencies.skills, eff.value.toLowerCase().replace(/\s+/g, "-"));
|
|
90
|
-
} else if (eff.proficiency_type === "tool") {
|
|
91
|
-
pushUnique(out.proficiencies.tools, eff.value);
|
|
92
|
-
} else if (eff.proficiency_type === "language") {
|
|
93
|
-
pushUnique(out.proficiencies.languages, eff.value);
|
|
94
|
-
} else if (eff.proficiency_type === "armor") {
|
|
95
|
-
pushUnique(out.proficiencies.armor, eff.value.toLowerCase());
|
|
96
|
-
} else if (eff.proficiency_type === "weapon") {
|
|
97
|
-
pushUnique(out.proficiencies.weapons, eff.value.toLowerCase());
|
|
98
|
-
} else {
|
|
99
|
-
const ab = normalizeAbility(eff.value);
|
|
100
|
-
if (ab && !out.proficiencies.saves.includes(ab)) out.proficiencies.saves.push(ab);
|
|
101
|
-
}
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
case "ac-bonus":
|
|
105
|
-
out.ac_terms.push({ value: eff.value, requires_armor: eff.requires_armor === true, label });
|
|
106
|
-
break;
|
|
107
|
-
case "weapon-ability": {
|
|
108
|
-
if (eff.ability !== "spellcasting") {
|
|
109
|
-
const w = eff.weapons;
|
|
110
|
-
const weaponSlugs = !w || w === "chosen" ? void 0 : Array.isArray(w) ? w.map(bareEntitySlug) : [bareEntitySlug(w)];
|
|
111
|
-
out.weaponAbilities.push({ ability: eff.ability, weaponSlugs });
|
|
112
|
-
}
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case "roll-modifier":
|
|
116
|
-
out.rollModifiers.push({ mode: eff.mode, roll: eff.roll, scope: eff.scope, condition: eff.condition, label });
|
|
117
|
-
break;
|
|
118
|
-
case "crit-range":
|
|
119
|
-
if (((_a = eff.applies_to) != null ? _a : "weapon") !== "spell") out.critRange = Math.min(out.critRange, eff.min_roll);
|
|
120
|
-
break;
|
|
121
|
-
case "extra-attack":
|
|
122
|
-
out.extraAttack = Math.max(out.extraAttack, eff.count);
|
|
123
|
-
break;
|
|
124
|
-
case "reroll-damage":
|
|
125
|
-
out.attackNotes.push(`Reroll ${eff.max_reroll}s${eff.once_per_die ? " (once/die)" : ""}`);
|
|
126
|
-
break;
|
|
127
|
-
case "attack-rule":
|
|
128
|
-
if (eff.flag === "no-ranged-in-melee-disadvantage") out.attackNotes.push("No disadvantage firing in melee");
|
|
129
|
-
break;
|
|
130
|
-
case "damage-bonus":
|
|
131
|
-
if (((_b = eff.applies_to) != null ? _b : "weapon") !== "spell") {
|
|
132
|
-
out.damageBonuses.push({ amount: eff.amount, damage_type: eff.damage_type, source: label });
|
|
133
|
-
}
|
|
134
|
-
break;
|
|
135
|
-
default:
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export {
|
|
141
|
-
emptyFeatureEffectTotals,
|
|
142
|
-
computeFeatureEffects
|
|
143
|
-
};
|
package/dist/chunk-CZPMTQOY.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
durationSchema
|
|
3
|
-
} from "./chunk-WYGD2UGN.js";
|
|
4
|
-
import {
|
|
5
|
-
resourceConsumptionSchema,
|
|
6
|
-
resourceSchema
|
|
7
|
-
} from "./chunk-PZOWBI3B.js";
|
|
8
|
-
import {
|
|
9
|
-
choiceSchema
|
|
10
|
-
} from "./chunk-NXSWH3AE.js";
|
|
11
|
-
import {
|
|
12
|
-
featureEffectSchema
|
|
13
|
-
} from "./chunk-NXR3BD2V.js";
|
|
14
|
-
|
|
15
|
-
// src/schemas/feature-schema.ts
|
|
16
|
-
import { z as z2 } from "zod";
|
|
17
|
-
|
|
18
|
-
// src/schemas/attack-schema.ts
|
|
19
|
-
import { z } from "zod";
|
|
20
|
-
var abilityEnum = z.enum(["str", "dex", "con", "int", "wis", "cha"]);
|
|
21
|
-
var attackSchema = z.object({
|
|
22
|
-
name: z.string().min(1),
|
|
23
|
-
type: z.enum(["melee", "ranged", "spell"]),
|
|
24
|
-
ability: z.union([abilityEnum, z.array(abilityEnum).nonempty()]).optional(),
|
|
25
|
-
damage: z.string().optional(),
|
|
26
|
-
damage_type: z.string().optional(),
|
|
27
|
-
action: z.enum(["action", "bonus-action", "reaction"]).optional(),
|
|
28
|
-
properties: z.array(z.string()).optional(),
|
|
29
|
-
range: z.object({
|
|
30
|
-
normal: z.number().int().nonnegative().optional(),
|
|
31
|
-
long: z.number().int().nonnegative().optional(),
|
|
32
|
-
reach: z.number().int().nonnegative().optional()
|
|
33
|
-
}).optional(),
|
|
34
|
-
condition: z.string().optional()
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// src/schemas/feature-schema.ts
|
|
38
|
-
var featureSchema = z2.lazy(
|
|
39
|
-
() => z2.object({
|
|
40
|
-
id: z2.string().min(1).optional(),
|
|
41
|
-
name: z2.string().min(1),
|
|
42
|
-
description: z2.string().optional(),
|
|
43
|
-
entries: z2.array(z2.string()).optional(),
|
|
44
|
-
choices: z2.array(choiceSchema).optional(),
|
|
45
|
-
grants_resource: z2.string().optional(),
|
|
46
|
-
consumes: resourceConsumptionSchema.optional(),
|
|
47
|
-
attacks: z2.array(attackSchema).optional(),
|
|
48
|
-
action: z2.enum(["action", "bonus-action", "reaction", "free", "special"]).optional(),
|
|
49
|
-
trigger: z2.string().optional(),
|
|
50
|
-
dc_formula: z2.string().optional(),
|
|
51
|
-
effects: z2.array(featureEffectSchema).optional(),
|
|
52
|
-
sub_features: z2.array(featureSchema).optional(),
|
|
53
|
-
resources: z2.array(resourceSchema).optional(),
|
|
54
|
-
// Phase 3 activatable buffs: a feature flagged `activatable` folds its effects
|
|
55
|
-
// only while its id is present in state.active_buffs. `passive` renders a tag;
|
|
56
|
-
// `duration` is a static label (no live countdown this phase).
|
|
57
|
-
activatable: z2.boolean().optional(),
|
|
58
|
-
passive: z2.boolean().optional(),
|
|
59
|
-
duration: durationSchema.optional()
|
|
60
|
-
}).refine(
|
|
61
|
-
(f) => f.description !== void 0 || f.entries !== void 0 && f.entries.length > 0,
|
|
62
|
-
{ message: "feature requires either description or non-empty entries" }
|
|
63
|
-
)
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
export {
|
|
67
|
-
featureSchema
|
|
68
|
-
};
|
package/dist/chunk-N2JE7BWL.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
spellEntitySchema
|
|
3
|
-
} from "./chunk-Y4I74YEG.js";
|
|
4
|
-
|
|
5
|
-
// src/spell/spell.parser.ts
|
|
6
|
-
import { parseYaml, toStringSafe } from "@archivist-gg/core";
|
|
7
|
-
var KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
8
|
-
"name",
|
|
9
|
-
"level",
|
|
10
|
-
"school",
|
|
11
|
-
"casting_time",
|
|
12
|
-
"range",
|
|
13
|
-
"components",
|
|
14
|
-
"duration",
|
|
15
|
-
"concentration",
|
|
16
|
-
"ritual",
|
|
17
|
-
"classes",
|
|
18
|
-
"description",
|
|
19
|
-
"at_higher_levels",
|
|
20
|
-
"damage",
|
|
21
|
-
"saving_throw",
|
|
22
|
-
"casting_options",
|
|
23
|
-
// Body-only metadata that's emitted to YAML but ignored at runtime — accept silently.
|
|
24
|
-
"slug",
|
|
25
|
-
"edition",
|
|
26
|
-
"source"
|
|
27
|
-
]);
|
|
28
|
-
function parseSpell(source) {
|
|
29
|
-
const result = parseYaml(source, ["name"]);
|
|
30
|
-
if (!result.success) return result;
|
|
31
|
-
const meta = {};
|
|
32
|
-
if (typeof result.data.source === "string") meta.source = result.data.source;
|
|
33
|
-
if (typeof result.data.edition === "string") meta.edition = result.data.edition;
|
|
34
|
-
const filtered = {};
|
|
35
|
-
for (const [k, v] of Object.entries(result.data)) {
|
|
36
|
-
if (k === "slug" || k === "edition" || k === "source") continue;
|
|
37
|
-
if (!KNOWN_KEYS.has(k)) {
|
|
38
|
-
return { success: false, error: `Unknown spell field: ${k}` };
|
|
39
|
-
}
|
|
40
|
-
filtered[k] = v;
|
|
41
|
-
}
|
|
42
|
-
const parsed = spellEntitySchema.safeParse(filtered);
|
|
43
|
-
if (!parsed.success) {
|
|
44
|
-
return { success: false, error: `spell schema validation failed: ${parsed.error.message}` };
|
|
45
|
-
}
|
|
46
|
-
const raw = parsed.data;
|
|
47
|
-
const spell = { name: raw.name };
|
|
48
|
-
if (raw.level != null) spell.level = raw.level;
|
|
49
|
-
if (raw.school != null) spell.school = toStringSafe(raw.school);
|
|
50
|
-
if (raw.casting_time != null) spell.casting_time = toStringSafe(raw.casting_time);
|
|
51
|
-
if (raw.range != null) spell.range = toStringSafe(raw.range);
|
|
52
|
-
if (raw.components != null) spell.components = toStringSafe(raw.components);
|
|
53
|
-
if (raw.duration != null) spell.duration = toStringSafe(raw.duration);
|
|
54
|
-
if (raw.concentration != null) spell.concentration = Boolean(raw.concentration);
|
|
55
|
-
if (raw.ritual != null) spell.ritual = Boolean(raw.ritual);
|
|
56
|
-
if (raw.classes) spell.classes = raw.classes.map(String);
|
|
57
|
-
if (raw.description) spell.description = raw.description;
|
|
58
|
-
if (raw.at_higher_levels) spell.at_higher_levels = raw.at_higher_levels.map(String);
|
|
59
|
-
if (raw.damage) spell.damage = { types: raw.damage.types.map(String) };
|
|
60
|
-
if (raw.saving_throw) spell.saving_throw = { ability: raw.saving_throw.ability };
|
|
61
|
-
if (raw.casting_options) {
|
|
62
|
-
spell.casting_options = raw.casting_options.map((opt) => {
|
|
63
|
-
const co = { type: opt.type };
|
|
64
|
-
if (opt.damage_roll !== void 0) co.damage_roll = opt.damage_roll;
|
|
65
|
-
if (opt.target_count !== void 0) co.target_count = opt.target_count;
|
|
66
|
-
if (opt.duration !== void 0) co.duration = opt.duration;
|
|
67
|
-
if (opt.range !== void 0) co.range = opt.range;
|
|
68
|
-
if (opt.concentration !== void 0) co.concentration = opt.concentration;
|
|
69
|
-
if (opt.shape_size !== void 0) co.shape_size = opt.shape_size;
|
|
70
|
-
if (opt.desc !== void 0) co.desc = opt.desc;
|
|
71
|
-
return co;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
if (meta.source) spell.source = meta.source;
|
|
75
|
-
if (meta.edition) spell.edition = meta.edition;
|
|
76
|
-
return { success: true, data: spell };
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export {
|
|
80
|
-
parseSpell
|
|
81
|
-
};
|
package/dist/chunk-NXR3BD2V.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
// src/schemas/feature-effect-schema.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var featureEffectSchema = z.discriminatedUnion("kind", [
|
|
4
|
-
z.object({ kind: z.literal("initiative-bonus"), value: z.number().int() }),
|
|
5
|
-
z.object({ kind: z.literal("immune-condition"), condition: z.string().min(1), while: z.string().optional() }),
|
|
6
|
-
z.object({ kind: z.literal("resistance"), damage_type: z.string().min(1) }),
|
|
7
|
-
z.object({ kind: z.literal("hp-per-level-bonus"), value: z.number().int() }),
|
|
8
|
-
z.object({
|
|
9
|
-
kind: z.literal("speed-bonus"),
|
|
10
|
-
mode: z.enum(["walk", "fly", "swim", "climb", "burrow"]),
|
|
11
|
-
value: z.number().int(),
|
|
12
|
-
// when true, value is an absolute floor (Math.max), not additive; currently
|
|
13
|
-
// only surfaced for mode:"walk" — other modes have no derived speed yet.
|
|
14
|
-
set: z.boolean().optional()
|
|
15
|
-
}),
|
|
16
|
-
z.object({
|
|
17
|
-
kind: z.literal("sense"),
|
|
18
|
-
type: z.enum(["darkvision", "blindsight", "tremorsense", "truesight"]),
|
|
19
|
-
range: z.number().int().nonnegative()
|
|
20
|
-
}),
|
|
21
|
-
z.object({
|
|
22
|
-
kind: z.literal("apply-condition"),
|
|
23
|
-
condition: z.string().min(1),
|
|
24
|
-
duration: z.string().optional(),
|
|
25
|
-
ends_on: z.array(z.string()).optional(),
|
|
26
|
-
save_repeat: z.object({
|
|
27
|
-
ability: z.string().min(1),
|
|
28
|
-
timing: z.string().min(1)
|
|
29
|
-
}).optional()
|
|
30
|
-
}),
|
|
31
|
-
z.object({
|
|
32
|
-
kind: z.literal("damage-bonus"),
|
|
33
|
-
// intentionally an open string, NOT a damage-type enum: must accept the
|
|
34
|
-
// literal "chosen" (player-selected damage type at action time) alongside
|
|
35
|
-
// canonical damage types. Do not tighten to an enum.
|
|
36
|
-
damage_type: z.string().min(1),
|
|
37
|
-
amount: z.string().min(1),
|
|
38
|
-
applies_to: z.enum(["weapon", "spell", "all"]).optional(),
|
|
39
|
-
condition: z.string().optional()
|
|
40
|
-
}),
|
|
41
|
-
z.object({
|
|
42
|
-
kind: z.literal("proficiency"),
|
|
43
|
-
proficiency_type: z.enum(["skill", "tool", "language", "saving-throw", "armor", "weapon"]),
|
|
44
|
-
value: z.string().min(1)
|
|
45
|
-
}),
|
|
46
|
-
z.object({
|
|
47
|
-
kind: z.literal("ac-bonus"),
|
|
48
|
-
value: z.number().int(),
|
|
49
|
-
requires_armor: z.boolean().optional()
|
|
50
|
-
}),
|
|
51
|
-
z.object({
|
|
52
|
-
kind: z.literal("unarmored-ac"),
|
|
53
|
-
abilities: z.array(z.enum(["str", "dex", "con", "int", "wis", "cha"])),
|
|
54
|
-
base: z.number().int().optional(),
|
|
55
|
-
allow_shield: z.boolean().optional()
|
|
56
|
-
}),
|
|
57
|
-
z.object({
|
|
58
|
-
kind: z.literal("weapon-ability"),
|
|
59
|
-
ability: z.union([z.enum(["str", "dex", "con", "int", "wis", "cha"]), z.literal("spellcasting")]),
|
|
60
|
-
weapons: z.union([z.literal("chosen"), z.string(), z.array(z.string())]).optional()
|
|
61
|
-
}),
|
|
62
|
-
z.object({
|
|
63
|
-
kind: z.literal("roll-modifier"),
|
|
64
|
-
mode: z.enum(["advantage", "disadvantage"]),
|
|
65
|
-
roll: z.enum(["ability-check", "saving-throw", "attack"]),
|
|
66
|
-
scope: z.string().optional(),
|
|
67
|
-
condition: z.string().optional()
|
|
68
|
-
}),
|
|
69
|
-
z.object({ kind: z.literal("extra-attack"), count: z.number().int().positive() }),
|
|
70
|
-
z.object({
|
|
71
|
-
kind: z.literal("crit-range"),
|
|
72
|
-
min_roll: z.number().int().min(2).max(20),
|
|
73
|
-
applies_to: z.enum(["weapon", "spell", "all"]).optional(),
|
|
74
|
-
condition: z.string().optional()
|
|
75
|
-
}),
|
|
76
|
-
z.object({
|
|
77
|
-
kind: z.literal("reroll-damage"),
|
|
78
|
-
max_reroll: z.number().int().positive(),
|
|
79
|
-
applies_to: z.enum(["weapon", "spell", "all"]).optional(),
|
|
80
|
-
once_per_die: z.boolean().optional()
|
|
81
|
-
}),
|
|
82
|
-
z.object({
|
|
83
|
-
kind: z.literal("attack-rule"),
|
|
84
|
-
flag: z.enum(["no-ranged-in-melee-disadvantage"])
|
|
85
|
-
})
|
|
86
|
-
]);
|
|
87
|
-
|
|
88
|
-
export {
|
|
89
|
-
featureEffectSchema
|
|
90
|
-
};
|
package/dist/chunk-O5EYMKFH.js
DELETED
package/dist/chunk-Q5K6LWBZ.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
choiceSchema
|
|
3
|
-
} from "./chunk-NXSWH3AE.js";
|
|
4
|
-
import {
|
|
5
|
-
featureEffectSchema
|
|
6
|
-
} from "./chunk-NXR3BD2V.js";
|
|
7
|
-
|
|
8
|
-
// src/feat/feat.schema.ts
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
var abilityEnum = z.enum(["str", "dex", "con", "int", "wis", "cha"]);
|
|
11
|
-
var editionEnum = z.enum(["2014", "2024"]);
|
|
12
|
-
var categoryEnum = z.enum(["origin", "general", "fighting-style", "epic-boon"]);
|
|
13
|
-
var prerequisiteSchema = z.discriminatedUnion("kind", [
|
|
14
|
-
z.object({ kind: z.literal("ability"), ability: abilityEnum, min: z.number().int().positive() }),
|
|
15
|
-
z.object({ kind: z.literal("level"), min: z.number().int().positive() }),
|
|
16
|
-
z.object({ kind: z.literal("spellcaster") }),
|
|
17
|
-
z.object({
|
|
18
|
-
kind: z.literal("proficiency"),
|
|
19
|
-
proficiency_type: z.enum(["armor", "weapon", "tool", "skill", "saving-throw"]),
|
|
20
|
-
value: z.string().min(1)
|
|
21
|
-
}),
|
|
22
|
-
z.object({ kind: z.literal("race"), slug: z.string().min(1) }),
|
|
23
|
-
z.object({ kind: z.literal("class"), slug: z.string().min(1) })
|
|
24
|
-
]);
|
|
25
|
-
var featEntitySchema = z.object({
|
|
26
|
-
slug: z.string().min(1),
|
|
27
|
-
name: z.string().min(1),
|
|
28
|
-
edition: editionEnum,
|
|
29
|
-
source: z.string().min(1),
|
|
30
|
-
category: categoryEnum,
|
|
31
|
-
description: z.string(),
|
|
32
|
-
prerequisites: z.array(prerequisiteSchema),
|
|
33
|
-
benefits: z.array(z.string()),
|
|
34
|
-
effects: z.array(featureEffectSchema),
|
|
35
|
-
grants_asi: z.object({
|
|
36
|
-
amount: z.number().int().positive(),
|
|
37
|
-
pool: z.array(abilityEnum).optional()
|
|
38
|
-
}).nullable(),
|
|
39
|
-
repeatable: z.boolean(),
|
|
40
|
-
choices: z.array(choiceSchema)
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export {
|
|
44
|
-
featEntitySchema
|
|
45
|
-
};
|