//=============================================================================
// EMPGrenade.
//=============================================================================
class FlashProj extends ThrownProjectile;

#exec OBJ LOAD FILE=NailageEffects

var ParticleGenerator fireGen;

var float shakeTime;
var float shakeRollMagnitude;
var float shakeVertMagnitude;

function Tick(float j)
{
		MultiSkins[0]=Texture'Effects.Electricity.WEPN_EMPG_SFX';
		MultiSkins[1]=Texture'ContenderStuff.Skins.Flash3rd';
		MultiSkins[2]=Texture'ContenderStuff.Skins.Flash3rd';
	super.tick(j);
}

auto simulated state Flying
{
	simulated function Explode(vector HitLocation, vector HitNormal)
	{
		local DeusExPlayer Play;
		foreach VisibleActors (class'DeusExPlayer', Play, BlastRadius)
		{
			if(Play != None)
			{
				Play.IncreaseClientFlashLength(5);
				Play.ShakeView(shakeTime, shakeRollMagnitude, shakeVertMagnitude);
				Play.ClientFlash(4, vect(0,200,1000));
			}
		}
		Super.Explode(HitLocation, HitNormal);
	}
}

simulated function SpawnEffects(Vector HitLocation, Vector HitNormal, Actor Other)
{
	if (fireGen == None)
	{
		fireGen = Spawn(class'ParticleGenerator', Self);
	}

	if (fireGen != None)
	{
		fireGen.RemoteRole = ROLE_None;
		//fireGen.particleTexture = None;
		fireGen.particleDrawScale = 1;
		fireGen.checkTime = 4.00;
		fireGen.riseRate = 0.0;
		fireGen.ejectSpeed = 00.0;
		fireGen.particleLifeSpan = 0.0001;
		fireGen.AmbientSound = Sound'ContenderStuff.Weapons.FlashHiss';
		fireGen.bRandomEject = True;
		fireGen.SetBase(Self);
		fireGen.LifeSpan = 4.0;
	}
}

simulated function Destroyed()
{
	Super.Destroyed();
}

function PlayBeepSound( float Range, float Pitch, float volume )
{

}
defaultproperties
{
     shaketime=30.000000
     shakeRollMagnitude=1024.000000
     shakeVertMagnitude=32.000000
     blastradius=512.000000
     fuseLength=3.000000
     proxRadius=128.000000
     AISoundLevel=0.000000
     bBlood=False
     bDebris=False
     DamageType=Shot
     spawnWeaponClass=Class'Contender.FlashWeap'
     ItemName="Flash-Bang Grenade"
     speed=1000.000000
     MaxSpeed=1000.000000
     Damage=10.000000
     MomentumTransfer=50000
    ImpactSound=Sound'ContenderStuff.Weapons.FlashExp'
     MiscSound=Sound'ContenderStuff.Weapons.GasBounce'
     LifeSpan=0.000000
     Mesh=LodMesh'DeusExItems.EMPGrenadePickup'
     MultiSkins=Texture'ContenderStuff.Skins.Flash3rd'
     Skin=Texture'ContenderStuff.Skins.Flash3rd'
     CollisionRadius=4.300000
     CollisionHeight=1.400000
     Mass=5.000000
     Buoyancy=2.000000
}
