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

@ -39,6 +39,7 @@ namespace RacesOfValheim
private string m_lastSkadiForm = "";
private GameObject m_currentFormInstance = null;
private GameObject m_fireAuraVFX = null;
private GameObject m_draughAuraVFX = null;
private float m_lastFlightLog = 0f;
private void Awake()
@ -77,6 +78,18 @@ namespace RacesOfValheim
{
UpdateAswidVisuals();
}
else if (race == DraughVisuals.RaceId)
{
// The smoke and flies a Draugh trails. DraughRace only ever dresses the player at
// the keyboard, so without this every other client saw an ordinary, unrotted one.
DraughVisuals.EnsureAura(m_player, true, ref m_draughAuraVFX);
}
else if (race == TrentaConfig.RaceId)
{
// Keeps the crown of branches on between equipment refreshes, the same way the
// Dvergar's hood is kept on below.
TrentaVisuals.ApplyCrown(m_player);
}
else if (race == "Trol")
{
// Managed externally in TrolPatches.cs
@ -255,6 +268,9 @@ namespace RacesOfValheim
if (m_currentFormInstance != null) Destroy(m_currentFormInstance);
EnsureFireAuraVFX(false);
DraughVisuals.EnsureAura(m_player, false, ref m_draughAuraVFX);
// Takes the crown off a Trenta who has died or changed race; a no-op for everyone else.
TrentaVisuals.ApplyCrown(m_player);
Animator anim = m_player.GetComponentInChildren<Animator>();
if (anim != null)