//=============================================================================
// TazerProj.
//=============================================================================
class TazerProj expands Projectile;

#exec MESH IMPORT MESH=TazerProj ANIVFILE=MODELS\Cross_a.3D DATAFILE=MODELS\Cross_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=TazerProj X=0 Y=0 Z=0 YAW=64
#exec MESH SEQUENCE MESH=TazerProj SEQ=All    STARTFRAME=0   NUMFRAMES=1
#exec MESH SEQUENCE MESH=TazerProj SEQ=Still  STARTFRAME=0   NUMFRAMES=1
#exec MESHMAP SCALE MESHMAP=TazerProj X=0.04 Y=0.04 Z=0.08
#exec OBJ LOAD FILE=Textures\FireEffect2.utx PACKAGE=UNREALI
#exec MESHMAP SETTEXTURE MESHMAP=TazerProj NUM=1 TEXTURE=FireEffect2

#exec AUDIO IMPORT FILE="Sounds\General\Expl05.wav" NAME="Expl05" GROUP="General"
#exec AUDIO IMPORT FILE="Sounds\General\Expl03.wav" NAME="Expl03" GROUP="General"

function SuperExplosion()
{
	local Rotation RotVect;
	local EnergyBurst e;

	PlaySound(MiscSound,,4.0,,1000);
	HurtRadius(Damage*3.9, 80*3, 'jolted', MomentumTransfer*2, Location );
	RotVect = Pawn(Owner).ViewRotation; 
	Spawn(Class'RingExplosion2',,'',Location, RotVect);
	Spawn(class'PurpleLight');
	e = Spawn(class'EnergyBurst');
	e.DrawScale = 3.5;
	Destroy(); 

}

auto state Flying
{
	function ProcessTouch (Actor Other, vector HitLocation)
	{

		If (Other!=Instigator  && TazerProj(Other)==None)
		{
			Explode(HitLocation,Normal(HitLocation-Other.Location));
		}
	}

	function BeginState()
	{
		Velocity = vector(Rotation) * speed;	
		PlaySound(SpawnSound);
	}
}


function Explode(vector HitLocation,vector HitNormal)
{
	HurtRadius(Damage, 70, 'jolted', MomentumTransfer, Location );
	if (Damage > 60) Spawn(class'RingExplosion3',,, HitLocation+HitNormal*8,Rotation(HitNormal));
	else Spawn(class'RingExplosion',,, HitLocation+HitNormal*8,Rotation(HitNormal));
	Spawn(class'EffectLight',,, HitLocation+HitNormal*8);
	PlaySound(ImpactSound);	
	Destroy();
}

