UnrealShare
Class TentacleProjectile

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

class TentacleProjectile
extends Engine.Projectile

//============================================================================= // TentacleProjectile. //=============================================================================
States
Flying
State Flying Function Summary
 void BeginState()



Source Code


00001	//=============================================================================
00002	// TentacleProjectile.
00003	//=============================================================================
00004	class TentacleProjectile extends Projectile;
00005	
00006	#exec MESH IMPORT MESH=TentProjectile ANIVFILE=MODELS\Tproj_a.3D DATAFILE=MODELS\Tproj_d.3D X=0 Y=0 Z=0
00007	#exec MESH ORIGIN MESH=TentProjectile X=0 Y=0 Z=0 YAW=64
00008	#exec MESH SEQUENCE MESH=TentProjectile SEQ=All  STARTFRAME=0  NUMFRAMES=1
00009	#exec TEXTURE IMPORT NAME=JTentacle1 FILE=MODELS\Tentacle.PCX GROUP="Skins" 
00010	#exec MESHMAP SCALE MESHMAP=TentProjectile X=0.02 Y=0.02 Z=0.04
00011	#exec MESHMAP SETTEXTURE MESHMAP=TentProjectile NUM=1 TEXTURE=JTentacle1
00012	
00013	#exec AUDIO IMPORT FILE="Sounds\tentacle\tensht1.WAV" NAME="TentSpawn" GROUP="Tentacle"
00014	#exec AUDIO IMPORT FILE="Sounds\tentacle\tenimp2.WAV" NAME="TentImpact" GROUP="Tentacle"
00015	
00016	auto state Flying
00017	{
00018		simulated function ProcessTouch (Actor Other, Vector HitLocation)
00019		{
00020			local vector momentum;
00021		
00022			if ((Tentacle(Other) == None) && (TentacleProjectile(Other) == None))
00023			{
00024				if ( Role == ROLE_Authority )
00025				{
00026					momentum = 10000.0 * Normal(Velocity);
00027					Other.TakeDamage(Damage, instigator, HitLocation, momentum, 'stung');
00028				}
00029				Destroy();
00030			}
00031		}
00032		
00033		simulated function Explode(vector HitLocation, vector HitNormal)
00034		{
00035			local SmallSpark2 s;
00036			PlaySound(ImpactSound);
00037			MakeNoise(1.0);
00038			s = spawn(class'SmallSpark2',,,HitLocation+HitNormal*5,rotator(HitNormal*2+VRand()));
00039			s.RemoteRole = ROLE_None;
00040			destroy();
00041		}
00042	
00043		function BeginState()
00044		{
00045			Velocity = Vector(Rotation) * speed;
00046			PlaySound(SpawnSound);
00047		}
00048	
00049	Begin:
00050		Sleep(7.0); //self destruct after 7.0 seconds
00051		Explode(Location, vect(0,0,0));
00052		
00053	}
00054	
00055	defaultproperties
00056	{
00057	     speed=800.000000
00058	     MaxSpeed=800.000000
00059	     Damage=12.000000
00060	     SpawnSound=Sound'UnrealShare.Tentacle.TentSpawn'
00061	     ImpactSound=Sound'UnrealShare.Tentacle.TentImpact'
00062	     RemoteRole=ROLE_SimulatedProxy
00063	     LifeSpan=15.000000
00064	     AnimRate=1.000000
00065	     Mesh=LodMesh'UnrealShare.TentProjectile'
00066	     AmbientGlow=255
00067	     bUnlit=True
00068	     Mass=2.000000
00069	}

End Source Code