D&D: wire the Open5e magic-item registry into live gameplay

Magic items now reach players through three surfaces: zone loot drops,
Luigi's "Curios" shelf, and combat effects. Effects are formulaic
(Rarity scalar x Kind), mirroring the bestiary tuning pass, with an
empty magicItemEffectOverlay as the hand-authored refinement path.

- magic_items_gameplay.go: rarity index, magic_item_equipped persistence
  (new table, DnDSlot-keyed), codified effect formula, applyMagicItemEffects
  combat hook, potion/scroll -> ConsumableDef bridge, !adventure equip-magic
- dropZoneLoot: 15% magic-item substitution roll by tier rarity
- Luigi's Curios category: daily UTC-seeded 8-item rotation
- combat_bridge / combat_session_build: applyMagicItemEffects after passives
- consumableDefByName falls through so loot/shop potions auto-resolve
- renderDnDSheet: new Magic Items section

Equippable items live entirely in the DnDSlot scheme, separate from the
legacy tier-gear. Attunement items equip inert until attuned (3-slot cap).
This commit is contained in:
prosolis
2026-05-14 18:38:57 -07:00
parent 297ce3d786
commit 0d666beea3
12 changed files with 996 additions and 10 deletions

View File

@@ -311,7 +311,7 @@ func TestSheet_ShowsSubclassWhenChosen(t *testing.T) {
STR: 16, DEX: 12, CON: 14, INT: 8, WIS: 10, CHA: 10,
Subclass: SubclassBattleMaster,
}
out := renderDnDSheet(c, nil, nil, HouseState{}, nil, nil)
out := renderDnDSheet(c, nil, nil, HouseState{}, nil, nil, nil)
if !strings.Contains(out, "Battle Master") {
t.Errorf("sheet missing subclass name:\n%s", out)
}
@@ -323,7 +323,7 @@ func TestSheet_PromptsWhenUnchosenAtL5(t *testing.T) {
Level: 5, HPMax: 40, HPCurrent: 40, ArmorClass: 16,
STR: 16, DEX: 12, CON: 14, INT: 8, WIS: 10, CHA: 10,
}
out := renderDnDSheet(c, nil, nil, HouseState{}, nil, nil)
out := renderDnDSheet(c, nil, nil, HouseState{}, nil, nil, nil)
if !strings.Contains(out, "!subclass") {
t.Errorf("sheet should nudge `!subclass` when unchosen at L5:\n%s", out)
}