script_enemy_main{


//Argument 0 = down, 1 = up

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




	let ne_image = GetCurrentScriptDirectory~"..\img\enemy\deviceyellow.png";
	let ne_image1 = GetCurrentScriptDirectory~"..\img\enemy\circle1white.png";



	let enemyframe1 = 0;
	let ne_spin = 0;
	let ne_spin1 = 0;



	let ne_angle = 0;

	let e_frametime = 0;
	let e_vanishframe = 420;

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







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

    @Initialize
	{
	SetLife(125);
	SetDamageRate(0,0);
	SetInvincibility(60);
	LoadGraphic(ne_image);
	LoadGraphic(ne_image1);

//	SetMovePosition02(GetX, GetY, 0);
	}

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

    @MainLoop
	{
	SetDamageRate(70+(6*GetCommonDataDefault("CD_PowerUse",0)),35+(3*GetCommonDataDefault("CD_PowerUse",0)));

	SetCollisionA(GetX, GetY, 32);
	if ((GetPlayerType == REIMU_A) || (GetPlayerType == REIMU_B))
	{	SetCollisionB(GetX, GetY, 0);	}	else
	{	SetCollisionB(GetX, GetY, 16);	}

	SetShotDirectionType(ABSOLUTE);

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

	if (e_frametime == 1)
	{
	SetSpeed(0.75);
	SetAngle(GetArgument);
	}

	if (e_frametime == 180)
	{
	SetSpeed(0);
	}



if (GetCommonData("CD_gamemode") == 2)
{
	if ((enemyframe1%60 == 0) && (enemyframe1 > 0))
	{
	ne_angle = rand(0,360);
	ascent (i in 0..36)
		{
		PlaySE(GetCurrentScriptDirectory~"..\sfx\Shot1.wav");
		CreateShot02(GetX, GetY, 4, ne_angle+i*10, -0.05, 0.5, GREEN05, 10);
		CreateShot02(GetX, GetY, 4, ne_angle+i*10, -0.05, 0.5, GREEN05, 20);
		CreateShot02(GetX, GetY, 4, ne_angle+i*10, -0.05, 0.5, GREEN05, 30);
		}
	}
}
else
{
	if ((enemyframe1%60 == 0) && (enemyframe1 > 0))
	{
	ne_angle = rand(0,360);
	ascent (i in 0..36)
		{
		PlaySE(GetCurrentScriptDirectory~"..\sfx\Shot1.wav");
		CreateShot02(GetX, GetY, 4, ne_angle+i*10, -0.05, 0.5, GREEN05, 10);
		}
	}
}





	enemyframe1++;


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

	if ((e_frametime >= e_vanishframe) || (GetX < GetClipMinX-50) || (GetX > GetClipMaxX+50)
	 || (GetY < GetClipMinY-50) || (GetY > GetClipMaxY+50))
		{
		VanishEnemy;
		}

	e_frametime++;
	}




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

    @Finalize
	{
	if ((BeVanished == false) && (OnBomb == false))
		{
		Explosion01(GetX, GetY, 4, 0.08, 60);
		DeleteEnemyShotInCircle(ALL, GetX, GetY, 75);
		}
	}

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

    @DrawLoop
	{
	SetTexture(ne_image1);
	SetGraphicRect(0, 0, 31, 31);
	SetColor(255, 255, 255);
	SetRenderState(ALPHA);
	SetGraphicAngle(0, 0, ne_spin1);
	SetGraphicScale(1.25, 1.25);
	DrawGraphic(GetX, GetY);
	ne_spin1 += 5;

	SetTexture(ne_image);
	SetGraphicRect(0, 0, 31, 31);
	SetColor(255, 255, 255);
	SetRenderState(ALPHA);
	SetGraphicAngle(0, 0, ne_spin);
	SetGraphicScale(1, 1);
	DrawGraphic(GetX, GetY);
	ne_spin += 3;
	}
}