#e
#Title[uXsAEUEMkXv]
#Text[CGX̏YɗpꂽƂ鑄BʊO߂Ă鍂@_Ƃ肦ȂEBdłɂĂ܂EEorz  T[Z]

#BackGround[Default]
#BGM[.\BGM\shooting_star]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾;
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
        let power0=GetCurrentScriptDirectory~"SE\power0.wave";
        let tan00=GetCurrentScriptDirectory~"SE\tan00.wave";
	let imgLittle=GetCurrentScriptDirectory~"img\RumiaCutIn.png";
	let imgCircle=GetCurrentScriptDirectory~"img\circle6_m.png";
	let imgAngle=0;
	let imgback04_06=GetCurrentScriptDirectory~"img\back04_06.png";
	let freeze04=GetCurrentScriptDirectory~"SE\freeze04.wave";
	let data_usershot=GetCurrentScriptDirectory~"USERSHOT\data_usershot.txt";	

        @Initialize
	{
		SetScore(30000);//XyJ[h{[iX30000ɐݒ
		SetLife(360);//Ct300ɐݒ
		SetDamageRate(10,3);//_[W10%ɐݒ
		SetTimer(60);//Ԑ60bɐݒ

		SetGraphicRect(1,1,64,64);//`挳`ݒ
		SetInvincibility(80);//G30t[Gɂ
		
		LoadGraphic(imgExRumia);//摜uimg\ExRumia.pngvǂ݂
		LoadGraphic(imgback04_06);		
		LoadGraphic(imgCircle);
                LoadSE(power0);
		LoadSE(freeze04);
		LoadUserShotData(data_usershot);
		SetMovePosition02(cx+100,100,60);//W(cx,60)60t[Ĉړ
		Concentration01(150);
		CutIn(YOUMU,"uXsAEUEMkXv",imgLittle,1,1,350,525);//XyJ[h\
	}
	
	@MainLoop
	{
		SetShotDirectionType(PLAYER);//e̊px@ɕύX
		if(count==190){Concentration02(115);}
		if(count==180){PlaySE(power0);}
		if(count==350){PlaySE(freeze04);}
		if(count==395){PlaySE(freeze04);}
		if(count==455){PlaySE(freeze04);}
		if(count==515){PlaySE(freeze04);}



		if(count==330)
			{//z[~Oe쐻

			SetShotAutoDeleteClip(600,600,600,600);
			let Ronginus1 =1;
			let Ronginus2 =2;
			let Ronginus3 =3;
			let Ronginus4 =4;
			let ta1 =5;
			let Hosaki1 =6;
			let ta2 =5;
			let Hosaki2 =7;
			let ta3 =5;
			let Hosaki3 =8;
			let ta4 =5;
			let Hosaki4 =9;

			CreateLaserC(Ronginus1,GetX-20,GetY,7,24,PURPLE11,30);
			SetLaserDataC(Ronginus1,0,5,0,0,0.55,12);
			SetShotKillTime(Ronginus1,61);
			CreateLaserC(Hosaki1,GetX-20,GetY,12,12,PURPLE32,30);
			SetLaserDataC(Hosaki1,0,12,0,0,0,5);
			SetShotKillTime(Hosaki1,61);

			CreateLaserC(Ronginus2,0,0,7,24,PURPLE11,0);
			SetLaserDataC(Ronginus2,0,5,0,0,0.55,12);
			SetShotKillTime(Ronginus2,61);
			CreateLaserC(Hosaki2,0,0,12,12,PURPLE32,0);
			SetLaserDataC(Hosaki2,0,12,0,0,0,5);
			SetShotKillTime(Hosaki2,61);

			CreateLaserC(Ronginus3,0,0,7,24,PURPLE11,0);
			SetLaserDataC(Ronginus3,0,5,0,0,0.55,12);
			SetShotKillTime(Ronginus3,61);
			CreateLaserC(Hosaki3,0,0,12,12,PURPLE32,0);
			SetLaserDataC(Hosaki3,0,12,0,0,0,5);
			SetShotKillTime(Hosaki3,61);
	
			CreateLaserC(Ronginus4,0,0,7,24,PURPLE11,0);
			SetLaserDataC(Ronginus4,0,5,0,0,0.55,12);
			SetShotKillTime(Ronginus4,120);
			CreateLaserC(Hosaki4,0,0,12,12,PURPLE32,0);
			SetLaserDataC(Hosaki4,0,12,0,0,0,5);
			SetShotKillTime(Hosaki4,120);
			
			let i=0;
                        while(i<60)
			{//360JԂ
				let Shotang=rand(0,360);
				let ta1=10;
				CreateShotA(ta1,0,0,60);//ta쐻
				SetShotDataA(ta1,0,7,Shotang,0,-0.7,0,PURPLE01);
				SetShotDataA(ta1,180,0.1,0,0,0.3,10,PURPLE32);
				SetShotKillTime(ta1,400);
				AddShot(i,Ronginus1,ta1,0);//shotAtao^;
				i+=3;
			}

			let j=0;
                        while(j<60)
			{//360JԂ
				let Shotang=rand(0,360);
				let ta2=10;
				CreateShotA(ta2,0,0,60);//ta쐻
				SetShotDataA(ta2,0,7,Shotang,0,-0.7,0,PURPLE01);
				SetShotDataA(ta2,180,0.1,0,0,0.3,10,PURPLE32);
				SetShotKillTime(ta2,400);
				AddShot(j,Ronginus2,ta2,0);//shotAtao^;
				j+=3;
			}

			let k=0;
                        while(k<60)
			{//360JԂ
				let Shotang=rand(0,360);
				let ta3=10;
				CreateShotA(ta3,0,0,60);//ta쐻
				SetShotDataA(ta3,0,7,Shotang,0,-0.7,0,PURPLE01);
				SetShotDataA(ta3,180,0.1,0,0,0.3,10,PURPLE32);
				SetShotKillTime(ta3,400);
				AddShot(k,Ronginus3,ta3,0);//shotAtao^;
				k+=3;
			}

			let l=0;
			let emem=GetAngleToPlayer();
                        while(l<80)
			{//360JԂ
				let Shotang=rand(0,360);
				let ta1=10;
				CreateShotA(ta4,0,0,60);//ta쐻
				SetShotDataA(ta4,0,7,Shotang,0,-0.7,0,PURPLE01);
				SetShotDataA(ta4,180,0.1,0,0,0.3,10,PURPLE32);
				SetShotKillTime(ta4,400);
				AddShot(l,Ronginus4,ta4,0);//shotAtao^;
				l+=3;
			}
			
			AddShot(0,Hosaki4,Ronginus4,0); 
			AddShot(60,Ronginus3,Hosaki4,0); 
			AddShot(0,Hosaki3,Ronginus3,0); 
			AddShot(60,Ronginus2,Hosaki3,0); 
			AddShot(0,Hosaki2,Ronginus2,0); 
			AddShot(45,Ronginus1,Hosaki2,0); 
			FireShot(Ronginus1);
			FireShot(Hosaki1);




				
			}

				
			


                if(count==660)
			{
			SetShotAutoDeleteClip(300,300,300,300);
			SetMovePositionRandom01(75,40,5,GetClipMinX()+100,80,GetClipMaxX()-100,150);
			count=0;
			}
	

		SetCollisionA(GetX(),GetY(),48);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),12);//蔻(̓)o^
		count++;
	}
	
	@Finalize
	{//ǂ݂񂾃t@C폜
		DeleteGraphic(imgExRumia);	
		SetShotAutoDeleteClip(64,64,64,64);
		CreateItem(ITEM_1UP,GetX,GetY-60);
		loop(8)
		{
			CreateItem(ITEM_SCORE,GetX+rand(-100,100),GetY-rand(20,100));
		}
	}
	
	@DrawLoop
	{
		//Ex[~A`
                if(GetSpeedX()==0)
			{
			if(count<360){SetGraphicRect(64,64,127,127)};
			if(count>=360){SetGraphicRect(1,1,64,64);}
			}
		else if(GetSpeedX()>0){SetGraphicRect(192,1,255,64);}
	        else if(GetSpeedX()<0){SetGraphicRect(128,1,191,64);}
		SetGraphicAngle(0,0,0);
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());

		SetGraphicRect(129,1,256,128);
		SetAlpha(100);
		SetGraphicAngle(0,0,-imgAngle);
		SetTexture(imgCircle);
		DrawGraphic(GetX(),GetY());
		imgAngle+=1;
	}

	@BackGround
	{
	//XyJ[h̔wi
	//Ă悢


		SetTexture(imgback04_06);
		SetGraphicRect(1,1,512,512);
		SetAlpha(100);
		SetGraphicAngle(0,0,0);
		DrawGraphic(GetCenterX,GetCenterY);
		
	} 


}


	


	
	}
