diff --git a/JotunnModStub/Aswid/AswidConfig.cs b/JotunnModStub/Aswid/AswidConfig.cs index a50f8c8..0bdf141 100644 --- a/JotunnModStub/Aswid/AswidConfig.cs +++ b/JotunnModStub/Aswid/AswidConfig.cs @@ -23,6 +23,7 @@ namespace RacesOfValheim public static ConfigEntry MistFormKey; public static ConfigEntry EclipseKey; public static ConfigEntry TameKey; + public static ConfigEntry ToggleAuraKey; public static ConfigEntry ToggleDevourKey; // ─── Passive combat (scales with progression state, doubles at night) ──── @@ -70,8 +71,13 @@ namespace RacesOfValheim new ConfigDescription("Casts Eclipse, tier 6+. Fails silently at night.")); TameKey = config.Bind(keybinds, "Tame", new KeyboardShortcut(KeyCode.U), new ConfigDescription("Tames the creature under your cursor, if your tier allows it.")); - ToggleDevourKey = config.Bind(keybinds, "Toggle Devour Ability", new KeyboardShortcut(KeyCode.I), - new ConfigDescription("Turns the automatic Devour-on-kill behavior on or off.")); + ToggleAuraKey = config.Bind(keybinds, "Toggle Vampiric Aura", new KeyboardShortcut(KeyCode.I), + new ConfigDescription("Turns the passive Vampiric Aura's damage/lifesteal on or off.")); + // Unbound by default: Devour always stays on now that I is the Aura's toggle. Left as + // a real keybind, not removed, so anyone who still wants a switch for it can bind one + // themselves in Configuration Manager. + ToggleDevourKey = config.Bind(keybinds, "Toggle Devour Ability", new KeyboardShortcut(KeyCode.None), + new ConfigDescription("Turns the automatic Devour-on-kill behavior on or off. Unbound by default - Devour stays on unless you assign a key here.")); const string combat = "Aswid - Passive Combat"; DamageBonusPerState = config.Bind(combat, "Damage Bonus Per State", 2f, diff --git a/JotunnModStub/Aswid/AswidPatches.cs b/JotunnModStub/Aswid/AswidPatches.cs index c3d0dff..ac5c76f 100644 --- a/JotunnModStub/Aswid/AswidPatches.cs +++ b/JotunnModStub/Aswid/AswidPatches.cs @@ -529,6 +529,13 @@ namespace RacesOfValheim ZNetView nview = __instance.GetComponent(); if (nview != null && nview.IsValid() && nview.GetZDO().GetString("RacesOfValheim_Race", "Human") == "Aswid") { + if (__instance == Player.m_localPlayer && RaceInput.Allowed && AswidConfig.ToggleAuraKey.Value.IsDownIgnoringHeldKeys()) + { + AswidRace.AuraEnabled = !AswidRace.AuraEnabled; + string msg = AswidRace.AuraEnabled ? "Vampiric Aura: ENABLED" : "Vampiric Aura: DISABLED"; + __instance.Message(MessageHud.MessageType.Center, msg); + } + if (__instance == Player.m_localPlayer && RaceInput.Allowed && AswidConfig.ToggleDevourKey.Value.IsDownIgnoringHeldKeys()) { AswidRace.DevourEnabled = !AswidRace.DevourEnabled; diff --git a/JotunnModStub/Aswid/AswidRace.cs b/JotunnModStub/Aswid/AswidRace.cs index 9293dd4..363fead 100644 --- a/JotunnModStub/Aswid/AswidRace.cs +++ b/JotunnModStub/Aswid/AswidRace.cs @@ -824,12 +824,18 @@ namespace RacesOfValheim private float damageTickTimer = 0f; + /// Toggled by AswidConfig.ToggleAuraKey (Aswid_PlayerUpdate_Patch); on by default. + public static bool AuraEnabled = true; + /// /// The Vampiric Aura is passive: it drains on its own, in every form, with no key to hold and - /// no icon or message of its own. The form only decides how hard it bites. + /// no icon or message of its own beyond the on/off toggle. The form only decides how hard it + /// bites. /// private void HandleVampiricAura() { + if (!AuraEnabled) return; + damageTickTimer += Time.deltaTime; if (damageTickTimer < AswidConfig.AuraTickInterval.Value) return;