@archivist-gg/dnd5e 0.1.0 → 0.1.1
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/dist/{chunk-QQ5W2AZP.js → chunk-ADLTSHOR.js} +63 -12
- package/dist/{chunk-XURS6Q6Q.js → chunk-GEJSJP6E.js} +19 -5
- package/dist/{chunk-537BHVSH.js → chunk-TPZSPU4L.js} +1 -1
- package/dist/{chunk-4C2KOKLF.js → chunk-VLKIB33F.js} +6 -0
- package/dist/{chunk-4SSDYJS2.js → chunk-YDPWD2T7.js} +2 -1
- package/dist/index.js +304 -46
- package/dist/item/item.codec.js +3 -3
- package/dist/item/item.parser.js +2 -2
- package/dist/item/item.schema.d.ts +10 -0
- package/dist/item/item.schema.js +1 -1
- package/dist/item/item.types.d.ts +9 -0
- package/dist/pc/pc.equipment.d.ts +2 -1
- package/dist/pc/pc.equipment.js +5 -1
- package/dist/pc/pc.feature-effects.d.ts +31 -9
- package/dist/pc/pc.feature-effects.js +4 -1
- package/dist/pc/pc.recalc.js +63 -55
- package/dist/pc/pc.resolver.d.ts +12 -0
- package/dist/pc/pc.resolver.js +111 -22
- package/dist/pc/pc.types.d.ts +48 -1
- package/dist/weapon/weapon-mastery.d.ts +9 -0
- package/package.json +1 -1
package/dist/pc/pc.types.d.ts
CHANGED
|
@@ -246,6 +246,19 @@ export type FeatureSource = {
|
|
|
246
246
|
export interface ResolvedFeature {
|
|
247
247
|
feature: Feature;
|
|
248
248
|
source: FeatureSource;
|
|
249
|
+
/** #3: chosen select-inline option prose, folded onto the PARENT feature for
|
|
250
|
+
* render (a shallow-copy wrapper field — the shared registry entity is never
|
|
251
|
+
* mutated). One entry per select-inline choice with a recorded pick. */
|
|
252
|
+
chosenInline?: {
|
|
253
|
+
label: string;
|
|
254
|
+
description?: string;
|
|
255
|
+
}[];
|
|
256
|
+
/** #3: marks a synthesized chosen-option feature the renderer must SKIP (its
|
|
257
|
+
* prose shows on the parent via chosenInline). A wrapper-only flag —
|
|
258
|
+
* computeFeatureEffects ignores it, so the synthetic's effects still fold. */
|
|
259
|
+
renderSuppressed?: boolean;
|
|
260
|
+
/** The feat's entire substance is a full ability-score improvement (a pure ASI). The DISPLAY layer hides these. */
|
|
261
|
+
buildOnly?: boolean;
|
|
249
262
|
}
|
|
250
263
|
export interface ResolvedSpell {
|
|
251
264
|
entity: Spell;
|
|
@@ -290,6 +303,11 @@ export interface ResolvedCharacter {
|
|
|
290
303
|
features: ResolvedFeature[];
|
|
291
304
|
spells: ResolvedSpell[];
|
|
292
305
|
pools: ResolvedPool[];
|
|
306
|
+
/** 2024 Weapon Mastery: bare-normalized slugs of the weapons the character has
|
|
307
|
+
* chosen mastery of, unioned across every class/level `weapon-mastery` pick
|
|
308
|
+
* (e.g. "srd-2024_greatsword" → "greatsword"). Empty when the character has no
|
|
309
|
+
* such pick. Populated by the resolver's collectChosenWeaponMasteries pass. */
|
|
310
|
+
weaponMasteries: string[];
|
|
293
311
|
state: CharacterState;
|
|
294
312
|
}
|
|
295
313
|
export interface ProficiencySet {
|
|
@@ -301,6 +319,16 @@ export interface ACTerm {
|
|
|
301
319
|
amount: number;
|
|
302
320
|
kind: "armor" | "shield" | "item" | "unarmored" | "override" | "dex" | "ability" | "feature";
|
|
303
321
|
}
|
|
322
|
+
/** An additive on-hit damage rider (dice or flat) applied to an attack, from a
|
|
323
|
+
* feature (global — all weapon attacks) or a magic item (that weapon only).
|
|
324
|
+
* `amount` is a dice/flat string ("2d6", "1d8", "2"); `damage_type` optional
|
|
325
|
+
* (a bare manual override string carries its type inline); `source` is a human
|
|
326
|
+
* label for the expand/tooltip. Rendered as its own damage chip on the row. */
|
|
327
|
+
export interface DamageRider {
|
|
328
|
+
amount: string;
|
|
329
|
+
damage_type?: string;
|
|
330
|
+
source?: string;
|
|
331
|
+
}
|
|
304
332
|
export interface AttackRow {
|
|
305
333
|
id: string;
|
|
306
334
|
name: string;
|
|
@@ -308,7 +336,10 @@ export interface AttackRow {
|
|
|
308
336
|
toHit: number;
|
|
309
337
|
damageDice: string;
|
|
310
338
|
damageType: string;
|
|
311
|
-
|
|
339
|
+
/** Accumulated additive on-hit damage riders (feature-global + item-local +
|
|
340
|
+
* the migrated manual override), rendered as extra damage chips. Absent when
|
|
341
|
+
* none apply (so untouched rows are unchanged). */
|
|
342
|
+
damageRiders?: DamageRider[];
|
|
312
343
|
properties: string[];
|
|
313
344
|
proficient: boolean;
|
|
314
345
|
breakdown: {
|
|
@@ -343,6 +374,22 @@ export interface AttackRow {
|
|
|
343
374
|
* untouched attack rows are unchanged. The weapons table renders these joined
|
|
344
375
|
* with " · " as a muted caption under the weapon name. */
|
|
345
376
|
attackNotes?: string[];
|
|
377
|
+
/** 2024 Weapon Mastery for this attack, present only when the character has
|
|
378
|
+
* chosen mastery of this weapon AND is proficient with it AND the weapon
|
|
379
|
+
* declares a mastery property. `slug`/`label`/`description` come from the
|
|
380
|
+
* mastery glossary; `derived` carries the computed number for the two
|
|
381
|
+
* numeric masteries (topple → Save DC, graze → On-miss damage) and is absent
|
|
382
|
+
* for the rest. Additive + display-only — absent (undefined) on untouched
|
|
383
|
+
* rows so nothing else changes. */
|
|
384
|
+
mastery?: {
|
|
385
|
+
slug: string;
|
|
386
|
+
label: string;
|
|
387
|
+
description: string;
|
|
388
|
+
derived?: {
|
|
389
|
+
label: string;
|
|
390
|
+
value: number;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
346
393
|
}
|
|
347
394
|
export interface AppliedBonuses {
|
|
348
395
|
ability_bonuses: Partial<Record<Ability, number>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const MASTERY: Record<string, {
|
|
2
|
+
label: string;
|
|
3
|
+
description: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare function masteryLabel(slug: string): string | undefined;
|
|
6
|
+
export declare function masteryDerived(slug: string, abilityMod: number, proficiencyBonus: number): {
|
|
7
|
+
label: string;
|
|
8
|
+
value: number;
|
|
9
|
+
} | undefined;
|