UnrealShare
Class SteelBarrel

source: e:\games\UnrealTournament\UnrealShare\Classes\SteelBarrel.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Decoration
         |
         +--UnrealShare.SteelBarrel
Direct Known Subclasses:TarydiumBarrel

class SteelBarrel
extends Engine.Decoration

//============================================================================= // SteelBarrel. //=============================================================================
Variables
 int Health

States
Animate
State Animate Function Summary
 void TakeDamage(int NDamage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
 void HitWall(vector HitNormal, Actor Wall)



Source Code


00001	//=============================================================================
00002	// SteelBarrel.
00003	//=============================================================================
00004	class SteelBarrel extends Decoration;
00005	
00006	#exec AUDIO IMPORT FILE="sounds\general\bPush1.wav" NAME="ObjectPush" GROUP="General"
00007	#exec AUDIO IMPORT FILE="sounds\general\EndPush.wav" NAME="Endpush" GROUP="General"
00008	
00009	#exec MESH IMPORT MESH=steelbarrelM ANIVFILE=MODELS\steelb_a.3D DATAFILE=MODELS\steelb_d.3D X=0 Y=0 Z=0 ZEROTEX=1
00010	#exec MESH ORIGIN MESH=steelbarrelM X=0 Y=0 Z=-20 YAW=0 ROLL=128
00011	#exec MESH SEQUENCE MESH=steelbarrelM SEQ=All    STARTFRAME=0  NUMFRAMES=2
00012	#exec MESH SEQUENCE MESH=steelbarrelM SEQ=Normal STARTFRAME=0  NUMFRAMES=1
00013	#exec MESH SEQUENCE MESH=steelbarrelM SEQ=Crush  STARTFRAME=1  NUMFRAMES=1
00014	#exec TEXTURE IMPORT NAME=Jsteelbarrel1 FILE=MODELS\steelb.PCX GROUP="Skins"
00015	#exec MESHMAP SCALE MESHMAP=steelbarrelM X=0.04 Y=0.04 Z=0.08
00016	#exec MESHMAP SETTEXTURE MESHMAP=steelbarrelM NUM=0 TEXTURE=Jsteelbarrel1
00017	
00018	var() int Health;
00019	
00020	Auto State Animate
00021	{
00022	
00023		function HitWall (vector HitNormal, actor Wall)
00024		{
00025			if (VSize(Velocity)>200) PlayAnim('Crush');
00026			Velocity = 0.8*(( Velocity dot HitNormal ) * HitNormal * (-1.8 + FRand()*0.8) + Velocity);   // Reflect off Wall w/damping
00027			Velocity.Z = Velocity.Z*0.6;
00028			If (VSize(Velocity) < 5) {
00029				SetPhysics(PHYS_None);	
00030				bBounce = False;
00031			}
00032		}
00033	
00034		function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
00035							Vector momentum, name damageType)
00036		{
00037				SetPhysics(PHYS_Falling);
00038				bBounce = True;
00039				Momentum.Z = 1000;
00040				Velocity=Momentum*0.01;
00041		}
00042	
00043	
00044	Begin:
00045		PlayAnim('normal');
00046	}
00047	
00048	defaultproperties
00049	{
00050	     Health=100
00051	     bPushable=True
00052	     PushSound=Sound'UnrealShare.General.ObjectPush'
00053	     EndPushSound=Sound'UnrealShare.General.Endpush'
00054	     bStatic=False
00055	     DrawType=DT_Mesh
00056	     Mesh=LodMesh'UnrealShare.steelbarrelM'
00057	     CollisionRadius=14.000000
00058	     CollisionHeight=23.500000
00059	     bCollideActors=True
00060	     bCollideWorld=True
00061	     bBlockActors=True
00062	     bBlockPlayers=True
00063	     bProjTarget=True
00064	     Mass=100.000000
00065	     Buoyancy=1.000000
00066	}

End Source Code