Core.Object | +--Engine.Actor | +--Engine.Decoration | +--UnrealShare.Barrel
int
Health
void
TakeDamage(int NDamage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
HitWall(vector HitNormal, Actor Wall)
00001 //============================================================================= 00002 // Barrel. 00003 //============================================================================= 00004 class Barrel 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=BarrelM ANIVFILE=MODELS\Barrel_a.3D DATAFILE=MODELS\Barrel_d.3D ZEROTEX=1 00010 #exec MESH LODPARAMS MESH=BarrelM STRENGTH=0.5 00011 #exec MESH ORIGIN MESH=BarrelM X=320 Y=160 Z=95 YAW=64 00012 #exec MESH SEQUENCE MESH=BarrelM SEQ=All STARTFRAME=0 NUMFRAMES=1 00013 #exec MESH SEQUENCE MESH=BarrelM SEQ=Still STARTFRAME=0 NUMFRAMES=1 00014 #exec TEXTURE IMPORT NAME=JBarrel1 FILE=MODELS\Barrel.PCX GROUP=Skins FLAGS=2 00015 #exec MESHMAP SCALE MESHMAP=BarrelM X=0.15 Y=0.15 Z=0.3 00016 #exec MESHMAP SETTEXTURE MESHMAP=BarrelM NUM=0 TEXTURE=JBarrel1 TLOD=10 00017 00018 00019 var() int Health; 00020 00021 Auto State Animate 00022 { 00023 function HitWall (vector HitNormal, actor Wall) 00024 { 00025 if (Velocity.Z<-200) TakeDamage(100,Pawn(Owner),HitNormal,HitNormal*10000,'shattered'); 00026 bBounce = False; 00027 Velocity = vect(0,0,0); 00028 } 00029 00030 00031 function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 00032 Vector momentum, name damageType) 00033 { 00034 Instigator = InstigatedBy; 00035 bBobbing = false; 00036 if (Health<0) Return; 00037 if ( Instigator != None ) 00038 MakeNoise(1.0); 00039 Health -= NDamage; 00040 if (Health <0) 00041 Frag(class'WoodFragments',Momentum,1.75,12); 00042 else 00043 { 00044 SetPhysics(PHYS_Falling); 00045 bBounce = True; 00046 Momentum.Z = 1000; 00047 Velocity=Momentum*0.01; 00048 } 00049 } 00050 00051 Begin: 00052 } 00053 00054 defaultproperties 00055 { 00056 Health=10 00057 bPushable=True 00058 PushSound=Sound'UnrealShare.General.ObjectPush' 00059 EndPushSound=Sound'UnrealShare.General.Endpush' 00060 bStatic=False 00061 DrawType=DT_Mesh 00062 Skin=Texture'UnrealShare.Skins.JBarrel1' 00063 Mesh=LodMesh'UnrealShare.BarrelM' 00064 CollisionRadius=24.000000 00065 CollisionHeight=29.000000 00066 bCollideActors=True 00067 bCollideWorld=True 00068 bBlockActors=True 00069 bBlockPlayers=True 00070 Mass=50.000000 00071 Buoyancy=60.000000 00072 }