#e
#Title[uTCgATVv]
#Text[g̎pBǂƂȂiCt𓊂]
#Image[.\img\ExRumia(uTCgATVv).png]
#BackGround[Default]
#BGM[.\BGM\th06_11.wav]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾;
	let imgExRumia=GetCurrentScriptDirectory~".\img\Sakuya.png";
	let step=1;
	let bDraw=1;
	let shootSE = GetCurrentScriptDirectory~".\SE\shoot13.wav";
	let cutin = GetCurrentScriptDirectory~".\img\cutSakuya.png";
let scount=60;
	@Initialize
	{
		SetScore(7000000);
		SetLife(100);//Ct100ɐݒ
		SetDamageRate(10,10);//_[W10%ɐݒ
		SetTimer(89);//Ԑ89bɐݒ

		SetGraphicRect(0,0,44,86);//`挳`ݒ
		SetInvincibility(1000);//G1000t[Gɂ
		LoadGraphic(imgExRumia);//摜uimg\ExRumia.pngvǂ݂		
		SetMovePosition02(cx,200,60);//W(200,60)60t[Ĉړ
		CutIn(YOUMU,"uTCgATVv",cutin,0,0,256,256);//XyJ[h\
		SetDurableSpellCard();	
	}

	@MainLoop
	{
              if(OnBomb){
           SetDamageRate(0,0);}
else {SetDamageRate(20,0);}
		let sec=count/60;
		if(count==120)
		{
			bDraw=0;
			Explosion01(GetX(),GetY(),1/60*255,0.3,60);
		}	
		if(bDraw==1){SetCollisionA(GetX(),GetY(),32);}
		count++;
if(sec>=0&&sec<40&&count%80==0){
PlaySE(shootSE);
SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
	CreateShot01(0,0,1.5,0,BLUE32,10);
	CreateShot01(384,0,1.5,0,RED32,10);
	CreateShot01(384,460,1.5,0,YELLOW32,10);
	CreateShot01(0,448,1.5,0,GREEN32,10);}
if(sec>=0&&sec<40&&count%50==0)
		{
		PlaySE(shootSE);
		let x=rand(0,384)+GetClipMinX();
		let y=GetClipMinY();
                SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
		CreateShot01(x,y,1.5,0,BLUE04,10);
		}
		if(sec>=1&&sec<40&&count%50==0)
		{
		PlaySE(shootSE);
		if(count==10*60){SetMovePosition02(cx-150,200,5*60);}
		let x=rand(0,384)+GetClipMinX();
		let y=GetClipMaxY();
                SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
		CreateShot01(x,y,1.5,0,RED04,10);
		}
		if(sec>=1&&sec<40&&count%50==0)
		{
		PlaySE(shootSE);
		if(count==20*60){SetMovePosition02(cx+150,100,5*60);}
		let x=GetClipMinX();
		let y=rand(0,448)+GetClipMinY();
                SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
		CreateShot01(x,y,1.5,0,YELLOW04,10);
		}
		if(sec>=1&&sec<40&&count%50==0)
		{
		PlaySE(shootSE);
		if(count==30*60){SetMovePosition02(cx+100,300,5*60);}
		let x=GetClipMaxX();
		let y=rand(0,448)+GetClipMinY();
                SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
		CreateShot01(x,y,1.5,0,GREEN04,10);
		}
if(sec>=20&&sec<90&&count%50==0)
		{
		PlaySE(shootSE);
		let x=rand(0,384)+GetClipMinX();
		let y=GetClipMinY();
                SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
		CreateShot01(x,y,1.5,0,BLUE03,10);
		}
if(sec>=20&&sec<90&&count%50==0)
		{
		PlaySE(shootSE);
		if(count==20*60){SetMovePosition02(cx+150,100,5*60);}
		let x=rand(0,384)+GetClipMinX();
		let y=GetClipMaxY();
                SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
		CreateShot01(x,y,1.5,0,YELLOW03,10);
		}
if(sec>=20&&sec<40&&count%300==0){
PlaySE(shootSE);
SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
	CreateShot01(0,0,1.8,0,BLUE32,10);
	CreateShot01(0,0,1.7,0,BLUE32,10);
	CreateShot01(0,0,1.6,0,BLUE32,10);
	CreateShot01(384,0,1.8,0,RED32,10);
	CreateShot01(384,0,1.7,0,RED32,10);
	CreateShot01(384,0,1.6,0,RED32,10);
	CreateShot01(384,460,1.8,0,YELLOW32,10);
	CreateShot01(384,460,1.7,0,YELLOW32,10);
	CreateShot01(384,460,1.6,0,YELLOW32,10);
	CreateShot01(0,460,1.8,0,GREEN32,10);
	CreateShot01(0,460,1.7,0,GREEN32,10);
	CreateShot01(0,460,1.6,0,GREEN32,10);
	}
if(sec>=45&&sec<90&&count%240==0){
PlaySE(shootSE);
SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
CreateShot01(0,0,1.3,rand(-10,10),RED32,10);
CreateShot01(0,0,1.3,rand(-10,10),RED32,10);
CreateShot01(0,0,1.3,rand(-10,10),RED32,10);
CreateShot01(0,0,1.3,rand(-10,10),RED32,10);
CreateShot01(0,0,1.3,rand(-10,10),RED32,10);
CreateShot01(0,0,1.3,rand(-10,10),RED32,10);
CreateShot01(0,0,1.3,rand(-10,10),RED32,10);
CreateShot01(384,0,1.3,rand(-10,10),RED32,10);
CreateShot01(384,0,1.3,rand(-10,10),RED32,10);
CreateShot01(384,0,1.3,rand(-10,10),RED32,10);
CreateShot01(384,0,1.3,rand(-10,10),RED32,10);
CreateShot01(384,0,1.3,rand(-10,10),RED32,10);
CreateShot01(384,0,1.3,rand(-10,10),RED32,10);
CreateShot01(384,0,1.3,rand(-10,10),RED32,10);
CreateShot01(0,460,1.3,rand(-10,10),RED32,10);
CreateShot01(0,460,1.3,rand(-10,10),RED32,10);
CreateShot01(0,460,1.3,rand(-10,10),RED32,10);
CreateShot01(0,460,1.3,rand(-10,10),RED32,10);
CreateShot01(0,460,1.3,rand(-10,10),RED32,10);
CreateShot01(0,460,1.3,rand(-10,10),RED32,10);
CreateShot01(0,460,1.3,rand(-10,10),RED32,10);
CreateShot01(384,460,1.3,rand(-10,10),RED32,10);
CreateShot01(384,460,1.3,rand(-10,10),RED32,10);
CreateShot01(384,460,1.3,rand(-10,10),RED32,10);
CreateShot01(384,460,1.3,rand(-10,10),RED32,10);
CreateShot01(384,460,1.3,rand(-10,10),RED32,10);
CreateShot01(384,460,1.3,rand(-10,10),RED32,10);
CreateShot01(384,460,1.3,rand(-10,10),RED32,10);
}
if(sec>=45&&sec<90&&count%240==0){
PlaySE(shootSE);
SetShotDirectionType(PLAYER);//e̊px̊@ɕύX
CreateShot01(0,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,0,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(0,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,460,1.3,rand(-20,20),BLUE32,10);
CreateShot01(384,460,1.3,rand(-20,20),BLUE32,10);
}
}
	
	@Finalize
	{//ǂ݂񂾃t@C폜
		DeleteGraphic(imgExRumia);	
		DeleteSE(shootSE);
		loop(48){CreateItem(ITEM_SCORE,GetX()+rand(-70,70),GetY()+rand(-70,70));}
	}
	
	@DrawLoop
	{
		SetColor(255,255,255);
		//Ex[~A`		
		if(bDraw==1)
		{
			SetRenderState(ALPHA);
			SetAlpha(255);
			SetTexture(imgExRumia);
			if(int(GetSpeedX())==0){SetGraphicRect(0,0,44,86);}
			else if(GetSpeedX()>0){SetGraphicRect(0,0,44,86);}
			else if(GetSpeedX()<0){SetGraphicRect(0,0,44,86);}	
			DrawGraphic(GetX(),GetY());
		}
	}
}