UnrealI
Class Chair

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

class Chair
extends Engine.Decoration

//============================================================================= // Chair. //=============================================================================
Variables
 int FragChunks
 Float Fragsize
 int Health

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



Source Code


00001	//=============================================================================
00002	// Chair.
00003	//=============================================================================
00004	class Chair extends Decoration;
00005	
00006	
00007	#exec MESH IMPORT MESH=Chair1 ANIVFILE=MODELS\chair_a.3D DATAFILE=MODELS\chair_d.3D X=0 Y=0 Z=0
00008	#exec MESH ORIGIN MESH=Chair1 X=0 Y=0 Z=0 ROLL=-64 
00009	#exec MESH SEQUENCE MESH=Chair1 SEQ=All    STARTFRAME=0  NUMFRAMES=1
00010	#exec TEXTURE IMPORT NAME=JChair11 FILE=MODELS\chair.PCX GROUP="Skins"
00011	#exec MESHMAP SCALE MESHMAP=Chair1 X=0.05 Y=0.05 Z=0.1
00012	#exec MESHMAP SETTEXTURE MESHMAP=Chair1 NUM=1 TEXTURE=JChair11
00013	
00014	
00015	var() int Health;
00016	var() int FragChunks;
00017	var() Float Fragsize;
00018	
00019	Auto State Animate
00020	{
00021	
00022		function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
00023							Vector momentum, name damageType)
00024		{
00025			Instigator = InstigatedBy;
00026			if (Health<0) Return;
00027			if ( Instigator != None )
00028				MakeNoise(1.0);
00029			bBobbing = false;
00030			Health -= NDamage;
00031			if (Health <0) 	
00032				Frag(Class'WoodFragments',Momentum,FragSize,FragChunks);		
00033			else 
00034			{
00035				SetPhysics(PHYS_Falling);
00036				Momentum.Z = 1000;
00037				Velocity=Momentum*0.016;
00038			}
00039		}
00040	}
00041	
00042	defaultproperties
00043	{
00044	     Health=15
00045	     FragChunks=9
00046	     Fragsize=1.200000
00047	     bStatic=False
00048	     DrawType=DT_Mesh
00049	     Mesh=LodMesh'UnrealI.Chair1'
00050	     CollisionRadius=17.000000
00051	     CollisionHeight=15.000000
00052	     bCollideActors=True
00053	     bCollideWorld=True
00054	     bBlockActors=True
00055	     bBlockPlayers=True
00056	}

End Source Code