#e
#Title[𓚁uƂe̒Eov]
#Text[]
#ScriptVersion[2]
script_enemy_main
{
	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(600);
		SetDamageRate(10,0);
		SetMovePosition02(cx,cy-120,60);
		SetTimer(80);
		SetGraphicRect(1,1,64,64);
		SetInvincibility(60);
		LoadGraphic(imgExRumia);
		SetTexture(imgExRumia);	
		shottask;
		bombtask;
		CutIn(YOUMU,"𓚁uƂe̒Eov",0,0,0,0,0);//XyJ[h\
	}
	@MainLoop
	{
		yield;
	}
	@Finalize
	{
		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	@DrawLoop
	{
		SetGraphicRect(1,1,64,64);
		DrawGraphic(GetX(),GetY());
	}
	task shottask
	{
		let s=0;
		let angle=0;
		wait(120);
		loop
		{
			angle=rand(0,360);
			loop(20)
			{
				shot(s,angle);
				angle+=18;
			}
			wait(60);
		}
	}
	task bombtask
	{
		loop
		{
			if(OnBomb)
			{
				SetAlpha(64);
				SetDamageRate(0,0);
			}
			else
			{
				SetAlpha(255);
				SetDamageRate(10,0);
				SetCollisionA(GetX(),GetY(),24);
				SetCollisionB(GetX(),GetY(),24);
			}
			yield;
		}
	}
	function shot(let shotid,let angle)
	{
		SetShotDirectionType(PLAYER);
		CreateShotA(shotid,GetPlayerX+120*cos(angle),GetPlayerY+120*sin(angle),0);
		SetShotDataA(shotid,0,0,180,0,0,2,223);
		SetShotDataA(shotid,360,NULL,0,0,0.1,2,223);
		FireShot(shotid);
	}
	function wait(w) 
	{
		loop(w)
		{
			yield;
		}
	}
}