@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.
@@ -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
- extraDamage?: string;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archivist-gg/dnd5e",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "publishConfig": {