UnrealI
Class Titan

source: e:\games\UnrealTournament\UnrealI\Classes\Titan.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--UnrealShare.ScriptedPawn
            |
            +--UnrealI.Titan
Direct Known Subclasses:StoneTitan

class Titan
extends UnrealShare.ScriptedPawn

//============================================================================= // Titan. //=============================================================================
Variables
 byte SlapDamage,
 name StepEvent
 name StompEvent
 bool bEndFootStep
 bool bLavaTitan
 bool bStomp
 float realSpeed

States
LavaDeath, WalkOut, Sitting

Function Summary
 eAttitude AttitudeToCreature(Pawn Other)
 void FootStep()
 bool NeedToTurn(vector targ)
     
//Titan doesn't need to face as directly
 void PlayAcquisitionSound()
 void PlayChallenge()
 void PlayDying(name DamageType, vector HitLocation)
 void PlayFearSound()
 void PlayMeleeAttack()
 void PlayPatrolStop()
     
//PlayPatrolStop(), and PlayWaitingAmbush() all use PlayWaiting(); 			
 void PlayRangedAttack()
 void PlayRoamingSound()
 void PlayRunning()
 void PlayTakeHit(float tweentime, vector HitLoc, int Damage)
 void PlayThreatening()
 void PlayThreateningSound()
 void PlayTurning()
 void PlayVictoryDance()
 void PlayWaiting()
 void PlayWaitingAmbush()
 void PlayWalking()
 void PunchDamageTarget()
 void SlapDamageTarget()
 void SpawnRock()
 void StartMoving()
 void Stomp()
 void ThrowOther(Pawn Other)
 void TweenToFighter(float tweentime)
 void TweenToPatrolStop(float tweentime)
 void TweenToRunning(float tweentime)
 void TweenToWaiting(float tweentime)
 void TweenToWalking(float tweentime)
 void ZoneChange(ZoneInfo newZone)


State LavaDeath Function Summary


State WalkOut Function Summary
 void BeginState()
 void Trigger(Actor Other, Pawn EventInstigator)


State Sitting Function Summary
 void BeginState()
 void Trigger(Actor Other, Pawn EventInstigator)



Source Code


00001	//=============================================================================
00002	// Titan.
00003	//=============================================================================
00004	class Titan extends ScriptedPawn;
00005	
00006	#exec MESH IMPORT MESH=Titan1 ANIVFILE=MODELS\titan_a.3D DATAFILE=MODELS\titand.3D X=0 Y=0 Z=0 ZEROTEX=1
00007	#exec MESH ORIGIN MESH=Titan1 X=20 Y=-130 Z=-65 YAW=64 ROLL=-64
00008	
00009	#exec MESH SEQUENCE MESH=titan1 SEQ=All       STARTFRAME=0   NUMFRAMES=300
00010	#exec MESH SEQUENCE MESH=titan1 SEQ=TBrea001  STARTFRAME=0   NUMFRAMES=6   RATE=6
00011	#exec MESH SEQUENCE MESH=titan1 SEQ=TChest    STARTFRAME=6   NUMFRAMES=28  RATE=15  Group=Attack
00012	#exec MESH SEQUENCE MESH=titan1 SEQ=TDeat001  STARTFRAME=34  NUMFRAMES=29  RATE=15
00013	#exec MESH SEQUENCE MESH=titan1 SEQ=TDeat002  STARTFRAME=63  NUMFRAMES=18  RATE=15
00014	#exec MESH SEQUENCE MESH=titan1 SEQ=TDeat003  STARTFRAME=81  NUMFRAMES=18  RATE=15
00015	#exec MESH SEQUENCE MESH=titan1 SEQ=TFigh001  STARTFRAME=99  NUMFRAMES=8   RATE=6
00016	#exec MESH SEQUENCE MESH=titan1 SEQ=TFist     STARTFRAME=107 NUMFRAMES=28  RATE=15
00017	#exec MESH SEQUENCE MESH=titan1 SEQ=TGetUp    STARTFRAME=135 NUMFRAMES=35  RATE=15
00018	#exec MESH SEQUENCE MESH=titan1 SEQ=TLeftUp   STARTFRAME=170 NUMFRAMES=1
00019	#exec MESH SEQUENCE MESH=titan1 SEQ=TPunc001  STARTFRAME=171 NUMFRAMES=13  RATE=15  Group=Attack
00020	#exec MESH SEQUENCE MESH=titan1 SEQ=TRightUp  STARTFRAME=184 NUMFRAMES=1
00021	#exec MESH SEQUENCE MESH=titan1 SEQ=TSit      STARTFRAME=185 NUMFRAMES=1
00022	#exec MESH SEQUENCE MESH=titan1 SEQ=TSlap001  STARTFRAME=186 NUMFRAMES=15  RATE=15  Group=Attack
00023	#exec MESH SEQUENCE MESH=titan1 SEQ=TSnif001  STARTFRAME=201 NUMFRAMES=18  RATE=15
00024	#exec MESH SEQUENCE MESH=titan1 SEQ=TStom001  STARTFRAME=219 NUMFRAMES=18  RATE=15  Group=Attack
00025	#exec MESH SEQUENCE MESH=titan1 SEQ=TThro001  STARTFRAME=237 NUMFRAMES=18  RATE=15  Group=Attack
00026	#exec MESH SEQUENCE MESH=titan1 SEQ=TWalk001  STARTFRAME=255 NUMFRAMES=30  RATE=15
00027	#exec MESH SEQUENCE MESH=titan1 SEQ=TShuffle  STARTFRAME=285 NUMFRAMES=15  RATE=15
00028	
00029	#exec TEXTURE IMPORT NAME=Jtitan1 FILE=MODELS\titan.PCX GROUP=Skins  
00030	#exec MESHMAP SCALE MESHMAP=titan1 X=0.3 Y=0.3 Z=0.6
00031	#exec MESHMAP SETTEXTURE MESHMAP=titan1 NUM=0 TEXTURE=Jtitan1
00032	
00033	#exec MESH NOTIFY MESH=titan1 SEQ=TWalk001 TIME=0.25 FUNCTION=FootStep
00034	#exec MESH NOTIFY MESH=titan1 SEQ=TWalk001 TIME=0.75 FUNCTION=FootStep
00035	#exec MESH NOTIFY MESH=titan1 SEQ=TWalk001 TIME=0.4  FUNCTION=StartMoving
00036	#exec MESH NOTIFY MESH=titan1 SEQ=TWalk001 TIME=0.9  FUNCTION=StartMoving
00037	#exec MESH NOTIFY MESH=titan1 SEQ=TStom001 TIME=0.4  FUNCTION=Stomp
00038	#exec MESH NOTIFY MESH=titan1 SEQ=TSlap001 TIME=0.46 FUNCTION=SlapDamageTarget
00039	#exec MESH NOTIFY MESH=titan1 SEQ=TPunc001 TIME=0.61 FUNCTION=PunchDamageTarget
00040	#exec MESH NOTIFY MESH=titan1 SEQ=TThro001 TIME=0.75 FUNCTION=SpawnRock
00041	#exec MESH NOTIFY MESH=titan1 SEQ=TDeat001 TIME=0.86 FUNCTION=LandThump
00042	#exec MESH NOTIFY MESH=titan1 SEQ=TDeat002 TIME=0.61 FUNCTION=LandThump
00043	#exec MESH NOTIFY MESH=titan1 SEQ=TDeat003 TIME=0.69 FUNCTION=LandThump
00044	
00045	#exec AUDIO IMPORT FILE="Sounds\Titan\throw1a.WAV" NAME="Throw1t" GROUP="Titan"
00046	#exec AUDIO IMPORT FILE="Sounds\Titan\step1a.WAV" NAME="step1t" GROUP="Titan"
00047	#exec AUDIO IMPORT FILE="Sounds\Titan\stomp4a.WAV" NAME="stomp4t" GROUP="Titan"
00048	#exec AUDIO IMPORT FILE="Sounds\Titan\punch1Tt.WAV" NAME="punch1Ti" GROUP="Titan"
00049	#exec AUDIO IMPORT FILE="Sounds\Titan\Swing1.WAV" NAME="Swing1t" GROUP="Titan"
00050	#exec AUDIO IMPORT FILE="Sounds\Titan\yell1a.WAV" NAME="yell1t" GROUP="Titan"
00051	#exec AUDIO IMPORT FILE="Sounds\Titan\yell2a.WAV" NAME="yell2t" GROUP="Titan"
00052	#exec AUDIO IMPORT FILE="Sounds\Titan\yell3a.WAV" NAME="yell3t" GROUP="Titan"
00053	#exec AUDIO IMPORT FILE="Sounds\Titan\death1a.WAV" NAME="death1t" GROUP="Titan"
00054	#exec AUDIO IMPORT FILE="Sounds\Titan\injur1a.WAV" NAME="injur1t" GROUP="Titan"
00055	#exec AUDIO IMPORT FILE="Sounds\Titan\injur2a.WAV" NAME="injur2t" GROUP="Titan"
00056	#exec AUDIO IMPORT FILE="Sounds\Titan\amb1Ti.WAV" NAME="amb1Ti" GROUP="Titan"
00057	#exec AUDIO IMPORT FILE="Sounds\Titan\sniff1Ti.WAV" NAME="sniff1Ti" GROUP="Titan"
00058	#exec AUDIO IMPORT FILE="Sounds\Titan\fall1Ti.WAV" NAME="fall1Ti" GROUP="Titan"
00059	#exec AUDIO IMPORT FILE="Sounds\Titan\slaphit1Ti.WAV" NAME="slaphit1Ti" GROUP="Titan"
00060	#exec AUDIO IMPORT FILE="Sounds\Titan\roam1Ti.WAV" NAME="roam1Ti" GROUP="Titan"
00061	#exec AUDIO IMPORT FILE="Sounds\Titan\chestB2Ti.WAV" NAME="chestB2Ti" GROUP="Titan"
00062	
00063	//FIXME - use fall1ti for titancarcass landed
00064	
00065	//TITAN variables;
00066	var() byte SlapDamage,
00067		PunchDamage;
00068		
00069	var bool bStomp;
00070	var bool bLavaTitan;
00071	var bool bEndFootStep;
00072	var float realSpeed;
00073	var() name StompEvent;
00074	var() name StepEvent;
00075	var(Sounds) sound Step;
00076	var(Sounds) sound StompSound;
00077	var(Sounds) sound slap;
00078	var(Sounds) sound swing;
00079	var(Sounds) sound throw;
00080	var(Sounds) sound chest;
00081	
00082	function PlayAcquisitionSound()
00083	{
00084		if (Acquire != None) 
00085		{
00086			PlaySound(Acquire, SLOT_Talk,, true); 
00087			PlaySound(Acquire, SLOT_Misc,, true);
00088		} 
00089	}
00090	
00091	function PlayFearSound()
00092	{
00093		if (Fear != None)
00094		{
00095			PlaySound(Fear, SLOT_Talk,, true); 
00096			PlaySound(Fear, SLOT_Misc,, true); 
00097		}
00098	}
00099	
00100	function PlayRoamingSound()
00101	{
00102		if ( (Threaten != None) && (FRand() < 0.3) )
00103		{
00104			PlaySound(Threaten, SLOT_Talk,, true);
00105			PlaySound(Threaten, SLOT_Misc,, true);
00106			return;
00107		}
00108		if ( FRand() < 0.5 )
00109		{
00110			PlaySound(Sound'roam1Ti', SLOT_Talk,, true);
00111			PlaySound(Sound'roam1Ti', SLOT_Misc,, true);
00112			return;
00113		}
00114		if (Roam != None)
00115		{
00116			PlaySound(Roam, SLOT_Talk,, true);
00117			PlaySound(Roam, SLOT_Misc,, true);
00118		}
00119	}
00120	
00121	function PlayThreateningSound()
00122	{
00123		if (Threaten == None) return;
00124		if (FRand() < 0.5)
00125		{
00126			PlaySound(Threaten, SLOT_Talk,, true);
00127			PlaySound(Threaten, SLOT_Misc,, true);
00128		}
00129		else
00130		{
00131			PlaySound(Fear, SLOT_Talk,, true);
00132			PlaySound(Fear, SLOT_Misc,, true);
00133		}
00134	}
00135	
00136	singular event BaseChange()
00137	{
00138		local float decorMass;
00139		if (Pawn(Base) != None)
00140		{
00141			Base.TakeDamage( 1000, Self,Location,0.5 * Velocity , 'stomped');
00142			JumpOffPawn();
00143		}
00144		else if ( (Decoration(Base) != None) && (Velocity.Z < -400) )
00145		{
00146			decorMass = FMax(Decoration(Base).Mass, 1);
00147			Base.TakeDamage(1000, Self, Location, 0.5 * Velocity, 'stomped');
00148		}
00149	}
00150	
00151	function eAttitude AttitudeToCreature(Pawn Other)
00152	{
00153		if ( Other.IsA('Titan') )
00154			return ATTITUDE_Friendly;
00155		else if ( Other.IsA('ScriptedPawn') )
00156			return ATTITUDE_Hate;
00157		else
00158			return ATTITUDE_Ignore;
00159	}
00160	
00161	function ThrowOther(Pawn Other)
00162	{
00163		local float dist, shake;
00164		local PlayerPawn aPlayer;
00165		local vector Momentum;
00166	
00167		if ( Other.mass > 500 )
00168			return;
00169	
00170		aPlayer = PlayerPawn(Other);
00171		if ( aPlayer == None )
00172		{	
00173			if ( !bStomp || (Other.Physics != PHYS_Walking) )
00174				return;
00175			dist = VSize(Location - Other.Location);
00176			if (dist > 500)
00177				return;
00178		}
00179		else
00180		{
00181			dist = VSize(Location - Other.Location);
00182			shake = FMax(500, 1500 - dist);
00183			if ( dist > 1500 )
00184				return;
00185			aPlayer.ShakeView( FMax(0, 0.35 - dist/20000), shake, 0.015 * shake);
00186			if ( Other.Physics != PHYS_Walking )
00187				return;
00188		}
00189	
00190		Momentum = -0.5 * Other.Velocity + 100 * VRand();
00191		Momentum.Z =  7000000.0/((0.4 * dist + 350) * Other.Mass);
00192		if (bStomp)
00193			Momentum.Z *= 5.0;		
00194		Other.AddVelocity(Momentum);
00195	}
00196	
00197	function FootStep()
00198	{
00199		local actor A;
00200		local pawn Thrown;
00201		//slightly throw player if nearby ,& play footstep sound
00202		bStomp = false;
00203		bEndFootstep = false;
00204		if (StepEvent != '')
00205			foreach AllActors( class 'Actor', A, StepEvent )
00206				A.Trigger( Self, Instigator );
00207	
00208		Thrown = Level.PawnList;
00209		While ( Thrown != None )
00210		{
00211			ThrowOther(Thrown);
00212			Thrown = Thrown.nextPawn;
00213		}
00214		
00215		realSpeed = DesiredSpeed; //fixme - don't stop if very low friction
00216		DesiredSpeed = 0.0;
00217		PlaySound(Step, SLOT_Interact);
00218	}
00219	
00220	function StartMoving()
00221	{
00222		DesiredSpeed = realSpeed;
00223	}
00224	
00225	function Stomp()
00226	{
00227		local actor A;
00228		local pawn Thrown;
00229	
00230		if (StompEvent != '')
00231			foreach AllActors( class 'Actor', A, StompEvent )
00232				A.Trigger( Self, Instigator );
00233				
00234		//throw all nearby creatures, and play sound
00235		bStomp = true;
00236		Thrown = Level.PawnList;
00237		While ( Thrown != None )
00238		{
00239			ThrowOther(Thrown);
00240			Thrown = Thrown.nextPawn;
00241		}
00242		PlaySound(Step, SLOT_Interact, 24);
00243	}
00244	
00245	function PlayWaiting()
00246	{
00247		local float decision;
00248		local float animspeed;
00249	
00250		decision = FRand();
00251		animspeed = 0.2 + 0.5 * FRand();
00252	
00253		if (bEndFootStep)
00254			FootStep();
00255					
00256		if ( (AnimSequence == 'TBrea001') && (decision < 0.17) )
00257		{
00258			SetAlertness(0.0);
00259			if (decision < 0.1)
00260			{
00261				PlaySound(sound'sniff1Ti', SLOT_Talk);
00262				LoopAnim('TSnif001', animspeed);
00263			}
00264			else if (decision < 0.17)
00265				LoopAnim('TFist', animspeed);
00266		}
00267		else
00268		{
00269			SetAlertness(0.3);
00270			LoopAnim('TBrea001', animspeed);
00271		}
00272	}
00273		
00274	//PlayPatrolStop(), and PlayWaitingAmbush() all use PlayWaiting(); 			
00275	function PlayPatrolStop()
00276	{
00277		if (bEndFootStep)
00278			FootStep();
00279		DesiredSpeed = 0.0;
00280		PlayWaiting();
00281	}
00282	
00283	function PlayWaitingAmbush()
00284	{
00285		if (bEndFootStep)
00286			FootStep();
00287		DesiredSpeed = 0.0;
00288		PlayWaiting();
00289	}
00290	
00291	function PlayChallenge()
00292	{
00293		local float decision;
00294	
00295		if (bEndFootStep)
00296			FootStep();
00297		DesiredSpeed = 0.0;
00298		decision = FRand();
00299	
00300		if ( decision < 0.2 )
00301			PlayAnim('TStom001', 1.0, 0.2);
00302		else if ( decision < 0.4 )
00303			PlayAnim('TFist', 1.0, 0.2);
00304		else if ( decision < 0.64 )
00305			PlayAnim('TFigh001', 1.0, 0.2);
00306		else if ( decision < 0.75 )
00307		{
00308			PlaySound(Chest, SLOT_Interact);
00309			PlaySound(Chest, SLOT_Misc);
00310			PlayAnim('TChest', 1.0, 0.2);
00311		}
00312		else
00313			PlayAnim('TShuffle',1.0, 0.2);
00314	}
00315	
00316	function TweenToFighter(float tweentime)
00317	{
00318		bEndFootStep = ( (AnimSequence == 'TWalk001') && (AnimFrame > 0.1) );   
00319		TweenAnim('TFigh001', tweentime);
00320	}
00321	
00322	function TweenToRunning(float tweentime)
00323	{
00324		if ( (AnimSequence != 'TWalk001') || !bAnimLoop )
00325			TweenAnim('TWalk001', tweentime);
00326	}
00327	
00328	function TweenToWalking(float tweentime)
00329	{
00330		TweenAnim('TWalk001', tweentime);
00331	}
00332	
00333	function TweenToWaiting(float tweentime)
00334	{
00335		TweenAnim('TBrea001', tweentime);
00336	}
00337	
00338	function TweenToPatrolStop(float tweentime)
00339	{
00340		TweenAnim('TBrea001', tweentime);
00341	}
00342	
00343	function PlayRunning()
00344	{
00345		LoopAnim('TWalk001', -1.0/GroundSpeed,, 0.8);
00346	}
00347	
00348	function PlayWalking()
00349	{
00350		LoopAnim('TWalk001', -1.0/GroundSpeed,, 0.8);
00351		if (FRand() < 0.4)
00352			PlayRoamingSound();
00353	}
00354	
00355	function PlayThreatening()
00356	{
00357		local float decision, animspeed;
00358	
00359		decision = FRand();
00360		animspeed = 0.4 + 0.6 * FRand();
00361	
00362		if ( decision < 0.5 )
00363			PlayAnim('TBrea001', animspeed, 0.4);
00364		else if ( decision < 0.7 )
00365		{
00366			PlaySound(StompSound, SLOT_Talk);		
00367			PlaySound(StompSound, SLOT_Misc);		
00368			PlayAnim('TStom001', animspeed, 0.4);
00369		}
00370		else
00371		{
00372			PlayThreateningSound();
00373			if ( decision < 0.9 )
00374				PlayAnim('TFist', animspeed, 0.4);
00375			else
00376				TweenAnim('TFigh001', 0.4);
00377		}
00378	}
00379	
00380	function PlayTurning()
00381	{
00382		if (bEndFootStep)
00383			FootStep();
00384		DesiredSpeed = 0.0;
00385		LoopAnim('TShuffle',, 0.15);
00386	}
00387	
00388	function PlayDying(name DamageType, vector HitLocation)
00389	{
00390		local float decision;
00391		Decision = FRand();
00392		if (Decision < 0.4)
00393			PlayAnim('TDeat001', 0.7, 0.15);
00394		else if (Decision < 0.7)
00395			PlayAnim('TDeat002', 0.7, 0.15);
00396		else
00397			PlayAnim('TDeat003', 0.7, 0.15);
00398		
00399		PlaySound(Die, SLOT_Talk);	
00400		PlaySound(Die, SLOT_Misc);	
00401	}
00402	
00403	function PlayTakeHit(float tweentime, vector HitLoc, int Damage)
00404	{
00405		local float decision;
00406		Decision = FRand();
00407		if (Decision < 0.4)
00408			TweenAnim('TDeat001', tweentime);
00409		else if (Decision < 0.7)
00410			TweenAnim('TDeat002', tweentime);
00411		else
00412			TweenAnim('TDeat003', tweentime);
00413	}
00414	
00415	function SpawnRock()
00416	{
00417		local Projectile Proj;
00418		local vector X,Y,Z, projStart;
00419		GetAxes(Rotation,X,Y,Z);
00420		
00421		MakeNoise(1.0);
00422		if (FRand() < 0.4)
00423		{
00424			projStart = Location + CollisionRadius * X + 0.4 * CollisionHeight * Z;
00425			Proj = spawn(class 'Boulder1' ,self,'',projStart,AdjustAim(1000, projStart, 400, false, true));
00426			if( Proj != None )
00427				Proj.SetPhysics(PHYS_Projectile);
00428			return;
00429		}
00430		
00431		projStart = Location + CollisionRadius * X + 0.4 * CollisionHeight * Z;
00432		Proj = spawn(class 'BigRock' ,self,'',projStart,AdjustAim(1000, projStart, 400, false, true));
00433		if( Proj != None )
00434			Proj.SetPhysics(PHYS_Projectile);
00435	
00436		projStart = Location + CollisionRadius * X -  40 * Y + 0.4 * CollisionHeight * Z;
00437		Proj = spawn(class 'BigRock' ,self,'',projStart,AdjustAim(1000, projStart, 400, true, true));
00438		if( Proj != None )
00439			Proj.SetPhysics(PHYS_Projectile);
00440	
00441		if (FRand() < 0.2 * skill)
00442		{
00443			projStart = Location + CollisionRadius * X + 40 * Y + 0.4 * CollisionHeight * Z;
00444			Proj = spawn(class 'BigRock' ,self,'',projStart,AdjustAim(1000, projStart, 2000, false, true));
00445			if( Proj != None )
00446				Proj.SetPhysics(PHYS_Projectile);
00447		}
00448	}
00449	
00450	function PlayVictoryDance()
00451	{
00452		if (bEndFootStep)
00453			FootStep();
00454		DesiredSpeed = 0.0;
00455		PlayAnim('TStom001', 0.6, 0.2); //gib the enemy here!
00456		PlaySound(StompSound, SLOT_Talk);		
00457		PlaySound(StompSound, SLOT_Misc);		
00458	}
00459	
00460	function PunchDamageTarget()
00461	{
00462		if ( MeleeDamageTarget(PunchDamage, (70000.0 * (Normal(Target.Location - Location)))) )
00463		{
00464			PlaySound(Slap, SLOT_Interact);
00465			PlaySound(Slap, SLOT_Misc);
00466		}
00467	}
00468	
00469	function SlapDamageTarget()
00470	{
00471		local vector X,Y,Z;
00472		GetAxes(Rotation,X,Y,Z);
00473		
00474		if ( MeleeDamageTarget(SlapDamage, (70000.0 * ( Y + vect(0,0,1)))) )
00475		{
00476			PlaySound(Slap, SLOT_Interact);
00477			PlaySound(Slap, SLOT_Misc);
00478		}
00479	}
00480	
00481	//Titan doesn't need to face as directly
00482	function bool NeedToTurn(vector targ)
00483	{
00484		local int YawErr;
00485	
00486		DesiredRotation = rotator(targ - location);
00487		DesiredRotation.Yaw = DesiredRotation.Yaw & 65535;
00488		YawErr = (DesiredRotation.Yaw - (Rotation.Yaw & 65535)) & 65535;
00489		if ( (YawErr < 8000) || (YawErr > 57535) )
00490			return false;
00491	
00492		return true;
00493	}
00494		
00495	function PlayMeleeAttack()
00496	{
00497		if (bEndFootStep)
00498			FootStep();
00499		if (FRand() < 0.45)
00500		{
00501			PlaySound(sound'Punch1Ti', SLOT_Interact);			
00502			PlaySound(sound'Punch1Ti', SLOT_Misc);			
00503	  		PlayAnim('TPunc001');
00504		}
00505		else
00506		{ 
00507			PlaySound(swing, SLOT_Interact);			
00508			PlaySound(swing, SLOT_Misc);			
00509			PlayAnim('TSlap001'); 
00510		}
00511	}
00512	
00513	function PlayRangedAttack()
00514	{
00515		////log("Play ranged attack");
00516		if ( bEndFootStep )
00517			FootStep();
00518		if ( (AnimSequence == 'TStom001') || (FRand() < 0.7) )
00519		{
00520			PlaySound(Throw, SLOT_Interact);
00521			PlayAnim('TThro001');
00522		}
00523		else
00524		{
00525			PlayAnim('TStom001'); 
00526			PlaySound(StompSound, SLOT_Talk);			
00527			PlaySound(StompSound, SLOT_Misc);			
00528		}
00529	}
00530	
00531	function ZoneChange(ZoneInfo newZone)
00532	{
00533		if ( newZone.bPainZone && (newZone.DamageType == 'burned') )
00534			GotoState('LavaDeath');
00535		else
00536			Super.ZoneChange(newZone);
00537	}
00538	
00539	state Sitting
00540	{
00541		ignores SeePlayer, HearNoise, Bump, TakeDamage;
00542	
00543		function Trigger( actor Other, pawn EventInstigator )
00544		{
00545			if ( EventInstigator.bIsPlayer )
00546			{
00547				AttitudeToPlayer = ATTITUDE_Hate;
00548				Enemy = EventInstigator;
00549				GotoState('Sitting', 'GetUp');
00550			}
00551			Disable('Trigger');
00552		}
00553		
00554		function BeginState()
00555		{
00556			bProjTarget = false;
00557		}
00558	
00559	GetUp:
00560		bProjTarget = true;
00561		PlayAnim('TGetUp');
00562		FinishAnim();
00563		SetCollisionSize(0, Default.CollisionHeight);
00564		SetPhysics(PHYS_Walking);
00565		DesiredSpeed = 1.0;
00566		Acceleration = vector(Rotation) * AccelRate;
00567		PlayAnim('TWalk001');
00568		FinishAnim();
00569		SetCollisionSize(Default.CollisionRadius, Default.CollisionHeight);
00570		GotoState('Attacking');
00571		
00572	Begin:
00573		TweenAnim('TSit', 0.05);
00574		SetPhysics(PHYS_None);
00575	}
00576	
00577	
00578	state WalkOut
00579	{
00580		ignores SeePlayer, HearNoise, Bump, TakeDamage;
00581	
00582		function Trigger( actor Other, pawn EventInstigator )
00583		{
00584			if ( EventInstigator.bIsPlayer )
00585			{
00586				AttitudeToPlayer = ATTITUDE_Hate;
00587				Enemy = EventInstigator;
00588				GotoState('WalkOut', 'Walk');
00589			}
00590			Disable('Trigger');
00591		}
00592		
00593		function BeginState()
00594		{
00595			bProjTarget = false;
00596		}
00597	
00598	Walk:
00599		bProjTarget = true;
00600		SetPhysics(PHYS_Walking);
00601		DesiredSpeed = 1.0;
00602		Acceleration = vector(Rotation) * AccelRate;
00603		PlayAnim('TWalk001');
00604		FinishAnim();
00605		PlayAnim('TWalk001');
00606		FinishAnim();
00607		GotoState('Attacking');
00608		
00609	Begin:
00610		TweenAnim('TWalk001', 0.05);
00611		SetPhysics(PHYS_None);
00612	}
00613	
00614	state LavaDeath
00615	{
00616		ignores SeePlayer, HearNoise, Bump, TakeDamage;
00617		
00618	Begin:
00619		ReducedDamageType = 'Burned';
00620		Acceleration = vect(0,0,0);
00621		PlaySound(Chest, SLOT_Interact);
00622		PlayAnim('TChest');
00623		FinishAnim();
00624		PlayAnim('TDeat002');
00625		FinishAnim();
00626		bLavaTitan = true;
00627		TweenAnim('TDeat001', 2.0);
00628		GotoState('Attacking');
00629	}
00630	
00631	defaultproperties
00632	{
00633	     SlapDamage=85
00634	     PunchDamage=80
00635	     Step=Sound'UnrealI.Titan.step1t'
00636	     StompSound=Sound'UnrealI.Titan.stomp4t'
00637	     Slap=Sound'UnrealI.Titan.slaphit1Ti'
00638	     Swing=Sound'UnrealI.Titan.Swing1t'
00639	     Throw=Sound'UnrealI.Titan.Throw1t'
00640	     Chest=Sound'UnrealI.Titan.chestB2Ti'
00641	     Aggressiveness=8.000000
00642	     RefireRate=0.600000
00643	     WalkingSpeed=0.750000
00644	     bHasRangedAttack=True
00645	     bIsBoss=True
00646	     Acquire=Sound'UnrealI.Titan.yell1t'
00647	     Fear=Sound'UnrealI.Titan.yell2t'
00648	     Roam=Sound'UnrealI.Titan.yell3t'
00649	     Threaten=Sound'UnrealI.Titan.yell2t'
00650	     MeleeRange=140.000000
00651	     GroundSpeed=400.000000
00652	     AirSpeed=400.000000
00653	     AccelRate=1000.000000
00654	     JumpZ=-1.000000
00655	     Visibility=255
00656	     Health=1800
00657	     ReducedDamageType=exploded
00658	     ReducedDamagePct=0.300000
00659	     Intelligence=BRAINS_REPTILE
00660	     HitSound1=Sound'UnrealI.Titan.injur1t'
00661	     HitSound2=Sound'UnrealI.Titan.injur2t'
00662	     Land=Sound'UnrealI.Titan.stomp4t'
00663	     Die=Sound'UnrealI.Titan.death1t'
00664	     CombatStyle=0.850000
00665	     AmbientSound=Sound'UnrealI.Titan.amb1Ti'
00666	     DrawType=DT_Mesh
00667	     Mesh=LodMesh'UnrealI.Titan1'
00668	     SoundRadius=32
00669	     SoundVolume=250
00670	     TransientSoundVolume=20.000000
00671	     CollisionRadius=115.000000
00672	     CollisionHeight=110.000000
00673	     Mass=2000.000000
00674	     RotationRate=(Pitch=0,Yaw=30000,Roll=0)
00675	}

End Source Code