From 8f5511e899ed70c8a60cdfb24414137a1f853143 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 29 Oct 2024 03:17:30 +0700 Subject: [PATCH] Add attack delay to Shivers right after teleport Now shivers cannot attack for 0.5 seconds after teleporting, which should help with them getting cheap shots on players. --- sources/Zeds/Nice/NiceZombieShiver.uc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sources/Zeds/Nice/NiceZombieShiver.uc b/sources/Zeds/Nice/NiceZombieShiver.uc index 1a883ff..a28b0d1 100644 --- a/sources/Zeds/Nice/NiceZombieShiver.uc +++ b/sources/Zeds/Nice/NiceZombieShiver.uc @@ -3,6 +3,7 @@ class NiceZombieShiver extends NiceZombieShiverBase; var float TeleportBlockTime; var float HeadOffsetY; var transient bool bRunning, bClientRunning; +var float teleportAttackCooldownEndTime; replication { reliable if ( Role == ROLE_Authority) @@ -39,6 +40,12 @@ simulated function PostBeginPlay() } } +function bool CanAttack(Actor target) { + if (level.timeSeconds < teleportAttackCooldownEndTime) + return false; + return super.CanAttack(target); +} + simulated event SetAnimAction(name NewAction) { local int meleeAnimIndex; @@ -407,6 +414,7 @@ function FlashTeleport() Teleported: bFlashTeleporting = false; LastFlashTime = Level.TimeSeconds; + teleportAttackCooldownEndTime = level.timeSeconds + 0.5; } function Died(Controller Killer, class damageType, vector HitLocation) {