UnrealI
Class GasbagBelch

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

class GasbagBelch
extends Engine.Projectile

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

States
Flying

Function Summary
 
simulated
PostBeginPlay()
 void SetUp()
 
simulated
Timer()


State Flying Function Summary



Source Code


00001	//=============================================================================
00002	// GasbagBelch.
00003	//=============================================================================
00004	class GasbagBelch extends Projectile;
00005	
00006	#exec TEXTURE IMPORT NAME=gbProj0 FILE=MODELS\gb_a00.pcx GROUP=Effects
00007	#exec TEXTURE IMPORT NAME=gbProj1 FILE=MODELS\gb_a01.pcx GROUP=Effects
00008	#exec TEXTURE IMPORT NAME=gbProj2 FILE=MODELS\gb_a02.pcx GROUP=Effects
00009	#exec TEXTURE IMPORT NAME=gbProj3 FILE=MODELS\gb_a03.pcx GROUP=Effects
00010	#exec TEXTURE IMPORT NAME=gbProj4 FILE=MODELS\gb_a04.pcx GROUP=Effects
00011	#exec TEXTURE IMPORT NAME=gbProj5 FILE=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	
00019	simulated function Timer()
00020	{
00021		Texture = SpriteAnim[i];
00022		i++;
00023		if (i>=6) i=0;
00024	}
00025	
00026	function SetUp()
00027	{
00028		if ( ScriptedPawn(Instigator) != None )
00029			Speed = ScriptedPawn(Instigator).ProjectileSpeed;
00030		Velocity = Vector(Rotation) * speed;
00031		MakeNoise ( 1.0 );
00032		PlaySound(SpawnSound);
00033	}
00034	
00035	simulated function PostBeginPlay()
00036	{
00037		SetUp();
00038		if ( Level.NetMode != NM_DedicatedServer )
00039		{
00040			Texture = SpriteAnim[0];
00041			i=1;
00042			SetTimer(0.15,True);
00043		}
00044		Super.PostBeginPlay();
00045	}
00046	
00047	auto state Flying
00048	{
00049	
00050	
00051	simulated function ProcessTouch (Actor Other, Vector HitLocation)
00052	{
00053		if (Other != instigator)
00054		{
00055			if ( Role == ROLE_Authority )
00056				Other.TakeDamage(Damage, instigator,HitLocation,
00057						15000.0 * Normal(velocity), 'burned');
00058			Explode(HitLocation, Vect(0,0,0));
00059		}
00060	}
00061	
00062	simulated function Explode(vector HitLocation, vector HitNormal)
00063	{
00064		local SpriteBallExplosion s;
00065	
00066		if ( (Role == ROLE_Authority) && (FRand() < 0.5) )
00067			MakeNoise(1.0); //FIXME - set appropriate loudness
00068	
00069		s = Spawn(class'SpriteBallExplosion',,,HitLocation+HitNormal*9);
00070		s.RemoteRole = ROLE_None;
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=600.000000
00088	     Damage=40.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