script_enemy_main
{

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


	sfx01 = "t";

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

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


	ng_timeset = 50;
	ng_spellcard = 0;



	let nb_num = 0;

	let frame1 = 0;


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





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

	@Initialize
	{
	SetInvincibility(60);
	SetLife(2500);
	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)
	{
	PlaySE(sfx01);
	ascent (a in 0..5)
		{
		CreateShotA(0, GetX, GetY, 10);
		if (nb_num%2 == 0)	{	SetShotDataA(0, 0, 0, a*72, 1, 0.1, 4, RED03);	}
		else	{	SetShotDataA(0, 0, 0, a*72, -1, 0.1, 4, RED03);	}
		ascent (i in 1..100)
			{
			CreateShotA(i, 0, 0, 30);
			SetShotDataA(i, 0, 0, rand(0,360), 0, 0.05, 2, RED04);
			if (GetCommonData("CD_gamemode") == 2)	{	AddShot((i*5), 0, i, 0);	}
			else	{	AddShot((i*10), 0, i, 0);	}
			}
		FireShot(0);
		}
	}

	if (frame1 == 120)
	{
	nb_num++;
	frame1 = 0;
	}



	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;
    	}
}
