feat(trenta): grow a crown of branches, and fix(draugh): let everyone see the rot

Trenta: a greydwarf shaman trophy is hung on the player head bone and sunk into
the skull until only the horns and branches clear it - the Furling wears a goblin
head the same way, aimed at the opposite result. A trophy is a plain static mesh,
so unlike the Dvergar hood there is no rig to collapse: the player own head does
all the hiding, which makes the three offsets in TrentaConfig the entire look.
They are a first pass and want eyeballing in game.

Draugh: the smoke and the cloud of flies only ever existed on the client of the
player wearing them. DraughRace is a single MonoBehaviour that looks at
Player.m_localPlayer and nothing else, so in multiplayer every other player saw
an ordinary, unrotted Viking. The build moved to DraughVisuals, which takes a
Player, and RacesVisualController now grows the same aura on every remote Draugh
it can see. Nothing is networked and nothing needs to be - each client reads the
race off the ZDO and makes its own particles.

Both hang off VisEquipment.UpdateVisuals or the visual controller, the two hooks
that already run for remote players, so neither had to invent a sync path.
This commit is contained in:
kanym 2026-08-05 13:40:09 +02:00
commit 67e445014f
7 changed files with 345 additions and 70 deletions

View file

@ -52,6 +52,27 @@ namespace RacesOfValheim
public static readonly Color HairColor = new Color(0.06f, 0.28f, 0.08f, 1f);
// ─── Crown of branches ───────────────────────────────────────────────
// A greydwarf shaman wears a crown of horns and dead wood, and it is the one piece of
// vanilla art that says "this one grew rather than was born". The whole trophy is hung on
// the player's head bone and then sunk into the skull until only the branches clear it -
// the same trick the Furling uses to wear a goblin head, aimed at a different result.
public const string CrownTrophyPrefabName = "TrophyGreydwarfShaman";
// Bone the crown is hung from on the player's own rig.
public const string PlayerHeadBoneName = "Head";
// These three are the ones to eyeball in game; everything else about the crown is fixed.
// Valheim's player rig is authored at roughly 100x, which is why bone-local numbers are
// this small - the Furling's goblin head sits at 0.0058 for comparison.
//
// Y is up in the head bone's frame, so lowering it sinks the trophy deeper and shows less
// of the crown. Too high and a shrunken greydwarf face floats out of the player's own; too
// low and the branches disappear into the scalp.
public static readonly Vector3 CrownOffsetPosition = new Vector3(0.0005f, 0.0008f, 0f);
public static readonly Vector3 CrownOffsetRotation = new Vector3(-90f, 0f, 90f);
public static readonly float CrownScale = 0.0070f;
// ─── Progression tables ──────────────────────────────────────────────
// Indexed by progression state; index 0 is unused so the state number indexes directly.
// 1 Base, 2 Eikthyr, 3 The Elder, 4 Bonemass, 5 Moder, 6 Yagluth, 7 The Queen, 8 Fader.