script_enemy_main
{
	#include_function ".\func.txt"


	let gcsd = GetCurrentScriptDirectory;
	let boss = gcsd~"b01.png";
	let name = gcsd~"nm1.png";

	let tan02 = gcsd~"se005.wav";

	@Initialize
	{
		Init(800, 100, 100, 15, 180, true, false, false, 0, false, false);
		SetLife(800);

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

		MainTask;

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

	@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(tan02);
			ascent(a in 0..3)
			{
				CreateShot02(GetX, GetY, 3.5, 90+ang, -0.05, 1.5, 70, 10+a*5);
				CreateShot02(GetX, GetY, 3.5, 90-ang, -0.05, 1.5, 70, 10+a*5);
				ang+=2;
			}
			ang+=27;
			Wait(6);
		}
	}

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