//============================================================================= // SuperBall. // Author: Kenneth Stojevich //============================================================================= class SuperBall extends FlakChunk; var bool bCanHitOwner; var() float DampenFactor, DampenFactorParallel; simulated function PostBeginPlay() { Super.PostBeginPlay(); if ( Role == ROLE_Authority ) { bCanHitOwner = false; } } simulated function ProcessTouch (Actor Other, vector HitLocation) { if ( Role == ROLE_Authority ) { if ( Instigator == None || Instigator.Controller == None ) Other.SetDelayedDamageInstigatorController( InstigatorController ); Other.TakeDamage( Max(5, Damage - DamageAtten*FMax(0,(default.LifeSpan*1))), Instigator, HitLocation, (MomentumTransfer * Velocity/speed), MyDamageType ); } } simulated function Landed( Vector HitNormal ) { SetPhysics(PHYS_Projectile); LifeSpan += 1.0; } event Destroyed() { Super.Destroyed(); Instigator.Weapon.AddAmmo(1,0); } simulated function HitWall( vector HitNormal, actor Wall ) { local Vector VNorm; //Super.HitWall(HitNormal,Wall); //RandSpin(0); // if (lifespan == 0) { Destroyed(); } VNorm = (Velocity dot HitNormal) * HitNormal; Velocity = -VNorm * DampenFactor + (Velocity - VNorm) * DampenFactorParallel; Velocity.Z=0.0; Bounces = 1; lifespan -= 1; return; } defaultproperties { ScaleGlow=0.0 speed=5000.0 MaxSpeed=5000.0 DampenFactor=1.0 DampenFactorParallel=1.0 Damage=30 DamageAtten=0.0 // damage reduced per second from when the chunk was fired MomentumTransfer = 115000 LifeSpan=15 bBounce=true Bounces=1 NetPriority=10 DrawScale3D=(x=7.0,y=1.0,z=1.0) CullDistance=+30000.0 }