New NiceBloatVomit
Limit how many times single projectile can damage zeds
This commit is contained in:
parent
3cf769fdfa
commit
989bfc7792
30
sources/Zeds/Nice/NiceBloatVomit.uc
Normal file
30
sources/Zeds/Nice/NiceBloatVomit.uc
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -173,7 +173,8 @@ function SpawnTwoShots()
|
|||||||
if ( !SavedFireProperties.bInitialized )
|
if ( !SavedFireProperties.bInitialized )
|
||||||
{
|
{
|
||||||
SavedFireProperties.AmmoClass = Class'SkaarjAmmo';
|
SavedFireProperties.AmmoClass = Class'SkaarjAmmo';
|
||||||
SavedFireProperties.ProjectileClass = Class'KFBloatVomit';
|
// use fixed bile class, to prevent super high damage to zeds
|
||||||
|
SavedFireProperties.ProjectileClass = Class'NiceBloatVomit';
|
||||||
SavedFireProperties.WarnTargetPct = 1;
|
SavedFireProperties.WarnTargetPct = 1;
|
||||||
SavedFireProperties.MaxRange = 500;
|
SavedFireProperties.MaxRange = 500;
|
||||||
SavedFireProperties.bTossed = False;
|
SavedFireProperties.bTossed = False;
|
||||||
@ -185,13 +186,13 @@ function SpawnTwoShots()
|
|||||||
// Turn off extra collision before spawning vomit, otherwise spawn fails
|
// Turn off extra collision before spawning vomit, otherwise spawn fails
|
||||||
ToggleAuxCollision(false);
|
ToggleAuxCollision(false);
|
||||||
FireRotation = Controller.AdjustAim(SavedFireProperties,FireStart,600);
|
FireRotation = Controller.AdjustAim(SavedFireProperties,FireStart,600);
|
||||||
Spawn(Class'KFBloatVomit',,,FireStart,FireRotation);
|
Spawn(SavedFireProperties.ProjectileClass,,,FireStart,FireRotation);
|
||||||
FireStart-=(0.5*CollisionRadius*Y);
|
FireStart-=(0.5*CollisionRadius*Y);
|
||||||
FireRotation.Yaw -= 1200;
|
FireRotation.Yaw -= 1200;
|
||||||
spawn(Class'KFBloatVomit',,,FireStart, FireRotation);
|
spawn(SavedFireProperties.ProjectileClass,,,FireStart, FireRotation);
|
||||||
FireStart+=(CollisionRadius*Y);
|
FireStart+=(CollisionRadius*Y);
|
||||||
FireRotation.Yaw += 2400;
|
FireRotation.Yaw += 2400;
|
||||||
spawn(Class'KFBloatVomit',,,FireStart, FireRotation);
|
spawn(SavedFireProperties.ProjectileClass,,,FireStart, FireRotation);
|
||||||
// Turn extra collision back on
|
// Turn extra collision back on
|
||||||
ToggleAuxCollision(true);
|
ToggleAuxCollision(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user