//----------------------------------------------------------- // //----------------------------------------------------------- class HardPatController extends BossZombieController; var NavigationPoint MidGoals[2]; var byte ReachOffset; var Actor OldPathsCheck[3]; function Debugf( string S ) { Level.GetLocalPlayerController().ClientMessage(S); Log(S); } final function FindPathAround() { local Actor Res; local NavigationPoint N; local NavigationPoint OldPts[12]; local byte i; local bool bResult; if( Enemy==None || VSizeSquared(Enemy.Location-Pawn.Location)<360000 ) return; // No can do this. // Attempt to find an alternative path to enemy. /* This works by: - finding shortest path to enemy - block middle path point - if the path is still about same to enemy, try block the new path and repeat up to 6 times. */ for( i=0; i0 && CompareOldPaths() ) { bResult = true; break; } N = GetMidPoint(); if( N==None ) break; N.bBlocked = true; OldPts[i] = N; if( i==0 ) SetOldPaths(); } // Unblock temp blocked paths. for( i=0; i=2 ) { GotoState('ZombieHunt'); return; } if( ActorReachable(MidGoals[ReachOffset]) ) { MoveTarget = MidGoals[ReachOffset]; ++ReachOffset; } else { MoveTarget = FindPathToward(MidGoals[ReachOffset]); if( MoveTarget==None ) ++ReachOffset; } } function BreakUpDoor( KFDoorMover Other, bool bTryDistanceAttack ) { Global.BreakUpDoor(Other,bTryDistanceAttack); Pawn.GoToState(''); } Begin: PickDestination(); if( MoveTarget==None ) Sleep(0.5f); else MoveToward(MoveTarget,MoveTarget,,False); GoTo'Begin'; } defaultproperties { }