From 324e644db4e243f1ae1688f95ba35609f11e6270 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 29 Oct 2024 03:57:46 +0700 Subject: [PATCH] Add mechanic that buffs clots from the siren's scream Increase their speed by 50% and tankiness by not receving any body damage upon decapitation while under the effects. --- sources/Zeds/Nice/NiceZombieClot.uc | 26 ++++++++++++++++++++++++++ sources/Zeds/Nice/NiceZombieSiren.uc | 5 +++++ 2 files changed, 31 insertions(+) diff --git a/sources/Zeds/Nice/NiceZombieClot.uc b/sources/Zeds/Nice/NiceZombieClot.uc index 57875e8..71f8939 100644 --- a/sources/Zeds/Nice/NiceZombieClot.uc +++ b/sources/Zeds/Nice/NiceZombieClot.uc @@ -5,6 +5,8 @@ class NiceZombieClot extends NiceZombieClotBase; #exec OBJ LOAD FILE=KF_Specimens_Trip_T.utx #exec OBJ LOAD FILE=MeanZedSkins.utx +var float sirenBoostTimeout; + function ClawDamageTarget() { local vector PushDir; @@ -109,9 +111,33 @@ simulated function int DoAnimAction( name AnimName ) } return super.DoAnimAction( AnimName ); } +function DealDecapDamage( int damage, + Pawn instigatedBy, + Vector hitLocation, + Vector momentum, + class damageType, + float headshotLevel, + KFPlayerReplicationInfo KFPRI, + optional float lockonTime) { + if (sirenBoostTimeout > 0) { + RemoveHead(); + } else { + super.DealDecapDamage(damage, instigatedBy, hitLocation, momentum, + damageType, headshotLevel, KFPRI, lockonTime); + } +} +simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + if (sirenBoostTimeout > 0) { + groundSpeed *= 1.5; + } +} simulated function Tick(float DeltaTime) { super.Tick(DeltaTime); + if (sirenBoostTimeout >= 0) { + sirenBoostTimeout -= deltaTime; + } if( bShotAnim && Role == ROLE_Authority ) { if( LookTarget!=none ) diff --git a/sources/Zeds/Nice/NiceZombieSiren.uc b/sources/Zeds/Nice/NiceZombieSiren.uc index 6f13cf4..aa15090 100644 --- a/sources/Zeds/Nice/NiceZombieSiren.uc +++ b/sources/Zeds/Nice/NiceZombieSiren.uc @@ -226,6 +226,7 @@ simulated function HurtRadius(float DamageAmount, float DamageRadius, class niceVet; + local NiceZombieClot niceClot; if (bHurtEntry || Health <= 0 || HeadHealth <= 0 || bIsStunned) return; @@ -243,6 +244,10 @@ simulated function HurtRadius(float DamageAmount, float DamageRadius, class