task MANMOS{  

                      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(600);

CreateEnemyBossFromFile("script\某マンモス\MANMOZAKO05.TXT",GetCenterX,GetClipMinY,0,0,0);
   
loop(8){
Wait(450);   
if(GetEnemyLife==0){break;}
loop(4){
	CreateEnemyFromFile("script\某マンモス\MANMOZAKO01.TXT",GetClipMinX,30,0,0,0);
        Wait(30);
}
Wait(450);
if(GetEnemyLife==0){break;}
loop(4){
		CreateEnemyFromFile("script\某マンモス\MANMOZAKO02.TXT",GetClipMaxX,90,0,0,0);
  Wait(30);
}
Wait(450);
if(GetEnemyLife==0){break;}
loop(3){
		CreateEnemyFromFile("script\某マンモス\MANMOZAKO03.TXT",cx,GetClipMinY-60,0,0,0);
Wait(120);
}
}



        


	
                 
   

WaitForZeroEnemy();
ExtendPlayer(1);
AddBomb(30);
Wait(60);
CreateEventFromScript("stage");
loop{yield;if(OnEvent()==false){break;}}
CreateEnemyBossFromFile("script\某マンモス\BOSSマンモス.TXT",GetClipMaxX,GetClipMinY,0,0,0);		
WaitForZeroEnemy();
  CreateEventFromScript("FAf");
loop{yield;  if(OnEvent()==false){break;}}
                    SetCommonDataEx("gokusi",FA,1);  
CreateEventFromScript("Get");
loop{yield;   if(OnEvent()==false){break;}}
DeleteEnemyShot(ALL);

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);
      



}