From b7b9cbcbd5206c4d0a6a4156e530d0c46bb84a76 Mon Sep 17 00:00:00 2001 From: kanym Date: Thu, 29 Oct 2026 01:52:10 +0100 Subject: [PATCH] fix(forms): Trol, Skadi, Sverm and Muspell form hits build adrenaline The same bug the Fenrir forms had until d8dcecb. Vanilla grants a hit's adrenaline inside Attack; these forms skip Attack and call Damage directly, so only the stagger bonus in Character.Damage ever reached the player. FormMelee.GrantAdrenaline now runs after each hit of the True Form troll's punch and log swings, the drake's maul, the Ravager's swings and the Muspell's stomp. The troll's ground slam hits through an Aoe, which never touches Attack either: the slam marks its Aoe, and a postfix on Aoe.OnHit grants the adrenaline for each creature it lands on. Projectiles (Throw Rock, the Muspell spike, drake breath) were never affected: Projectile grants its own adrenaline on a hit. --- JotunnModStub/Skadi/DrakeFormBehavior.cs | 1 + JotunnModStub/Sverm/SvermRavagerForm.cs | 1 + JotunnModStub/Trenta/TrentaMuspell.cs | 1 + JotunnModStub/Trol/TrolTrueFormBehavior.cs | 21 +++++++++++++++++++++ 4 files changed, 24 insertions(+) diff --git a/JotunnModStub/Skadi/DrakeFormBehavior.cs b/JotunnModStub/Skadi/DrakeFormBehavior.cs index 331f6b9..c66e735 100644 --- a/JotunnModStub/Skadi/DrakeFormBehavior.cs +++ b/JotunnModStub/Skadi/DrakeFormBehavior.cs @@ -620,6 +620,7 @@ namespace RacesOfValheim hitData.SetAttacker(Player.m_localPlayer); target.Damage(hitData); + FormMelee.GrantAdrenaline(target); } } diff --git a/JotunnModStub/Sverm/SvermRavagerForm.cs b/JotunnModStub/Sverm/SvermRavagerForm.cs index bee58bb..22af4ba 100644 --- a/JotunnModStub/Sverm/SvermRavagerForm.cs +++ b/JotunnModStub/Sverm/SvermRavagerForm.cs @@ -1067,6 +1067,7 @@ namespace RacesOfValheim hitData.SetAttacker(player); target.Damage(hitData); + FormMelee.GrantAdrenaline(target); } } } diff --git a/JotunnModStub/Trenta/TrentaMuspell.cs b/JotunnModStub/Trenta/TrentaMuspell.cs index d3af9ef..67c3e79 100644 --- a/JotunnModStub/Trenta/TrentaMuspell.cs +++ b/JotunnModStub/Trenta/TrentaMuspell.cs @@ -496,6 +496,7 @@ namespace RacesOfValheim hitData.SetAttacker(attacker); target.Damage(hitData); + FormMelee.GrantAdrenaline(target); } } } diff --git a/JotunnModStub/Trol/TrolTrueFormBehavior.cs b/JotunnModStub/Trol/TrolTrueFormBehavior.cs index 710f2b2..f69daae 100644 --- a/JotunnModStub/Trol/TrolTrueFormBehavior.cs +++ b/JotunnModStub/Trol/TrolTrueFormBehavior.cs @@ -337,6 +337,7 @@ namespace RacesOfValheim aoe.m_hitOwner = false; aoe.m_hitProps = true; aoe.m_radius = Mathf.Max(aoe.m_radius, range * 0.6f); + instance.AddComponent(); aoe.Setup(player, player.transform.forward, -1f, hitData, null, null); spawned = true; } @@ -429,6 +430,7 @@ namespace RacesOfValheim if (targetObj != null) done.Add(targetObj); FormMelee.LogHit(FormLabel, target, damage.GetTotalDamage()); target.Damage(hitData); + FormMelee.GrantAdrenaline(target); profile.Shared.m_hitEffect.Create(targetCenter, Quaternion.identity); landed++; } @@ -437,6 +439,25 @@ namespace RacesOfValheim } } + /// Marks the Aoe a True Form slam spawned, so its hits can be told apart from a + /// real troll's. + internal class TrolSlamAoe : MonoBehaviour { } + + /// + /// Adrenaline for each creature the slam's Aoe lands on. Vanilla gives it inside Attack, and + /// an Aoe set up by hand never goes through one (FormMelee.GrantAdrenaline says why the sweeps + /// needed the same). + /// + [HarmonyPatch(typeof(Aoe), "OnHit")] + public static class Trol_SlamAoeAdrenaline_Patch + { + public static void Postfix(Aoe __instance, Collider collider, bool __result) + { + if (!__result || collider == null || __instance.GetComponent() == null) return; + FormMelee.GrantAdrenaline(collider.GetComponentInParent()); + } + } + /// /// The troll every other client sees. RemoteFenrirAnimator in shape: legs from the remote /// player's own Animator, which ZSyncAnimation keeps fed over the network, and attacks replayed