//0 is doing nothing
//1 is engaging with the enemy
//2 is finding the enemy
//3 is looking for health powerups
if distance_to_object(character)<=200 status=1;
if health<=25 status=3;
if distance_to_object(character)>200 and health>25 status=choose(0,2);
if status==1
{
var yyy,qqq,zzz;
yyy=arctan2(self.y-character.y,character.x-self.x);
qqq=radtodeg(yyy);
zzz=instance_create(20*cos(yyy)+x,-20*sin(yyy)+y,projectile_Boss4);
zzz.direction=qqq;
zzz.speed=8;
}
if status==3
{
var eee,fff,ggg,hhh,jjj;
eee=instance_nearest(x,y,blueberries);
fff=instance_nearest(x,y,apple);
ggg=distance_to_point(eee.x,eee.y);
hhh=distance_to_point(fff.x,fff.y);
if ggg<hhh jjj=eee;
if ggg>hhh jjj=fff;
mp_potential_settings(40,5,4,true);
mp_potential_step(jjj.x,jjj.y,6.5,false);
}
if status==2
{
mp_potential_settings(40,5,4,true);
mp_potential_step(character.x,character.y,6.5,true);
}