//=============================================================================
// 
//=============================================================================
class FireRocketP 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=None;
			bSpawned = True;
         		//if ((Level.NetMode != NM_DedicatedServer) || (Role < ROLE_Authority))
			if(Role == ROLE_Authority)
			{		
				DrawExplosionEffects(Location, vect(0,0,1));
				bSpawned = True;
				AmbientSound=None;
			}
		}

	}
	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)
{
	local rotator rot;
		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 FireRocketP2 RP;
	
	RP = Spawn(class'FireRocketP2',,, HitLocation, Rotator(HitNormal));
	Destroy();

}

defaultproperties
{
     CollisionHeight=21
     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="Rocket"
     ItemArticle="a"
     speed=1.000000
     MaxSpeed=1.000000
     Damage=0.000000
     MomentumTransfer=5000
     Physics=PHYS_Falling
  Mesh=Mesh'fireworkrocket'
  MultiSkins(0)=Texture'CoreTexWood.Wood.ClenWhitPine_A'
  MultiSkins(1)=Texture'NailageEffects.SmokeScreen'
  MultiSkins(2)=Texture'NailageEffects.slotpanel3'
  MultiSkins(3)=Texture'NailageEffects.RocktFrTex'
}

