script_enemy_main
{

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


	sfx01 = "t";

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

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


	ng_timeset = 30;
	ng_spellcard = 0;




	let nb_angle = 0;

	let frame1 = 0;
	let frame2 = 0;


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




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

	@Initialize
	{
	SetX(0);
	SetY(-128);
	SetInvincibility(120);
	SetLife(1500);
	SetDamageRate(0,0);
	SetTimer(ng_timeset);
	SetEnemyMarker(true);

	SetMovePosition03(GetCenterX, GetClipMinY + 90, 10, 5);

	LoadGraphic(BossSprite);

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

	}

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

	@MainLoop 
	{
	SFU_GloBossCounter;

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

	SetShotDirectionType(ABSOLUTE);

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

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



//Lunatic
if (GetCommonData("CD_gamemode") == 2)
{
	if ((ng_start == 1) && (frame1 == 3))
	{
	PlaySE(sfx01);
		ascent(i in 0..4)
		{
		CreateShot01(GetX, GetY, 2, (i*90)-nb_angle, BLUE05, 0);
		CreateShot01(GetX, GetY, 2, (i*90)+nb_angle, BLUE05, 0);
		}
	nb_angle += 8;
	frame1 = 0;
	}

	if ((ng_start == 1) && (frame2 == 45))
	{
	PlaySE(sfx01);
		ascent(i in 0..48)
		{
		CreateShot02(GetX, GetY, 4.5, i*7.5, -0.035, 0.5, RED01, 0);
		}
	frame2 = 0;
	}
}
else
{
	if ((ng_start == 1) && (frame1 == 5))
	{
	PlaySE(sfx01);
		ascent(i in 0..4)
		{
		CreateShot01(GetX, GetY, 2, (i*90)-nb_angle, BLUE05, 0);
		CreateShot01(GetX, GetY, 2, (i*90)+nb_angle, BLUE05, 0);
		}
	nb_angle += 8;
	frame1 = 0;
	}

	if ((ng_start == 1) && (frame2 == 45))
	{
	PlaySE(sfx01);
		ascent(i in 0..36)
		{
		CreateShot02(GetX, GetY, 4.5, i*10, -0.035, 0.5, RED01, 0);
		}
	frame2 = 0;
	}
}







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





	frame1++;
	frame2++;

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