Rework Skadi combat costs, fix dead melee, add cooldown icons

Dragon melee never dealt damage at all: the damage block sat behind
!isMelee, so bite, claw and spin played an animation, charged eitr and
did nothing. Melee now sweeps for targets the way Fenrir's claws do, and
costs nothing - it is the baseline attack that has to work at every tier.

Everything Skadi casts now runs on stamina rather than eitr. Eitr food
only exists from the Mistlands on, while the Cold Spell unlocks at
Eikthyr and the drake at the Elder, so the old costs were either
unpayable or, in the drake's case, silently ignored because UseEitr
never checked affordability. Ranged volleys are charged per projectile
so the sixty shard breath no longer costs the same as a three shard
spit, capped so the widest one stays castable.

The Cold Spell also stopped borrowing the Staff of Frost's damage, which
handed out Mistlands numbers from Eikthyr and multiplied them by every
shard. It now scales with progression, and the improved cast spreads one
budget across its shards: wider, not stronger.

The kick that played over every cast was Valheim's own SecondaryAttack,
bound to the same Middle Mouse button - suppressed for a Skadi holding
the spell. Moder now keeps its ranged attack on Middle Mouse in the air
as on the ground, with no left hand attack aloft, and Fader's airborne
branch is gone since its form cannot fly.

Ability cooldowns finally show on the HUD, each with its own icon and a
live countdown.
This commit is contained in:
kanym 2026-08-01 18:02:24 +02:00
commit fc7fd54404
4 changed files with 251 additions and 56 deletions

View file

@ -282,12 +282,28 @@ namespace RacesOfValheim
[HarmonyPatch(typeof(Humanoid), "StartAttack")]
public static class SkadiAttackPatch
{
public static bool Prefix(Humanoid __instance)
public static bool Prefix(Humanoid __instance, bool secondaryAttack)
{
if (__instance == Player.m_localPlayer && __instance.GetComponentInChildren<DrakeFormBehavior>() != null)
if (__instance != Player.m_localPlayer) return true;
if (__instance.GetComponentInChildren<DrakeFormBehavior>() != null)
{
return false;
}
// Valheim binds its own SecondaryAttack action to Middle Mouse, the same button the
// Cold Spell casts on, so pressing it also swung the unarmed secondary - the kick that
// kept showing up alongside the cast no matter which animation trigger we used. For a
// Skadi who has the spell, Middle Mouse belongs to the spell. Keyed off the live button
// state rather than a flag set during our Update, so it does not depend on whether
// PlayerController's FixedUpdate happens to run first.
if (secondaryAttack && Input.GetMouseButton(2) &&
SkadiRace.Instance != null && SkadiRace.Instance.IsSkadi())
{
var rules = SkadiProgression.GetRules(BossProgressionManager.GetCurrentProgressionState());
if (rules.ColdSpell) return false;
}
return true;
}
}