script_enemy_main
{
	#include_function ".\func.txt"


	let gcsd = GetCurrentScriptDirectory;
	let boss = gcsd~"b04.png";
	let name = gcsd~"nm4.png";

	let kira00 = gcsd~"se002.wav";

	@Initialize
	{
		Init(800, 100, 100, 35, 120, true, false, false, 0, false, false);
		SetLife(1500);

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

		MainTask;

		LoadGraphic(boss);
		LoadGraphic(name);
		LoadSE(kira00);
	}

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

		yield;
	}

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

		SetTexture(name);
		SetGraphicRect(0, 0, 150, 30);
		SetGraphicScale(1, 1);
		DrawGraphic(GetClipMinX+75, GetClipMinY+30);
	}

	@Finalize
	{
	}

	task MainTask
	{
		Wait(120);
		//move;
		attack;
	}

	task attack
	{
		let ang = 0;

		loop
		{
			PlaySE(kira00);
			ascent(a in 0..2)
			{
				CreateShot01(GetX, GetY, 1.5, a*180+ang, 11, 10);
				CreateShot01(GetX, GetY, 1.5, a*180+ang+12, 23, 10);
				CreateShot01(GetX, GetY, 1.5, a*180+ang+24, 22, 10);
				CreateShot01(GetX, GetY, 1.5, a*180+ang+36, 19, 10);
				CreateShot01(GetX, GetY, 1.5, a*180+ang+48, 15, 10);
				CreateShot01(GetX, GetY, 1.5, a*180+ang+60, 14, 10);
				CreateShot01(GetX, GetY, 1.5, a*180+ang+72, 12, 10);
			}
			ang+=7;
			Wait(20);
		}
	}

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