);
diff --git a/packages/domain/src/creature-types.ts b/packages/domain/src/creature-types.ts
index 548bf8e..59e4ace 100644
--- a/packages/domain/src/creature-types.ts
+++ b/packages/domain/src/creature-types.ts
@@ -86,6 +86,19 @@ export interface SpellReference {
readonly usesPerDay?: number;
}
+/** A carried equipment item on a PF2e creature (weapon, consumable, magic item, etc.). */
+export interface EquipmentItem {
+ readonly name: string;
+ readonly level: number;
+ readonly category?: string;
+ readonly traits?: readonly string[];
+ readonly description?: string;
+ /** For scrolls/wands: the embedded spell name. */
+ readonly spellName?: string;
+ /** For scrolls/wands: the embedded spell rank. */
+ readonly spellRank?: number;
+}
+
export interface DailySpells {
readonly uses: number;
readonly each: boolean;
@@ -201,6 +214,7 @@ export interface Pf2eCreature {
readonly abilitiesMid?: readonly TraitBlock[];
readonly abilitiesBot?: readonly TraitBlock[];
readonly spellcasting?: readonly SpellcastingBlock[];
+ readonly equipment?: readonly EquipmentItem[];
}
export type AnyCreature = Creature | Pf2eCreature;
diff --git a/packages/domain/src/index.ts b/packages/domain/src/index.ts
index bfd37a5..c455dc2 100644
--- a/packages/domain/src/index.ts
+++ b/packages/domain/src/index.ts
@@ -33,6 +33,7 @@ export {
type CreatureId,
creatureId,
type DailySpells,
+ type EquipmentItem,
type LegendaryBlock,
type Pf2eBestiaryIndex,
type Pf2eBestiaryIndexEntry,
diff --git a/specs/004-bestiary/spec.md b/specs/004-bestiary/spec.md
index cdd32f9..40106f8 100644
--- a/specs/004-bestiary/spec.md
+++ b/specs/004-bestiary/spec.md
@@ -108,10 +108,15 @@ As a DM running a PF2e encounter, I want to see the Recall Knowledge DC and asso
The Recall Knowledge line appears below the trait tags, showing the DC (calculated from the creature's level using the PF2e standard DC-by-level table, adjusted for rarity) and the skill determined by the creature's type trait. The line is omitted for creatures with no recognized type trait and never shown for D&D creatures.
+**US-D6 — View NPC Equipment and Consumables (P2)**
+As a DM running a PF2e encounter, I want to see a creature's carried equipment — magic weapons, potions, scrolls, wands, and other items — displayed on its stat block so I can use these tactical options in combat without consulting external tools.
+
+An "Equipment" section appears on the stat block listing each carried item with its name and relevant details (level, traits, activation description). Scrolls additionally show the embedded spell name and rank (e.g., "Scroll of Teleport (Rank 6)"). The section is omitted entirely for creatures that carry no equipment. Equipment data is extracted from the existing cached creature JSON — no additional fetch is required.
+
### Requirements
- **FR-016**: The system MUST display a stat block panel with full creature information when a creature is selected.
-- **FR-017**: For D&D creatures, the stat block MUST include: name, size, type, alignment, AC (with armor source if applicable), HP (average + formula), speed, ability scores with modifiers, saving throws, skills, damage vulnerabilities, damage resistances, damage immunities, condition immunities, senses, languages, challenge rating, proficiency bonus, passive perception, traits, actions, bonus actions, reactions, spellcasting, and legendary actions. For PF2e creatures, the stat block MUST include: name, level, traits (as tags), Perception and senses, languages, skills, ability modifiers (Str/Dex/Con/Int/Wis/Cha as modifiers, not scores), items, AC, saving throws (Fort/Ref/Will), HP (with optional immunities/resistances/weaknesses), speed, attacks, top abilities, mid abilities (reactions/auras), bot abilities (active), and spellcasting.
+- **FR-017**: For D&D creatures, the stat block MUST include: name, size, type, alignment, AC (with armor source if applicable), HP (average + formula), speed, ability scores with modifiers, saving throws, skills, damage vulnerabilities, damage resistances, damage immunities, condition immunities, senses, languages, challenge rating, proficiency bonus, passive perception, traits, actions, bonus actions, reactions, spellcasting, and legendary actions. For PF2e creatures, the stat block MUST include: name, level, traits (as tags), Perception and senses, languages, skills, ability modifiers (Str/Dex/Con/Int/Wis/Cha as modifiers, not scores), items, AC, saving throws (Fort/Ref/Will), HP (with optional immunities/resistances/weaknesses), speed, attacks, top abilities, mid abilities (reactions/auras), bot abilities (active), spellcasting, and equipment (weapons, consumables, and other carried items).
- **FR-018**: Optional stat block sections (traits, legendary actions, bonus actions, reactions, etc.) MUST be omitted entirely when the creature has none.
- **FR-019**: The system MUST strip bestiary markup tags (spell references, dice notation, attack tags) and render them as plain readable text (e.g., `{@spell fireball|XPHB}` -> "fireball", `{@dice 3d6}` -> "3d6").
- **FR-020**: On wide viewports (desktop), the layout MUST be side-by-side with the encounter tracker on the left and stat block on the right.
@@ -157,6 +162,11 @@ The Recall Knowledge line appears below the trait tags, showing the DC (calculat
19. **Given** a PF2e creature with rare rarity is displayed, **When** the DM views the stat block, **Then** the Recall Knowledge DC is the standard DC for its level +5.
20. **Given** a PF2e creature with the "Undead" type trait is displayed, **When** the DM views the stat block, **Then** the Recall Knowledge line shows "Religion" as the associated skill.
21. **Given** a D&D creature is displayed, **When** the DM views the stat block, **Then** no Recall Knowledge line is shown.
+22. **Given** a PF2e creature carrying a Staff of Fire and an Invisibility Potion is displayed, **When** the DM views the stat block, **Then** an "Equipment" section appears listing both items with their names and relevant details.
+23. **Given** a PF2e creature carrying a Scroll of Teleport Rank 6 is displayed, **When** the DM views the stat block, **Then** the Equipment section shows the scroll with the embedded spell name and rank (e.g., "Scroll of Teleport (Rank 6)").
+24. **Given** a PF2e creature with no equipment items is displayed, **When** the DM views the stat block, **Then** no Equipment section is shown.
+25. **Given** a PF2e creature with equipment is displayed, **When** the DM views the stat block, **Then** equipment item descriptions have HTML tags stripped and render as plain readable text.
+26. **Given** a D&D creature is displayed, **When** the DM views the stat block, **Then** no Equipment section is shown (equipment display is PF2e-only).
### Edge Cases
@@ -164,6 +174,8 @@ The Recall Knowledge line appears below the trait tags, showing the DC (calculat
- Very long content (e.g., a Lich with extensive spellcasting): the stat block panel scrolls independently of the encounter tracker.
- Viewport resized from wide to narrow while stat block is open: the layout transitions from panel to drawer.
- Embedded spell item missing description text: the popover/sheet shows the available metadata (level, traits, range, etc.) and a placeholder note for the missing description.
+- Scroll item with missing or empty `system.spell` data: the scroll is displayed by name only, without spell name or rank.
+- Equipment item with empty description: the item is displayed with its name and metadata (level, traits) but no description text.
- Cached source data from before the spell description feature was added: existing cached entries lack the new per-spell data fields. The IndexedDB schema version MUST be bumped to invalidate old caches and trigger re-fetch (re-normalization from raw Foundry data is not possible because the original raw JSON is not retained).
- Creature with no recognized type trait (e.g., a creature whose only traits are not in the type-to-skill mapping): the Recall Knowledge line is omitted entirely.
- Creature with a type trait that maps to multiple skills (e.g., Beast → Arcana/Nature): both skills are shown.
@@ -233,6 +245,11 @@ A DM wants to see which sources are cached, find a specific source, clear a spec
- **FR-087**: The Recall Knowledge skill MUST be derived from the creature's type trait using the standard PF2e mapping (e.g., Aberration → Occultism, Animal → Nature, Astral → Occultism, Beast → Arcana/Nature, Celestial → Religion, Construct → Arcana/Crafting, Dragon → Arcana, Dream → Occultism, Elemental → Arcana/Nature, Ethereal → Occultism, Fey → Nature, Fiend → Religion, Fungus → Nature, Giant → Society, Humanoid → Society, Monitor → Religion, Ooze → Occultism, Plant → Nature, Undead → Religion).
- **FR-088**: Creatures with no recognized type trait MUST omit the Recall Knowledge line entirely rather than showing incorrect data.
- **FR-089**: The Recall Knowledge line MUST NOT be shown for D&D creatures.
+- **FR-090**: The PF2e normalization pipeline MUST extract `weapon` and `consumable` item types from the Foundry VTT `items[]` array, in addition to the existing `melee`, `action`, `spell`, and `spellcastingEntry` types. Each extracted equipment item MUST include name, level, traits, and description text.
+- **FR-091**: PF2e stat blocks MUST display an "Equipment" section listing all extracted equipment items. Each item MUST show its name and relevant details (e.g., level, traits, activation description).
+- **FR-092**: For scroll items, the stat block MUST display the embedded spell name and rank derived from the `system.spell` data on the item (e.g., "Scroll of Teleport (Rank 6)").
+- **FR-093**: The Equipment section MUST be omitted entirely when the creature has no equipment items, consistent with FR-018 (optional sections omitted when empty).
+- **FR-094**: Equipment item descriptions MUST be processed through the existing Foundry tag-stripping utility before display, consistent with FR-068 and FR-081.
### Acceptance Scenarios
@@ -334,7 +351,7 @@ As a DM with a creature pinned, I want to collapse the right (browse) panel inde
- **Search Index (D&D)** (`BestiaryIndex`): Pre-shipped lightweight dataset keyed by name + source, containing mechanical facts (name, source code, AC, HP average, DEX score, CR, initiative proficiency multiplier, size, type) for all creatures. Sufficient for adding combatants; insufficient for rendering a full stat block.
- **Search Index (PF2e)** (`Pf2eBestiaryIndex`): Pre-shipped lightweight dataset for PF2e creatures, containing name, source code, AC, HP, level, Perception modifier, size, and creature type. Parallel to the D&D search index but with PF2e-specific fields (level instead of CR, Perception instead of DEX/proficiency).
- **Source** (`BestiarySource`): A D&D or PF2e publication identified by a code (e.g., "XMM") with a display name (e.g., "Monster Manual (2025)"). Caching and fetching operate at the source level.
-- **Creature (Full)** (`Creature`): A complete creature record with all stat block data (traits, actions, legendary actions, spellcasting, etc.), available only after source data is fetched/uploaded and cached. Identified by a branded `CreatureId`. For PF2e creatures, each spell entry inside `spellcasting` carries full per-spell data (slug, level, traits, range, action cost, target/area, duration, defense, description, heightening) extracted from the embedded `items[type=spell]` data on the source NPC, enabling inline spell description display without additional fetches.
+- **Creature (Full)** (`Creature`): A complete creature record with all stat block data (traits, actions, legendary actions, spellcasting, etc.), available only after source data is fetched/uploaded and cached. Identified by a branded `CreatureId`. For PF2e creatures, each spell entry inside `spellcasting` carries full per-spell data (slug, level, traits, range, action cost, target/area, duration, defense, description, heightening) extracted from the embedded `items[type=spell]` data on the source NPC, enabling inline spell description display without additional fetches. PF2e creatures also carry an `equipment` list of carried items (weapons, consumables) extracted from `items[type=weapon]` and `items[type=consumable]` entries, each with name, level, traits, description, and (for scrolls) embedded spell data.
- **Cached Source Data**: The full normalized bestiary data for a single source, stored in IndexedDB. Contains complete creature stat blocks.
- **Combatant** (extended): Gains an optional `creatureId` reference to a `Creature`, enabling stat block lookup and stat pre-fill on creation.
- **Queued Creature**: Transient UI-only state representing a bestiary creature selected for batch-add, containing the creature reference and a count (1+). Not persisted.