
class Grenade_IncenProj extends Grenade_FragProj;

#exec AUDIO IMPORT NAME="GrenadeSmokeBounce" FILE=Sounds\Grenades\GrenadeSmoke\SmokeBounce.wav GROUP="GrenadeSmoke"

var bool bEnableSmokeTrail;

simulated function PostBeginPlay()
{
	local ObjectsFlames F;
	
	bEnableSmokeTrail = False;
	if (Level.NetMode != NM_DedicatedServer)
		F = Spawn(Class'ObjectsFlames', Self,, Self.Location);
	Super.PostBeginPlay();
}

function SpawnGrenade()
{
	bEnableSmokeTrail = False;
	Super.SpawnGrenade();
}

simulated function Explosion(vector HitLocation)
{
	BlowUp(HitLocation);
	if (Level.NetMode != NM_DedicatedServer)
	{
		Spawn(class'Grenade_FragBlastMark',,,,rot(16384,0,0));
		Spawn(class'Grenade_FragExplosionA',,,HitLocation);
		Spawn(class'Grenade_FragExplosionB',,,HitLocation);
	}

	if(!Region.Zone.bWaterZone)
		SpawnStuff(HitLocation);
	Destroy();
}

function SpawnStuff(vector HitNormal)
{
	local int i;
	local vector Start;

	Spawn(Class'Grenade_FragSmokeRing',,,, rot(16384,0,0));
	Spawn(Class'Grenade_FragSmoke',,,Location);
	Spawn(Class'Grenade_FragSmoke',,,Location + Vect(0,0,1) * 50);
	Spawn(Class'Grenade_FragSmoke',,,Location + Vect(0,1,0) * 50);
	
	for (i=0; i<(7); i++)
	{
		Start = self.Location + 4 * VRand();
    	Spawn(class'IncenFragmentsSmall',,,Start,Rotator(Start - Location));
	}
}

simulated function Tick(float DeltaTime)
{
	local UT_SpriteSmokePuff b;

	if(bEnableSmokeTrail)
	{
		if (bHitWater || Level.bDropDetail)
		{
			Disable('Tick');
			return;
		}
		b = Spawn(class'UT_SpriteSmokePuff');
		b.RemoteRole = ROLE_None;
		b.DrawScale = 0.7;
	}
}

defaultproperties
{
	speed=150.000000
	MaxSpeed=2000.000000
	Damage=0.000000
	MomentumTransfer=0
	bUnlit=False
	AmbientGlow=0
	Physics=PHYS_Falling
	ImpactSound=Sound'BRUT.GrenadeSmoke.GrenadeSmokeBounce'
	Mesh=LodMesh'BRUT.GrenadeIncenFirstPick'
	DrawScale=2.000000
	RemoteRole=ROLE_SimulatedProxy
	bBounce=True
	LODBias=20.000000
   bFixedRotationDir=True
   DesiredRotation=(Pitch=12000,Yaw=5666,Roll=2334)
	CollisionRadius=6.000000
	CollisionHeight=7.000000
}