'== included in the AI scripts file =='

'look for a target
AI.getTarget(s, 600)
	
'slow down
If s.speed > 1 Then s.speed = s.speed - 1

'act as a turret
If target <> Null
	s.turn(ATan2(target.y-s.y, target.x-s.x), 1)	'face the target
	AI.fireAIWeapons(s, 0, target.x,  target.y)		'shoot
EndIf

'if we take enough damage, activate our ability (assumed to be a shield)
If s.recent_damage > 5 Then
	'overwrite default ability values
	s.abilitySetTimer("Shield", "duration", 4000)
	s.abilitySetVar("Shield", "cost", 0)
	s.activateAbility()
EndIf


