//=============================================================================
// BruteProjectile.
//=============================================================================
class BruteProjectile expands Projectile;

#exec MESH IMPORT MESH=srocket ANIVFILE=MODELS\srocket_a.3D DATAFILE=MODELS\srocket_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=srocket X=0 Y=0 Z=-40 YAW=0 ROLL=0 PITCH=-64
#exec MESH SEQUENCE MESH=srocket SEQ=All       STARTFRAME=0   NUMFRAMES=16
#exec MESH SEQUENCE MESH=srocket SEQ=Ignite    STARTFRAME=0   NUMFRAMES=3
#exec MESH SEQUENCE MESH=srocket SEQ=Flying    STARTFRAME=3   NUMFRAMES=13
#exec TEXTURE IMPORT NAME=SProj2 FILE=MODELS\skj_a02.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=Jpeace1 FILE=MODELS\srocket.PCX
#exec OBJ LOAD FILE=textures\FireEffect18.utx PACKAGE=UNREALI
#exec MESHMAP SCALE MESHMAP=srocket  X=1.0 Y=1.0 Z=2.0
#exec MESHMAP SETTEXTURE MESHMAP=srocket NUM=1 TEXTURE=Jpeace1
#exec MESHMAP SETTEXTURE MESHMAP=srocket NUM=0 TEXTURE=FireEffect18

#exec AUDIO IMPORT FILE="Sounds\General\brufly1.WAV" NAME="Brufly1" GROUP="General"
#exec AUDIO IMPORT FILE="Sounds\EightBal\Ignite.WAV" NAME="Ignite" GROUP="Eightball"
#exec AUDIO IMPORT FILE="Sounds\flak\Explode1.WAV" NAME="Explode1" GROUP="flak"

var float TimerDelay;

function PreBeginPlay()
{
	PlayAnim('Ignite',0.5);
	PlaySound(SpawnSound);
	Velocity = Vector(Rotation) * speed;
}


auto state Flying
{

	simulated function Timer()
	{	
		if (Level.NetMode!=NM_Server) {
			Spawn(class'BlackSmoke');		
		}
		SetTimer(TimerDelay,True);			
		TimerDelay += 0.01;
	}

	function ProcessTouch (Actor Other, Vector HitLocation)
	{
		if (Other != instigator)
			Explode(HitLocation,Vect(0,0,0));
	}
	
	function Explode(vector HitLocation, vector HitNormal)
	{
		HurtRadius(damage, 150, 'exploded', MomentumTransfer, HitLocation);
		PlaySound(ImpactSound);
		spawn(class 'SpriteBallExplosion',,'',HitLocation+HitNormal*10 );
		Destroy();
	}
	
Begin:
	TimerDelay = 0.05;
	Timer();
	FinishAnim();
	LoopAnim('Flying');
	Sleep(7.0); //self destruct after 7.0 seconds
	Explode(Location,vect(0,0,0));
}

