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;