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 = 40;
	ng_spellcard = 0;



	let frame1 = 0;

	let nb_angle1 = 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 (ng_sframe == 1)
	{
	CreateEnemyFromFile(GetCurrentScriptDirectory~"stage1_DropItemBossSpell1.txt", GetCenterX, GetClipMinY+100, 0, 0, 0);
	}

	if (ng_sframe == 60)
	{
	ng_start = 1;
	frame1 = 0;
	}


	if ((frame1 == 30) && (ng_start == 1))
	{
	PlaySE(sfx01);
	// Lunatic
	if (GetCommonData("CD_gamemode") == 2)
		{
		ascent(i in 0..72)
			{
			CreateShot02(GetX , GetY, 0, 0+nb_angle1*5, 0.2, 4, AQUA11, 10);
			CreateShot02(GetX , GetY, 0, 0+nb_angle1*5, 0.2, 3.5, AQUA05, 10);
			nb_angle1++;
			}
		}
	// Normal
	else
		{
		ascent(i in 0..36)
			{
			CreateShot02(GetX , GetY, 0, 0+nb_angle1*10, 0.2, 4, AQUA11, 10);
			CreateShot02(GetX , GetY, 0, 0+nb_angle1*10, 0.2, 3.5, AQUA05, 10);
			nb_angle1++;
			}
		}
	frame1 = 0;
	}



	if (ng_bossmframe == 120)
	{
	SetMovePositionRandom01(rand_int(25,75),5,10,GetClipMinX+125,50,GetClipMaxX-125,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;
    	}
}
