class UltimaProj expands Projectile;

#exec AUDIO IMPORT NAME="UltimaProjAmb" FILE=SOUNDS\UltimaProjAmb.wav GROUP="UltimaProtos"

simulated function PostBeginPlay()
{
	SetTimer(0.01, true);
}

simulated function Timer()
{
local Ultima_Trail trail;

	trail = Spawn(Class'Ultima_Trail');
	trail.RemoteRole = ROLE_None;
}


auto state Flying
{

	simulated function ZoneChange( Zoneinfo NewZone );

	function ProcessTouch (Actor Other, Vector HitLocation)
	{
		if ( (Other != instigator) && (!Other.IsA('Projectile') || Other.bProjTarget)) 
			Explode(HitLocation,Normal(HitLocation-Other.Location));
	}


	function Explode(vector HitLocation, vector HitNormal)
	{
		if ( Role < ROLE_Authority )
            		return;

		Spawn(Class'NuclearExplosionII',,,, rot(0,0,0));
		MakeNoise(10.0);
		Destroy();
	}

	function BeginState()
	{
        local vector Dir;

		Dir = vector(Rotation);

		if ( Role == ROLE_Authority )
			Velocity = speed * Dir;
		Acceleration = Dir * 50;
	}
}


defaultproperties
{
	DrawType=DT_Sprite
	Texture=MegaTonCorona
	MyDamageType=UltimaNuke
	speed=3600.000000
	MaxSpeed=6000.000000
	RemoteRole=ROLE_SimulatedProxy
	DrawScale=4.000000
	bUnlit=True
	SoundRadius=255
	SoundVolume=255
	AmbientSound=UltimaProjAmb
	LightType=LT_Steady
	LightEffect=LE_NonIncidence
	LightBrightness=100
	LightHue=0
	LightSaturation=0
	LightRadius=6
	Style=STY_Translucent
	ScaleGlow=2.000000
	bFixedRotationDir=True
	RotationRate=(Roll=25000)
	bNetTemporary=False
}
