#搶曽抏枊晽
#Title[栦晞乽堿梲懢嬌恾乿]
#Text[帋嶌]
#ScriptVersion[2]

script_enemy_main
{
	let cx=GetCenterX();
	let cy=GetCenterY();
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,10);
		SetMovePosition02(cx,cy-120,60);
		SetTimer(60);
		SetGraphicRect(1,1,64,64);
		SetInvincibility(60);
		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 angle=0;
		let s=0;
		let s2=1;
		wait(120);
		loop
		{
			wait(3);
			SetShotDirectionType(ABSOLUTE);
			CreateShotA(s,GetX,GetY,0);	
			SetShotDataA(s,0,2,angle,0,-0.02,0,32);
			SetShotDataA(s,300,2,rand(0,360),-0.5,0,3,16);
			CreateShotA(s2,0,0,0);	
			SetShotDataA(s2,0,2,rand(0,360),0.5,0,3,16);
			AddShot(300,s,s2,0);
			FireShot(s);
			angle+=183;
		}
	}
	function wait(w) 
	{
		loop(w)
		{
			yield;
		}
	}
}