fix(fenrir): Cultist claws land on the clip's own hits

The single claw dealt its damage at a fixed 0.4 s, before the swing in
ClawAttackCultist (Hit event at 0.64 s of 1.33 s), and released the lock
at 0.5 s, so clicking again started a new claw mid-swing. The double
claw dealt one hit at 0.6 s although DoubleClawAttackCultist swipes
twice (Hit events at 0.64 s and 1.21 s).

BlockPlayerAttackTriggerPatch now counts the form's Hit events
(FenrirForms.AttackEvents) instead of only swallowing them. Both claws
wait for their events, with a timeout, and hold the lock until the clip
ends. Each double-claw swipe deals 60% of Double Claw Damage, 120% in
all for a slower swing that can be cut short.
This commit is contained in:
kanym 2026-10-29 02:23:27 +01:00
commit ffb45d1c1c
4 changed files with 73 additions and 17 deletions

View file

@ -18,6 +18,16 @@ namespace RacesOfValheim
/// form's own routines, and on every revert.</summary>
public static bool LocalAttacking { get; set; }
/// <summary>
/// How many hit events the local form's clips have fired: the creature's own "Hit" event,
/// which CharacterAnimEvent hands to the player's OnAttackTrigger, and BlockPlayerAttackTriggerPatch
/// counts here instead of letting it through. A swing waits for this to move, so its damage
/// lands on the clip's own blow (TrolTrueFormModel.AttackEvents, the same idea).
/// </summary>
public static int AttackEvents { get; private set; }
public static void NotifyAttackTrigger() => AttackEvents++;
public static bool LocalInForm(Character character)
{
if (character == null || character != Player.m_localPlayer) return false;