

script_enemy_main
{
	#include_function ".\func.txt"

	let gcsd = GetCurrentScriptDirectory;
	let boss = gcsd~"b05.png";
	let name = gcsd~"nm5.png";

	//let kira01 = gcsd~"se007.wav";

	@Initialize
	{
		Init(0, 100, 100, 50, 60, true, false, false, 0, false, false);
		SetLife(2100);

		LoadUserShotData(gcsd~"supershot2.txt");
		SetMovePosition03(GetCenterX, GetClipMinY+120, 10, 5);

		MainTask;

		LoadGraphic(boss);
		LoadGraphic(name);
		//LoadSE(kira01);
	}

	@MainLoop
	{
		SetCollision(GetX, GetY, 24);

		yield;
	}

	@DrawLoop
	{
		SetColor(255, 255, 255);
		SetTexture(boss);
		SetAlpha(255);
		SetGraphicRect(0, 0, 64, 64);
		SetGraphicScale(1, 1);
		DrawGraphic(GetX, GetY);

		SetTexture(name);
		SetAlpha(255);
		SetGraphicRect(0, 0, 180, 30);
		SetGraphicScale(1, 1);
		DrawGraphic(GetClipMinX+90, GetClipMinY+30);
	}

	@Finalize
	{
	}

	task MainTask
	{
		Wait(120);
		SetColor(255, 0, 0);
		Concentration01(60);
		Wait(60);
		move;
		attack;
	}

	task attack
	{
		let ang = 0;

		loop
		{
			ascent(b in 0..20)
			{
				ascent(a in 0..6)
				{
					CreateShotA(0, GetX, GetY, 10);
					SetShotDataA(0, 0, 2, a*60+ang, 0, 0, 0, 120);
					SetShotDataA(0, 60, 2, a*60+ang+60, 0, 0, 0, 120);
					SetShotDataA(0, 90, 2, a*60+ang+rand(-20, 20), 0, 0, 0, 120);
					FireShot(0);
					CreateShotA(0, GetX, GetY, 10);
					SetShotDataA(0, 0, 2, a*60+ang, 0, 0, 0, 120);
					SetShotDataA(0, 60, 2, a*60+ang-60, 0, 0, 0, 120);
					SetShotDataA(0, 90, 2, a*60+ang+rand(-20, 20), 0, 0, 0, 120);
					FireShot(0);
					CreateShotA(0, GetX, GetY, 10);
					SetShotDataA(0, 0, 2, a*60+ang, 0, 0, 0, 120);
					SetShotDataA(0, 60, 2, a*60+ang+60, 0, 0, 0, 120);
					SetShotDataA(0, 90, 2, a*60+ang+180+rand(-20, 20), 0, 0, 0, 120);
					FireShot(0);
					CreateShotA(0, GetX, GetY, 10);
					SetShotDataA(0, 0, 2, a*60+ang, 0, 0, 0, 120);
					SetShotDataA(0, 60, 2, a*60+ang-60, 0, 0, 0, 120);
					SetShotDataA(0, 90, 2, a*60+ang-180+rand(-20, 20), 0, 0, 0, 120);
					FireShot(0);
				}
				Wait(5);
			}
			ascent(a in 0..24)
			{
				CreateShot02(GetX, GetY, 2, a*15, -0.01, 1, 201, 10);
				CreateShot02(GetX, GetY, 2, a*15+7.5, -0.01, 1, 201, 70);
			}
			ang+=17;
			Wait(140);
		}
	}

	task move
	{
		loop
		{
			Wait(120);
			SetMovePosition03(rand(GetClipMinX+80, GetClipMaxX-80), rand(GetClipMinY+90, GetClipMinY+150), 10, 2);
			Wait(120);
		}
	}
}