..#e
#Title[䕄uۂɎjv]
#Text[XNvg]
#ScriptVersion[2]

script_enemy_main
{//Enemy01
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾
	let cy=GetCenterY();//STGV[̒SyW擾
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,8);
		SetMovePosition02(cx,cy,60);
		SetTimer(60);
		SetGraphicRect(1,1,64,64);
		SetInvincibility(60);
		LoadGraphic(imgExRumia);
		SetTexture(imgExRumia);	
		shottask;
		CutIn(YOUMU,"䕄uۂɎjv",0,0,0,0,0);//XyJ[h\
	}
	@MainLoop
	{
			yield;
			SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
			SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
	}
	@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;
		let angle=rand(0,360);
		loop
		{
			wait(240);
			shot(s,s2);
			wait(60);
			loop(60)
			{
				CreateShotA(s,cx,cy,0);	
				SetShotDirectionType(ABSOLUTE);
				SetShotDataA(s,0,3,angle,0,0,0,80);
				SetShotDataA(s,30,0,angle,0,0,0,80);
				SetShotDataA(s,60,NULL,angle,0,0.01,0.7,80);
				FireShot(s);
				CreateShotA(s2,cx,cy,0);	
				SetShotDataA(s2,0,1,angle,0,-0.01,0,80);
				SetShotDataA(s2,30,0,angle,0,0,0,80);
				SetShotDataA(s2,60,NULL,angle,0,0.01,0.5,80);
				FireShot(s2);
				angle+=6;
			}
		}
	}
	function shot (shotid,shotid2)
	{
		let angle=90;
		let angle2=rand(0,360);
		loop(6)
		{
			CreateShotA(shotid,GetX,GetY,0);
			SetShotDataA(shotid,0,1,angle,0,0,0,80);
			loop(40)
			{
				CreateShotA(shotid2,0,0,0);	
				SetShotDataA(shotid2,0,1,angle2,0,-0.01,0,80);
				SetShotDataA(shotid2,30,0,angle2,0,0,2,80);
				SetShotDataA(shotid2,60,NULL,angle2,0,0.01,0.5,80);
				AddShot(60,shotid,shotid2,0);
				angle2+=9;
			}
			SetShotKillTime(shotid,61);
			FireShot(shotid);
			angle+=60;
		}
	}
	function wait(w) 
	{
		loop(w)
		{
			yield;
		}
	}
}