#東方弾幕風
#Title[模写「恋色星空」]
#Text[試作]
#ScriptVersion[2]

script_enemy_main
{//Enemy01
	let count=0;
	let cx=GetCenterX();
	let cy=GetCenterY();
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgback=GetCurrentScriptDirectory~"img\RyuukaBack.png";
	let angle=0;
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,8);
		SetTimer(90);
	
		SetGraphicRect(1,1,64,64);
		SetInvincibility(600);
		
		LoadGraphic(imgExRumia);	
		LoadGraphic(imgback);

		SetMovePosition02(cx,cy-90,60);
		Concentration01(150);
		CutIn(YOUMU,"模写「恋色星空」",0,0,0,0,0);
	}
	@MainLoop
	{
		let s=0;
		let base =GetAngleToPlayer;

		SetCollisionA(GetX(),GetY(),24);
		SetCollisionB(GetX(),GetY(),24);
		SetShotAutoDeleteClip(512,512,512,512);

		if(count>=180)
		{
			if(count%6==0)
			{	
				SetShotDirectionType(ABSOLUTE);
				CreateShotA(s,GetClipMaxX,rand(GetClipMinY,GetClipMaxY),0);	
				SetShotDataA(s,0,1,rand(179,160),0,0,2,131);
				FireShot(s)
			}
			if(count%6==0)
			{	
				SetShotDirectionType(ABSOLUTE);
				CreateShotA(s,GetClipMinX,rand(GetClipMinY,GetClipMaxY),0);	
				SetShotDataA(s,0,1,rand(1,20),0,0,2,132);
				FireShot(s)
			}
			if(count%36==0)
			{	
				loop(8)
				{
					SetShotDirectionType(ABSOLUTE);
					CreateShotA(s,GetX,GetY,20);	
					SetShotDataA(s,0,1,angle,0,0,2,137);
					FireShot(s);
					angle+=45;
				}
			}
			if(count%36==18)
			{
				loop(8)
				{
					SetShotDirectionType(ABSOLUTE);
					CreateShotA(s,GetX,GetY,20);	
					SetShotDataA(s,0,1,angle+0.5,0,0,2,142);
					FireShot(s);
					angle+=45;
				}
			}
		}
	count++;
	angle-=0.5;
	}
	@Finalize
	{//読みこんだファイルを削除

	}
	@DrawLoop
	{
		if(count<270){SetGraphicRect(64,64,127,127)};
		if(count>=270){SetGraphicRect(1,1,64,64);}
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());
	}
}