script_enemy_main
{

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


	sfx01 = "t";

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

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


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


	if (frame1 == 60)
	{
	PlaySE(sfx01);
if (GetCommonData("CD_gamemode") == 2)
{
	ascent (i in 0..48)
		{
		CreateShot02(GetX, GetY, 0, i*7.5, 0.05, 4.5, YELLOW21, 10);
		CreateShot02(GetX, GetY, 0, i*7.5, 0.05, 4.1, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*7.5, 0.05, 3.7, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*7.5, 0.05, 3.3, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*7.5, 0.05, 2.9, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*7.5, 0.05, 2.5, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*7.5, 0.05, 2.1, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*7.5, 0.05, 1.7, YELLOW05, 10);
		}
}
else
{
	ascent (i in 0..36)
		{
		CreateShot02(GetX, GetY, 0, i*10, 0.05, 4, YELLOW21, 10);
		CreateShot02(GetX, GetY, 0, i*10, 0.05, 3.7, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*10, 0.05, 3.4, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*10, 0.05, 3.1, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*10, 0.05, 2.8, YELLOW05, 10);
		CreateShot02(GetX, GetY, 0, i*10, 0.05, 2.5, YELLOW05, 10);
		}
}
	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;
    	}
}
