
#Title[X_ueAuU[hv]
#Text[hq_^eAL̕KEZB
CXłi]
#BGM[]
#ScriptVersion[2]


script_enemy_main {let name = "X_ueAuU[hv";
let csd     = GetCurrentScriptDirectory;
    let imgBoss   = csd ~ "Boss.png";
    let frame     =  0;
    let angleBase = 90;
let angle2 = 0;
        let count;//eoԊu𐧌䂷邽߂̕ϐ;
	let count2;//eoԊu𐧌䂷邽߂̕ϐ;
	let cx;//ϐcxɐ^񒆂̍W;
	let kari=1;
        
let count3;
let ID = 0;
let count4;
let wIni    = 120;
let angle3=120;
let angle4=240;
let count5;

//ʒu
let xIni = GetCenterX;
let yIni = GetClipMaxY - 32;



    @Initialize {CutIn(KOUMA, name, "", 0, 0, 0, 0);

        SetLife(2000);
        SetTimer(85);
        SetScore(2700000);
        SetDamageRate(70,50);
        LoadGraphic(imgBoss);
        SetTexture(imgBoss);
        SetGraphicRect(1, 1, 64, 64);
SetInvincibility(360);
SetDamageRate(40, 0);
SetMovePosition02(GetCenterX-100, GetClipMinY + 50, wIni);
TMain;}
        count=0;//eoԊu𐧌䂷邽߂̕ϐ;
		count2=-100;//eoԊu𐧌䂷邽߂̕ϐ;
count4=0;
count3=0;		
count5=0;
cx=GetCenterX();//ϐcxɐ^񒆂̍W;

    @MainLoop {SetCollisionA(GetX, GetY, 32);

 SetCollisionB(GetX, GetY, 16);
count3++;
if(count3==120){TConcentration;}
if(count3>=350){

//eXNvg
frame++;
count2++;
if(count2==60){
CreateShot02(rand(50,400),rand(20,25),0,90,0.035,8,AQUA23,0);
count2=-15;
}
count5++;
if(count5==910){
CreateLaser01(rand(50,400),rand(20,25),4,90,75,8,BLUE11,0);
count5=865;}

if((frame>=6)&&(frame<=120)){
count++;
if(count==6){let angle=GetAngleToPlayer-36;

loop(5){CreateShotA(0,GetX,GetY,0);
SetShotDataA(0,0,10,angle,0,0,10,AQUA03);
angle+=18;
FireShot(0);
count=0;}}}
if(frame==120){Concentration02(30);
wait(30);}
if((frame>=200)&&(frame<=400))
{count++;
if(count==10){let angle=GetAngleToPlayer-60;

loop(5){CreateShotA(1,GetX,GetY,0);
SetShotDataA(1,0,5,angle,0,0,10,BLUE04);
angle+=30;
FireShot(1);}
loop(6){

CreateShotA(2,GetX,GetY,0);
SetShotDataA(2,0,2,angle-290,0,0,10,AQUA04);
angle+=20;
SetShotDataA(2,60,2.5,GetAngleToPlayer,0,0.2,7,AQUA04);
FireShot(2);
count=0;
}}}

if(frame==400){Concentration02(60);
wait(60);}
if((frame>=500)&&(frame<=800)){count4++;
if(count4==10){loop(3){
CreateShotA(3,rand(GetX-100,GetX+100),rand(GetY-50,GetY-10),0);
SetShotDataA(3,0,4,rand(-180,180),0,0,4,BLUE01);
SetShotDataA(3,6,0,rand(-180,180),0,0.05,5.5,BLUE01);
FireShot(3);}
loop(3){
CreateShotA(4,rand(GetX-100,GetX+100),rand(GetY-50,GetY-10),0);
SetShotDataA(4,0,4,rand(-180,180),0,0,4,AQUA01);
SetShotDataA(4,6,0,rand(-180,180),0,0.05,5.5,AQUA01);
FireShot(4);
}
count4=0;
}}
if(frame==810){Concentration02(60);
wait(60);
}
if(frame==910){
frame=0;}
}




}
@DrawLoop {DrawGraphic(GetX, GetY);}
@Finalize {DeleteGraphic(imgBoss);
CreateItem(ITEM_1UP,GetX,GetY);
loop(10){CreateItem(ITEM_SCORE,GetX+rand(-100,100),GetY+rand(-30,5));}}

task TMain{
yield;
standBy;}
sub standBy{
SetMovePosition02(GetCenterX, GetClipMinY + 120, wIni);}

task TConcentration{concentration;}
sub concentration {
    let wConc = 180;
    Concentration02(wConc);
    wait(wConc);}

function wait(wConc){loop(wConc){yield;}}}