NicePack/sources/Zeds/Mean/MeanZombieHusk.uc
Anton Tarasenko 618229b8d3 Add distance to target limit for mean husks' spam
Husks now only spam fireballs in a rage when within 30 units of
their target. They’ll still keep track of the number of shots and
enter this enraged state regardless of distance, but close
proximity is required for rapid-fire.
2024-10-29 04:15:16 +07:00

58 lines
2.2 KiB
Ucode

class MeanZombieHusk extends NiceZombieHusk;
#exec OBJ LOAD FILE=NicePackT.utx
var int consecutiveShots, totalShots, maxNormalShots;
function DoStun(optional Pawn instigatedBy, optional Vector hitLocation, optional Vector momentum, optional class<NiceWeaponDamageType> damageType, optional float headshotLevel, optional KFPlayerReplicationInfo KFPRI){
super.DoStun(instigatedBy, hitLocation, momentum, damageType, headshotLevel, KFPRI);
totalShots = maxNormalShots;
}
function RangedAttack(Actor A) {
local int LastFireTime;
if ( bShotAnim )
return;
if ( Physics == PHYS_Swimming ) {
SetAnimAction('Claw');
bShotAnim = true;
LastFireTime = Level.TimeSeconds;
}
else if ( VSize(A.Location - Location) < MeleeRange + CollisionRadius + A.CollisionRadius ) {
bShotAnim = true;
LastFireTime = Level.TimeSeconds;
SetAnimAction('Claw');
//PlaySound(sound'Claw2s', SLOT_Interact); KFTODO: Replace this
Controller.bPreparingMove = true;
Acceleration = vect(0,0,0);
}
else if((KFDoorMover(A) != none ||
(!Region.Zone.bDistanceFog && VSize(A.Location-Location) <= 65535) ||
(Region.Zone.bDistanceFog && VSizeSquared(A.Location-Location) < (Square(Region.Zone.DistanceFogEnd) * 0.8))) // Make him come out of the fog a bit
&& !bDecapitated && Physics != PHYS_Falling) {
bShotAnim = true;
SetAnimAction('ShootBurns');
Controller.bPreparingMove = true;
Acceleration = vect(0,0,0);
//Increment the number of consecutive shtos taken and apply the cool down if needed
totalShots ++;
consecutiveShots ++;
if(consecutiveShots < 3 && totalShots > maxNormalShots && VSize(a.location - location) <= 900)
NextFireProjectileTime = Level.TimeSeconds;
else{
NextFireProjectileTime = Level.TimeSeconds + ProjectileFireInterval + (FRand() * 2.0);
consecutiveShots = 0;
}
}
}
defaultproperties
{
maxNormalShots=3
AmmunitionClass=class'MeanZombieHuskAmmo'
remainingStuns=1
MenuName="Mean Husk"
ControllerClass=class'MeanZombieHuskController'
Skins(0)=Texture'NicePackT.MonsterMeanHusk.burns_tatters'
Skins(1)=Shader'NicePackT.MonsterMeanHusk.burns_shdr'
}