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

s.controller.vars.init("countdown", 5)

'look for a target
AI.getTarget(s, 500)
	
'slow down
If s.speed > 5 Then s.speed = s.speed - 5 * timeMod Else s.speed = 0

'fire a beam of points at the target
If target <> Null And target.behavior = "player"
	'if within range
	If approxDist(s.x-target.x,s.y-target.y) <= rangeGroup(s, 0) 
		fireShipWeapons(s, 0, target.x, target.y)		'fire at current target coords
		
		'countdown
		If s.controller.hasTimerTicked("kingofthehill", 1000)
			Local countdown = s.controller.vars.get("countdown")
			
			If countdown > 0
				If countdown = 2 Then s.spin:* -1
				stage.createText(countdown, s.x, s.y - 40, 800)
				s.controller.vars.set("countdown", countdown-1)
			Else
				s.armour = 0
			EndIf
		EndIf
	EndIf
EndIf

