bugfix 07/10/26 + evil laugh

This commit is contained in:
Ferdinando 2026-10-07 17:31:29 +02:00
commit 0159f1e8c4
11 changed files with 417 additions and 8 deletions

View file

@ -239,6 +239,33 @@ namespace RacesOfValheim
}
}
/// <summary>
/// Bat and mist form shut the rest of the human's attack loop as well as StartAttack: crossbow
/// reload and draw live in PlayerAttackInput, and the form's Animator fires the held attack
/// through OnAttackTrigger. See Fenrir's BlockPlayerAttackInputPatch.
/// </summary>
public static class AswidFormAttackLoop
{
public static bool InForm(Humanoid player)
{
if (player != Player.m_localPlayer) return false;
return player.GetComponentInChildren<BatFormBehavior>() != null
|| player.GetSEMan().HaveStatusEffect("SE_MistForm".GetStableHashCode());
}
}
[HarmonyPatch(typeof(Player), "PlayerAttackInput")]
public static class Aswid_BlockAttackInput_Patch
{
public static bool Prefix(Player __instance) => !AswidFormAttackLoop.InForm(__instance);
}
[HarmonyPatch(typeof(Humanoid), nameof(Humanoid.OnAttackTrigger))]
public static class Aswid_BlockAttackTrigger_Patch
{
public static bool Prefix(Humanoid __instance) => !AswidFormAttackLoop.InForm(__instance);
}
[HarmonyPatch(typeof(Character), "SetRun")]
public static class Aswid_Run_Patch
{