fix(aswid): center Vampiric Aura on the caster and stop transforms from casting the real Guardian Power

Vampiric Aura was centered 2m in front of the player instead of on
them, and its Blood Magic scaling only ever added up to +1 damage at
level 100; rebalanced to a 1 base + up to 5 scaled split.

Aswid Bat Form, Skadi Cold Spell, Skadi Drake/Moder Form and Fenrir
Wolf Form all borrow the native "gpower" animator trigger for its
arms-raised casting pose. That clip carries a baked-in Animation Event
that calls Player.ActivateGuardianPower(), which fired regardless of
who triggered the animation - borrowing it silently cast the player's
real Guardian Power (and burned its cooldown) whenever one was
available. Added a brief, time-based suppression window in RaceInput
around each borrowed trigger so only that one call is swallowed.

Also includes AswidSpectralClaw.cs, a boss-scaled bare-fist damage
item for Aswid, currently disabled pending equip-state fixes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Ferdinando 2026-08-03 21:37:58 +02:00
commit 1dbfbd02b6
6 changed files with 354 additions and 11 deletions

View file

@ -1,5 +1,6 @@
using System.Reflection;
using HarmonyLib;
using UnityEngine;
namespace RacesOfValheim
{
@ -32,5 +33,33 @@ namespace RacesOfValheim
return (bool)TakeInputMethod.Invoke(player, null);
}
}
// Aswid/Skadi/Fenrir all borrow the native "gpower" Animator trigger to get its
// arms-raised cast gesture for their own transformations. The "gpower" clip carries a
// baked-in Animation Event that calls Player.ActivateGuardianPower() partway through -
// that fires no matter who requested the animation, so borrowing the trigger silently
// cast the player's real Guardian Power (and put it on cooldown) whenever it happened
// to be available. Races set this right before SetTrigger("gpower") to swallow that one
// call. Time-based rather than a plain latch, so a skipped/interrupted animation can't
// leave the real power blocked forever.
public static float SuppressGuardianPowerUntil = -1f;
public static void SuppressGuardianPowerBriefly(float seconds = 2f)
{
SuppressGuardianPowerUntil = Time.time + seconds;
}
}
[HarmonyPatch(typeof(Player), "ActivateGuardianPower")]
public static class Player_ActivateGuardianPower_SuppressBorrowed_Patch
{
public static bool Prefix(Player __instance)
{
if (__instance != Player.m_localPlayer) return true;
if (Time.time > RaceInput.SuppressGuardianPowerUntil) return true;
RaceInput.SuppressGuardianPowerUntil = -1f; // one-shot: don't block real future casts
return false;
}
}
}