#e
#Title[u~bhiCg@Gv]
#Text[Ex[~Aŏ̃XyJ[hFu~bhiCg@Gv]
#Image[.\img\ExRumia(u~bhiCg@Gv).png]
#BackGround[Default]
#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";
	@Initialize
	{
		SetScore(30000);//XyJ[h{[iX30000ɐݒ
		SetLife(300);//Ct300ɐݒ
		SetDamageRate(10,10);//_[W10%ɐݒ
		SetTimer(60);//Ԑ60bɐݒ

		SetGraphicRect(1,1,64,64);//`挳`ݒ
		SetInvincibility(30);//G30t[Gɂ
		
		LoadGraphic(imgExRumia);//摜uimg\ExRumia.pngvǂ݂		
		LoadGraphic(imgExRumiaBack);

		SetMovePosition02(cx,60,60);//W(cx,60)60t[Ĉړ
		Concentration01(150);
		CutIn(YOUMU,"u~bhiCg@Gv",0,0,0,0,0);//XyJ[h\
	}
	
	@MainLoop
	{
		if(count==90)
		{//e
			let shotA=0;
			CreateShotA(shotA,GetX(),GetY(),0);//shotA쐻
			SetShotDataA(shotA,0,5,0,0,-0.08,0,BLUE03);//shotAɃf[^o^;
			SetShotDataA(shotA,60,5,135,0,0,5,BLUE03);
			let i=60;
			while(i<360)
			{//360JԂ
				let shotSpeed=rand(0.5,1.5);
				let ta=1;
				CreateShotA(ta,0,0,60);//ta쐻
				SetShotDataA(ta,0,shotSpeed,rand(0,360),0,0,0,BLUE01);
				AddShot(i,shotA,ta,0);//shotAtao^;
				i++;
			}
			FireShot(shotA);

			i=60;
			CreateShotA(shotA,GetX(),GetY(),0);
			SetShotDataA(shotA,0,5,180,0,-0.08,0,BLUE03);
			SetShotDataA(shotA,60,5,45,0,0,5,BLUE03);
			while(i<360)
			{
				let shotSpeed=rand(0.5,1.5);
				let ta=1;
				CreateShotA(ta,0,0,60);
				SetShotDataA(ta,0,shotSpeed,rand(0,360),0,0,0,BLUE01);
				AddShot(i,shotA,ta,0);
				i++;
			}
			FireShot(shotA);		
		}
	
		if(count==250)
		{//Ԓe
			let shotA=0;
			CreateShotA(shotA,GetX(),GetY(),0);
			SetShotDataA(shotA,0,5,0,0,-0.08,0,RED03);
			SetShotDataA(shotA,60,5,90,0,0,5,BLUE03);
			let i=60;
			while(i<360)
			{
				let shotSpeed=rand(0.5,1.5);
				let ta=1;
				CreateShotA(ta,0,0,60);
				SetShotDataA(ta,0,shotSpeed,rand(0,360),0,0,0,RED01);
				AddShot(i,shotA,ta,0);
				i++;
			}
			FireShot(shotA);
			
			i=60;
			CreateShotA(shotA,GetX(),GetY(),0);
			SetShotDataA(shotA,0,5,180,0,-0.08,0,RED03);
			SetShotDataA(shotA,60,5,90,0,0,5,BLUE03);
			while(i<360)
			{
				let shotSpeed=rand(0.5,1.5);
				let ta=1;
				CreateShotA(ta,0,0,60);
				SetShotDataA(ta,0,shotSpeed,rand(0,360),0,0,0,RED01);
				AddShot(i,shotA,ta,0);
				i++;
			}
			FireShot(shotA);
		}
		if(count==300){Concentration01(120)};
		if(count==400){count=89;};
		SetCollisionA(GetX(),GetY(),32);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
		count++;
	}
	
	@Finalize
	{//ǂ݂񂾃t@C폜
		DeleteGraphic(imgExRumia);	
		DeleteGraphic(imgExRumiaBack);
		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	
	@DrawLoop
	{
		//Ex[~A`
		if(count<270){SetGraphicRect(64,64,127,127)};
		if(count>=270){SetGraphicRect(1,1,64,64);}
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());
	}
}