class NukeMush expands Effects;

#exec MESH IMPORT MESH=NukeMush ANIVFILE=MODELS\NukeMush_a.3d DATAFILE=MODELS\NukeMush_d.3d X=0 Y=0 Z=0
#exec MESH LODPARAMS MESH=NukeMush STRENGTH=0
#exec MESH ORIGIN MESH=NukeMush X=0 Y=0 Z=0

#exec MESH SEQUENCE MESH=NukeMush SEQ=All STARTFRAME=0 NUMFRAMES=16
#exec MESH SEQUENCE MESH=NukeMush SEQ=Revolve STARTFRAME=0 NUMFRAMES=16 RATE=5.0

#exec MESHMAP NEW MESHMAP=NukeMush MESH=NukeMush
#exec MESHMAP SCALE MESHMAP=NukeMush X=4.0 Y=4.0 Z=4.5

var() texture RndFlames[15];
var bool bVanishing;
var byte NukeStage;

simulated function PostBeginPlay()
{
local byte i;

	Velocity = vect(0,0,250);
	LoopAnim('Revolve', 0.7);

	For (i=0; i<8; i++)
		MultiSkins[i] = RndFlames[Min(14,Rand(15))];

	SetTimer(12.0, False);
}

simulated function Timer()
{
	if (!bVanishing)
	{
		bVanishing = True;
		Spawn(Class'NukeMushSmk');
	}
	else if (NukeStage < 8)
	{
		MultiSkins[NukeStage] = Texture'TranslucentInvisible';
		NukeStage++;
	}

	SetTimer(0.15, False);
}

simulated function Tick( float DeltaTime)
{
	if (bVanishing)
		ScaleGlow = LifeSpan * Default.ScaleGlow / 4;
}

simulated function ZoneChange( Zoneinfo NewZone );

defaultproperties
{
	DrawType=DT_Mesh
	Mesh=NukeMush
	Physics=PHYS_Projectile
	LifeSpan=16.000000
	bParticles=True
	bRandomFrame=True
	RemoteRole=ROLE_SimulatedProxy
	Texture=Flames_01
	MultiSkins(0)=Flames_01
	MultiSkins(1)=Flames_01
	MultiSkins(2)=Flames_01
	MultiSkins(3)=Flames_01
	MultiSkins(4)=Flames_01
	MultiSkins(5)=Flames_01
	MultiSkins(6)=Flames_01
	MultiSkins(7)=Flames_01
	Style=STY_Translucent
	DrawScale=9.000000
	bUnlit=True
	ScaleGlow=2.000000
	RndFlames(0)=Flames_01
	RndFlames(1)=Flames_02
	RndFlames(2)=Flames_03
	RndFlames(3)=Flames_04
	RndFlames(4)=Flames_05
	RndFlames(5)=Flames_06
	RndFlames(6)=Flames_07
	RndFlames(7)=Flames_08
	RndFlames(8)=Flames_09
	RndFlames(9)=Flames_10
	RndFlames(10)=Flames_11
	RndFlames(11)=Flames_12
	RndFlames(12)=Flames_13
	RndFlames(13)=Flames_14
	RndFlames(14)=Flames_15
}
