All pastes #905623 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-15 22:35 UTC
rendered paste body
objectdef Testnet
{
variable point3f FeelPoint
variable int FeelAhead=5
variable int Slope=.5
variable int bearing
	method Pulse()
	{
	This:CheckIt
	}
	
	method CheckIt()
	{
	bearing:Set[${Me.Heading}]
	FeelPoint.X:Set[ ${Me.X} + ${Math.Cos[${Math.Calc[${bearing}]}].Round} * ${FeelAhead} ]
  FeelPoint.Y:Set[ ${Me.Y} - ${Math.Sin[${Math.Calc[${bearing}]}].Round} * ${FeelAhead} ]
  FeelPoint.Z:Set[${Me.Z}]
  
  
if ${Math.Distance[${Me.X},${Me.Y},${Math.Calc[${Me.Z}]},${ISXWoW.IsPathObstructed[${Me.X},${Me.Y},${Math.Calc[${Me.Z}]},${FeelPoint.X},${FeelPoint.Y},${Math.Calc[${FeelPoint.Z}+${Slope}]}]}]}<${Math.Calc[${FeelAhead}]}
{  
echo "BLOCKED"
return
}
echo "clean"
	}
}

function main()
{
	declare testin Testnet
	do
	{
		testin:Pulse
	}
	while 1
}