script_enemy_main{

let color=1;
color=(color-1)*40;
let grow=0;

let usespell=0;
let frame=0;
let time=0;
let miny=GetClipMinY; let maxy=GetClipMaxY; let minx=GetClipMinX; let maxx=GetClipMaxX;
let cx=GetCenterX; let cy=GetCenterY;

let SEshotm2=("\script\SoundEffects\shotm2.wav");
let SEdeath=("script\SoundEffects\enemydeath1.wav");

let GRfamiliar=("\script\Images\OtherEffects\Chips.png");

@Initialize{
	LoadGraphic("\script\Images\OtherEffects\Chips.png");
	
	LoadSE("script\SoundEffects\enemydeath1.wav");
	LoadSE("\script\SoundEffects\shotm2.wav");

	SetScore(100);
	SetLife(150);
	MagicCircle(false);
	SetSpeed(0);
	SetAngle(GetAngleToPlayer);
}
	
@MainLoop{

SetCollisionB(GetX,GetY,grow*18);

if(GetX<=minx-32 || GetX>=maxx+32 || GetY<=miny-32 || GetY>=maxy+32 && time>=60){ VanishEnemy; }

if(time==90){ SetAngle(GetAngleToPlayer); }
if(time>=90){ SetSpeed(GetSpeed+0.05); }

if(time==60){
let angle=GetAngle;
	loop(18){
	CreateShot02(GetX+10*cos(angle),GetY+10*sin(angle),0,angle,0.02,GetArgument,167,0);
	angle+=360/18;
	}
PlaySE(SEshotm2);
}

if(grow<1){ grow+=0.1; }

time++;
frame++;

SetCommonData("LifeBarPresent",1);

}

@DrawLoop{
	SetGraphicScale(grow,grow);
	SetTexture(GRfamiliar);
	SetGraphicAngle(0,0,time*5);
	SetColor(255,255,255);
	SetRenderState(ALPHA);
	SetGraphicRect(0+color,0,40+color,40);
	DrawGraphic(GetX,GetY);
}

@Finalize{
if(BeVanished==false){ PlaySE(SEdeath); SetCommonData("FamiliarDestroyed",1); }
}

}