'== included in the AI scripts file =='
If s.spin = 0 Then s.spin = binsgn(Rand(0,1)) * 1.5

'"forcedir" should be already set to 1 or -1 at this point
vars.init("forcedir", -1)



vars.init("setwell", 0)
If vars.get("setwell") = 0
	'make the gravity well
	Local well:GravityWell = New GravityWell
	well.init(s.x, s.y, 350, 3.75)
	well.direction = vars.get("forcedir")
	
	'black holes set a place to warp to
	If vars.get("forcedir") = -1
		
		'find some black peaks
		Local peakList:TList = New TList
		For Local e:Ship = EachIn shipList
			If e.behavior = "blackpeak" Then peakList.addLast(e)
		Next
		If Not ListIsEmpty(peakList)
			'Print "found a peak!"
			Local peak:Ship = Ship(scrambleList(peakList).First())
			well.warpx = peak.x
			well.warpy = peak.y
		EndIf
		well.warpradius = 30
	
	'Else'tweak the oomf between the two types
	'	well.force:* 0.8
	EndIf
	
	vars.set("setwell", 1)
	'Print "made gravity well at " + well.x + "   " + well.y
EndIf

'heh
'If vars.get("forcedir") = -1 Then s.attractItem("point")'black holes only


'fire a gun that spawns asteroids off the edges of the map
'fireShipWeapons(s, 0)
