From eba537fa0739d1cd7429b7ca56d33a1f5a519ba0 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 19:18:53 +0200 Subject: [PATCH 1/9] fix(food): race foods replace a worn-down meal when the stomach is full Trenta seeds, Draugh raw flesh and Aswid meals each go through an EatFood prefix that, with three slots full and none holding the same food, answered false. Vanilla would replace the most depleted meal past half its time. The UseItem callers also never showed why: EatFood says nothing on a refusal, so the click did nothing at all. That is the Reddit report of a Trenta who could not eat any seeds. The prefixes now hand that case to native EatFood, the Aswid's CanConsumeItem postfix keeps vanilla's answer instead of forcing false, and the Trenta and Draugh callers ask CanEat(item, true) for vanilla's own message when a meal is refused. --- JotunnModStub/Aswid/AswidPatches.cs | 19 ++++++++----------- JotunnModStub/Draugh/DraughFoodPatches.cs | 12 +++++++++--- JotunnModStub/Trenta/TrentaFoodPatches.cs | 13 +++++++++++-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/JotunnModStub/Aswid/AswidPatches.cs b/JotunnModStub/Aswid/AswidPatches.cs index 6931d80..6e1609e 100644 --- a/JotunnModStub/Aswid/AswidPatches.cs +++ b/JotunnModStub/Aswid/AswidPatches.cs @@ -341,14 +341,11 @@ namespace RacesOfValheim } } - if (canRefresh) - { - __result = true; - } - else - { - __result = false; // Nessuno spazio disponibile, cibo si disintegra - } + // Otherwise vanilla's answer stands: it already allows replacing the + // most depleted meal past half its time, and already showed its "too + // full" message when it refused. Forcing false here used to block + // that replacement, silently. + if (canRefresh) __result = true; } } else @@ -426,9 +423,9 @@ namespace RacesOfValheim return false; } - // Se pieno e senza 4° slot disponibile, fallisce e disintegra - __result = false; - return false; + // Full, no fourth slot free, no slot holding this meal. Native EatFood + // replaces the most depleted meal past half its time, or refuses. + return true; } else { diff --git a/JotunnModStub/Draugh/DraughFoodPatches.cs b/JotunnModStub/Draugh/DraughFoodPatches.cs index f4a9ce2..ea56d5c 100644 --- a/JotunnModStub/Draugh/DraughFoodPatches.cs +++ b/JotunnModStub/Draugh/DraughFoodPatches.cs @@ -90,6 +90,11 @@ namespace RacesOfValheim var zanim = Traverse.Create(player).Field("m_zanim").GetValue(); if (zanim != null) zanim.SetTrigger("eat"); } + else + { + // Vanilla's refusal message, which EatFood never shows by itself + player.CanEat(customItemDrop.m_itemData, true); + } return false; // Skip native UseItem } } @@ -154,9 +159,10 @@ namespace RacesOfValheim return false; // Skip native EatFood } - // Inventory full - __result = false; - return false; + // Full, and no slot holds this flesh. Native EatFood replaces the most + // depleted meal past half its time, or refuses - vanilla's own rule. This + // used to refuse outright, with no message. + return true; } else { diff --git a/JotunnModStub/Trenta/TrentaFoodPatches.cs b/JotunnModStub/Trenta/TrentaFoodPatches.cs index bc17d19..43bd5c5 100644 --- a/JotunnModStub/Trenta/TrentaFoodPatches.cs +++ b/JotunnModStub/Trenta/TrentaFoodPatches.cs @@ -71,6 +71,12 @@ namespace RacesOfValheim var zanim = Traverse.Create(player).Field("m_zanim").GetValue(); if (zanim != null) zanim.SetTrigger("eat"); } + else + { + // Vanilla's "can't eat more" / "too full" message, from vanilla's own + // check. EatFood itself never says why it refused. + player.CanEat(customDrop.m_itemData, true); + } return false; // Skip native UseItem either way } @@ -172,8 +178,11 @@ namespace RacesOfValheim } } - __result = false; // Full, and nothing in it worth topping up: the seed stays. - return false; + // Full, and no slot holds this seed. Native EatFood takes it from here with + // vanilla's own rule: it replaces the most depleted meal past half its time, + // or refuses. This used to refuse outright, so a Trenta with three meals going + // could not eat a seed at all, and saw no message saying why. + return true; } // Temporarily hide any existing slot with the same name to force native EatFood From f1597dd6462a7049753643929b769dbba13eca04 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 19:22:31 +0200 Subject: [PATCH 2/9] fix(hud): the stamina bar comes back after leaving the Aswid or the Draugh Both races hide the stamina bar root from a Hud.UpdateStamina prefix. Vanilla activates that root once, when the HUD is built, so after a race change the bar stayed hidden until relog. The prefix now switches it back on for every other race. --- JotunnModStub/Aswid/AswidPatches.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JotunnModStub/Aswid/AswidPatches.cs b/JotunnModStub/Aswid/AswidPatches.cs index 6931d80..58ea170 100644 --- a/JotunnModStub/Aswid/AswidPatches.cs +++ b/JotunnModStub/Aswid/AswidPatches.cs @@ -508,6 +508,14 @@ namespace RacesOfValheim } return false; } + + // Vanilla switches the bar on once, when the HUD is built, and never again. Without + // this a player who left the Aswid or the Draugh had no stamina bar until relog. + if (player == Player.m_localPlayer && __instance.m_staminaBar2Root != null + && !__instance.m_staminaBar2Root.gameObject.activeSelf) + { + __instance.m_staminaBar2Root.gameObject.SetActive(true); + } return true; } } From d1f328a496c5e84b968df63d755114149fdc2027 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 19:33:00 +0200 Subject: [PATCH 3/9] feat(fenrir): eyes glow at night, bright when a form is ready A community suggestion: an indicator on the character instead of the "
is Ready!" text. FenrirVisuals borrows the Skeleton's eye_l and eye_r the way AswidVisuals does, with the Aswid's playtested placement, and tints them with the Fenring's own emission colour (2.0, 0.372, 0), read from bundle c4210710. Dark by day and in a beast form. At night they glow faintly, and brightly while one of the three keys would transform. That uses the same gates as TryTransformWithRules: tier, night, sun sickness, cooldown. The owner writes it to the ZDO only on a change, so remote players see the same. New local section "Fenrir - Appearance": Ready Message (on by default), Eye Glow, and the night and ready strengths. --- JotunnModStub/ConfigSync.cs | 1 + JotunnModStub/Fenrir/FenrirConfig.cs | 17 ++ JotunnModStub/Fenrir/FenrirRace.cs | 29 +++ JotunnModStub/Fenrir/FenrirStatusEffects.cs | 2 +- JotunnModStub/Fenrir/FenrirVisuals.cs | 256 ++++++++++++++++++++ 5 files changed, 304 insertions(+), 1 deletion(-) create mode 100644 JotunnModStub/Fenrir/FenrirVisuals.cs diff --git a/JotunnModStub/ConfigSync.cs b/JotunnModStub/ConfigSync.cs index f743b4c..0281af6 100644 --- a/JotunnModStub/ConfigSync.cs +++ b/JotunnModStub/ConfigSync.cs @@ -28,6 +28,7 @@ namespace RacesOfValheim { "Aswid - Claws", "Aswid - Eyes", + "Fenrir - Appearance", "Skeleton - Visuals", "Sverm - Dorsal Spines", "Sverm - Emberform", diff --git a/JotunnModStub/Fenrir/FenrirConfig.cs b/JotunnModStub/Fenrir/FenrirConfig.cs index 74795e5..68e9a97 100644 --- a/JotunnModStub/Fenrir/FenrirConfig.cs +++ b/JotunnModStub/Fenrir/FenrirConfig.cs @@ -85,6 +85,12 @@ namespace RacesOfValheim // ─── Debug ───────────────────────────────────────────────────────────── public static ConfigEntry DebugFormHits; + // ─── Appearance (per player, never synced) ────────────────────────────── + public static ConfigEntry ReadyMessage; + public static ConfigEntry EyeGlow; + public static ConfigEntry EyeNightStrength; + public static ConfigEntry EyeReadyStrength; + public static void Bind(ConfigFile config) { const string keybinds = "Fenrir - Keybinds"; @@ -188,6 +194,17 @@ namespace RacesOfValheim UlvPushForce = config.Bind(ulv, "Push Force", 25f, new ConfigDescription("Knockback applied on a hit.", new AcceptableValueRange(0f, 100f))); + // The whole section stays local - see ConfigSync.LocalSections. + const string appearance = "Fenrir - Appearance"; + ReadyMessage = config.Bind(appearance, "Ready Message", true, + new ConfigDescription("Shows \" is Ready!\" when a form's cooldown ends. The eyes say the same thing; turn this off if they are enough.")); + EyeGlow = config.Bind(appearance, "Eye Glow", true, + new ConfigDescription("Fenrir eyes glow at night in the Fenring's own orange: faint while no form can be taken, bright when one can. Off hides them on every Fenrir you see.")); + EyeNightStrength = config.Bind(appearance, "Eye Night Strength", 0.35f, + new ConfigDescription("Glow at night while no form is ready.", new AcceptableValueRange(0f, 3f))); + EyeReadyStrength = config.Bind(appearance, "Eye Ready Strength", 1.2f, + new ConfigDescription("Glow at night while a form is ready.", new AcceptableValueRange(0f, 3f))); + // "debug" in the key keeps it local - see ConfigSync. DebugFormHits = config.Bind("Fenrir - Debug", "Debug: Log Form Hits", false, new ConfigDescription("Writes one log line per claw or bite: what was in reach, what it hit, and why anything was skipped. For bug reports about attacks that do no damage.")); diff --git a/JotunnModStub/Fenrir/FenrirRace.cs b/JotunnModStub/Fenrir/FenrirRace.cs index 655cb86..9feeb51 100644 --- a/JotunnModStub/Fenrir/FenrirRace.cs +++ b/JotunnModStub/Fenrir/FenrirRace.cs @@ -150,6 +150,8 @@ namespace RacesOfValheim { } wasNight = isNight; + FenrirVisuals.SetReady(Player.m_localPlayer, CanTakeAnyForm()); + if (isTransformed) { bool hasAnyForm = Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_FenrirForm".GetStableHashCode()) || @@ -171,6 +173,33 @@ namespace RacesOfValheim { if (FenrirConfig.CultistFormKey.Value.IsDownIgnoringHeldKeys()) { TryTransformWithRules(FenrirProgression.GetJKeyRules(state)); return; } } + /// + /// Whether one of the three keys would transform right now. The same gates as + /// TryTransformWithRules below, without its messages: this feeds the eye glow. + /// + private bool CanTakeAnyForm() + { + if (isTransformed) return false; + + int state = BossProgressionManager.GetCurrentProgressionState(); + return CanTake(FenrirProgression.GetGKeyRules(state)) + || CanTake(FenrirProgression.GetHKeyRules(state)) + || CanTake(FenrirProgression.GetJKeyRules(state)); + } + + private bool CanTake(FenrirProgression.FormRules rules) + { + if (rules == null || rules.Form == FenrirProgression.FormType.None) return false; + if (rules.NeedsNight && (sunSicknessTimer > 0f || !EnvMan.IsNight())) return false; + + if (rules.CooldownMinutes > 0) + { + string cdName = rules.Form == FenrirProgression.FormType.Cultist ? "SE_CultistCooldown" : "SE_FenrirCooldown"; + if (Player.m_localPlayer.GetSEMan().HaveStatusEffect(cdName.GetStableHashCode())) return false; + } + return true; + } + private void TryTransformWithRules(FenrirProgression.FormRules rules) { if (rules == null || rules.Form == FenrirProgression.FormType.None) return; diff --git a/JotunnModStub/Fenrir/FenrirStatusEffects.cs b/JotunnModStub/Fenrir/FenrirStatusEffects.cs index 43de139..f08ae33 100644 --- a/JotunnModStub/Fenrir/FenrirStatusEffects.cs +++ b/JotunnModStub/Fenrir/FenrirStatusEffects.cs @@ -15,7 +15,7 @@ namespace RacesOfValheim public override void Stop() { base.Stop(); - if (Player.m_localPlayer != null) + if (Player.m_localPlayer != null && FenrirConfig.ReadyMessage.Value) { Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_ready", m_name)); } diff --git a/JotunnModStub/Fenrir/FenrirVisuals.cs b/JotunnModStub/Fenrir/FenrirVisuals.cs new file mode 100644 index 0000000..7b901c0 --- /dev/null +++ b/JotunnModStub/Fenrir/FenrirVisuals.cs @@ -0,0 +1,256 @@ +using System.Collections.Generic; +using HarmonyLib; +using Jotunn.Managers; +using UnityEngine; + +namespace RacesOfValheim +{ + /// + /// The Fenrir's eyes catch the light at night, the way a wolf's do: a faint glow while no form + /// can be taken, a bright one when a key would transform right now. Dark by day and while in a + /// beast form, whose own eyes take over. A community suggestion (lexsonn), meant to say what + /// the "Ready!" text says without the text. + /// + /// Built the way AswidVisuals builds the Aswid's eyes, which is where the long story lives: the + /// vanilla Skeleton's eye_l/eye_r borrowed for mesh and material, placed on the head bone the + /// body mesh is skinned to, sized from the source's world scale. The placement numbers are the + /// Aswid's playtested defaults, fixed here rather than exposed again. + /// + /// The colour is the Fenring's own: its body material's _EmissionColor, (2.0, 0.372, 0.0) in + /// bundle c4210710, read offline with UnityPy rather than picked by eye. + /// + /// Runs for remote players too. Night is the same for everyone; whether a form is ready is + /// only known to the owner, who writes it to the ZDO (SetReady) for everyone else to read. + /// + public static class FenrirVisuals + { + public const string RaceId = "Fenrir"; + public const string ReadyKey = "RacesOfValheim_FenrirReady"; + private const string FormKey = "RacesOfValheim_FenrirForm"; + private const string EyesName = "FenrirEyes"; + private const string SourceModel = "Skeleton"; + private static readonly string[] SourceEyeNames = { "eye_l", "eye_r" }; + + private static readonly Color FenringGlow = new Color(2.0f, 0.372f, 0f, 1f); + + // AswidVisuals' base placement plus its Configuration Manager defaults, which are what + // playtesting settled on for this same pair of eyes on this same rig. + private const float EyeForward = 0.081f + 0.013f; + private const float EyeHeight = 0.181f + 0.004f; + private const float EyeSeparation = 0.032f + 0.007f; + private const float EyeSize = 1.1f; + private const float EyeYaw = 22.068f; + private const float EyeRoll = -180f; + + /// Owner only, and only on a change: one ZDO write per transition, not per frame. + public static void SetReady(Player player, bool ready) + { + ZNetView nview = player != null ? player.GetComponent() : null; + if (nview == null || !nview.IsValid() || !nview.IsOwner()) return; + + ZDO zdo = nview.GetZDO(); + if (zdo.GetBool(ReadyKey, false) != ready) zdo.Set(ReadyKey, ready); + } + + /// + /// Keeps the eyes on a living Fenrir and takes them off anyone else. Called from + /// VisEquipment.UpdateColors, which is what notices a race change; the ticker below then + /// follows night, readiness and forms frame by frame. + /// + public static void ApplyEyes(Player player) + { + if (player == null) return; + + Transform headBone = FindHeadBone(player); + if (headBone == null) return; // rig not up yet; the ticker or the next refresh retries + + Transform eyes = headBone.Find(EyesName); + + if (DvergarVisuals.GetPlayerRace(player) != RaceId || player.IsDead()) + { + if (eyes != null) + { + // Renamed first: Destroy waits for the end of the frame. + eyes.name = EyesName + "_Removed"; + Object.Destroy(eyes.gameObject); + } + EyeTicker ticker = player.GetComponent(); + if (ticker != null) Object.Destroy(ticker); + return; + } + + if (player.GetComponent() == null) player.gameObject.AddComponent(); + + float strength = GetGlowStrength(player); + if (strength <= 0f) + { + if (eyes != null && eyes.gameObject.activeSelf) eyes.gameObject.SetActive(false); + return; + } + + if (eyes == null) + { + // The skull's facing is measured once, at build time. A head turned by sitting, + // an attack or sleep would measure wrong; see AswidVisuals.ApplyEyes. + if (player.IsAttached() || player.IsAttachedToShip() || player.InAttack() || player.IsSleeping()) return; + eyes = BuildEyes(player, headBone); + if (eyes == null) return; + } + + if (!eyes.gameObject.activeSelf) eyes.gameObject.SetActive(true); + PaintEyes(eyes, FenringGlow * strength); + } + + /// 0 means dark: day, a beast form, or the viewer turned the glow off. + private static float GetGlowStrength(Player player) + { + if (!FenrirConfig.EyeGlow.Value) return 0f; + if (EnvMan.instance == null || !EnvMan.IsNight()) return 0f; + + ZNetView nview = player.GetComponent(); + if (nview == null || !nview.IsValid()) return 0f; + + ZDO zdo = nview.GetZDO(); + if (!string.IsNullOrEmpty(zdo.GetString(FormKey, ""))) return 0f; + + return zdo.GetBool(ReadyKey, false) + ? FenrirConfig.EyeReadyStrength.Value + : FenrirConfig.EyeNightStrength.Value; + } + + public class EyeTicker : MonoBehaviour + { + private Player m_player; + + private void Awake() => m_player = GetComponent(); + + private void LateUpdate() + { + if (m_player == null) { Destroy(this); return; } + ApplyEyes(m_player); + } + } + + /// The body mesh's own Head bone, never the Animator's. See AswidVisuals.FindHeadBone. + private static Transform FindHeadBone(Player player) + { + VisEquipment visEq = player.GetComponent(); + if (visEq == null || visEq.m_bodyModel == null || visEq.m_bodyModel.bones == null) return null; + + foreach (Transform bone in visEq.m_bodyModel.bones) + { + if (bone != null && bone.name == AswidVisuals.PlayerHeadBoneName) return bone; + } + return null; + } + + private static Transform BuildEyes(Player player, Transform headBone) + { + List sources = FindSourceEyes(); + if (sources.Count == 0) return null; + + float lossy = headBone.lossyScale.x; + if (Mathf.Abs(lossy) < 0.0001f) return null; // rig still coming up + float toLocal = 1f / lossy; + + GameObject holder = new GameObject(EyesName); + holder.transform.SetParent(headBone, false); + + RigBindPose.MeasureHeadFrame(player, headBone, RaceId, + out Vector3 forward, out Vector3 up, out Vector3 right); + Quaternion facing = Quaternion.LookRotation(forward, up); + + // The player's own scale cancels the rig's, as in AswidVisuals.PlaceEyes. + float scale = player.transform.localScale.x * toLocal; + + foreach (Transform source in sources) + { + GameObject eye = Object.Instantiate(source.gameObject, holder.transform); + eye.name = source.name; + + float side = source.name.ToLowerInvariant().Contains("_l") ? -1f : 1f; + + eye.transform.localPosition = forward * (EyeForward * scale) + + up * (EyeHeight * scale) + + right * (side * EyeSeparation * scale); + // Yaw mirrored per eye so the pair turns in towards the nose together. + eye.transform.localRotation = Quaternion.Euler(0f, EyeYaw * side, EyeRoll) * facing; + eye.transform.localScale = source.lossyScale * toLocal * EyeSize; + + // Allowlist: whatever else rode along on the skeleton goes. + foreach (Component comp in eye.GetComponentsInChildren(true)) + { + if (comp is Transform || comp is MeshRenderer || comp is MeshFilter) continue; + if (comp is ParticleSystem || comp is ParticleSystemRenderer) + { + // The skeleton's eye smoke, on a child of the eye: too loud for a reflection. + if (comp.gameObject != eye) comp.gameObject.SetActive(false); + continue; + } + Object.Destroy(comp); + } + + foreach (Renderer renderer in eye.GetComponentsInChildren(true)) + { + renderer.enabled = true; + renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; + renderer.receiveShadows = false; + } + + eye.SetActive(true); + } + + return holder.transform; + } + + /// Every colour property the borrowed material has; see AswidVisuals.PaintEyes. + private static void PaintEyes(Transform holder, Color glow) + { + glow.a = 1f; + foreach (Renderer renderer in holder.GetComponentsInChildren(true)) + { + Material material = renderer.material; + if (material == null) continue; + + if (material.HasProperty("_Color")) material.SetColor("_Color", glow); + if (material.HasProperty("_TintColor")) material.SetColor("_TintColor", glow); + if (material.HasProperty("_BaseColor")) material.SetColor("_BaseColor", glow); + if (material.HasProperty("_EmissionColor")) material.SetColor("_EmissionColor", glow); + } + } + + private static bool warnedSource; + + private static List FindSourceEyes() + { + List found = new List(); + + GameObject prefab = PrefabManager.Cache.GetPrefab(SourceModel); + if (prefab != null) + { + foreach (Transform t in prefab.GetComponentsInChildren(true)) + { + string lower = t.name.ToLower(); + if (lower == SourceEyeNames[0] || lower == SourceEyeNames[1]) found.Add(t); + } + } + + if (found.Count == 0 && !warnedSource) + { + warnedSource = true; + Jotunn.Logger.LogWarning($"[Fenrir] No eye_l/eye_r found on '{SourceModel}' - the eyes stay dark."); + } + return found; + } + } + + [HarmonyPatch(typeof(VisEquipment), "UpdateColors")] + public static class FenrirEyesPatch + { + public static void Postfix(VisEquipment __instance) + { + if (!__instance.m_isPlayer) return; + FenrirVisuals.ApplyEyes(__instance.GetComponent()); + } + } +} From 2becb81b6ffe2e44950cd906bfdb62ea349697f7 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 19:58:35 +0200 Subject: [PATCH 4/9] fix(fenrir): the faint night glow is bright enough to see At 0.35 the red channel stayed under 1, so bloom never picked it up and a Fenrir with no form ready looked like it had no glow at all. 0.6 puts it just over. --- JotunnModStub/Fenrir/FenrirConfig.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/JotunnModStub/Fenrir/FenrirConfig.cs b/JotunnModStub/Fenrir/FenrirConfig.cs index 68e9a97..67f695a 100644 --- a/JotunnModStub/Fenrir/FenrirConfig.cs +++ b/JotunnModStub/Fenrir/FenrirConfig.cs @@ -200,7 +200,9 @@ namespace RacesOfValheim new ConfigDescription("Shows \" is Ready!\" when a form's cooldown ends. The eyes say the same thing; turn this off if they are enough.")); EyeGlow = config.Bind(appearance, "Eye Glow", true, new ConfigDescription("Fenrir eyes glow at night in the Fenring's own orange: faint while no form can be taken, bright when one can. Off hides them on every Fenrir you see.")); - EyeNightStrength = config.Bind(appearance, "Eye Night Strength", 0.35f, + // Above 0.5 so the red channel (2.0 x strength) passes 1 and the bloom pass picks it + // up: at 0.35 the faint state read as no glow at all. + EyeNightStrength = config.Bind(appearance, "Eye Night Strength", 0.6f, new ConfigDescription("Glow at night while no form is ready.", new AcceptableValueRange(0f, 3f))); EyeReadyStrength = config.Bind(appearance, "Eye Ready Strength", 1.2f, new ConfigDescription("Glow at night while a form is ready.", new AcceptableValueRange(0f, 3f))); From c2bc73b3a095f738d94e15997699e4fa7881812d Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 20:06:49 +0200 Subject: [PATCH 5/9] feat(fenrir): eyes turn the Cultist's yellow when it is back from cooldown The ready flag becomes an int: none, a form, or the Cultist. The Cultist wins only while its rules give it a cooldown (Yagluth and Queen), since that is the one return worth announcing. Its body shares the Fenring's material and its breath is white flame tinted by texture, so the colour comes from its death effect: FlameRoundYellowParticle's emission, (2.691, 1.797, 0.455), bundle c4210710. --- JotunnModStub/Fenrir/FenrirConfig.cs | 2 +- JotunnModStub/Fenrir/FenrirRace.cs | 23 ++++++++++----- JotunnModStub/Fenrir/FenrirVisuals.cs | 41 ++++++++++++++++++++------- 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/JotunnModStub/Fenrir/FenrirConfig.cs b/JotunnModStub/Fenrir/FenrirConfig.cs index 67f695a..17a26cd 100644 --- a/JotunnModStub/Fenrir/FenrirConfig.cs +++ b/JotunnModStub/Fenrir/FenrirConfig.cs @@ -199,7 +199,7 @@ namespace RacesOfValheim ReadyMessage = config.Bind(appearance, "Ready Message", true, new ConfigDescription("Shows \" is Ready!\" when a form's cooldown ends. The eyes say the same thing; turn this off if they are enough.")); EyeGlow = config.Bind(appearance, "Eye Glow", true, - new ConfigDescription("Fenrir eyes glow at night in the Fenring's own orange: faint while no form can be taken, bright when one can. Off hides them on every Fenrir you see.")); + new ConfigDescription("Fenrir eyes glow at night in the Fenring's own orange: faint while no form can be taken, bright when one can, yellow when the Cultist is back from its cooldown. Off hides them on every Fenrir you see.")); // Above 0.5 so the red channel (2.0 x strength) passes 1 and the bloom pass picks it // up: at 0.35 the faint state read as no glow at all. EyeNightStrength = config.Bind(appearance, "Eye Night Strength", 0.6f, diff --git a/JotunnModStub/Fenrir/FenrirRace.cs b/JotunnModStub/Fenrir/FenrirRace.cs index 9feeb51..963737b 100644 --- a/JotunnModStub/Fenrir/FenrirRace.cs +++ b/JotunnModStub/Fenrir/FenrirRace.cs @@ -150,7 +150,7 @@ namespace RacesOfValheim { } wasNight = isNight; - FenrirVisuals.SetReady(Player.m_localPlayer, CanTakeAnyForm()); + FenrirVisuals.SetReady(Player.m_localPlayer, GetReadyState()); if (isTransformed) { @@ -174,17 +174,26 @@ namespace RacesOfValheim { } /// - /// Whether one of the three keys would transform right now. The same gates as - /// TryTransformWithRules below, without its messages: this feeds the eye glow. + /// What the eyes should say right now, using the same gates as TryTransformWithRules + /// below without its messages. The Cultist wins over the other forms only while its rules + /// give it a cooldown: that is the one form whose return is worth announcing. /// - private bool CanTakeAnyForm() + private FenrirVisuals.ReadyState GetReadyState() { - if (isTransformed) return false; + if (isTransformed) return FenrirVisuals.ReadyState.None; int state = BossProgressionManager.GetCurrentProgressionState(); - return CanTake(FenrirProgression.GetGKeyRules(state)) + FenrirProgression.FormRules cultist = FenrirProgression.GetJKeyRules(state); + + if (CanTake(cultist) && cultist.CooldownMinutes > 0) return FenrirVisuals.ReadyState.Cultist; + + if (CanTake(FenrirProgression.GetGKeyRules(state)) || CanTake(FenrirProgression.GetHKeyRules(state)) - || CanTake(FenrirProgression.GetJKeyRules(state)); + || CanTake(cultist)) + { + return FenrirVisuals.ReadyState.Form; + } + return FenrirVisuals.ReadyState.None; } private bool CanTake(FenrirProgression.FormRules rules) diff --git a/JotunnModStub/Fenrir/FenrirVisuals.cs b/JotunnModStub/Fenrir/FenrirVisuals.cs index 7b901c0..fd0836b 100644 --- a/JotunnModStub/Fenrir/FenrirVisuals.cs +++ b/JotunnModStub/Fenrir/FenrirVisuals.cs @@ -7,7 +7,8 @@ namespace RacesOfValheim { /// /// The Fenrir's eyes catch the light at night, the way a wolf's do: a faint glow while no form - /// can be taken, a bright one when a key would transform right now. Dark by day and while in a + /// can be taken, a bright one when a key would transform right now, and the Cultist's yellow + /// when that form is back from its cooldown. Dark by day and while in a /// beast form, whose own eyes take over. A community suggestion (lexsonn), meant to say what /// the "Ready!" text says without the text. /// @@ -26,6 +27,14 @@ namespace RacesOfValheim { public const string RaceId = "Fenrir"; public const string ReadyKey = "RacesOfValheim_FenrirReady"; + + /// Written to the ZDO as an int, so the values are part of the network contract. + public enum ReadyState + { + None = 0, + Form = 1, + Cultist = 2, + } private const string FormKey = "RacesOfValheim_FenrirForm"; private const string EyesName = "FenrirEyes"; private const string SourceModel = "Skeleton"; @@ -33,6 +42,11 @@ namespace RacesOfValheim private static readonly Color FenringGlow = new Color(2.0f, 0.372f, 0f, 1f); + // The Cultist's body is the Fenring's material and its breath is white flame tinted by + // texture, so neither tells it apart. Its own death effect (vfx_fenring_cultist_death) + // does: FlameRoundYellowParticle's _EmissionColor, same bundle. + private static readonly Color CultistGlow = new Color(2.691f, 1.797f, 0.455f, 1f); + // AswidVisuals' base placement plus its Configuration Manager defaults, which are what // playtesting settled on for this same pair of eyes on this same rig. private const float EyeForward = 0.081f + 0.013f; @@ -43,13 +57,13 @@ namespace RacesOfValheim private const float EyeRoll = -180f; /// Owner only, and only on a change: one ZDO write per transition, not per frame. - public static void SetReady(Player player, bool ready) + public static void SetReady(Player player, ReadyState ready) { ZNetView nview = player != null ? player.GetComponent() : null; if (nview == null || !nview.IsValid() || !nview.IsOwner()) return; ZDO zdo = nview.GetZDO(); - if (zdo.GetBool(ReadyKey, false) != ready) zdo.Set(ReadyKey, ready); + if (zdo.GetInt(ReadyKey, 0) != (int)ready) zdo.Set(ReadyKey, (int)ready); } /// @@ -81,7 +95,7 @@ namespace RacesOfValheim if (player.GetComponent() == null) player.gameObject.AddComponent(); - float strength = GetGlowStrength(player); + float strength = GetGlowStrength(player, out Color hue); if (strength <= 0f) { if (eyes != null && eyes.gameObject.activeSelf) eyes.gameObject.SetActive(false); @@ -98,12 +112,17 @@ namespace RacesOfValheim } if (!eyes.gameObject.activeSelf) eyes.gameObject.SetActive(true); - PaintEyes(eyes, FenringGlow * strength); + PaintEyes(eyes, hue * strength); } - /// 0 means dark: day, a beast form, or the viewer turned the glow off. - private static float GetGlowStrength(Player player) + /// + /// 0 means dark: day, a beast form, or the viewer turned the glow off. Otherwise faint + /// orange with nothing ready, bright orange with a form ready, bright yellow when the + /// Cultist is back from its cooldown. + /// + private static float GetGlowStrength(Player player, out Color hue) { + hue = FenringGlow; if (!FenrirConfig.EyeGlow.Value) return 0f; if (EnvMan.instance == null || !EnvMan.IsNight()) return 0f; @@ -113,9 +132,11 @@ namespace RacesOfValheim ZDO zdo = nview.GetZDO(); if (!string.IsNullOrEmpty(zdo.GetString(FormKey, ""))) return 0f; - return zdo.GetBool(ReadyKey, false) - ? FenrirConfig.EyeReadyStrength.Value - : FenrirConfig.EyeNightStrength.Value; + ReadyState ready = (ReadyState)zdo.GetInt(ReadyKey, 0); + if (ready == ReadyState.None) return FenrirConfig.EyeNightStrength.Value; + + if (ready == ReadyState.Cultist) hue = CultistGlow; + return FenrirConfig.EyeReadyStrength.Value; } public class EyeTicker : MonoBehaviour From 418d2462bdb34c7394c8f1de59b1dc81eecb6e88 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 20:12:30 +0200 Subject: [PATCH 6/9] fix(fenrir): a softer ready glow 1.2 read too strong in game; 0.9 by default. The faint glow stays at 0.6. --- JotunnModStub/Fenrir/FenrirConfig.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/JotunnModStub/Fenrir/FenrirConfig.cs b/JotunnModStub/Fenrir/FenrirConfig.cs index 17a26cd..4a95c89 100644 --- a/JotunnModStub/Fenrir/FenrirConfig.cs +++ b/JotunnModStub/Fenrir/FenrirConfig.cs @@ -204,7 +204,8 @@ namespace RacesOfValheim // up: at 0.35 the faint state read as no glow at all. EyeNightStrength = config.Bind(appearance, "Eye Night Strength", 0.6f, new ConfigDescription("Glow at night while no form is ready.", new AcceptableValueRange(0f, 3f))); - EyeReadyStrength = config.Bind(appearance, "Eye Ready Strength", 1.2f, + // Tried at 1.2 in game: the orange was too strong. + EyeReadyStrength = config.Bind(appearance, "Eye Ready Strength", 0.9f, new ConfigDescription("Glow at night while a form is ready.", new AcceptableValueRange(0f, 3f))); // "debug" in the key keeps it local - see ConfigSync. From 8b7e88e0770502b4adb1151435a738987b3feb7c Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 22:08:05 +0200 Subject: [PATCH 7/9] fix(fenrir): faint night glow at 0.675, as tuned in game --- JotunnModStub/Fenrir/FenrirConfig.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/JotunnModStub/Fenrir/FenrirConfig.cs b/JotunnModStub/Fenrir/FenrirConfig.cs index 4a95c89..e9dd6e5 100644 --- a/JotunnModStub/Fenrir/FenrirConfig.cs +++ b/JotunnModStub/Fenrir/FenrirConfig.cs @@ -201,10 +201,10 @@ namespace RacesOfValheim EyeGlow = config.Bind(appearance, "Eye Glow", true, new ConfigDescription("Fenrir eyes glow at night in the Fenring's own orange: faint while no form can be taken, bright when one can, yellow when the Cultist is back from its cooldown. Off hides them on every Fenrir you see.")); // Above 0.5 so the red channel (2.0 x strength) passes 1 and the bloom pass picks it - // up: at 0.35 the faint state read as no glow at all. - EyeNightStrength = config.Bind(appearance, "Eye Night Strength", 0.6f, + // up: at 0.35 the faint state read as no glow at all. 0.675 is what looked right in game. + EyeNightStrength = config.Bind(appearance, "Eye Night Strength", 0.675f, new ConfigDescription("Glow at night while no form is ready.", new AcceptableValueRange(0f, 3f))); - // Tried at 1.2 in game: the orange was too strong. + // Tried at 1.2 in game: the orange was too strong. 0.9 checked and kept. EyeReadyStrength = config.Bind(appearance, "Eye Ready Strength", 0.9f, new ConfigDescription("Glow at night while a form is ready.", new AcceptableValueRange(0f, 3f))); From d8dcecb573381e4b8b5fe603a62adeb3970bc085 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 22:17:17 +0200 Subject: [PATCH 8/9] fix(fenrir): form hits build adrenaline like a weapon hit Vanilla grants a hit's adrenaline inside Attack. The forms skip Attack and call Damage directly, so only the stagger bonus in Character.Damage reached the player: meadow mobs, quick to stagger, filled the bar, while Lox, Tar, Brutes and Furlings gave nothing until staggered. FormMelee.GrantAdrenaline adds the player's unarmed attack adrenaline times the target's multiplier after each claw or bite, and a fifth of it per 0.2s tick of the Cultist's fire. --- JotunnModStub/Fenrir/FenrirBehaviors.cs | 5 +++++ JotunnModStub/Fenrir/FenrirFormShared.cs | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/JotunnModStub/Fenrir/FenrirBehaviors.cs b/JotunnModStub/Fenrir/FenrirBehaviors.cs index 2b0783d..e1df615 100644 --- a/JotunnModStub/Fenrir/FenrirBehaviors.cs +++ b/JotunnModStub/Fenrir/FenrirBehaviors.cs @@ -752,6 +752,7 @@ namespace RacesOfValheim if (targetObj != null) hitObjects.Add(targetObj); FormMelee.LogHit(FormLabel, target, totalDamage); target.Damage(hitData); + FormMelee.GrantAdrenaline(target); } } } @@ -1012,6 +1013,7 @@ namespace RacesOfValheim if (targetObj != null) hitObjects.Add(targetObj); FormMelee.LogHit(FormLabel, target, totalDamage); target.Damage(hitData); + FormMelee.GrantAdrenaline(target, 0.2f); // one 0.2s tick: a full hit per second of breath if (ZNetScene.instance != null) { @@ -1141,6 +1143,7 @@ namespace RacesOfValheim if (targetObj != null) hitObjects.Add(targetObj); FormMelee.LogHit(FormLabel, target, totalDamage); target.Damage(hitData); + FormMelee.GrantAdrenaline(target); } } } @@ -1355,6 +1358,7 @@ namespace RacesOfValheim if (targetObj != null) hitObjects.Add(targetObj); FormMelee.LogHit(FormLabel, target, totalDamage); target.Damage(hitData); + FormMelee.GrantAdrenaline(target); } } } @@ -1562,6 +1566,7 @@ namespace RacesOfValheim if (targetObj != null) hitObjects.Add(targetObj); FormMelee.LogHit(FormLabel, target, totalDamage); target.Damage(hitData); + FormMelee.GrantAdrenaline(target); } } } diff --git a/JotunnModStub/Fenrir/FenrirFormShared.cs b/JotunnModStub/Fenrir/FenrirFormShared.cs index 6fafc2e..84dc78a 100644 --- a/JotunnModStub/Fenrir/FenrirFormShared.cs +++ b/JotunnModStub/Fenrir/FenrirFormShared.cs @@ -336,6 +336,26 @@ namespace RacesOfValheim Jotunn.Logger.LogInfo($"[FenrirForm] {form} swing skipped '{hit.name}' (layer {LayerMask.LayerToName(hit.gameObject.layer)}): {reason}."); } + /// + /// The adrenaline vanilla gives for a weapon hit, which a form's hit never got. Vanilla + /// grants it inside Attack (m_attackAdrenaline x the enemy's m_enemyAdrenalineMultiplier); + /// the forms skip Attack and call Damage directly, so only the stagger bonus inside + /// Character.Damage reached the player. That is the report: easy-to-stagger meadow mobs + /// filled the bar, Lox, Tar, Brutes and Furlings only did when staggered. + /// + /// The per-hit amount is the player's own unarmed attack's, since the forms fight + /// unarmed. scale lets a damage-over-time tick pay a fraction of a hit. + /// + public static void GrantAdrenaline(IDestructible target, float scale = 1f) + { + Player player = Player.m_localPlayer; + if (player == null || !(target is Character character) || character == player) return; + + ItemDrop unarmed = player.m_unarmedWeapon; + float perHit = unarmed != null ? unarmed.m_itemData.m_shared.m_attack.m_attackAdrenaline : 1f; + player.AddAdrenaline(perHit * character.m_enemyAdrenalineMultiplier * scale); + } + public static void LogHit(string form, IDestructible target, float damage) { if (!FenrirConfig.DebugFormHits.Value) return; From 7411680553abdba17a0ccea4afcd0cb0b35caa5a Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 22:27:26 +0200 Subject: [PATCH 9/9] chore(release): v1.5.14 - Fenrir night eyes, form adrenaline, full-stomach eating Fenrir eyes glow at night, brighter when a form is ready and yellow when the Cultist is back. Form hits build adrenaline like a weapon hit. Race foods replace a worn-down meal when the stomach is full. The stamina bar comes back after leaving Aswid or Draugh. Other players see a Furling at Furling size, and a Legacy True Form Trol hits as far as it reaches. README: New in block, Fenrir night eyes, changelog entry, new Discord link (also in the old JotunnModStub README). --- JotunnModStub/Package/manifest.json | 2 +- JotunnModStub/README.md | 2 +- JotunnModStub/RacesOfValheim.cs | 2 +- README.md | 16 +++++++++++++--- manifest.json | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/JotunnModStub/Package/manifest.json b/JotunnModStub/Package/manifest.json index 8b1a0cf..6c5a7ef 100644 --- a/JotunnModStub/Package/manifest.json +++ b/JotunnModStub/Package/manifest.json @@ -1,7 +1,7 @@ { "name": "RacesOfValheim", "description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.", - "version_number": "1.5.13", + "version_number": "1.5.14", "website_url": "", "dependencies": [ "denikson-BepInExPack_Valheim-5.4.2333", diff --git a/JotunnModStub/README.md b/JotunnModStub/README.md index e9389e3..343bba3 100644 --- a/JotunnModStub/README.md +++ b/JotunnModStub/README.md @@ -109,7 +109,7 @@ This mod currently introduces 6 custom races: This is a stable release of Races of Valheim, but the mod is actively in development! We plan to add more races, gameplay elements, and refine the mechanics in future updates. Any feedback, bug reports, or suggestions for new features are more than welcome. -Please write to us on my Discord server: **https://discord.gg/gbBEK2VTE** +Please write to us on my Discord server: **https://discord.gg/dW72ch6Sw5** ## Changelog diff --git a/JotunnModStub/RacesOfValheim.cs b/JotunnModStub/RacesOfValheim.cs index 1bd1c2b..4ff8ec9 100644 --- a/JotunnModStub/RacesOfValheim.cs +++ b/JotunnModStub/RacesOfValheim.cs @@ -16,7 +16,7 @@ namespace RacesOfValheim { public const string PluginGUID = "com.nandor.racesofvalheim"; public const string PluginName = "Races Of Valheim"; - public const string PluginVersion = "1.5.13"; + public const string PluginVersion = "1.5.14"; private readonly Harmony harmony = new Harmony(PluginGUID); diff --git a/README.md b/README.md index 8c1b542..9e09880 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ A comprehensive Valheim mod allowing you to play as unique races, each providing This is a stable release, but more races and refinements are planned! Wiki: [https://wiki.aledanidev.ovh/](https://wiki.aledanidev.ovh/) -Bug reports, feedback, ideas: [https://discord.gg/jJzuKBZNC](https://discord.gg/jJzuKBZNC) +Bug reports, feedback, ideas: [https://discord.gg/dW72ch6Sw5](https://discord.gg/dW72ch6Sw5) Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorTheModder) --- -## New in v1.5.13 +## New in v1.5.14 -Fixes a freeze on servers with factions on: when a building a mob was attacking got destroyed, every creature in the area stopped moving and players slid on the ground. Dvergar now pay the discounted metal cost the build menu shows. Full details in the [changelog](#v1513). +A Fenrir's eyes now glow at night, brighter when a form is ready and yellow when the Cultist is back. Fenrir forms build adrenaline on every hit, Trenta can eat seeds with a full stomach, and the stamina bar comes back after leaving Aswid or Draugh. Full details in the [changelog](#v1514). --- @@ -47,6 +47,7 @@ Fixes a freeze on servers with factions on: when a building a mob was attacking - **Beast Form:** Transform into a wolf-like beast. - **Cultist Form:** Transform into a Cultist. Its claws cost nothing, but the **fire breath (hold Right Mouse) runs on eitr** — 12.5 per second — and eitr comes from the Mistlands, so the form unlocks at Yagluth with its flames still out of reach. Holding the button with an empty pool now says so. - **Cursed Claws:** The wolf's hands, kept on in the man's shape — see [Claws](#claws). +- **Night Eyes:** At night your eyes glow in the Fenring's orange: faintly while no form is ready, brightly when one is, and yellow when the Cultist is back from its cooldown. Other players see it too. Turn it off, or the "Ready!" message, under `Fenrir - Appearance`. - **Sneak and Sleep:** Forms sneak at a walk when you crouch and stand still to attack. Sit down as an Ulv and it curls up asleep. - **A Pack of Your Own:** The Pack Trough keeps a standing pack of wolves, ulvs and, late, fenrir — see [Race Stations](#race-stations--companions). - **Progression:** Forms grow as you defeat bosses, unlocking new powers and reducing cooldowns. Immune to fall damage. @@ -450,6 +451,15 @@ Both halves have an off switch under `Factions` in Configuration Manager: **Fact ## Changelog +### v1.5.14 +- **New - Fenrir night eyes:** at night a Fenrir's eyes glow in the Fenring's orange, the way a wolf's eyes catch the light. Faint while no form is ready, bright when one is, and yellow when the Cultist is back from its cooldown. Other players see it too. Under `Fenrir - Appearance` each player can turn off the glow or the "Ready!" message for themselves. Thanks to lexsonn for the idea. +- **Fix - Fenrir forms and adrenaline:** in Wolf, Ulv, Fenring and Cultist form, hits now build adrenaline the way a weapon does. Before, only staggering an enemy did, so Lox, Tar, Brutes and Furlings gave almost none. The Cultist's fire breath builds it too, about one hit's worth per second. Thanks to lexsonn for the report. +- **Fix - eating with a full stomach:** with all three food slots full, a Trenta couldn't eat seeds, and a Draugh's raw flesh or an Aswid's meals could get stuck the same way. Nothing happened and no message said why. They now follow the normal rule: they replace the meal that has worn down the most, once it's past half its time, and otherwise show the usual "too full" message. Thanks to ExpensiveMouse1700 for the report. +- **Fix - stamina bar after Aswid or Draugh:** switching from Aswid or Draugh to a race with stamina no longer leaves you without a stamina bar until you log out. Thanks to frogneel for the report. +- **Fix - Furling size for other players:** other players now see a Furling at Furling size. The shrink was only applied on the Furling's own screen, so everyone else saw them at full height. +- **Fix - Legacy True Form reach:** a big Trol's weapons now hit as far as they reach. Vanilla measured every swing at a human's range, so in Legacy True Form only the closest targets got hit. Melee range and swing width now grow with the model's size, for every race that grows. +- **Change - new Discord link:** [https://discord.gg/dW72ch6Sw5](https://discord.gg/dW72ch6Sw5). + ### v1.5.13 - **Fix - world freezes with factions on:** since v1.5.11, if a mob was targeting a building piece and the piece got destroyed or removed, the faction check threw an error every frame. On a server this stopped the AI of every creature in the area: players slid on the ground, enemies stood still, and characters sometimes turned invisible. The check now drops the dead target and moves on. Thanks to SCRIMSHAW and GaoVN for the reports, and to SCRIMSHAW for testing the fix on their server. - **Fix - Dvergar build discount:** the build menu showed the discounted metal cost (a cauldron for 6 tin instead of 10), but the hammer still refused to place the piece unless you carried the full vanilla amount. Pieces now build at the price shown. Dismantling or destroying a piece a Dvergar built returns the metal they paid, not the vanilla amount. Thanks to Balmarog for the report. diff --git a/manifest.json b/manifest.json index 8b1a0cf..6c5a7ef 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "RacesOfValheim", "description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.", - "version_number": "1.5.13", + "version_number": "1.5.14", "website_url": "", "dependencies": [ "denikson-BepInExPack_Valheim-5.4.2333",