UnrealI
Class SludgeBarrel

source: e:\games\UnrealTournament\UnrealI\Classes\SludgeBarrel.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Decoration
         |
         +--UnrealI.SludgeBarrel
Direct Known Subclasses:None

class SludgeBarrel
extends Engine.Decoration

//============================================================================= // SludgeBarrel. //=============================================================================
Variables
 name DamageTypeb
 int Health

States
exploding, Animate
State exploding Function Summary
 void Timer()


State Animate Function Summary
 void TakeDamage(int NDamage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)



Source Code


00001	//=============================================================================
00002	// SludgeBarrel.
00003	//=============================================================================
00004	class SludgeBarrel extends Decoration;
00005	
00006	#exec AUDIO IMPORT FILE="..\UnrealShare\sounds\general\bPush1.wav" NAME="ObjectPush" GROUP="General"
00007	#exec AUDIO IMPORT FILE="..\UnrealShare\sounds\general\EndPush.wav" NAME="Endpush" GROUP="General"
00008	
00009	#exec MESH IMPORT MESH=sbarrel ANIVFILE=MODELS\oilbar_a.3D DATAFILE=MODELS\oilbar_d.3D X=0 Y=0 Z=0
00010	#exec MESH ORIGIN MESH=sbarrel X=0 Y=0 Z=-190 YAW=0
00011	#exec MESH SEQUENCE MESH=sbarrel SEQ=All    STARTFRAME=0  NUMFRAMES=21
00012	#exec MESH SEQUENCE MESH=sbarrel SEQ=Swirl  STARTFRAME=0  NUMFRAMES=21
00013	#exec TEXTURE IMPORT NAME=Jsbarrel1 FILE=MODELS\oilbarel.PCX GROUP="Skins"
00014	#exec MESHMAP SCALE MESHMAP=sbarrel X=0.05 Y=0.05 Z=0.1
00015	#exec MESHMAP SETTEXTURE MESHMAP=sbarrel NUM=1 TEXTURE=Jsbarrel1
00016	
00017	
00018	var() int Health;
00019	var name DamageTypeb;
00020	
00021	Auto State Animate
00022	{
00023		singular function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
00024							Vector momentum, name damageType)
00025		{
00026			DamageTypeb = DamageType;
00027			Instigator = InstigatedBy;
00028			if (Health<0) Return;
00029			if ( Instigator != None )
00030				MakeNoise(1.0);
00031			Health -= NDamage;
00032			if (Health <0) 	GoToState('exploding');
00033			else 
00034			{
00035				SetPhysics(PHYS_Falling);
00036				bBounce = True;
00037				Momentum.Z = 1000;
00038				Velocity=Momentum*0.01;
00039			}
00040		}
00041	
00042	
00043	Begin:
00044		LoopAnim('swirl',0.4);
00045	}
00046	
00047	state exploding
00048	{
00049	
00050		function Timer()
00051		{
00052			local int i;
00053			local BarrelSludge b;
00054			
00055			HurtRadius(200, 100, 'burned', 0, Location);
00056			SetCollision(False,False,False);
00057			for (i=0 ; i<int(FRand()*5+1) ; i++) {
00058				b = Spawn( class 'BarrelSludge',, '', Location + (vect(0,0,1.2)+VRand())*(70+FRand()*50));
00059				if ( b != None )
00060					b.DrawScale = FRand()+1.2;
00061			}
00062			Spawn(Class 'GreenSmokePuff');
00063			if (DamageTypeb == 'burned') skinnedFrag(class'Fragment1', texture'jSBarrel1', Vect(0,0,30000),1.0, 4);	
00064			else  skinnedFrag(class'Fragment1', texture'jSBarrel1', Vect(0,0,30000),1.0, 12);
00065			Destroy();
00066	}
00067	
00068	Begin:
00069		if (DamageTypeb != 'burned') Timer();	
00070		else SetTimer(FRand()*0.4+0.1,False);
00071	}
00072	
00073	defaultproperties
00074	{
00075	     Health=2
00076	     bPushable=True
00077	     PushSound=Sound'UnrealI.General.ObjectPush'
00078	     EndPushSound=Sound'UnrealI.General.Endpush'
00079	     bStatic=False
00080	     DrawType=DT_Mesh
00081	     Mesh=LodMesh'UnrealI.sbarrel'
00082	     AmbientGlow=96
00083	     CollisionRadius=17.000000
00084	     CollisionHeight=26.299999
00085	     bCollideActors=True
00086	     bCollideWorld=True
00087	     bBlockActors=True
00088	     bBlockPlayers=True
00089	     LightType=LT_Steady
00090	     LightEffect=LE_TorchWaver
00091	     LightBrightness=64
00092	     LightHue=88
00093	     LightRadius=10
00094	     Mass=100.000000
00095	}

End Source Code