PROCEDURAL EQUIPMENT — generation + equipped visuals
STATUS: spec v1 (design locked; implementation is a build task on starborne.html).
Goal: generate most gear from (template × material × gem) with stats from BALANCE.md and a **composed
procedural visual that renders when equipped / used** (in-hand on the hero, body tint, light pool, and an
inventory icon). Quest-unique & chest-unique pieces are hand-authored and skip this generator.
1. GENERATION MODEL buildEquip(template, material, gem, seed) → piece
sword · axe · hammer · spear · dagger · staff (handedness, reach, swing arc).light · medium · heavy · robe. · Light: lantern · lamp · torch. · Tool: pick · hoe · sickle.ring · amulet · charm.the palette (resource hex → 3 shades + metallic highlight), and feel mods (steel +stagger, leather
+speed/light, gold +arcane/+1 socket, silver +anti-Veil).
POWER = templateFactor × materialTierFactor × (1 + gemBonus); derive weaponPWR / armorDef /affix to land in the material's BALANCE band, with a small ±5% variance so drops "roll" (high-roll = the
Minecraft grind chase). Derive secondary stats (reach/speed/socket count) from template + material.
"{Material} {Template}[ of {GemAffix}]" → e.g. "Silver Spear of Frost (Sapphire)","Gold Amulet of Storm (Topaz)", "Black-Iron Hammer of the Veil (Black Diamond)".
2. EQUIPPED / USED VISUALS (must render in-game)
Compose from layers so any generated piece can be drawn:
(leather = matte; gold/silver = bright specular; black diamond = dark with violet sheen).
Emerald→green motes, Diamond→white flash, Black Diamond→violet blood-wisp (+the blood-bias HP tick).
On the hero: the equipped weapon draws in-hand over the procedural hero (per facing/pose); armor
tints the body layer with the material palette (light→robe drape, heavy→bulkier silhouette); light gear
sets the carried lantern's colour + safe-pool radius. Inventory icon = the same composer at icon scale.
3. IMPLEMENTATION NOTES (for the build pass — not this design phase)
EQUIP_TEMPLATES{}, MATERIALS{} (= RESOURCES palettes/bands), GEMS{} (affix+colour), buildEquip(t,m,g,seed) returning {id,name,slot,stats,affix, drawIcon(ctx,x,y,s), drawOnHero(ctx,hero,pose)}.
drawGideon/drawLyra) for in-hand + body tint.buildEquip to mint pieces; bosses can mint a high-roll. Keep procedural fallbacks; never break the build (comments end-of-line / / / only).
CROSS-REFS
RESOURCES.md (materials/gems) · CAVES.md (where mats come from) · BALANCE.md (POWER bands) · EQUIPMENT.md
(the fixed/uniques + tier ladder this generator fills out) · ITEMS.md (taxonomy).