feat(skadi): add rebindable keybinds for abilities and special attacks

Adds a Skadi - Keybinds config section (bound first, ahead of the other
Skadi sections) covering every ability/attack trigger: dragon primary
attack, cold spell cast, breath attack, Fader spin, flight toggle, and the
three transform keys (Drake/Moder/Fader). Defaults match the previous
fixed inputs exactly. SkadiAttackPatch's kick-suppression check now reads
the configured Cold Spell key instead of a hardcoded Middle Mouse, so it
stays correct if that key is rebound.

Entries within Keybinds carry an explicit Order (via the new
ConfigurationManagerAttributes shim, per CONFIGURATION-MANAGER-HOWTO.md)
so they list as attack -> cast -> breath -> spin -> flight -> the three
transform keys, rather than alphabetically.
This commit is contained in:
kanym 2026-08-06 13:08:05 +02:00
commit 7708599ff9
5 changed files with 108 additions and 22 deletions

View file

@ -95,8 +95,8 @@ namespace RacesOfValheim
{
if (Player.m_localPlayer == null || Player.m_localPlayer.IsDead()) return;
// Handle Flight Toggle (RMB) - Disabled for Fader
if (RaceInput.Allowed && Input.GetMouseButtonDown(1) && formRules != null && formRules.Form != SkadiProgression.FormType.SkeletonDragon)
// Handle Flight Toggle (Right Mouse by default, rebindable) - Disabled for Fader
if (RaceInput.Allowed && SkadiConfig.FlightToggleKey.Value.IsDown() && formRules != null && formRules.Form != SkadiProgression.FormType.SkeletonDragon)
{
if (!isFlying && !isLanding)
{
@ -150,24 +150,26 @@ namespace RacesOfValheim
anim.SetFloat("forward_speed", speed);
}
// Handle Attack
// Handle Attack - each trigger is a rebindable SkadiConfig keybind; the button id
// passed into PerformAttackCoroutine (0/1/2) still selects which attack runs, exactly
// as it did when these were raw mouse-button checks.
if (CanAttackNow() && RaceInput.Allowed)
{
if (Input.GetMouseButtonDown(0))
if (SkadiConfig.PrimaryAttackKey.Value.IsDown())
{
if (HasAttackForButton(0) && Time.time - lastAttackTime >= ATTACK_COOLDOWN)
{
StartCoroutine(PerformAttackCoroutine(0));
}
}
else if (Input.GetMouseButtonDown(2)) // MMB
else if (SkadiConfig.BreathAttackKey.Value.IsDown())
{
if (Time.time - lastAttackTime >= ATTACK_COOLDOWN)
{
StartCoroutine(PerformAttackCoroutine(2));
}
}
else if (Input.GetMouseButtonDown(1) && formRules.Form == SkadiProgression.FormType.SkeletonDragon) // RMB for Fader Spin
else if (SkadiConfig.SpinAttackKey.Value.IsDown() && formRules.Form == SkadiProgression.FormType.SkeletonDragon) // Fader Spin
{
if (Time.time - lastAttackTime >= ATTACK_COOLDOWN)
{