#東方弾幕風
#Title[柳花通常3]
#Text[試作]
#ScriptVersion[2]

script_enemy_main
{
	let count=0;
	let cx=GetCenterX();
	let cy=GetCenterY();
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetMovePosition02(cx,cy-120,60);
		SetLife(3000);
		SetDamageRate(100,100);
		SetTimer(60);
		SetGraphicRect(1,1,64,64);
		SetInvincibility(60);
		LoadGraphic(imgExRumia);
		SetTexture(imgExRumia);	
		shottask;
	}
	@MainLoop
	{
		yield;
		SetCollisionA(GetX(),GetY(),24);
		SetCollisionB(GetX(),GetY(),24);
	}
	@Finalize
	{//読みこんだファイルを削除

	}
	
	@DrawLoop
	{
		SetGraphicRect(1,1,64,64);
		SetAlpha(255);
		DrawGraphic(GetX(),GetY());
	}
	task shottask
	{
		let s=0;
		let s2=1;
		yield;
		wait(60);
		loop
		{
			wait(3);
			CreateShotA(s,GetX,GetY,0);		
			SetShotDirectionType(ABSOLUTE);
			SetShotDataA(s,0,2,60,0,0,2,78);
			SetShotDataA(s,60,2,180,0,0,2,78);
			SetShotDataA(s,120,2,300,0,0,2,78);
			SetShotDataA(s,180,1,rand(0,360),0,0,2,78);
			CreateShotA(s2,0,0,0);
			SetShotDataA(s2,0,1,rand(0,360),0,0,3,78);	
			AddShot(60,s,s2,0);
			CreateShotA(s2,0,0,0);
			SetShotDataA(s2,0,1,rand(0,360),0,0,3,78);	
			AddShot(120,s,s2,0);
			FireShot(s);
		}
	}
	function wait(w) 
	{
		loop(w)
		{
			yield;
		}
	}
}