NicePack/sources/Zeds/Nice/NiceBloatVomit.uc
Shtoyan 989bfc7792 New NiceBloatVomit
Limit how many times single projectile can damage zeds
2023-05-22 02:11:29 +04:00

30 lines
976 B
Ucode

class NiceBloatVomit extends KFBloatVomit;
// limit how much you can damage zeds
const DAMAGECOUNT=10;
var private transient int DamageTicked;
auto state Flying {
simulated function ProcessTouch(Actor Other, Vector HitLocation) {
// add damage limit
if (DamageTicked >= DAMAGECOUNT) {
BlowUp(HitLocation);
return;
}
if (ExtendedZCollision(Other) != none) {
return;
}
if (
Other != Instigator &&
(Other.IsA('Pawn') || Other.IsA('DestroyableObjective') || Other.bProjTarget)
) {
DamageTicked += 1;
// warn("DamageTicked: " $ DamageTicked);
// use server DelayedHurtRadius() instead?
HurtRadius(Damage, DamageRadius, MyDamageType, MomentumTransfer, HitLocation);
}
else if (Other != Instigator && Other.bBlockActors) {
HitWall(Normal(HitLocation - Location), Other);
}
}
}