#東方弾幕風
#Title[紋符「三角稲妻」]
#Text[試作]
#ScriptVersion[2]

script_enemy_main
{
	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);
		SetMovePosition02(cx,cy-120,60);
		SetTimer(60);
		SetGraphicRect(1,1,64,64);
		SetInvincibility(150);
		LoadGraphic(imgExRumia);
		SetTexture(imgExRumia);	
		shottask;
		CutIn(YOUMU,"紋符「三角稲妻」",0,0,0,0,0);
	}
	@MainLoop
	{
		yield;
		SetCollisionA(GetX(),GetY(),24);
		SetCollisionB(GetX(),GetY(),24);
	}
	@Finalize
	{
		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	@DrawLoop
	{
		SetGraphicRect(1,1,64,64);
		SetAlpha(255);
		DrawGraphic(GetX(),GetY());
	}
	task shottask
	{
		let s=0;
		let s2=1;
		SetShotAutoDeleteClip(512,512,512,512);
		Concentration01(150);
		wait(180);
		loop
		{
			wait(3);
			SetShotDirectionType(SEQUENCE);
			CreateShotA(s,cx,cy,0);	
			SetShotDataA(s,0,6,90,0,0,2,80);
			SetShotDataA(s,10,6,120,0,0,3,80);
			SetShotDataA(s,30,6,120,0,0,3,80);
			SetShotDataA(s,60,6,120,0,0,3,80);
			SetShotDataA(s,100,6,120,0,0,3,80);
			SetShotDataA(s,150,6,120,0,0,3,80);
			SetShotDataA(s,210,6,120,0,0,3,80);
			SetShotDataA(s,280,6,120,0,0,3,80);
			SetShotDataA(s,360,6,120,0,0,3,80);
			SetShotDataA(s,450,6,120,0,0,3,80);
			SetShotDataA(s,550,2,rand(90,270),0,0,3,80);
			CreateShotA(s2,0,0,0);
			SetShotDataA(s2,0,2,rand(180,0),0,0,3,80);	
			AddShot(360,s,s2,0);
			CreateShotA(s2,0,0,0);
			SetShotDataA(s2,0,2,rand(270,90),0,0,3,80);
			AddShot(450,s,s2,0);
			FireShot(s);
		}
	}
	function wait(w) 
	{
		loop(w)
		{
			yield;
		}
	}
}