UnrealShare
Class ExplosionChain

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

class ExplosionChain
extends Engine.Effects

//============================================================================= // ExplosionChain. //=============================================================================
Variables
 float Damage
 float Delaytime
 float MomentumTransfer
 float Size
 bool bExploding

States
Exploding

Function Summary
 void PreBeginPlay()
 void TakeDamage(int NDamage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
 void Trigger(Actor Other, Pawn EventInstigator)


State Exploding Function Summary
 void BeginState()
 void Timer()



Source Code


00001	//=============================================================================
00002	// ExplosionChain.
00003	//=============================================================================
00004	class ExplosionChain extends Effects;
00005	
00006	
00007	#exec Texture Import File=models\exp001.pcx Name=s_Exp001 Mips=Off Mask=On Flags=2
00008	
00009	var() float MomentumTransfer;
00010	var() float Damage;
00011	var() float Size;
00012	var() float Delaytime;
00013	
00014	var bool bExploding;
00015	
00016	function PreBeginPlay()
00017	{
00018		Texture=None;
00019		Super.PreBeginPlay();
00020	}
00021	
00022	singular function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
00023							Vector momentum, name damageType)
00024	{
00025		if (bOnlyTriggerable && DamageType!='Detonated') Return;
00026		
00027		Instigator = InstigatedBy;
00028		MakeNoise(1.0);
00029		GoToState('Exploding');
00030	}
00031	
00032	function Trigger( actor Other, pawn EventInstigator )
00033	{
00034		TakeDamage(10, EventInstigator, Location, Vector(Rotation), 'Detonated');
00035	}
00036	
00037	//////////////////////////////////////////////////////////////
00038	state Exploding
00039	{
00040		ignores TakeDamage;
00041	
00042		function Timer()
00043		{
00044			local SpriteBallExplosion f;
00045			
00046			bExploding = true;
00047	 		HurtRadius(damage, Damage+100, 'Detonated', MomentumTransfer, Location);
00048	 		f = spawn(class'SpriteBallExplosion',,,Location + vect(0,0,1)*16,rot(16384,0,0)); 
00049	 		f.DrawScale = (Damage/100+0.4+FRand()*0.5)*Size;
00050			Destroy();
00051		}
00052		
00053		function BeginState()
00054		{
00055			bExploding = True;
00056			SetTimer(DelayTime+FRand()*DelayTime*2, False);
00057		}
00058	}
00059	
00060	defaultproperties
00061	{
00062	     MomentumTransfer=100000.000000
00063	     Damage=100.000000
00064	     Size=1.000000
00065	     DelayTime=0.300000
00066	     bNetTemporary=False
00067	     RemoteRole=ROLE_SimulatedProxy
00068	     DrawType=DT_Sprite
00069	     Texture=Texture'UnrealShare.s_Exp001'
00070	     DrawScale=0.400000
00071	     bCollideActors=True
00072	     bCollideWorld=True
00073	     bProjTarget=True
00074	}

End Source Code