script_enemy_main
{
	#include_function ".\func.txt"

	let gcsd = GetCurrentScriptDirectory;
	let enemy = gcsd~"e04.png";
	let kira00 = gcsd~"se002.wav";
	let alpha = 0;

	@Initialize
	{
		SetLife(120);

		LoadUserShotData(gcsd~"supershot.txt");

		MainTask;
		FieldChecker;

		LoadGraphic(enemy);
		LoadSE(kira00);
	}

	@MainLoop
	{
		if(alpha>=255){SetCollision(GetX, GetY, 16);}
		yield;
	}

	@DrawLoop
	{
		SetColor(255, 255, 255);
		SetTexture(enemy);
		SetAlpha(alpha);
		SetGraphicRect(0, 0, 48, 48);
		SetGraphicScale(1, 1);
		DrawGraphic(GetX, GetY);
	}

	@Finalize
	{
		if(GetLife<=0){CreateItem(ITEM_SCORE, GetX, GetY); DeleteEnemyShotToItem(CHILD);}
	}

	task MainTask
	{
		loop(60){alpha+=(255/60); yield;}
		alpha = 255;
		Wait(60);
		PlaySE(kira00);
		ascent(a in 0..36)
		{
			CreateShot01(GetX, GetY, 1+0.5*cos(a*40), GetAngleToPlayer+a*10, 88, 10);
		}
		Wait(60);
		loop(60){alpha-=(255/60); yield;}
		alpha = 0;
		VanishEnemy;
	}

	task FieldChecker
	{
		loop
		{
			if(GetX<GetClipMinX-64||GetX>GetClipMaxX+64||GetY<GetClipMinY-64||GetY>GetClipMaxY+64)
			{
				VanishEnemy;
			}
			yield;
		}
	}
}