//=============================================================================
// JumpSpot.
// specifies positions that can be reached in jumpmatch or with jumpboots or translocator
//=============================================================================
class JumpSpot expands LiftCenter;

event int SpecialCost(Pawn Seeker)
{
	if ( !Seeker.IsA('Bot') || (!Bot(Seeker).bCanTranslocate && (Seeker.JumpZ <= 1.1 * Seeker.Default.JumpZ)) )
		return 100000000;

	return 0;
}

/* 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
*/
function Actor SpecialHandling(Pawn Other)
{
	local Translocator T;

	if ( !Other.IsA('Bot') )
		return None;


	if ( (VSize(Location - Other.Location) < 200) && Other.ActorReachable(self) )
		return self;

	if ( Other.JumpZ <= 1.1 * Other.Default.JumpZ )
	{
		T = Translocator(Other.FindInventoryType(class'Translocator'));
		if ( T == None )
			return None;
		Bot(Other).TranslocateToTarget(self, T);	
	}

	Other.SetPhysics(PHYS_Falling);
	Other.Velocity = Other.GroundSpeed * Normal(Location - Other.Location);
	Other.Velocity.Z = Other.JumpZ;
	Other.bJumpOffPawn = true;
	Other.DesiredRotation = Rotator(Location - Other.Location);
	Bot(Other).SetFall();

	return self;
}

defaultproperties
{
	bStatic=false
	bSpecialCost=true
}