Botpack
Class CannonShot

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

class CannonShot
extends Engine.Projectile

//============================================================================= // CannonShot. //=============================================================================
Variables
 Texture SpriteAnim[6]
 int i

States
Flying

Function Summary
 
simulated
PostBeginPlay()
 
simulated
Timer()


State Flying Function Summary



Source Code


00001	//=============================================================================
00002	// CannonShot.
00003	//=============================================================================
00004	class CannonShot extends Projectile;
00005	
00006	#exec TEXTURE IMPORT NAME=gbProj0 FILE=..\unreali\MODELS\gb_a00.pcx GROUP=Effects
00007	#exec TEXTURE IMPORT NAME=gbProj1 FILE=..\unreali\MODELS\gb_a01.pcx GROUP=Effects
00008	#exec TEXTURE IMPORT NAME=gbProj2 FILE=..\unreali\MODELS\gb_a02.pcx GROUP=Effects
00009	#exec TEXTURE IMPORT NAME=gbProj3 FILE=..\unreali\MODELS\gb_a03.pcx GROUP=Effects
00010	#exec TEXTURE IMPORT NAME=gbProj4 FILE=..\unreali\MODELS\gb_a04.pcx GROUP=Effects
00011	#exec TEXTURE IMPORT NAME=gbProj5 FILE=..\unreali\MODELS\gb_a05.pcx GROUP=Effects
00012	
00013	#exec AUDIO IMPORT FILE="..\unrealshare\Sounds\flak\expl2.wav" NAME="expl2" GROUP="flak"
00014	
00015	var() texture SpriteAnim[6];
00016	var int i;
00017	
00018	simulated function Timer()
00019	{
00020		if ( Level.Netmode != NM_DedicatedServer )
00021			Texture = SpriteAnim[i];
00022		i++;
00023		if (i>=6) i=0;
00024	}
00025	
00026	simulated function PostBeginPlay()
00027	{
00028		if ( Level.bDropDetail )
00029			LightType = LT_None;
00030		if ( Level.NetMode != NM_DedicatedServer )
00031		{
00032			Texture = SpriteAnim[0];
00033			i=1;
00034			SetTimer(0.15,True);
00035		}
00036		if ( Role == ROLE_Authority )
00037		{
00038			PlaySound(SpawnSound);
00039			Velocity = Vector(Rotation) * speed;
00040			MakeNoise ( 1.0 );
00041		}
00042		Super.PostBeginPlay();
00043	}
00044	
00045	auto state Flying
00046	{
00047	
00048	
00049	simulated function ProcessTouch (Actor Other, Vector HitLocation)
00050	{
00051		if (Other != instigator)
00052		{
00053			if ( Role == ROLE_Authority )
00054				Other.TakeDamage(Damage, instigator,HitLocation,
00055						15000.0 * Normal(velocity), 'burned');
00056			Explode(HitLocation, Vect(0,0,0));
00057		}
00058	}
00059	
00060	simulated function Explode(vector HitLocation, vector HitNormal)
00061	{
00062		Local UT_SpriteBallExplosion s;
00063	
00064		if (FRand() < 0.5)
00065			MakeNoise(1.0); 
00066		if ( Level.NetMode != NM_DedicatedServer )
00067		{
00068			s = Spawn(class'UT_SpriteBallExplosion',,,HitLocation+HitNormal*9);
00069			s.RemoteRole = ROLE_None;
00070		}
00071		Destroy();
00072	}
00073	
00074	Begin:
00075		Sleep(3);
00076		Explode(Location, Vect(0,0,0));
00077	}
00078	
00079	defaultproperties
00080	{
00081	     SpriteAnim(0)=Texture'UnrealI.Effects.gbProj0'
00082	     SpriteAnim(1)=Texture'UnrealI.Effects.gbProj1'
00083	     SpriteAnim(2)=Texture'UnrealI.Effects.gbProj2'
00084	     SpriteAnim(3)=Texture'UnrealI.Effects.gbProj3'
00085	     SpriteAnim(4)=Texture'UnrealI.Effects.gbProj4'
00086	     SpriteAnim(5)=Texture'UnrealI.Effects.gbProj5'
00087	     speed=2100.000000
00088	     Damage=12.000000
00089	     ImpactSound=Sound'UnrealShare.flak.expl2'
00090	     RemoteRole=ROLE_SimulatedProxy
00091	     LifeSpan=3.500000
00092	     DrawType=DT_Sprite
00093	     Style=STY_Translucent
00094	     Texture=Texture'UnrealI.Effects.gbProj0'
00095	     DrawScale=1.800000
00096	     Fatness=0
00097	     bUnlit=True
00098	     LightType=LT_Steady
00099	     LightEffect=LE_NonIncidence
00100	     LightBrightness=255
00101	     LightHue=5
00102	     LightSaturation=16
00103	     LightRadius=9
00104	}

End Source Code