#e
#Title[~ω̌ -Normal-]
#Text[]
#BackGround[DEFAULT]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	let img_boss = "script\img\ExRumia.png";
	let text = "";

	@Initialize
	{
		SetX(GetCenterX());
		SetY(GetClipMinY() + 150);

		SetLife(1000);
		SetTimer(60);
		SetScore(1000000);
		CutIn(YOUMU, "u~ω̌v", "", 0, 0, 0, 0);

		LoadGraphic(img_boss);
		SetTexture(img_boss);
		SetGraphicRect(0, 0, 63, 63);

		LoadUserShotData(GetCurrentScriptDirectory() ~ "lightbullet.txt");
		SetShotAutoDeleteClip(32, 32, 32, 32);

		SetDamageRate(20, 20);

		T_Main();
	}

	@Finalize
	{
		DeleteGraphic(img_boss);
	}

	@DrawLoop
	{
		DrawGraphic(GetX(), GetY());
	}

	@MainLoop
	{
		SetCollisionA(GetX(), GetY(), 48);
		SetCollisionB(GetX(), GetY(), 24);

		yield;
	}

	task T_Main()
	{
		yield;

		Wait(120);

		let angle = rand(0, 360);
		loop{
			CreateRow(angle);
			Wait(5);
			angle -= 360 * 3 / 7 + 16.7 / 7;
		}
	}

	task CreateRow(angle)
	{
		ascent( let i in 0..4 ){
			CreateShot02(GetX(), GetY(), 0.0, angle, 0.055, 10.0, [3, 5, 4, 7][i], 20);
			angle += 360 / 21 - 16.7 / 7 * 2.0;
			Wait(10);
		}
	}

	//w莞ԃ^XN̏~
	function Wait(wait)
	{
		loop( wait ){
			yield;
		}
	}
}
