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(0, 100, 100, 45, 60, true, false, false, 0, false, false);
		SetLife(1800);

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

		MainTask;

		LoadGraphic(boss);
		LoadSE(kira00);
	}

	@MainLoop
	{
		if(OnEvent==false){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
	{
		loop
		{
			PlaySE(kira00);
			ascent(a in 0..18)
			{
				ascent(b in 0..5)
				{
					CreateShot01(GetX+70*cos(a*20), GetY+70*sin(a*20), 1+0.2*b, a*20+90, 13, 10);
				}
			}
			Wait(20);
			ascent(a in 0..18)
			{
				ascent(b in 0..5)
				{
					CreateShot01(GetX+60*cos(a*20), GetY+60*sin(a*20), 1+0.2*b, a*20-90, 12, 10);
				}
			}
			Wait(40);
			PlaySE(kira00);
			ascent(a in 0..18)
			{
				ascent(b in 0..5)
				{
					CreateShot01(GetX+50*cos(a*20), GetY+50*sin(a*20), 1+0.2*b, a*20+90, 13, 10);
				}
			}
			Wait(20);
			ascent(a in 0..18)
			{
				ascent(b in 0..5)
				{
					CreateShot01(GetX+40*cos(a*20), GetY+40*sin(a*20), 1+0.2*b, a*20-90, 12, 10);
				}
			}
			Wait(120);
		}
	}

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