//=============================================================================
class FireRocketP2 extends DeusExProjectile;

var ParticleGenerator fireGen;
var ParticleGenerator smokeGen;

function PostBeginPlay()
{
	Super.PostBeginPlay();

   if (Level.NetMode == NM_DedicatedServer)
      return;
   
   SpawnRocketEffects();
}

simulated function PostNetBeginPlay()
{
   Super.PostNetBeginPlay();
   
   if (Role != ROLE_Authority)
      SpawnRocketEffects();
}

simulated function SpawnRocketEffects()
{
	fireGen = Spawn(class'ParticleGenerator', Self);
	if (fireGen != None)
	{
      fireGen.RemoteRole = ROLE_None;
		fireGen.particleTexture = Texture'Effects.Fire.Fireball1';
		fireGen.particleDrawScale = 0.1;
		fireGen.checkTime = 0.01;
		fireGen.riseRate = 0.0;
		fireGen.ejectSpeed = 0.0;
		fireGen.particleLifeSpan = 0.1;
		fireGen.bRandomEject = True;
		fireGen.SetBase(Self);
	}
	smokeGen = Spawn(class'ParticleGenerator', Self);
	if (smokeGen != None)
	{
      smokeGen.RemoteRole = ROLE_None;
		smokeGen.particleTexture = Texture'Effects.Smoke.SmokePuff1';
		smokeGen.particleDrawScale = 0.3;
		smokeGen.checkTime = 0.02;
		smokeGen.riseRate = 8.0;
		smokeGen.ejectSpeed = 0.0;
		smokeGen.particleLifeSpan = 2.0;
		smokeGen.bRandomEject = True;
		smokeGen.SetBase(Self);
	}
}

simulated function Destroyed()
{
	if (smokeGen != None)
		smokeGen.DelayedDestroy();
	if (fireGen != None)
		fireGen.DelayedDestroy();

	Super.Destroyed();
}


simulated function Timer()
{
   if (Level.NetMode != NM_Standalone)
   {   
      Explode(Location, vect(0,0,1));
   }
}

simulated function PreBeginPlay()
{
	Super.PreBeginPlay();

      SetTimer(2.5,false);
}


defaultproperties
{
    SoundRadius=64
    SoundVolume=255
     bExplodes=True
     bStickToWall=False
     blastRadius=2.000000
     DamageType=Shocked
     AccurateRange=2000
     maxRange=2000
     ItemName="Rocket"
     ItemArticle="a"
     speed=700.000000
     MaxSpeed=700.000000
     Damage=0.000000
     MomentumTransfer=5000
     SpawnSound=Sound'DeusExSounds.Robot.RobotFireRocket'
     AmbientSound=None
     Mesh=Mesh'rocketproj2'
     MultiSkins(0)=Texture'CoreTexWood.Wood.ClenWhitPine_A'
     MultiSkins(1)=Texture'NailageEffects.slotpanel3'
     MultiSkins(2)=Texture'NailageEffects.SmokeScreen'
     MultiSkins(3)=Texture'NailageEffects.RocktFrTex'
}
