////////////////////////////////////////////////////////// // Item: FreezeGrenade // // Item Type: Weapon Alt Fire Projectile // // Description: Grenade the freezes all actors in // // its hurt radius. // ////////////////////////////////////////////////////////// class FreezeGrenade extends RedeemerProjectile; var FreezeTimer MyFreezeTimer; // modified function from RedeemerProjectile, to take out smoke trails simulated function PostBeginPlay() { local vector Dir; if ( bDeleteMe || IsInState('Dying') ) return; Dir = vector(Rotation); Velocity = speed * Dir; Super(Projectile).PostBeginPlay(); } /* HurtRadius() Hurt locally authoritative actors within the radius. */ simulated function HurtRadius( float DamageAmount, float DamageRadius, class DamageType, float Momentum, vector HitLocation ) { local actor Victims; if ( bHurtEntry ) return; bHurtEntry = true; foreach VisibleCollidingActors( class 'Actor', Victims, DamageRadius, HitLocation ) { // don't let blast damage affect fluid - VisibleCollisingActors doesn't really work for them - jag // grenades do not affect ourselves if( (Victims != Instigator) && (Victims != self) && (Hurtwall != Victims) && (Victims.Role == ROLE_Authority) && !Victims.IsA('FluidSurfaceInfo') ) { if ( Instigator == None || Instigator.Controller == None ) Victims.SetDelayedDamageInstigatorController( InstigatorController ); if ( Victims == LastTouched ) LastTouched = None; // Freeze each victim MyFreezeTimer = Spawn(class'FreezeGun.FreezeTimer', xPawn(Victims)); // Create a temporary pawn to store our frozen pawn MyFreezeTimer.freezeActor( xPawn(Victims) ); // call our class to freeze the actor just hit } } // grenades do not affect ourselves if ( (lastTouched != Instigator) && (LastTouched != None) && (LastTouched != self) && (LastTouched.Role == ROLE_Authority) && !LastTouched.IsA('FluidSurfaceInfo') ) { Victims = LastTouched; LastTouched = None; // Freeze the victim MyFreezeTimer = Spawn(class'FreezeGun.FreezeTimer',xPawn(Victims)); // Create a temporary pawn to store our frozen pawn MyFreezeTimer.freezeActor( xPawn(Victims) ); // call our class to freeze the actor just hit } bHurtEntry = false; } defaultproperties { Physics=PHYS_Falling // lobbing Damage=0.000000 // does no damage to health MyDamageType=Class'Engine.DamageType' // basic damage type Texture=Texture'XEffectMat.Shock.shock_core_low' // texture from shockprojectile Skins(0)=Texture'XEffectMat.Shock.shock_core_low' // skin from shockprojectile DrawType=DT_Sprite // draw the grenade as a sprite ExplosionEffectClass=Class'FreezeGun.FreezeExplosion' // use our custom explosion effect DamageRadius=500.000000 // affects everyone in a radius of 500 Style=STY_Translucent // do not draw the frame around the sprite Speed=2000.0 MaxSpeed=2000.0 }