script_enemy_main
{

	#include_function".\..\function\glo_enemydrop.txt";
	#include_function".\stage1_Boss_Info.txt";


	sfx01 = "t";

	sfx50 = "t";
	sfx51 = "t";

	#include_function".\..\function\soundfx.txt";


	ng_timeset = 30;
	ng_spellcard = 0;



	let firecounter = 0;
	let nb_angle = 0;
	let nb_lock = 0;

	let frame1 = 0;

//-------------------------------------------------------------------------------------------------
// Any Task





//---------------------------------------------------------------

	@Initialize
	{
	SetInvincibility(60);
	SetLife(2000);
	SetDamageRate(0,0);
	SetTimer(ng_timeset);
//	SetScore(100000);
	SetEnemyMarker(true);

	SetMovePosition02(GetCenterX, GetClipMinY + 90, 30);

	LoadGraphic(BossSprite);

	// Fever score decrease if this is not survival card.
	SetCommonData("ng_feverdecrease", 1);

	Concentration01(60);
	PlaySE(GetCurrentScriptDirectory~"..\sfx\Charge.wav");

	}

//---------------------------------------------------------------

	@MainLoop 
	{
	SFU_GloBossCounter;

	SetCollisionA(GetX, GetY, 32);
	SetCollisionB(GetX, GetY, 16);

	SetShotDirectionType(ABSOLUTE);

//----------------------
// Attack script below
//----------------------


	if (frame1 == 60)
	{
		firecounter = 1;
		nb_lock = GetAngleToPlayer;
	}

	if (frame1 == 180)
	{
		firecounter = 0;
		frame1 = 0;
		nb_angle = 0;
	}

	if (firecounter == 1)
	{
	// Lunatic
	if (GetCommonData("CD_gamemode") == 2)
		{
		PlaySE(sfx01);
		CreateShot02(GetX, GetY, 0, nb_lock-90+nb_angle, 0.2, 3, AQUA11, 5);
		CreateShot02(GetX, GetY, 0, nb_lock+90-nb_angle, 0.2, 3, AQUA11, 5);
		CreateShot02(GetX, GetY, 0, nb_lock-90+nb_angle, 0.2, 2.5, AQUA05, 5);
		CreateShot02(GetX, GetY, 0, nb_lock+90-nb_angle, 0.2, 2.5, AQUA05, 5);

		CreateShot02(GetX, GetY, 0, nb_lock-90-nb_angle, 0.2, 3, AQUA11, 5);
		CreateShot02(GetX, GetY, 0, nb_lock+90+nb_angle, 0.2, 3, AQUA11, 5);
		CreateShot02(GetX, GetY, 0, nb_lock-90-nb_angle, 0.2, 2.5, AQUA05, 5);
		CreateShot02(GetX, GetY, 0, nb_lock+90+nb_angle, 0.2, 2.5, AQUA05, 5);
		nb_angle += 2.5;
		}
	// Normal
	else
		{
		PlaySE(sfx01);
		CreateShot02(GetX, GetY, 0, nb_lock-90+nb_angle, 0.2, 3, AQUA11, 5);
		CreateShot02(GetX, GetY, 0, nb_lock+90-nb_angle, 0.2, 3, AQUA11, 5);
		CreateShot02(GetX, GetY, 0, nb_lock-90+nb_angle, 0.2, 2.5, AQUA05, 5);
		CreateShot02(GetX, GetY, 0, nb_lock+90-nb_angle, 0.2, 2.5, AQUA05, 5);
		nb_angle += 5;
		}
	}


	if (ng_bossmframe == 120)
	{
		SetMovePositionRandom01(rand_int(25,100),10,5,GetClipMinX+100,50,GetClipMaxX-100,100);
		ng_bossmframe = 0;
	}





	frame1++;


//----------------------
// Attack script above
//----------------------

	#include_function".\..\function\glo_timernotice.txt";
	yield;
	}

//---------------------------------------------------------------

	@DrawLoop
	{
	SetTexture(BossSprite);
	SetGraphicAngle(0, 0, 0);
	SetGraphicScale(1, 1);
	#include_function".\..\function\boss_draw.txt";
	}

//---------------------------------------------------------------

	@BackGround
	{
	}

//---------------------------------------------------------------

	@Finalize
	{
	DeleteGraphic(BossSprite);
	SFX_Delete;
    	}
}
