script_enemy_main{

let radius=0;
let scale=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 GRfamiliar=("\script\Images\OtherEffects\SpellCircle1a.png");

@Initialize{
	LoadGraphic("\script\Images\OtherEffects\SpellCircle1a.png");

	SetScore(1);
	SetLife(1);
	MagicCircle(false);
}
	
@MainLoop{

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

if((GetX>minx && GetX<maxx) && (GetY>miny && GetY<maxy)){


if(GetCommonData("Difficulty")==1){
	SetX(cx+radius*cos(time*1.5));
	SetY(miny+100);
	if(radius<100){ radius++; }
	DeleteEnemyShotImmediatelyInCircle(SHOT,GetX,GetY,75);
	if(scale<0.55){ scale+=0.01; }
} //Easy

//================================================================================================

if(GetCommonData("Difficulty")==2){
	SetX(cx+radius*cos(time*1.8));
	SetY(miny+100);
	if(radius<100){ radius++; }
	DeleteEnemyShotImmediatelyInCircle(SHOT,GetX,GetY,70);
	if(scale<0.5){ scale+=0.01; }
} //Normal

//================================================================================================

if(GetCommonData("Difficulty")==3){
	SetX(cx+radius*cos(time*2.1));
	SetY(miny+100);
	if(radius<100){ radius++; }
	DeleteEnemyShotImmediatelyInCircle(SHOT,GetX,GetY,65);
	if(scale<0.45){ scale+=0.01; }
} //Hard

//================================================================================================

if(GetCommonData("Difficulty")==4){
	SetX(cx+radius*cos(time*2.4));
	SetY(miny+100);
	if(radius<100){ radius++; }
	DeleteEnemyShotImmediatelyInCircle(SHOT,GetX,GetY,60);
	if(scale<0.4){ scale+=0.01; }
} //Lunatic
} //Onscreen


time++;
frame++;

}

@DrawLoop{
	SetGraphicScale(scale,scale);
	SetTexture(GRfamiliar);
	SetGraphicAngle(0,0,time*2);
	SetColor(0,255,255);
	SetRenderState(ALPHA);
	SetAlpha(255);
	SetGraphicRect(0,0,200,200);
	DrawGraphic(GetX,GetY);
}

@Finalize{
}

}