UnrealShare
Class BruteProjectile

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

class BruteProjectile
extends Engine.Projectile

//============================================================================= // BruteProjectile. //=============================================================================
Variables
 float TimerDelay

States
Flying
State Flying Function Summary
 void SetUp()
 void BlowUp(vector HitLocation)



Source Code


00001	//=============================================================================
00002	// BruteProjectile.
00003	//=============================================================================
00004	class BruteProjectile extends Projectile;
00005	
00006	#exec MESH IMPORT MESH=srocket ANIVFILE=MODELS\srocket_a.3D DATAFILE=MODELS\srocket_d.3D X=0 Y=0 Z=0
00007	#exec MESH ORIGIN MESH=srocket X=0 Y=0 Z=-40 YAW=0 ROLL=0 PITCH=-64
00008	#exec MESH SEQUENCE MESH=srocket SEQ=All       STARTFRAME=0   NUMFRAMES=16
00009	#exec MESH SEQUENCE MESH=srocket SEQ=Ignite    STARTFRAME=0   NUMFRAMES=3
00010	#exec MESH SEQUENCE MESH=srocket SEQ=Flying    STARTFRAME=3   NUMFRAMES=13
00011	#exec TEXTURE IMPORT NAME=JTeace1 FILE=MODELS\srocket.PCX
00012	#exec OBJ LOAD FILE=textures\FireEffect18.utx PACKAGE=UnrealShare.Effect18
00013	#exec MESHMAP SCALE MESHMAP=srocket  X=1.0 Y=1.0 Z=2.0
00014	#exec MESHMAP SETTEXTURE MESHMAP=srocket NUM=1 TEXTURE=JTeace1
00015	#exec MESHMAP SETTEXTURE MESHMAP=srocket NUM=0 TEXTURE=UnrealShare.Effect18.FireEffect18
00016	
00017	#exec AUDIO IMPORT FILE="Sounds\General\8blfly2.WAV" NAME="BRocket" GROUP="General"
00018	#exec AUDIO IMPORT FILE="Sounds\EightBal\Ignite.WAV" NAME="Ignite" GROUP="Eightball"
00019	#exec AUDIO IMPORT FILE="Sounds\flak\Explode1.WAV" NAME="Explode1" GROUP="flak"
00020	
00021	var float TimerDelay;
00022	
00023	auto state Flying
00024	{
00025		simulated function Timer()
00026		{
00027			local SpriteSmokePuff bs;
00028				
00029			if (Level.NetMode!=NM_DedicatedServer) 
00030			{
00031				bs = Spawn(class'SpriteSmokePuff');
00032				bs.RemoteRole = ROLE_None;		
00033			}
00034			SetTimer(TimerDelay,True);			
00035			TimerDelay += 0.01;
00036		}
00037	
00038		simulated function ProcessTouch (Actor Other, Vector HitLocation)
00039		{
00040			if (Other != instigator)
00041				Explode(HitLocation,Vect(0,0,0));
00042		}
00043		
00044		function BlowUp(vector HitLocation)
00045		{
00046			HurtRadius(damage, 50 + instigator.skill * 45, 'exploded', MomentumTransfer, HitLocation);
00047			MakeNoise(1.0);
00048			PlaySound(ImpactSound);
00049		}
00050	
00051		simulated function Explode(vector HitLocation, vector HitNormal)
00052		{
00053			local SpriteBallExplosion s;
00054	
00055			BlowUp(HitLocation);
00056			s = spawn(class 'SpriteBallExplosion',,'',HitLocation+HitNormal*10 );
00057			s.RemoteRole = ROLE_None;
00058			Destroy();
00059		}
00060	
00061		simulated function AnimEnd()
00062		{
00063			LoopAnim('Flying');
00064			Disable('AnimEnd');
00065		}
00066	
00067		function SetUp()
00068		{
00069			PlaySound(SpawnSound);
00070			Velocity = Vector(Rotation) * speed;
00071			if ( ScriptedPawn(Instigator) != None )
00072			{
00073				Speed = ScriptedPawn(Instigator).ProjectileSpeed;
00074				if ( Instigator.IsA('LesserBrute') )
00075					Damage *= 0.7;
00076			}
00077		}
00078	
00079		simulated function BeginState()
00080		{
00081			if ( Level.NetMode != NM_DedicatedServer )
00082			{
00083				PlayAnim('Ignite',0.5);
00084				if (Level.bHighDetailMode) TimerDelay = 0.03;
00085				else TimerDelay = 5.0;;
00086				Timer();
00087			}
00088			SetUp();
00089		}
00090	
00091	Begin:
00092		Sleep(7.0); //self destruct after 7.0 seconds
00093		Explode(Location,vect(0,0,0));
00094	}
00095	
00096	defaultproperties
00097	{
00098	     speed=700.000000
00099	     MaxSpeed=900.000000
00100	     Damage=30.000000
00101	     MomentumTransfer=50000
00102	     SpawnSound=Sound'UnrealShare.Eightball.Ignite'
00103	     ImpactSound=Sound'UnrealShare.flak.Explode1'
00104	     RemoteRole=ROLE_SimulatedProxy
00105	     LifeSpan=8.000000
00106	     AmbientSound=Sound'UnrealShare.General.BRocket'
00107	     Texture=None
00108	     Mesh=LodMesh'UnrealShare.srocket'
00109	     DrawScale=0.120000
00110	     AmbientGlow=9
00111	     bUnlit=True
00112	     SoundRadius=15
00113	     SoundVolume=255
00114	     SoundPitch=73
00115	     LightType=LT_Steady
00116	     LightBrightness=154
00117	     LightHue=24
00118	     LightSaturation=207
00119	     LightRadius=2
00120	}

End Source Code