Botpack
Class PainPath

source: e:\games\UnrealTournament\Botpack\Classes\PainPath.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.NavigationPoint
         |
         +--Engine.LiftCenter
            |
            +--Botpack.PainPath
Direct Known Subclasses:None

class PainPath
extends Engine.LiftCenter

//============================================================================= // PainPath. //=============================================================================
Variables
 name DamageType


Function Summary
 void PostBeginPlay()
 Actor SpecialHandling(Pawn Other)
     
/* SpecialHandling is called by the navigation code when the next path has been found.  
It gives that path an opportunity to modify the result based on any special considerations
*/



Source Code


00001	//=============================================================================
00002	// PainPath.
00003	//=============================================================================
00004	class PainPath extends LiftCenter;
00005	
00006	var() name	 DamageType;
00007	
00008	function PostBeginPlay()
00009	{
00010		local inventory Inv;
00011	
00012		Super.PostBeginPlay();
00013	
00014		if ( Region.Zone.bPainZone )
00015			DamageType = Region.Zone.DamageType;
00016	}
00017	
00018	event int SpecialCost(Pawn Seeker)
00019	{
00020		//log(self@"special cost for"@Seeker@"with reduced damage"@Seeker.ReducedDamageType);
00021	
00022		if ( Seeker.ReducedDamageType == DamageType )
00023			return 0;
00024	
00025		return 1000000;
00026	}
00027	
00028	/* SpecialHandling is called by the navigation code when the next path has been found.  
00029	It gives that path an opportunity to modify the result based on any special considerations
00030	*/
00031	function Actor SpecialHandling(Pawn Other)
00032	{
00033		if ( Other.ReducedDamageType == DamageType )
00034			return self;
00035	
00036		return None;
00037	}
00038	
00039	defaultproperties
00040	{
00041	     bSpecialCost=True
00042	}

End Source Code