From 8dc8f35b08738ad095af6803a95cc184f237da2d Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 29 Oct 2024 03:00:45 +0700 Subject: [PATCH] Remove `Claw3` animation from Shiver --- sources/Zeds/Nice/NiceZombieShiver.uc | 43 +++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/sources/Zeds/Nice/NiceZombieShiver.uc b/sources/Zeds/Nice/NiceZombieShiver.uc index 8e88b16..1a883ff 100644 --- a/sources/Zeds/Nice/NiceZombieShiver.uc +++ b/sources/Zeds/Nice/NiceZombieShiver.uc @@ -38,6 +38,33 @@ simulated function PostBeginPlay() } } } + +simulated event SetAnimAction(name NewAction) { + local int meleeAnimIndex; + + if (bFrozenZed) return; + if (newAction == '') return; + + if (newAction == 'Claw') { + meleeAnimIndex = Rand(2); // Shivers only have two animations now + newAction = meleeAnims[meleeAnimIndex]; + currentDamtype = zombieDamType[meleeAnimIndex]; + } else if(newAction == 'DoorBash') { + currentDamtype = zombieDamType[Rand(3)]; + } + expectingChannel = DoAnimAction(NewAction); + if (AnimNeedsWait(newAction)) { + bWaitForAnim = true; + } else { + bWaitForAnim = false; + } + if (level.netMode != NM_Client) { + animAction = newAction; + bResetAnimAct = True; + resetAnimActTime = level.timeSeconds + 0.3; + } +} + simulated function Destroyed() { if (Level.NetMode != NM_DedicatedServer && MatAlphaSkin != none) @@ -429,10 +456,16 @@ simulated function int DoAnimAction( name AnimName ) } defaultproperties { - HeadOffsetY=-3.000000 + headOffsetY=-3.000000 idleInsertFrame=0.468000 - OnlineHeadshotOffset=(X=19.000000,Z=39.000000) - ScoringValue=15 - HeadRadius=8.000000 - HeadHeight=3.000000 + onlineHeadshotOffset=(X=19.000000,Z=39.000000) + scoringValue=15 + headRadius=8.000000 + headHeight=3.000000 + // Override third animation just in case. + // However it shouldn't be required since we've already changed + // `SetAnimAction` function to only use first two animations + meleeAnims(0)="Claw" + meleeAnims(1)="Claw2" + meleeAnims(2)="Claw" }