//=============================================================================
// The extended navigation point
// Native branch class only
// This actor should automatically become bNoDelete after being spawned
//
// For testing purposes, do not modify or redistribute
// Have suggestions? Contact me.
// caco_fff@hotmail.com - Higor at UT99.org
//=============================================================================
class Botz_NavigBase expands NavigationPoint;

#exec TEXTURE IMPORT NAME=BWP_Normal FILE=..\CompileData\BWP_Normal.bmp FLAGS=2

var float MaxDistance; //Maximum hook distance, used by automatic pather, setting to 0 ignores all pathing
var bool bPushSave;
var bool bOneWayInc; //Limits Incoming paths
var bool bOneWayOut; //Limits Outgoing paths
var bool bFlying; //Used to force special reachspec creation
var bool bHighPath; //This path is a high node, don't start walk-only connections here (only fall)
var bool bCustomFlags;
var bool bDirectConnect; //Dynamic Player will display the hook target
var bool bNeverPrune;
var byte ReservePaths;
var byte ReserveUpstreamPaths;

var string FriendlyName;
var Botz_PathLoader MyLoader;

enum EPathMode
{
	PM_None, //Don't path
	PM_Normal, //Do normal processing
	PM_Forced //Force this path!
};

function bool PostPathEvaluate( botz other);
function QueuedForNavigation( Botz Other, byte Slot);

function bool PathVisible( NavigationPoint Start, NavigationPoint End, optional bool IgnoreMovers)
{
	return false;
}

final function LockActor( bool bLock, optional NavigationPoint Other); 
final function int CreateReachSpec();
final function PathCandidates();
final function int ExistingPath( actor Dest);
final function bool EditReachSpec( int ReachSpec, actor Start, actor End, optional float CollisionHeight, optional float CollisionRadius, optional bool bTele);
final function int UnusedReachSpec();
static final function ConnectedDests( NavigationPoint Start, out Actor End, out int ReachSpecIdx);
static final function int IsConnectedTo( NavigationPoint N, NavigationPoint Other, optional bool bIncPruned);
static final function ClearAllPaths( NavigationPoint Other);

// MOVE TO NATIVE CODE LATER!
static final function int FreePathSlot( NavigationPoint N)
{
	local int i;

	For ( i=0 ; i<16 ; i++ )
		if ( N.Paths[i] == -1 )
			return i;
	return -1;
}

// MOVE TO NATIVE CODE LATER!
static final function int FreeUpstreamSlot( NavigationPoint N)
{
	local int i;

	For ( i=0 ; i<16 ; i++ )
		if ( N.UpstreamPaths[i] == -1 )
			return i;
	return -1;
}

event int ModifyFlags( NavigationPoint Dest, int CurFlags);

event EPathMode IsCandidateTo( Botz_NavigBase Other)
{
	return PM_Normal;
}

event EPathMode OtherIsCandidate( NavigationPoint Nav)
{
	if ( Nav.IsA('LiftCenter') ) //No lift centers
		return PM_None;
	if ( Nav.IsA('SpawnPoint') && (VSize(Nav.Location - Location) > MaxDistance * 0.5) ) //Avoid distant SpawnPoints
		return PM_None;
	if ( FastTrace( Nav.Location) )
		return PM_Normal;
	return PM_None;
}

event AddPathHere( NavigationPoint Start, NavigationPoint End, bool bForce);
event FinishedPathing();
function int WalkableCost( NavigationPoint Start, NavigationPoint End);

defaultproperties
{
	FriendlyName="Base Waypoint"
	bStatic=False
	bNoDelete=False
	MaxDistance=200
	Texture=Texture'FerBotz.BWP_Normal'
	bCollideWhenPlacing=false
	Style=3
	SpriteProjForward=4
	DrawScale=0.5
}