From d8dcecb573381e4b8b5fe603a62adeb3970bc085 Mon Sep 17 00:00:00 2001 From: kanym Date: Fri, 23 Oct 2026 22:17:17 +0200 Subject: [PATCH] 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;