script_enemy_main
{
        let csd     = GetCurrentScriptDirectory;
	let speed = GetSpeed;
	let angle = GetAngle; 
	let num = GetArgument;
	let imgEnemy;
	imgEnemy=csd~"..\lib\fairy_red.png";
	let SelectedDifficult=GetCommonDataDefault("SELECTEDDIFFICULT","Normal");

    @Initialize {
        SetLife(10);
        SetDamageRate(100,100);
	SetTexture(imgEnemy);
	Initialize_Fairy(0);
	Tmain;
	}

    @MainLoop {
	SetGroundCollision(GetX,GetY,24);
	yield;
    }

        @DrawLoop {
		SetColor(ZakoColor[0],ZakoColor[1],ZakoColor[2]);
		DrawFairy(imgEnemy);
		DrawMagicCircle("BLUE",0.20);
	}

        @Finalize
        {
		MagicCircleBreak(GetX,GetY,2,0.2);
		FinalizeItemAndShotnum(1);
        } 

task Tmain
{
yield;
OutDamageRateZero;
AutoErazeTime(900);
GetDamege;
move;
if(num!=0)
{
alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
case("Moderate")
{
shotM;
}
case("Extream")
{
shotE;
}
case("Apocalypse")
{
shotA;
}
}
}

task move
{
	let angle=GetAngle;
	SetSpeed(GetSpeed);
	SetAngle(GetAngle);
	loop(60)
	{
		SetAngle(angle);
		angle+=0.1;
		yield;
	}
	loop(45)
	{
		SetAngle(angle);
		angle+=1.5;
		yield;
	}
}

task shotM
{
wait(5);
loop(9)
{
	ascent(let j in -0..1)
	{
		SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+j*1.5,9,5);
	}
wait(15);
}
}
///////////////////////////////////////////////////////////
task shotE
{
wait(5);
loop(9)
{
	ascent(let j in -1..2)
	{
		SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+j*1.5,9,5);
	}
wait(15);
}
}
///////////////////////////////////////////////////////////
task shotA
{
wait(5);
loop(9)
{
	ascent(let j in -2..3)
	{
		SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+j*1.5,9,5);
		SkyCreateShot01(GetX,GetY,4.25,GetAngleToPlayer+j*1.5,9,5);
		SkyCreateShot01(GetX,GetY,4.0,GetAngleToPlayer+j*1.5,9,5);
	}
wait(15);
}
}

#include_function ".\..\txt/StageEnemydata.txt"
#include_function ".\..\lib\lib_anime_fairy.txt"
}

#include_script ".\..\txt/EnemyShotData.txt"