UnrealShare
Class SmokeGenerator

source: e:\games\UnrealTournament\UnrealShare\Classes\SmokeGenerator.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Effects
         |
         +--UnrealShare.SmokeGenerator
Direct Known Subclasses:ShortSmokeGen

class SmokeGenerator
extends Engine.Effects

//============================================================================= // SmokeGenerator. //=============================================================================
Variables
 float BasePuffSize
           how different each drip is
 class GenerationType
           how different each drip is
 float RisingVelocity
           how different each drip is
 float SizeVariance
           how different each drip is
 float SmokeDelay
           pause between drips
 int TotalNumPuffs
           how different each drip is
 bool bRepeating
           how different each drip is
 int i
           how different each drip is

States
Active
State Active Function Summary
 void UnTrigger(Actor Other, Pawn EventInstigator)
 void Trigger(Actor Other, Pawn EventInstigator)
 void Timer()



Source Code


00001	//=============================================================================
00002	// SmokeGenerator.
00003	//=============================================================================
00004	class SmokeGenerator extends Effects;
00005	
00006	#exec TEXTURE IMPORT NAME=SmokePuff43 FILE=MODELS\sp43.pcx GROUP=Effects
00007	
00008	var() float SmokeDelay;		// pause between drips
00009	var() float SizeVariance;		// how different each drip is 
00010	var() float BasePuffSize;
00011	var() int TotalNumPuffs;
00012	var() float RisingVelocity;
00013	var() class<effects> GenerationType;
00014	var() bool bRepeating;
00015	
00016	var int i;
00017	
00018	Auto State Active
00019	{
00020	
00021	function Timer()
00022	{
00023		local Effects d;
00024		
00025		d = Spawn(GenerationType);
00026		d.DrawScale = BasePuffSize+FRand()*SizeVariance;	
00027		if (SpriteSmokePuff(d)!=None) SpriteSmokePuff(d).RisingRate = RisingVelocity;	
00028		i++;
00029		if (i>TotalNumPuffs && TotalNumPuffs!=0)
00030		{
00031			if ( bRepeating )
00032				SetTimer(0.0, false);
00033			else
00034				Destroy();
00035		}
00036	}
00037	
00038	
00039	function Trigger( actor Other, pawn EventInstigator )
00040	{
00041		SetTimer(SmokeDelay+FRand()*SmokeDelay,True);
00042		i=0;
00043	}
00044	
00045	
00046	function UnTrigger( actor Other, pawn EventInstigator )
00047	{
00048		i=0;
00049		if (TotalNumPuffs==0)
00050		{
00051			if ( bRepeating )
00052				SetTimer(0.0, false);
00053			else
00054				Destroy();
00055		}
00056	
00057	}
00058	
00059	}
00060	
00061	defaultproperties
00062	{
00063	     SmokeDelay=0.150000
00064	     SizeVariance=1.000000
00065	     BasePuffSize=1.750000
00066	     TotalNumPuffs=200
00067	     RisingVelocity=75.000000
00068	     GenerationType=Class'UnrealShare.SpriteSmokePuff'
00069	     bHidden=True
00070	     bNetTemporary=False
00071	     DrawType=DT_Sprite
00072	     Style=STY_Masked
00073	     Texture=Texture'UnrealShare.Effects.SmokePuff43'
00074	}

End Source Code