task ALMAZI{  

                      let gokusi=49;
                      let aaaaa=0;
   
		let cx=GetCenterX();


			function Wait(let frame)
			{//待機関数
				loop(frame){yield};
			}
			function WaitForZeroEnemy()
			{//敵数が0になるまで待機する関数
				while(GetEnemyNum() != 0){yield;}
			}
yield;

Wait(60);
if(GetCommonDataEx("gokusi",myu)==1){PlayMusic("\bgm\x4introx.mid");}
if(GetCommonDataEx("gokusi",myu)==2){PlayMusic("\bgm\zerox4.mid");}
Wait(360);
    
             loop(5){let a=10;
                     Wait(60);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01R.TXT",cx-150,GetClipMinY,0,0,0);
                       Wait(45);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01R.TXT",cx-100,GetClipMinY,0,0,0);
                       Wait(45);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01R.TXT",cx-50,GetClipMinY,0,0,0);
                      Wait(45);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01R.TXT",cx-0,GetClipMinY,0,0,0);
                   Wait(60);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01L.TXT",cx+150,GetClipMinY,0,0,0);
                       Wait(45);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01L.TXT",cx+100,GetClipMinY,0,0,0);
                       Wait(45);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01L.TXT",cx+50,GetClipMinY,0,0,0);
                      Wait(45);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01L.TXT",cx+0,GetClipMinY,0,0,0);
                 
}

let a=cx;


                    

WaitForZeroEnemy();

             loop(1){let a=rand(0,60);
                     Wait(60);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO05.TXT",cx+30,GetClipMaxY,0,0,0);
                       Wait(60);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO05.TXT",cx-30,GetClipMaxY,0,0,0);
                      Wait(60);

                 
}
      loop(3){let a=10;
                     Wait(120);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO02.TXT",cx,GetClipMinY-30,0,0,0);
                       Wait(120);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO02.TXT",cx,GetClipMinY-30,0,0,0);

                     Wait(120);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO02.TXT",cx,GetClipMinY-30,0,0,0);
                       Wait(120);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO02.TXT",cx,GetClipMinY-30,0,0,0);
                                   Wait(120);
                 
}


WaitForZeroEnemy();
      loop(3){let a=10;

                     Wait(60);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO03.TXT",70+cx,GetClipMinY-30,0,0,0);
                       Wait(40);

		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO03.TXT",70+cx+90,GetClipMinY-30,0,0,0);
                    CreateEnemyFromFile("script\某アルマジロ\ARMZAKO03.TXT",70+cx-90,GetClipMinY-30,0,0,0);
                  Wait(120);
                     Wait(60);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO03.TXT",-70+cx,GetClipMinY-30,0,0,0);
                       Wait(40);

		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO03.TXT",-70+cx+90,GetClipMinY-30,0,0,0);
                    CreateEnemyFromFile("script\某アルマジロ\ARMZAKO03.TXT",-70+cx-90,GetClipMinY-30,0,0,0);
                  Wait(120);
}

  Wait(360);

             loop(1){let a=rand(0,60);
                     Wait(60);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO05.TXT",cx+30,GetClipMaxY,0,0,0);
                       Wait(60);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO05.TXT",cx-30,GetClipMaxY,0,0,0);
                      Wait(60);

                 
}
      loop(4){let a=10;
                     
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO04R.TXT",GetClipMinX,GetClipMinY+30,0,0,0);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO04L.TXT",GetClipMaxX,GetClipMinY+90,0,0,0);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO04R.TXT",GetClipMinX,GetClipMinY+150,0,0,0);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO04L.TXT",GetClipMaxX,GetClipMinY+210,0,0,0);
                   Wait(270);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO04R.TXT",GetClipMinX,GetClipMinY+90,0,0,0);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO04L.TXT",GetClipMaxX,GetClipMinY+30,0,0,0);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO04R.TXT",GetClipMinX,GetClipMinY+210,0,0,0);
		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO04L.TXT",GetClipMaxX,GetClipMinY+150,0,0,0);
                   Wait(270);
                               
}

WaitForZeroEnemy();
             loop(2){
                    
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01R.TXT",cx-150,GetClipMinY,0,0,0);

                            Wait(90);

	CreateEnemyFromFile("script\某アルマジロ\ARMZAKO06.TXT",GetClipMinX,360,0,0,0);
                            Wait(90);

		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01L.TXT",cx+150,GetClipMinY,0,0,0);
                            Wait(90);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO07.TXT",GetClipMaxX,180,0,0,0);

                            Wait(90);
                  			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01R.TXT",cx-150,GetClipMinY,0,0,0);

                            Wait(90);

	CreateEnemyFromFile("script\某アルマジロ\ARMZAKO06.TXT",GetClipMinX,120,0,0,0);
                            Wait(90);

		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01L.TXT",cx+150,GetClipMinY,0,0,0);
                            Wait(90);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO07.TXT",GetClipMaxX,240,0,0,0);

                            Wait(90);    
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01R.TXT",cx-150,GetClipMinY,0,0,0);

                            Wait(90);

	CreateEnemyFromFile("script\某アルマジロ\ARMZAKO06.TXT",GetClipMinX,200,0,0,0);
                            Wait(90);

		      CreateEnemyFromFile("script\某アルマジロ\ARMZAKO01L.TXT",cx+150,GetClipMinY,0,0,0);
                            Wait(90);
			CreateEnemyFromFile("script\某アルマジロ\ARMZAKO07.TXT",GetClipMaxX,100,0,0,0);

                            Wait(90);
                 
}


WaitForZeroEnemy();
ExtendPlayer(1);
AddBomb(30);
Wait(60);

CreateEnemyBossFromFile("script\某アルマジロ\BOSSアルマジロ.TXT",GetCenterX,GetClipMinY,0,0,0);
WaitForZeroEnemy();
DeleteEnemyShot(ALL);
  CreateEventFromScript("AMf");
loop{yield;  if(OnEvent()==false){break;}}
             SetCommonDataEx("gokusi",AM,1);  
CreateEventFromScript("Get");
loop{yield;   if(OnEvent()==false){break;}}
if(GetCommonDataEx("gokusi",ST)+GetCommonDataEx("gokusi",FA)+GetCommonDataEx("gokusi",CM)+GetCommonDataEx("gokusi",OC)+GetCommonDataEx("gokusi",BM)+GetCommonDataEx("gokusi",IC)+GetCommonDataEx("gokusi",EL)+GetCommonDataEx("gokusi",AM)==4){
WaitForZeroEnemy();
ExtendPlayer(1);
AddBomb(30);
Wait(300);
if(GetCommonDataEx("gokusi",50)==1){
CreateEnemyBossFromFile("script\vava\BOSSVAVA1.TXT",GetCenterX,GetClipMinY,0,0,0);
WaitForZeroEnemy();
CreateEventFromScript("VAf");
loop{yield;   if(OnEvent()==false){break;}}
}
else{
CreateEnemyBossFromFile("script\某犬\BOSS狼a.TXT",GetCenterX,GetClipMinY,0,0,0);
WaitForZeroEnemy();
CreateEventFromScript("BELaf");
loop{yield;  if(OnEvent()==false){break;}}
}

}
WaitForZeroEnemy();
PlayMusic("\bgm\BattleFinish.mid");
Wait(1220);
SetCommonDataEx("gokusi",TEST,0); 
PlayMusic("\bgm\DrCain.mid");
if(GetCommonDataEx("gokusi",ST)+GetCommonDataEx("gokusi",FA)+GetCommonDataEx("gokusi",CM)+GetCommonDataEx("gokusi",OC)+GetCommonDataEx("gokusi",BM)+GetCommonDataEx("gokusi",IC)+GetCommonDataEx("gokusi",EL)+GetCommonDataEx("gokusi",AM)==4){
CreateEventFromScript("MID");
loop{yield;   if(OnEvent()==false){break;}}
}
if(GetCommonDataEx("gokusi",ST)+GetCommonDataEx("gokusi",FA)+GetCommonDataEx("gokusi",CM)+GetCommonDataEx("gokusi",OC)+GetCommonDataEx("gokusi",BM)+GetCommonDataEx("gokusi",IC)+GetCommonDataEx("gokusi",EL)+GetCommonDataEx("gokusi",AM)==8){
CreateEventFromScript("FINAL");
loop{yield;   if(OnEvent()==false){break;}}
}
ExtendPlayer(1);
AddBomb(-1*GetPlayerBomb);
AddBomb(100);

       

}
