feat(fenrir): forms sneak at a walk and sleep when the player sits

FormLocomotion zeroed the speed whenever the player crouched, so a
sneaking form slid across the ground in its idle pose. Only airborne
reads as still now: crouched, the player moves at sneaking speed and
the creature's controller picks its walk.

Sitting sets the "sleeping" bool the creature's own MonsterAI uses,
when its controller has one; the log says once per controller which do.
IsSitting reads the replicated animator state, so onlookers' copies
sleep too. Covers every Fenrir form, local and remote, and the True
Form troll, which share FormLocomotion. Mirror now takes the Player.

Requested by a player on Discord.
This commit is contained in:
kanym 2026-10-17 18:51:14 +02:00
commit 580ef6d468
3 changed files with 43 additions and 15 deletions

View file

@ -86,7 +86,7 @@ namespace RacesOfValheim
if (isAttacking || player.IsDead()) return;
bool grounded = locomotion.Mirror(anim, playerAnim, player.IsCrouching());
bool grounded = locomotion.Mirror(anim, playerAnim, player);
if (!grounded || !RaceInput.Allowed) return;
bool log = heldLogName != null;
@ -437,7 +437,7 @@ namespace RacesOfValheim
TrolTrueFormModel.UpdateHeldLog(gameObject, rightPrefab, ref heldLog, ref heldLogName);
ReplayAttack();
locomotion.Mirror(anim, playerAnim, player.IsCrouching());
locomotion.Mirror(anim, playerAnim, player);
}
private void ReplayAttack()