Botpack
Class UT_ShortSmokeGen

source: e:\games\UnrealTournament\Botpack\Classes\UT_ShortSmokeGen.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Effects
         |
         +--Botpack.UT_ShortSmokeGen
Direct Known Subclasses:None

class UT_ShortSmokeGen
extends Engine.Effects

//============================================================================= // UT_ShortSmokeGen. //=============================================================================
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)



Source Code


00001	//=============================================================================
00002	// UT_ShortSmokeGen.
00003	//=============================================================================
00004	class UT_ShortSmokeGen extends Effects;
00005	
00006	var() float SmokeDelay;		// pause between drips
00007	var() float SizeVariance;		// how different each drip is 
00008	var() float BasePuffSize;
00009	var() int TotalNumPuffs;
00010	var() float RisingVelocity;
00011	var() class<effects> GenerationType;
00012	var() bool bRepeating;
00013	var int i;
00014	
00015	Auto State Active
00016	{
00017		Simulated function Timer()
00018		{
00019			local Effects d;
00020			
00021			d = Spawn(GenerationType);
00022			d.DrawScale = BasePuffSize+FRand()*SizeVariance;
00023			d.RemoteRole = ROLE_None;	
00024			i++;
00025			if (i>TotalNumPuffs && TotalNumPuffs!=0) Destroy();
00026		}
00027	}
00028	
00029	simulated function PostBeginPlay()
00030	{
00031		SetTimer(SmokeDelay+FRand()*SmokeDelay,True);
00032		Super.PostBeginPlay();
00033	}
00034	
00035	function Trigger( actor Other, pawn EventInstigator )
00036	{
00037		SetTimer(SmokeDelay+FRand()*SmokeDelay,True);
00038		i=0;
00039	}
00040	
00041	function UnTrigger( actor Other, pawn EventInstigator )
00042	{
00043		i=0;
00044		if (TotalNumPuffs==0)
00045		{
00046			if ( bRepeating )
00047				SetTimer(0.0, false);
00048			else
00049				Destroy();
00050		}
00051	
00052	}
00053	
00054	defaultproperties
00055	{
00056	     SmokeDelay=0.120000
00057	     SizeVariance=1.000000
00058	     BasePuffSize=1.500000
00059	     TotalNumPuffs=10
00060	     RisingVelocity=40.000000
00061	     GenerationType=Class'Botpack.UT_SpriteSmokePuff'
00062	     bHidden=True
00063	     bNetTemporary=False
00064	     RemoteRole=ROLE_None
00065	     Style=STY_Masked
00066	     Texture=None
00067	}

End Source Code