class FireRing expands SmkRing;

#exec MESH IMPORT MESH=FireRing ANIVFILE=MODELS\FireRing_a.3d DATAFILE=MODELS\FireRing_d.3d X=0 Y=0 Z=0
#exec MESH LODPARAMS MESH=FireRing STRENGTH=0.25
#exec MESH ORIGIN MESH=FireRing X=0 Y=0 Z=0 PITCH=64

#exec MESH SEQUENCE MESH=FireRing SEQ=All STARTFRAME=0 NUMFRAMES=4
#exec MESH SEQUENCE MESH=FireRing SEQ=Expand STARTFRAME=0 NUMFRAMES=2 RATE=1.0
#exec MESH SEQUENCE MESH=FireRing SEQ=MegaCollapse STARTFRAME=1 NUMFRAMES=2 RATE=1.0
#exec MESH SEQUENCE MESH=FireRing SEQ=MegaExpand STARTFRAME=2 NUMFRAMES=2 RATE=1.0

#exec MESHMAP NEW MESHMAP=FireRing MESH=FireRing
#exec MESHMAP SCALE MESHMAP=FireRing X=2.0 Y=2.0 Z=4.0


var() texture RndFlames[15];
var() texture RndSmoke[8];
var bool bChange;


simulated function Tick( float DeltaTime)
{
	ScaleGlow = 2.5 * LifeSpan;
}

simulated function PostBeginPlay()
{
local int i;

	Super.PostBeginPlay();

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

	SetTimer(0.1, True);
}

simulated function Timer()
{
local RingRemains rrm;
local int i;

	If (LifeSpan < 0.75 && !bChange)
	{
		bChange = True;

		For(i=0; i<8; i++)
			MultiSkins[i] = RndSmoke[Rand(7)];

		DrawScale = 3.5;
	}

	rrm = Spawn(Class'RingRemains');
	rrm.DrawScale = DrawScale;
	rrm.GlowCoeficient = ScaleGlow;
	rrm.AnimSequence = AnimSequence;
	rrm.AnimFrame = AnimFrame;
	
	For(i=0; i<8; i++)
	{
		if (!bChange)
			rrm.MultiSkins[i] = RndFlames[Rand(14)];
		else
			rrm.MultiSkins[i] = RndSmoke[Rand(7)];
	}

	rrm.RemoteRole = ROLE_None;
}

defaultproperties
{
	Mesh=FireRing
	DrawScale=1.500000
	ScaleGlow=2.000000
	LifeSpan=1.000000
	MultiSkins(0)=Flames_01
	MultiSkins(1)=Flames_02
	MultiSkins(2)=Flames_03
	MultiSkins(3)=Flames_04
	MultiSkins(4)=Flames_05
	MultiSkins(5)=Flames_06
	MultiSkins(6)=Flames_07
	MultiSkins(7)=Flames_08
	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
	RndSmoke(0)=Smoke_01
	RndSmoke(1)=Smoke_02
	RndSmoke(2)=Smoke_03
	RndSmoke(3)=Smoke_04
	RndSmoke(4)=Smoke_05
	RndSmoke(5)=Smoke_06
	RndSmoke(6)=Smoke_07
	RndSmoke(7)=Smoke_08
	ExpandRate=1.000000
	AnimType=MegaExpand
}
