//=============================================================================
// 
//=============================================================================
class FireConeP extends DeusExProjectile;

var float fuselength;
var bool bSpawned;

simulated function Tick(float deltaTime)
{
	time += deltaTime;

	Super.Tick(deltaTime);

	if (fuseLength - time <= 14)
	{
		if (!bSpawned)
		{
			AmbientSound=Sound'ContenderStuff.Weapons.FireFtn';
			bSpawned = True;
         		if ((Level.NetMode != NM_DedicatedServer) || (Role < ROLE_Authority))
			{		
				DrawExplosionEffects(Location, vect(0,0,1));
				bSpawned = True;
				AmbientSound=Sound'ContenderStuff.Weapons.FireFtn';
			}
		}

	}
	if (fuseLength - time <= 0.5)
	{
		Destroy();
		//Explode(Location, vect(0,0,1));
	}
}

Function Timer()
{

}

auto simulated state Flying
{
simulated function HitWall(vector HitNormal, actor Wall)
{
		if (bStickToWall)
		{
			Velocity = vect(0,0,0);
			Acceleration = vect(0,0,0);
			SetPhysics(PHYS_None);
			bStuck = True;
		}
}
simulated function ProcessTouch (Actor Other, Vector HitLocation)
{
	HitWall(Normal(HitLocation), Other);
}

}


simulated function DrawExplosionEffects(vector HitLocation, vector HitNormal)
{
	local ParticleGenerator gen;

	// create a particle generator shooting out white-hot fireballs
	gen = Spawn(class'ParticleGenerator',,, HitLocation, Rotator(HitNormal));
	if (gen != None)
	{
      gen.RemoteRole = ROLE_None;
		gen.particleDrawScale = 0.4;
		gen.checkTime = 0.03;
		gen.frequency = 1.0;
		gen.ejectSpeed = 250.0;
		gen.bGravity = True;
		gen.bRandomEject = True;
		gen.particleTexture = Texture'Effects.Laser.LaserSpot2';
		//gen.particleTexture = Texture'ContenderStuff.Skins.FireSpot1';
		gen.LifeSpan = 14;
		gen.bScale = False;
		gen.bTranslucent = True;
		gen.bParticlesUnlit = True;
	}
}

defaultproperties
{
     bSpawned=False
    SoundRadius=64
    SoundVolume=255
    AmbientSound=Sound'Ambient.Ambient.SteamVent2'
     fuseLength=19.000000
     bExplodes=True
     bStickToWall=True
     blastRadius=2.000000
     DamageType=Shocked
     AccurateRange=10
     maxRange=1
     ItemName="Fountain"
     ItemArticle="a"
     speed=1.000000
     MaxSpeed=1.000000
     Damage=0.000000
     MomentumTransfer=5000
     Physics=PHYS_Falling
     Mesh=Mesh'fireworkcone'
  MultiSkins(0)=Texture'NailageEffects.firew0rx'
  MultiSkins(1)=Texture'NailageEffects.PboxInside'
	CollisionHeight=8
}

