Core.Object | +--Engine.Actor | +--Engine.Decoration | +--UnrealShare.Chest
int
FragChunks
Float
Fragsize
Health
void
TakeDamage(int NDamage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
HitWall(vector HitNormal, Actor Wall)
00001 //============================================================================= 00002 // Chest. 00003 //============================================================================= 00004 class Chest extends Decoration; 00005 00006 #exec MESH IMPORT MESH=ChestM ANIVFILE=MODELS\chest_a.3D DATAFILE=MODELS\chest_d.3D X=0 Y=0 Z=0 00007 #exec MESH ORIGIN MESH=ChestM X=0 Y=0 Z=16 YAW=64 00008 #exec MESH SEQUENCE MESH=ChestM SEQ=All STARTFRAME=0 NUMFRAMES=1 00009 #exec MESH SEQUENCE MESH=ChestM SEQ=Still STARTFRAME=0 NUMFRAMES=1 00010 #exec TEXTURE IMPORT NAME=JChest1 FILE=MODELS\chest.PCX GROUP=Skins 00011 #exec MESHMAP SCALE MESHMAP=ChestM X=0.05 Y=0.05 Z=0.10 00012 #exec MESHMAP SETTEXTURE MESHMAP=ChestM NUM=1 TEXTURE=JChest1 TLOD=3 00013 00014 var() int Health; 00015 var() int FragChunks; 00016 var() Float Fragsize; 00017 00018 00019 Auto State Still 00020 { 00021 function HitWall (vector HitNormal, actor Wall) 00022 { 00023 SetPhysics(PHYS_None); 00024 bBounce = False; 00025 } 00026 00027 function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 00028 Vector momentum, name damageType) 00029 { 00030 Instigator = InstigatedBy; 00031 bBobbing = false; 00032 if (Health<0) Return; 00033 if ( Instigator != None ) 00034 MakeNoise(1.0); 00035 Health -= NDamage; 00036 if (Health <0) 00037 { 00038 Frag(class'WoodFragments',Momentum,FragSize,FragChunks); 00039 00040 } 00041 else { 00042 SetPhysics(PHYS_Falling); 00043 bBounce = True; 00044 Momentum.Z = 1000; 00045 Velocity=Momentum*0.016; 00046 } 00047 } 00048 Begin: 00049 } 00050 00051 defaultproperties 00052 { 00053 Health=10 00054 FragChunks=10 00055 Fragsize=1.200000 00056 bStatic=False 00057 DrawType=DT_Mesh 00058 Mesh=LodMesh'UnrealShare.ChestM' 00059 CollisionRadius=28.000000 00060 CollisionHeight=12.000000 00061 bCollideActors=True 00062 bCollideWorld=True 00063 bBlockActors=True 00064 bBlockPlayers=True 00065 Mass=10.000000 00066 NetPriority=0.500000 00067 }