Merge branch 'feat-aswid-aura-toggle' into main
I now toggles the Vampiric Aura on/off. Devour's own toggle moves off I, stays on by default, and its keybind is left unbound rather than removed.
This commit is contained in:
commit
f22accfb7c
3 changed files with 22 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue