#東方弾幕風
#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=270;
	let a=0.3;
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(200);
		SetDamageRate(10,10);
		SetTimer(90);
	
		SetGraphicRect(1,1,64,64);
		SetInvincibility(60);
		
		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);
		SetShotAutoDeleteClip(512,512,512,512);

		if(count==150)
		{
			Concentration01(30);
		}
		if(count>=60)
		{
			if(count%6==0)
			{	
				loop(9)
				{
					SetShotDirectionType(ABSOLUTE);
					CreateShotA(s,GetX,GetY,0);	
					SetShotDataA(s,0,4,angle,0,0,2,97);
					FireShot(s);
					angle+=40;
				}
			}
		}
		if(count==180)
		{
			a*=-1;
		}
		if(count>=180)
		{
			if(count%60==0)
			{
				let angle=GetAngleToPlayer;
				loop(60)
				{
					SetShotDirectionType(ABSOLUTE);
					CreateShotA(s,GetX,GetY,20);	
					SetShotDataA(s,0,1,angle,0,0,2,89);
					FireShot(s);
					angle+=6;
				}
			}
			if(count%120==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());
	}
}