#東方弾幕風
#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;
	let a=1;
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,10);
		SetTimer(90);
	
		SetGraphicRect(1,1,64,64);
		SetInvincibility(600);
		
		LoadGraphic(imgExRumia);	
		LoadGraphic(imgback);

		SetMovePosition02(cx,cy-90,60);
		Concentration01(60);
		CutIn(YOUMU,"謎符「知らぬが仏の白き舞」",0,0,0,0,0);
	}
	@MainLoop
	{
		let s=0;
		let base =GetAngleToPlayer;

		SetCollisionA(GetX(),GetY(),24);
		SetCollisionB(GetX(),GetY(),24);
		function shot(let hand,let angle,let plus)
		{
			SetShotDirectionType(PLAYER);
			CreateShotA(s,GetX,GetY,0);	
			SetShotDataA(s,0,4,angle,0,0,2,48);
			if(hand==1)
			{
			SetShotDataA(s,60,5,plus,0,0,2,41);
			}
			FireShot(s);
		}

		if(count==150)
		{
			Concentration01(30);
		}
		if(count>=60)
		{
			if(count%3==0)
			{
				shot(1,105+angle,2)
			}
			if(count%3==0)
			{
				shot(1,-75+angle,-2)
			}
			if(count%3==0)
			{
				shot(0,35+angle,0)
			}
			if(count%3==0)
			{
				shot(0,-5+angle,0)
			}
		}
			if(count%30==0)
			{
				a*=-1;
			}
			angle+=a;
		count++;
	}
	@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());
	}
}