UnrealShare
Class Arrow

source: e:\games\UnrealTournament\UnrealShare\Classes\Arrow.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Projectile
         |
         +--UnrealShare.Arrow
Direct Known Subclasses:None

class Arrow
extends Engine.Projectile

//============================================================================= // Arrow. //=============================================================================

Function Summary
 
simulated
AnimEnd()
 
simulated
Explode(vector HitLocation, vector HitNormal)
 
simulated
HitWall(vector HitNormal, Actor Wall)
 void PostBeginPlay()
 
simulated
ProcessTouch(Actor Other, Vector HitLocation)



Source Code


00001	//=============================================================================
00002	// Arrow.
00003	//=============================================================================
00004	class Arrow extends Projectile;
00005	
00006	#exec MESH IMPORT MESH=ArrowM ANIVFILE=MODELS\arrow_a.3D DATAFILE=MODELS\arrow_d.3D X=0 Y=0 Z=0
00007	#exec MESH ORIGIN MESH=ArrowM X=0 Y=0 Z=0 YAW=-64
00008	#exec MESH SEQUENCE MESH=ArrowM SEQ=All  STARTFRAME=0  NUMFRAMES=1
00009	#exec MESH SEQUENCE MESH=ArrowM SEQ=Still  STARTFRAME=0   NUMFRAMES=1 
00010	#exec TEXTURE IMPORT NAME=JArrow1 FILE=MODELS\arrow.PCX GROUP=Skins
00011	#exec MESHMAP SCALE MESHMAP=ArrowM X=0.04 Y=0.04 Z=0.08
00012	#exec MESHMAP SETTEXTURE MESHMAP=ArrowM NUM=1 TEXTURE=JArrow1
00013	
00014	#exec MESH IMPORT MESH=burst ANIVFILE=MODELS\burst_a.3D DATAFILE=MODELS\burst_d.3D X=0 Y=0 Z=0 ZEROTEX=1
00015	#exec MESH ORIGIN MESH=burst X=0 Y=0 Z=0 YAW=-64
00016	#exec MESH SEQUENCE MESH=burst SEQ=All       STARTFRAME=0   NUMFRAMES=6
00017	#exec MESH SEQUENCE MESH=burst SEQ=Explo     STARTFRAME=0   NUMFRAMES=6
00018	#exec TEXTURE IMPORT NAME=Jburst1 FILE=MODELS\burst.PCX GROUP=Skin
00019	#exec MESHMAP SCALE MESHMAP=burst X=0.2 Y=0.2 Z=0.4 YAW=128
00020	#exec MESHMAP SETTEXTURE MESHMAP=burst NUM=0 TEXTURE=Jburst1
00021	
00022	#exec AUDIO IMPORT FILE="Sounds\general\ArrowSpawn.wav" NAME="ArrowSpawn" GROUP="General"
00023	#exec AUDIO IMPORT FILE="..\Unreali\Sounds\Razor\bladehit.wav" NAME="BladeHit" GROUP="RazorJack"
00024	
00025		function PostBeginPlay()
00026		{
00027			local rotator RandRot;
00028	
00029			Super.PostBeginPlay();
00030	
00031			Velocity = Vector(Rotation) * Speed;      // velocity
00032			RandRot.Pitch = FRand() * 200 - 100;
00033			RandRot.Yaw = FRand() * 200 - 100;
00034			RandRot.Roll = FRand() * 200 - 100;
00035			Velocity = Velocity >> RandRot;
00036			PlaySound(SpawnSound, SLOT_Misc, 2.0);		
00037		}
00038	
00039		simulated function ProcessTouch( Actor Other, Vector HitLocation )
00040		{
00041			local int hitdamage;
00042	
00043			if (Arrow(Other) == none)
00044			{
00045				if ( Role == ROLE_Authority )
00046					Other.TakeDamage(damage, instigator,HitLocation,
00047						(MomentumTransfer * Normal(Velocity)), 'shot');
00048				Destroy();
00049			}
00050		}
00051	
00052		simulated function HitWall( vector HitNormal, actor Wall )
00053		{
00054			Super.HitWall(HitNormal, Wall);	
00055			PlaySound(ImpactSound, SLOT_Misc, 0.5);
00056	  		mesh = mesh'Burst';
00057	  		Skin = Texture'JArrow1';
00058			SetPhysics(PHYS_None); 
00059			SetCollision(false,false,false);
00060			MakeNoise(0.3);
00061			PlayAnim   ( 'Explo', 0.9 );
00062		}
00063	
00064		simulated function Explode(vector HitLocation, vector HitNormal)
00065		{
00066		}
00067	
00068	
00069		simulated function AnimEnd()
00070		{
00071			Destroy();
00072		}
00073	
00074	defaultproperties
00075	{
00076	     speed=700.000000
00077	     Damage=20.000000
00078	     MomentumTransfer=2000
00079	     SpawnSound=Sound'UnrealShare.General.ArrowSpawn'
00080	     ImpactSound=Sound'UnrealShare.Razorjack.BladeHit'
00081	     RemoteRole=ROLE_SimulatedProxy
00082	     Mesh=LodMesh'UnrealShare.ArrowM'
00083	     bUnlit=True
00084	}

End Source Code