UnrealI
Class EnergyBolt

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

class EnergyBolt
extends Engine.Projectile

//============================================================================= // EnergyBolt. //=============================================================================
States
Flying

Function Summary
 void Explode(vector HitLocation, vector HitNormal)
 void PostBeginPlay()


State Flying Function Summary
 void processTouch(Actor Other, vector HitLocation)



Source Code


00001	//=============================================================================
00002	// EnergyBolt.
00003	//=============================================================================
00004	class EnergyBolt extends Projectile;
00005	
00006	#exec MESH IMPORT MESH=bolt1 ANIVFILE=MODELS\bolt1_a.3D DATAFILE=MODELS\bolt1_d.3D X=0 Y=0 Z=0
00007	#exec MESH ORIGIN MESH=bolt1 X=0 Y=0 Z=-0 YAW=64
00008	#exec MESH SEQUENCE MESH=bolt1 SEQ=All    STARTFRAME=0   NUMFRAMES=1
00009	#exec MESH SEQUENCE MESH=bolt1 SEQ=Still  STARTFRAME=0   NUMFRAMES=1
00010	#exec TEXTURE IMPORT NAME=Jmisc1 FILE=..\unrealshare\MODELS\misc.PCX 
00011	#exec MESHMAP SCALE MESHMAP=bolt1 X=0.05 Y=0.05 Z=0.1
00012	#exec MESHMAP SETTEXTURE MESHMAP=bolt1 NUM=1 TEXTURE=Jmisc1
00013	
00014	
00015		function PostBeginPlay()
00016		{
00017			Super.PostBeginPlay();
00018			Acceleration = vect(0,0,0);
00019			Velocity = Vector(Rotation) * 600.0;
00020			SetLocation( Location + vect(0,0,25) );
00021		}
00022	
00023		function Explode(vector HitLocation, vector HitNormal)
00024		{
00025			MakeNoise(1.0); //FIXME - set appropriate loudness
00026	  		Destroy();
00027		}
00028	
00029	/////////////////////////////////////////////////////
00030	auto state Flying
00031	{
00032		function processTouch (Actor Other, vector HitLocation)
00033		{
00034			local int hitdamage;
00035			//log(Other.Class$" touched missile");
00036	
00037			if ( Other != instigator )
00038			{
00039				hitdamage = 10;
00040				Other.TakeDamage(hitdamage, instigator,Other.Location,
00041					(1500.0 * float(hitdamage) * Normal(Velocity)), 'zapped' );
00042				Explode(Location, vect(0,0,0));
00043			}
00044		}
00045	
00046	Begin:
00047		Sleep(7.0);
00048		Explode(Location, vect(0,0,0));
00049	}
00050	
00051	defaultproperties
00052	{
00053	     MaxSpeed=1000.000000
00054	     Mesh=LodMesh'UnrealShare.bolt1'
00055	     AmbientGlow=67
00056	     bUnlit=True
00057	     LightType=LT_Steady
00058	     LightRadius=9
00059	}

End Source Code