feat(aswid): let players toggle the Vampiric Aura, move Devour off I

The Vampiric Aura had no on/off switch - it always drains/executes
nearby targets in every form. I now toggles it (AswidRace.AuraEnabled,
on by default), matching the existing toggle pattern already used for
Devour.

Devour's own toggle moves off I to make room and stays on by default;
its keybind is unbound (KeyCode.None) rather than removed outright, so
it remains a real Configuration Manager entry for anyone who wants to
bind their own key to it.
This commit is contained in:
kanym 2026-08-09 17:11:25 +02:00
commit 9e4778def7
3 changed files with 22 additions and 3 deletions

View file

@ -23,6 +23,7 @@ namespace RacesOfValheim
public static ConfigEntry<KeyboardShortcut> MistFormKey;
public static ConfigEntry<KeyboardShortcut> EclipseKey;
public static ConfigEntry<KeyboardShortcut> TameKey;
public static ConfigEntry<KeyboardShortcut> ToggleAuraKey;
public static ConfigEntry<KeyboardShortcut> 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,

View file

@ -529,6 +529,13 @@ namespace RacesOfValheim
ZNetView nview = __instance.GetComponent<ZNetView>();
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;

View file

@ -824,12 +824,18 @@ namespace RacesOfValheim
private float damageTickTimer = 0f;
/// <summary>Toggled by AswidConfig.ToggleAuraKey (Aswid_PlayerUpdate_Patch); on by default.</summary>
public static bool AuraEnabled = true;
/// <summary>
/// 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.
/// </summary>
private void HandleVampiricAura()
{
if (!AuraEnabled) return;
damageTickTimer += Time.deltaTime;
if (damageTickTimer < AswidConfig.AuraTickInterval.Value) return;