script_enemy_main {

let frame1 = 50;
let frame2 = 0;
let frame3 = 80;
let frame4 = 0;
let w = 1;
let frame5 = 0;
let frame6 = 0;
let frame7 = 0;
let frame8 = 0;
let frame9 = 0;
let frame10 = 0;
let frame11 = 0;
let anim1 = 0;
let anim2 = 0;
let anim3 = 0;
let anim4 = 0;
let anim5 = 0;
let anim6 = 0;
let a1 = 0;
let a2 = 0;
let a3 = 0;
let a4 = 0;
let a5 = 0;
let a6 = 0;
let a7 = 0;
let a8 = 0;
let acc1 = 0;
let acc2 = 0;
let acc3 = 0;
let acc4 = 0;
let acc5 = 0;
let acc6 = 0;
let acc7 = 0;
let acc8 = 0;
let acc9 = 0;
let acc10 = 0;
let acc11 = 0;
let acc12 = 0;
let random1 = 0;
let random2 = 0;
let random3 = 0;
let random4 = 0;

let sh1 = GetCurrentScriptDirectory~"se\Shot1.wav";
let sh2 = GetCurrentScriptDirectory~"se\Laser1.wav";
let sh3 = GetCurrentScriptDirectory~"se\Laser4.wav";

let BossImage = GetCurrentScriptDirectory~"ef\familiar.png";

@Initialize{
	LoadGraphic(BossImage);
	LoadSE(sh1);
	LoadSE(sh2);
	LoadSE(sh3);
	SetLife(10);
	SetMovePosition03(GetClipMaxX, GetClipMaxY, 10, 9);
 }
@MainLoop{
    


        if (frame1 == 190)
        { 

        loop(15)
        {
            CreateLaser01(GetX, GetY,20,a1,300,50,rand(2,8),0);
	a1 += 360/15;
        }
	a1 -= 16.2;
	a2 -= 10;
	a3 += 17;
	PlaySE(sh3);
	frame1 = 100;
        }
        if (frame3 == 150)
        { 

        loop(15)
        {
            CreateLaserA(1,GetX,GetY,0,10,1,801);
	    SetLaserDataA(1,0,a1,0,30,0,0);
	    SetLaserDataA(1,90,NULL,-0.18,0,0,0);
	    SetShotKillTime(1,800);
	    FireShot(1);
	a1 += 360/15;
        }
	PlaySE(sh2);
        }
        frame1++;
        frame2++;
        frame3++;
        frame4++;
    
	if (frame2 == 800)
        {
	VanishEnemy;
	}
  }
@DrawLoop{
SetRenderState(ALPHA);
SetGraphicScale(1,1);
SetAlpha(255);
SetGraphicRect(0, 0, 66, 64);
SetTexture(BossImage);
SetGraphicAngle(0,0,acc2);
DrawGraphic(GetX, GetY);
acc2 += 10;
 }
@Finalize{
 }
}
