//=============================================================================
// SpriteSmokePuff.
//=============================================================================
class SpriteSmokePuff expands AnimSpriteEffect;

#exec TEXTURE IMPORT NAME=SmokePuff1 FILE=MODELS\sp01.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff2 FILE=MODELS\sp02.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff3 FILE=MODELS\sp03.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff4 FILE=MODELS\sp04.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff5 FILE=MODELS\sp05.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff6 FILE=MODELS\sp06.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff7 FILE=MODELS\sp07.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff8 FILE=MODELS\sp08.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff9 FILE=MODELS\sp09.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff11 FILE=MODELS\sp11.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff12 FILE=MODELS\sp12.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff13 FILE=MODELS\sp13.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff14 FILE=MODELS\sp14.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff15 FILE=MODELS\sp15.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff16 FILE=MODELS\sp16.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff17 FILE=MODELS\sp17.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff18 FILE=MODELS\sp18.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff21 FILE=MODELS\sp21.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff22 FILE=MODELS\sp22.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff23 FILE=MODELS\sp23.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff24 FILE=MODELS\sp24.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff25 FILE=MODELS\sp25.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff26 FILE=MODELS\sp26.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff27 FILE=MODELS\sp27.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff28 FILE=MODELS\sp28.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff29 FILE=MODELS\sp29.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff2a FILE=MODELS\sp2a.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff31 FILE=MODELS\sp31.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff32 FILE=MODELS\sp32.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff33 FILE=MODELS\sp33.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff34 FILE=MODELS\sp34.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff35 FILE=MODELS\sp35.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff36 FILE=MODELS\sp36.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff37 FILE=MODELS\sp37.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff41 FILE=MODELS\sp41.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff42 FILE=MODELS\sp42.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff43 FILE=MODELS\sp43.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff44 FILE=MODELS\sp44.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff45 FILE=MODELS\sp45.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff46 FILE=MODELS\sp46.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff47 FILE=MODELS\sp47.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff48 FILE=MODELS\sp48.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff49 FILE=MODELS\sp49.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff4a FILE=MODELS\sp4a.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff4b FILE=MODELS\sp4b.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff51 FILE=MODELS\sp51.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff52 FILE=MODELS\sp52.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff53 FILE=MODELS\sp53.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff54 FILE=MODELS\sp54.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff55 FILE=MODELS\sp55.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff61 FILE=MODELS\sp60.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff62 FILE=MODELS\sp61.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff63 FILE=MODELS\sp62.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff64 FILE=MODELS\sp63.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff65 FILE=MODELS\sp64.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff66 FILE=MODELS\sp65.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff67 FILE=MODELS\sp66.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff68 FILE=MODELS\sp67.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff69 FILE=MODELS\sp68.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff6a FILE=MODELS\sp69.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff70 FILE=MODELS\sp70.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff71 FILE=MODELS\sp71.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff72 FILE=MODELS\sp72.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff73 FILE=MODELS\sp73.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff74 FILE=MODELS\sp74.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff75 FILE=MODELS\sp75.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff76 FILE=MODELS\sp76.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff77 FILE=MODELS\sp77.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff78 FILE=MODELS\sp78.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff79 FILE=MODELS\sp79.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff7a FILE=MODELS\sp7a.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff80 FILE=MODELS\sp80.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff81 FILE=MODELS\sp81.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff82 FILE=MODELS\sp82.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff83 FILE=MODELS\sp83.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff84 FILE=MODELS\sp84.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff85 FILE=MODELS\sp85.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff86 FILE=MODELS\sp86.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff87 FILE=MODELS\sp87.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff88 FILE=MODELS\sp88.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff89 FILE=MODELS\sp89.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff8a FILE=MODELS\sp8a.pcx GROUP=Effects

#exec TEXTURE IMPORT NAME=SmokePuff90 FILE=MODELS\sp90.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff91 FILE=MODELS\sp91.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff92 FILE=MODELS\sp92.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff93 FILE=MODELS\sp93.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff94 FILE=MODELS\sp94.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff95 FILE=MODELS\sp95.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff96 FILE=MODELS\sp96.pcx GROUP=Effects
#exec TEXTURE IMPORT NAME=SmokePuff97 FILE=MODELS\sp97.pcx GROUP=Effects

var() Texture SmokeSprites[120];
var() int NumSprite[10];
var() int NumSets;
var() int SizeOfSets;
var() float RisingRate;
var int SelectedPuff;

auto state Flying
{
	simulated function Tick(float DeltaTime)
	{
		AnimTime+=DeltaTime;
		if (AnimTime>Pause) {
			Texture = SmokeSprites[i+SelectedPuff*SizeOfSets];
			i++;
			if (i==NumFrames) Destroy();
			AnimTime=0.0;
		}
	}
	
	simulated function BeginState()
	{
		AnimTime=0.0;
		Velocity = Vect(0,0,1)*RisingRate;
		SelectedPuff = int(FRand()*NumSets);
	}
}

