UnrealI
Class Warlord

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

class Warlord
extends UnrealShare.ScriptedPawn

//============================================================================= // Warlord. //=============================================================================
Variables
 float LastDuckTime
 byte StrikeDamage
 bool bTeleportWhenHurt

States
Mutilating, Teleporting, TacticalMove, Charging

Function Summary
 bool CanFireAtEnemy()
 void Died(Pawn Killer, name damageType, vector HitLocation)
 void Falling()
 void Flap()
 void PlayChallenge()
 void PlayDying(name DamageType, vector HitLocation)
 void PlayInAir()
 void PlayLanded(float impactVel)
 void PlayMeleeAttack()
 void PlayMovingAttack()
 void PlayPatrolStop()
 void PlayRangedAttack()
 void PlayRunning()
 void PlayTakeHit(float tweentime, vector HitLoc, int damage)
 void PlayThreatening()
 void PlayTurning()
 void PlayVictoryDance()
 void PlayWaiting()
 void PlayWaitingAmbush()
 void PlayWalking()
 void PreSetMovement()
 void SetMovementPhysics()
 void Step()
 void TryToDuck(vector duckDir, bool bReversed)
 void TweenToFalling()
 void TweenToFighter(float tweentime)
 void TweenToPatrolStop(float tweentime)
 void TweenToRunning(float tweentime)
 void TweenToWaiting(float tweentime)
 void TweenToWalking(float tweentime)


State Mutilating Function Summary
 void BeginState()
 void Landed(vector HitNormal)
 void AnimEnd()
 void EnemyAcquired()
 void Bump(Actor Other)
 void TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)


State Teleporting Function Summary
 void BeginState()
 void Tick(float DeltaTime)


State TacticalMove Function Summary
 void BeginState()
 void HitWall(vector HitNormal, Actor Wall)


State Charging Function Summary
 void BeginState()
 void HitWall(vector HitNormal, Actor Wall)



Source Code


00001	//=============================================================================
00002	// Warlord.
00003	//=============================================================================
00004	class Warlord extends ScriptedPawn;
00005	
00006	#exec MESH IMPORT MESH=WarlordM ANIVFILE=MODELS\warlor_a.3D DATAFILE=MODELS\warlor_d.3D LODSTYLE=2
00007	#exec MESH ORIGIN MESH=WarlordM X=0 Y=-300 Z=0 YAW=64 Roll=-64
00008	
00009	#exec MESH SEQUENCE MESH=warlordM SEQ=All		STARTFRAME=0	NUMFRAMES=492
00010	#exec MESH SEQUENCE MESH=warlordM SEQ=Breath		STARTFRAME=0	NUMFRAMES=8		RATE=6
00011	#exec MESH SEQUENCE MESH=warlordM SEQ=Dead1		STARTFRAME=8    NUMFRAMES=26	RATE=15
00012	#exec MESH SEQUENCE MESH=warlordM SEQ=TakeHit	STARTFRAME=8    NUMFRAMES=1
00013	#exec MESH SEQUENCE MESH=warlordM SEQ=Fire		STARTFRAME=34   NUMFRAMES=15	RATE=15  Group=Attack
00014	#exec MESH SEQUENCE MESH=warlordM SEQ=Fighter	STARTFRAME=34	NUMFRAMES=1
00015	#exec MESH SEQUENCE MESH=warlordM SEQ=Fly		STARTFRAME=49   NUMFRAMES=15	RATE=15	
00016	#exec MESH SEQUENCE MESH=warlordM SEQ=FlyFire	STARTFRAME=64   NUMFRAMES=15	RATE=15  Group=MovingAttack
00017	#exec MESH SEQUENCE MESH=warlordM SEQ=Land		STARTFRAME=79   NUMFRAMES=15	RATE=15
00018	#exec MESH SEQUENCE MESH=warlordM SEQ=Run		STARTFRAME=94   NUMFRAMES=10	RATE=15
00019	#exec MESH SEQUENCE MESH=warlordM SEQ=Strike		STARTFRAME=104  NUMFRAMES=15	RATE=15  Group=Attack
00020	#exec MESH SEQUENCE MESH=warlordM SEQ=TakeOff	STARTFRAME=119  NUMFRAMES=10	RATE=15
00021	#exec MESH SEQUENCE MESH=warlordM SEQ=Twirl		STARTFRAME=129  NUMFRAMES=40
00022	#exec MESH SEQUENCE MESH=warlordM SEQ=Walk		STARTFRAME=169  NUMFRAMES=15	RATE=18
00023	#exec MESH SEQUENCE MESH=warlordM SEQ=WalkFire	STARTFRAME=184  NUMFRAMES=15	RATE=18  Group=MovingAttack
00024	#exec MESH SEQUENCE MESH=warlordM SEQ=Appear		STARTFRAME=199  NUMFRAMES=11 
00025	#exec MESH SEQUENCE MESH=warlordM SEQ=FDodgeUp	STARTFRAME=210  NUMFRAMES=18	RATE=15	 Group=Dodge
00026	#exec MESH SEQUENCE MESH=warlordM SEQ=FDodgeL	STARTFRAME=228  NUMFRAMES=15	RATE=15  Group=Dodge
00027	#exec MESH SEQUENCE MESH=warlordM SEQ=FDodgeR	STARTFRAME=243  NUMFRAMES=15	RATE=15  Group=Dodge
00028	#exec MESH SEQUENCE MESH=warlordM SEQ=GKick1		STARTFRAME=258  NUMFRAMES=15	RATE=15
00029	#exec MESH SEQUENCE MESH=warlordM SEQ=GKick2		STARTFRAME=273  NUMFRAMES=15	RATE=15
00030	#exec MESH SEQUENCE MESH=warlordM SEQ=GPunch1	STARTFRAME=288  NUMFRAMES=15	RATE=15
00031	#exec MESH SEQUENCE MESH=warlordM SEQ=GPunch2	STARTFRAME=303  NUMFRAMES=15	RATE=15
00032	#exec MESH SEQUENCE MESH=warlordM SEQ=Grab		STARTFRAME=318  NUMFRAMES=18	RATE=15
00033	#exec MESH SEQUENCE MESH=warlordM SEQ=Laugh		STARTFRAME=336  NUMFRAMES=33	RATE=15
00034	#exec MESH SEQUENCE MESH=warlordM SEQ=Munch		STARTFRAME=369  NUMFRAMES=20	RATE=15
00035	#exec MESH SEQUENCE MESH=warlordM SEQ=Point		STARTFRAME=389  NUMFRAMES=28	RATE=15
00036	#exec MESH SEQUENCE MESH=warlordM SEQ=Teleport	STARTFRAME=417  NUMFRAMES=21	RATE=15
00037	#exec MESH SEQUENCE MESH=warlordM SEQ=Dead2A		STARTFRAME=438  NUMFRAMES=10	RATE=15
00038	#exec MESH SEQUENCE MESH=warlordM SEQ=Fall		STARTFRAME=448  NUMFRAMES=10	RATE=15
00039	#exec MESH SEQUENCE MESH=warlordM SEQ=Dead2B		STARTFRAME=458  NUMFRAMES=34	RATE=15
00040	
00041	#exec TEXTURE IMPORT NAME=JWarlord1 FILE=MODELS\warlord.PCX GROUP=Skins FLAGS=2
00042	#exec MESHMAP SCALE MESHMAP=WarlordM X=0.17 Y=0.17 Z=0.34
00043	#exec MESHMAP SETTEXTURE MESHMAP=warlordM NUM=1 TEXTURE=Jwarlord1
00044	
00045	#exec MESH NOTIFY MESH=WarlordM SEQ=Dead1 TIME=0.78 FUNCTION=LandThump
00046	#exec MESH NOTIFY MESH=WarlordM SEQ=Fly TIME=0.1 FUNCTION=Flap
00047	#exec MESH NOTIFY MESH=WarlordM SEQ=FlyFire TIME=0.1 FUNCTION=Flap
00048	#exec MESH NOTIFY MESH=WarlordM SEQ=TakeOff TIME=0.1 FUNCTION=Flap
00049	#exec MESH NOTIFY MESH=WarlordM SEQ=Run TIME=0.25 FUNCTION=Step
00050	#exec MESH NOTIFY MESH=WarlordM SEQ=Run TIME=0.75 FUNCTION=Step
00051	#exec MESH NOTIFY MESH=WarlordM SEQ=Walk TIME=0.33 FUNCTION=Step
00052	#exec MESH NOTIFY MESH=WarlordM SEQ=Walk TIME=0.83 FUNCTION=Step
00053	#exec MESH NOTIFY MESH=WarlordM SEQ=WalkFire TIME=0.33 FUNCTION=Step
00054	#exec MESH NOTIFY MESH=WarlordM SEQ=WalkFire TIME=0.83 FUNCTION=Step
00055	
00056	#exec AUDIO IMPORT FILE="Sounds\WarLord\injur1W.WAV" NAME="injur1WL" GROUP="WarLord"
00057	#exec AUDIO IMPORT FILE="Sounds\WarLord\injur2W.WAV" NAME="injur2WL" GROUP="WarLord"
00058	#exec AUDIO IMPORT FILE="Sounds\WarLord\aquire1W.WAV" NAME="acquire1WL" GROUP="WarLord"
00059	#exec AUDIO IMPORT FILE="Sounds\WarLord\DCry1W.WAV" NAME="DeathCry1WL" GROUP="WarLord"
00060	#exec AUDIO IMPORT FILE="Sounds\WarLord\fly1W.WAV" NAME="fly1WL" GROUP="WarLord"
00061	#exec AUDIO IMPORT FILE="Sounds\WarLord\roam1W.WAV" NAME="roam1WL" GROUP="WarLord"
00062	#exec AUDIO IMPORT FILE="Sounds\WarLord\threat1W.WAV" NAME="threat1WL" GROUP="WarLord"
00063	#exec AUDIO IMPORT FILE="Sounds\WarLord\breath1.WAV" NAME="breath1WL" GROUP="WarLord"
00064	#exec AUDIO IMPORT FILE="Sounds\Titan\step1a.WAV" NAME="step1t" GROUP="Titan"
00065	#exec AUDIO IMPORT FILE="Sounds\WarLord\laugh3b.WAV" NAME="laugh1WL" GROUP="WarLord"
00066	#exec AUDIO IMPORT FILE="..\UnrealShare\Sounds\Generic\teleprt28.WAV" NAME="Teleport2" GROUP="Generic"
00067	
00068	//FIXME - use TakeOff animation (maybe for falling start)
00069	
00070	var() byte	StrikeDamage;
00071	var() bool	bTeleportWhenHurt;
00072	var float	LastDuckTime;
00073	
00074	function PreSetMovement()
00075	{
00076		bCanJump = true;
00077		bCanWalk = true;
00078		bCanSwim = false;
00079		bCanFly = true;
00080		MinHitWall = -0.6;
00081		bCanOpenDoors = true;
00082		bCanDoSpecial = true;
00083		bCanDuck = true;
00084	}
00085	
00086	function Died(pawn Killer, name damageType, vector HitLocation)
00087	{
00088		if ( bTeleportWhenHurt )
00089		{
00090			Health = 1000;
00091			PlayAnim('Teleport');
00092			GotoState('Teleporting');
00093		}
00094		else
00095			Super.Died(Killer, damageType, HitLocation);
00096	}
00097	
00098	function TryToDuck(vector duckDir, bool bReversed)
00099	{
00100		local vector HitLocation, HitNormal, Extent;
00101		local bool duckLeft, bSuccess;
00102		local actor HitActor;
00103		local float decision;
00104	
00105		//log("duck");
00106		if ( Level.TimeSeconds - LastDuckTime < 0.6 - 0.1 * skill )
00107			return;	
00108					
00109		duckLeft = !bReversed;
00110	
00111		Extent.X = CollisionRadius;
00112		Extent.Y = CollisionRadius;
00113		Extent.Z = CollisionHeight;
00114	
00115		if ( (Physics != PHYS_Flying) && (FRand() < 0.4) ) // try to duck up
00116		{
00117			HitActor = Trace(HitLocation, HitNormal, Location + vect(0,0,300), Location, false, Extent);
00118			if ( HitActor == None )
00119			{
00120				if ( FRand() < 0.7 )
00121					PlayAnim('Fly', 1.6, 0.1);
00122				else
00123					PlayAnim('FDodgeUp');
00124				SetPhysics(PHYS_Flying);
00125				Destination = Location  + vect(0,0,300);
00126				Velocity = AirSpeed * vect(0,0,1);
00127				LastDuckTime = Level.TimeSeconds;
00128				GotoState('TacticalMove', 'DoMove');				
00129				return;
00130			}
00131		}		
00132			
00133		HitActor = Trace(HitLocation, HitNormal, Location + 200 * duckDir, Location, false, Extent);
00134		bSuccess = ( HitActor == None );
00135		if ( !bSuccess )
00136		{
00137			duckLeft = !duckLeft;
00138			duckDir *= -1;
00139			HitActor = Trace(HitLocation, HitNormal, Location + 200 * duckDir, Location, false, Extent);
00140			bSuccess = ( HitActor == None );
00141		}
00142		if ( !bSuccess )
00143			return;
00144		
00145		LastDuckTime = Level.TimeSeconds;
00146		if ( FRand() < 0.7 )
00147			PlayAnim('Fly', 1.6, 0.1);
00148		else if ( duckLeft )
00149			PlayAnim('FDodgeL');
00150		else
00151			PlayAnim('FDodgeR');
00152	
00153		SetPhysics(PHYS_Flying);
00154		Destination = Location + 200 * duckDir;
00155		Velocity = AirSpeed * duckDir;
00156		GotoState('TacticalMove', 'DoMove');
00157	}	
00158	
00159	event Landed(vector HitNormal)
00160	{
00161		SetPhysics(PHYS_Walking);
00162		if ( !IsAnimating() )
00163			PlayLanded(Velocity.Z);
00164		if (Velocity.Z < -1.4 * JumpZ)
00165			MakeNoise(-0.5 * Velocity.Z/(FMax(JumpZ, 150.0)));
00166		bJustLanded = true;
00167	}
00168	
00169	function Step()
00170	{
00171		PlaySound(sound'step1t', SLOT_Interact);
00172	}
00173	
00174	function Flap()
00175	{
00176		PlaySound(sound'fly1WL', SLOT_Interact);
00177	}
00178	
00179	function SetMovementPhysics()
00180	{
00181		if (Enemy != None)
00182		{
00183			if (Physics == PHYS_None)
00184				SetPhysics(PHYS_Walking);
00185			else if ( Region.Zone.bWaterZone || (Physics != PHYS_Walking) )
00186				SetPhysics(PHYS_Flying);
00187		} 
00188		else if (Physics != PHYS_Falling)
00189			SetPhysics(PHYS_Walking);
00190	}
00191	
00192	singular function Falling()
00193	{
00194		SetPhysics(PHYS_Flying);
00195	}
00196	
00197	function PlayWaiting()
00198	{
00199		local float decision;
00200	
00201		if (AnimSequence == 'Land')
00202		{
00203			TweenAnim('Breath', 0.3);
00204			return;
00205		}
00206	
00207		PlaySound(sound'breath1WL', SLOT_Interact);
00208		if (FRand() < 0.9)
00209			LoopAnim('Breath', 0.2 + 0.7 * FRand());
00210		else
00211			LoopAnim('Twirl', 0.5 + 0.5 * FRand());
00212	}
00213	
00214	function PlayPatrolStop()
00215	{
00216		if (Physics == PHYS_Flying)
00217			LoopAnim('Fly', 0.7);
00218		else
00219			PlayWaiting();
00220	}
00221	
00222	function PlayWaitingAmbush()
00223	{
00224		PlayWaiting();
00225	}
00226	
00227	function PlayChallenge()
00228	{
00229		if (Physics == PHYS_Flying)
00230			PlayAnim('Fly', 0.7, 0.1);
00231		else if ( FRand() < 0.5 )
00232		{
00233			PlaySound(sound'laugh1WL', SLOT_Talk);
00234			PlayAnim('Laugh', 0.7, 0.1);
00235		}
00236		else
00237			PlayAnim('Point', 0.7, 0.1);
00238	}
00239	
00240	function TweenToFighter(float tweentime)
00241	{
00242		if (Physics == PHYS_Flying)
00243			TweenAnim('Fly', tweentime);
00244		else
00245			TweenAnim('Fighter', tweentime);
00246	}
00247	
00248	function TweenToRunning(float tweentime)
00249	{
00250		if ( IsAnimating() && ((AnimSequence == 'WalkFire') || (AnimSequence == 'FlyFire')) )
00251			return;
00252		if (Physics == PHYS_Flying)
00253		{
00254			if ( (GetAnimGroup(AnimSequence) != 'Dodge') && ((AnimSequence != 'Fly') || !bAnimLoop) )
00255				TweenAnim('Fly', tweentime);
00256		}
00257		else if ( (AnimSequence != 'Run') || !bAnimLoop )
00258			TweenAnim('Run', tweentime);
00259	
00260	}
00261	
00262	function TweenToWalking(float tweentime)
00263	{
00264		if (Physics == PHYS_Flying)
00265			TweenAnim('Fly', tweentime);
00266		else
00267			TweenAnim('Walk', tweentime);
00268	}
00269	
00270	function TweenToWaiting(float tweentime)
00271	{
00272		PlayAnim('Land', 0.2 + 0.8 * FRand());
00273		SetPhysics(PHYS_Falling);
00274	}
00275	
00276	function TweenToPatrolStop(float tweentime)
00277	{
00278		if (Physics == PHYS_Flying)
00279		{
00280			if (FRand() < 0.3)
00281			{
00282				SetPhysics(PHYS_Falling);
00283				PlayAnim('Land', 0.7);
00284			}
00285			else
00286				TweenAnim('Fly', tweentime);
00287		}
00288		else
00289			TweenAnim('Breath', tweentime);
00290	
00291	}
00292	
00293	function PlayRunning()
00294	{
00295		if (Physics == PHYS_Walking)
00296			LoopAnim('Run', -1.0/GroundSpeed,, 0.4);
00297		else
00298			LoopAnim('Fly', -1.0/AirSpeed,, 0.4);
00299	}
00300	
00301	function PlayWalking()
00302	{
00303		if (Physics == PHYS_Walking)
00304			LoopAnim('Walk', -1.4/GroundSpeed,, 0.4);
00305		else
00306			LoopAnim('Fly', -1.7/AirSpeed,, 0.4);
00307	}
00308	
00309	function PlayThreatening()
00310	{
00311		if (Physics == PHYS_Walking)
00312			TweenAnim('Fighter', 0.3);
00313		else
00314			LoopAnim('Fly', 0.6);
00315	}
00316	
00317	function PlayTurning()
00318	{
00319		if (Physics == PHYS_Walking)
00320			TweenAnim('Walk', 0.3);
00321		else
00322			LoopAnim('Fly');
00323	}
00324	
00325	function PlayDying(name DamageType, vector HitLocation)
00326	{
00327		PlaySound(Die, SLOT_Talk);
00328		if ( Physics == PHYS_Flying )
00329			PlayAnim('Dead2A', 0.7, 0.12);
00330		else
00331			PlayAnim('Dead1', 0.7, 0.12);
00332	}
00333	
00334	function PlayTakeHit(float tweentime, vector HitLoc, int damage)
00335	{
00336		TweenAnim('TakeHit', tweentime);
00337	}
00338	
00339	function TweenToFalling()
00340	{
00341		TweenAnim('Fly', 0.2);
00342	}
00343	
00344	function PlayInAir()
00345	{
00346		LoopAnim('Fly');
00347	}
00348	
00349	function PlayLanded(float impactVel)
00350	{
00351		PlayAnim('Land');
00352	}
00353	
00354	function PlayVictoryDance()
00355	{
00356		PlayAnim('Strike', 0.6, 0.1);
00357	}
00358		
00359	function PlayMeleeAttack()
00360	{
00361		if (Physics == PHYS_Flying)
00362		{
00363			PlayRangedAttack();
00364			return;
00365		}
00366		PlayAnim('Strike');
00367		if ( MeleeDamageTarget(StrikeDamage, (StrikeDamage * 1000.0 * Normal(Target.Location - Location))) )
00368			PlaySound(Threaten, SLOT_Talk); 
00369	}
00370	
00371	
00372	function bool CanFireAtEnemy()
00373	{
00374		local vector HitLocation, HitNormal,X,Y,Z, projStart, EnemyDir, EnemyUp;
00375		local actor HitActor;
00376		local rotator EnemyRot;
00377		local float EnemyDist;
00378			
00379		EnemyDir = Enemy.Location - Location;
00380		EnemyDist = VSize(EnemyDir);
00381		EnemyUp = Enemy.CollisionHeight * vect(0,0,0.9);
00382		if ( EnemyDist > 300 )
00383		{
00384			EnemyDir = 300 * EnemyDir/EnemyDist;
00385			EnemyUp = 300 * EnemyUp/EnemyDist;
00386		}
00387		
00388		GetAxes(Rotation,X,Y,Z);
00389		projStart = Location - 0.5 * CollisionRadius * Y;
00390		HitActor = Trace(HitLocation, HitNormal, 
00391					projStart + EnemyDir + EnemyUp,
00392					projStart , true);
00393	
00394		if ( (HitActor == None) || (HitActor == Enemy) 
00395				|| ((Pawn(HitActor) != None) && (AttitudeTo(Pawn(HitActor)) <= ATTITUDE_Ignore)) )
00396			return true;
00397	
00398		HitActor = Trace(HitLocation, HitNormal, projStart + EnemyDir, projStart , true);
00399	
00400		return ( (HitActor == None) || (HitActor == Enemy) 
00401				|| ((Pawn(HitActor) != None) && (AttitudeTo(Pawn(HitActor)) <= ATTITUDE_Ignore)) );
00402	}
00403	
00404	function PlayRangedAttack()
00405	{
00406		local vector X,Y,Z, projStart;
00407		local rotator projRotation;
00408		if (Physics == PHYS_Flying)
00409			PlayAnim('FlyFire');
00410		else
00411			PlayAnim('Fire');
00412		 
00413		GetAxes(Rotation,X,Y,Z);
00414		projStart = Location - 0.5 * CollisionRadius * Y;
00415		projRotation = AdjustAim(ProjectileSpeed, projStart, 0, bLeadTarget, bWarnTarget); 
00416		spawn(RangedProjectile ,self,'',projStart,projRotation);
00417	}
00418	
00419	function PlayMovingAttack()
00420	{
00421		local vector X,Y,Z, projStart;
00422		local rotator projRotation;
00423		if (Physics == PHYS_Flying)
00424			PlayAnim('FlyFire');
00425		else
00426		{
00427			DesiredSpeed = 0.4;
00428			PlayAnim('WalkFire');
00429		}
00430		GetAxes(Rotation,X,Y,Z);
00431		projStart = Location - 0.5 * CollisionHeight * Y;
00432		projRotation = AdjustAim(ProjectileSpeed, projStart, 600, bLeadTarget, bWarnTarget); 
00433		if ( FRand() < 0.5 )
00434		{
00435			if (FRand() < 0.5)
00436				projRotation.Yaw += 3072; 
00437			else
00438				projRotation.Yaw -= 3072; 
00439		}
00440		spawn(RangedProjectile ,self,'',projStart,projRotation);
00441	}
00442	
00443	State Charging
00444	{
00445		function HitWall(vector HitNormal, actor Wall)
00446		{
00447			if ( (Physics == PHYS_Flying) && (HitNormal.Z > 0.7) )
00448			{
00449				SetPhysics(PHYS_Walking);
00450				return;
00451			}
00452			Super.HitWall(HitNormal, Wall);
00453		}
00454	
00455		function BeginState()
00456		{
00457			local vector HitLocation, HitNormal;
00458			local actor HitActor;
00459	
00460			if ( (Enemy.Location.Z > Location.Z + MaxStepHeight) || (FRand() < 0.3) )
00461			{
00462				Velocity.Z = 400;
00463				SetPhysics(PHYS_Flying);
00464			}
00465			else if ( !Region.Zone.bWaterZone )
00466			{	
00467				HitActor = Trace(HitLocation, HitNormal, Location - 2 * CollisionHeight * vect(0,0,1), Location, true);
00468				if (HitActor == Level)
00469					SetPhysics(PHYS_Falling);
00470			}				
00471			Super.BeginState();
00472		}
00473	}
00474	
00475	State TacticalMove
00476	{
00477		function HitWall(vector HitNormal, actor Wall)
00478		{
00479			if (HitNormal.Z > 0.7)
00480			{
00481				SetPhysics(PHYS_Walking);
00482				return;
00483			}
00484			Focus = Destination;
00485			if (PickWallAdjust())
00486				GotoState('TacticalMove', 'AdjustFromWall');
00487			else
00488			{
00489				DesiredRotation = Rotator(Enemy.Location - location);
00490				GotoState('Attacking');
00491			}
00492		}
00493	
00494		function BeginState()
00495		{
00496			local vector HitLocation, HitNormal;
00497			local actor HitActor;
00498	
00499			if ( (FRand() < 0.3) || 
00500					(Enemy.Location.Z - Location.Z) > MaxStepHeight + 2 * (CollisionHeight - Enemy.CollisionHeight) )
00501			{
00502				Velocity.Z = 400;
00503				SetPhysics(PHYS_Flying);
00504			}
00505			else if ( !Region.Zone.bWaterZone )
00506			{	
00507				HitActor = Trace(HitLocation, HitNormal, Location - 2 * CollisionHeight * vect(0,0,1), Location, true);
00508				if (HitActor == Level)
00509					SetPhysics(PHYS_Falling);
00510			}				
00511			Super.BeginState();
00512		}
00513	
00514	}
00515	
00516	State Teleporting
00517	{
00518	ignores TakeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, Died;
00519	
00520		function Tick(float DeltaTime)
00521		{
00522			local Actor A;
00523	
00524			ScaleGlow -= 3 * DeltaTime;
00525			if ( ScaleGlow < 0.3 )
00526			{
00527				PlaySound(sound'Teleport2',, 8.0);
00528				if ( Event != '' )
00529					ForEach AllActors( class'Actor', A, Event )
00530						A.Trigger( Self, Enemy );
00531				Destroy();
00532			}
00533		}
00534	
00535		function BeginState()
00536		{
00537			bStasis = false;
00538			SetPhysics(PHYS_None);
00539			Disable('Tick');
00540		}
00541			
00542	Begin:
00543		FinishAnim();
00544		Style = STY_Translucent;
00545		bUnlit = true;
00546		ScaleGlow = 2.0;
00547		Enable('Tick');
00548	}
00549	
00550	state Mutilating
00551	{
00552		function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, 
00553								Vector momentum, name damageType)
00554		{
00555		}
00556	
00557		function Bump(actor Other)
00558		{
00559			if ( Other.IsA('Pawn') && Pawn(Other).bIsPlayer )
00560				GotoState('Mutilating', 'FinalSequence');
00561		}
00562		
00563		function EnemyAcquired()
00564		{
00565			GotoState('Mutilating', 'FinalSequence');
00566		}
00567		
00568		function AnimEnd()
00569		{
00570			local float decision;
00571	
00572			decision = FRand();
00573			if ( AnimSequence == 'Grab' )
00574				PlayAnim('Munch', 0.3 + 0.7 * FRand());
00575			else if ( decision < 0.2 )
00576				PlayAnim('GKick1', 0.3 + 0.7 * FRand());
00577			else if ( decision < 0.4 )
00578				PlayAnim('GKick2', 0.3 + 0.7 * FRand());
00579			else if ( decision < 0.6 )
00580				PlayAnim('GPunch1', 0.3 + 0.7 * FRand());
00581			else if ( decision < 0.8 )
00582				PlayAnim('GPunch2', 0.3 + 0.7 * FRand());
00583			else
00584				PlayAnim('Grab', 0.3 + 0.7 * FRand());
00585		}
00586	 
00587		function Landed(vector HitNormal)
00588		{
00589			SetPhysics(PHYS_None);
00590		}
00591	
00592		function BeginState()
00593		{
00594			Enemy = None;
00595			Acceleration = vect(0,0,0);
00596			SetAlertness(0.0);
00597			Health = 100000;
00598		}
00599	
00600	FinalSequence:
00601		Disable('AnimEnd');
00602		PlayTurning();
00603		TurnToward(Enemy);
00604		PlayAnim('Point', 0.7, 0.15);
00605		FinishAnim();
00606		PlaySound(sound'laugh1WL', SLOT_Talk);
00607		PlayAnim('Laugh', 0.7);
00608		FinishAnim();
00609		GotoState('Attacking');
00610	Begin:
00611		TweenToWaiting(0.2);
00612		bReadyToAttack = false;
00613		DesiredRotation = rot(0,0,0);
00614		DesiredRotation.Yaw = Rotation.Yaw;
00615		SetRotation(DesiredRotation);
00616		if (Physics != PHYS_Falling) 
00617			SetPhysics(PHYS_None);
00618	}
00619	
00620	defaultproperties
00621	{
00622	     StrikeDamage=40
00623	     CarcassType=Class'UnrealI.WarlordCarcass'
00624	     Aggressiveness=0.500000
00625	     RefireRate=0.700000
00626	     WalkingSpeed=0.250000
00627	     bHasRangedAttack=True
00628	     bMovingRangedAttack=True
00629	     bIsBoss=True
00630	     RangedProjectile=Class'UnrealI.WarlordRocket'
00631	     Acquire=Sound'UnrealI.WarLord.acquire1WL'
00632	     Fear=Sound'UnrealI.WarLord.threat1WL'
00633	     Roam=Sound'UnrealI.WarLord.roam1WL'
00634	     Threaten=Sound'UnrealI.WarLord.threat1WL'
00635	     bCanStrafe=True
00636	     MeleeRange=70.000000
00637	     GroundSpeed=440.000000
00638	     AirSpeed=440.000000
00639	     AccelRate=1500.000000
00640	     SightRadius=3000.000000
00641	     Health=1100
00642	     ReducedDamageType=exploded
00643	     Intelligence=BRAINS_HUMAN
00644	     HitSound1=Sound'UnrealI.WarLord.injur1WL'
00645	     HitSound2=Sound'UnrealI.WarLord.injur2WL'
00646	     Die=Sound'UnrealI.WarLord.DeathCry1WL'
00647	     CombatStyle=0.500000
00648	     NameArticle=" the "
00649	     DrawType=DT_Mesh
00650	     Mesh=LodMesh'UnrealI.WarlordM'
00651	     TransientSoundVolume=12.000000
00652	     CollisionRadius=52.000000
00653	     CollisionHeight=78.000000
00654	     Mass=1000.000000
00655	}

End Source Code