UnrealShare
Class MonkStatue

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

class MonkStatue
extends Engine.Decoration

//============================================================================= // MonkStatue. //=============================================================================
States
Animate
State Animate Function Summary
 void Bump(Actor Other)
 void TakeDamage(int NDamage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
 void Timer()
 void HitWall(vector HitNormal, Actor Wall)



Source Code


00001	//=============================================================================
00002	// MonkStatue.
00003	//=============================================================================
00004	class MonkStatue extends Decoration;
00005	
00006	#exec  MESH IMPORT MESH=MonkStatueM ANIVFILE=MODELS\monk_a.3D DATAFILE=MODELS\monk_d.3D X=0 Y=0 Z=0
00007	#exec MESH ORIGIN MESH=MonkStatueM X=0 Y=0 Z=0 YAW=0
00008	#exec MESH SEQUENCE MESH=MonkStatueM SEQ=All    STARTFRAME=0  NUMFRAMES=1
00009	#exec MESH SEQUENCE MESH=MonkStatueM SEQ=Still STARTFRAME=0  NUMFRAMES=1
00010	#exec TEXTURE IMPORT NAME=JMonkStatue1 FILE=MODELS\monk.PCX GROUP="Skins"
00011	#exec MESHMAP SCALE MESHMAP=MonkStatueM X=0.12 Y=0.12 Z=0.24
00012	#exec MESHMAP SETTEXTURE MESHMAP=MonkStatueM NUM=1 TEXTURE=JMonkStatue1
00013	
00014	#exec AUDIO IMPORT FILE="sounds\general\bPush1.wav" NAME="ObjectPush" GROUP="General"
00015	#exec AUDIO IMPORT FILE="sounds\general\EndPush.wav" NAME="Endpush" GROUP="General"
00016	
00017	Auto State Animate
00018	{
00019		function HitWall (vector HitNormal, actor Wall)
00020		{
00021			if ( (Velocity.z<-200) && (HitNormal.Z > 0.5)  
00022				|| (Rotation.Pitch>4000) && (Rotation.Pitch<61000) )
00023				skinnedFrag(class'Fragment1',texture, VRand() * 40000,DrawScale*2.0,20);
00024			Velocity = 0.8*(( Velocity dot HitNormal ) * HitNormal * (-1.8 + FRand()*0.8) + Velocity);   // Reflect off Wall w/damping
00025			Velocity.Z = Velocity.Z*0.6;
00026			If ( (HitNormal.Z > 0.7) && (VSize(Velocity) < 60) )
00027			{
00028				SetPhysics(PHYS_None);	
00029				bBounce = False;
00030			}
00031		}
00032	
00033		function Timer()
00034		{
00035			if (Velocity.z<-80) 
00036			{
00037				RotationRate.Yaw = 15000;
00038				RotationRate.Pitch = 15000;
00039				RotationRate.Roll = 15000;	
00040				bRotatetoDesired=True;
00041				DesiredRotation.Pitch=16000;	
00042				DesiredRotation.Yaw=0;
00043				DesiredRotation.Roll=0;
00044			}		
00045		}
00046	
00047		function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
00048							Vector momentum, name damageType)
00049		{
00050			Instigator = InstigatedBy;
00051			if ( Instigator != None )
00052				MakeNoise(1.0);
00053			SetPhysics(PHYS_Falling);
00054			bBounce = True;
00055			Momentum.Z = 1000;
00056			Velocity=Momentum*0.01;
00057			SetTimer(0.4,False);			
00058		}
00059	}
00060	
00061	function Bump( Actor Other )
00062	{
00063		bBounce = ( bPushable && (Pawn(Other)!=None) );
00064		if ( bBounce )
00065			Super.Bump(Other);
00066	}
00067	
00068	defaultproperties
00069	{
00070	     bPushable=True
00071	     PushSound=Sound'UnrealShare.General.ObjectPush'
00072	     EndPushSound=Sound'UnrealShare.General.Endpush'
00073	     bStatic=False
00074	     DrawType=DT_Mesh
00075	     Mesh=LodMesh'UnrealShare.MonkStatueM'
00076	     CollisionHeight=88.000000
00077	     bCollideActors=True
00078	     bCollideWorld=True
00079	     bBlockActors=True
00080	     bBlockPlayers=True
00081	     bBounce=True
00082	     Mass=100.000000
00083	     Buoyancy=1.000000
00084	}

End Source Code