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(20);
        SetDamageRate(100,100);
	SetTexture(imgEnemy);
	Initialize_Fairy(0);
	Tmain;
	}

    @MainLoop {
	SetSkyCollision(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;

alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
case("Moderate")
{
shotM;
}
case("Extream")
{
shotE;
}
case("Apocalypse")
{
shotA;
}

}


task move
{
	SetMovePosition03(GetX-180*num,GetY,20,5);
	wait(180);
	SetMovePosition02(GetX,GetClipMinY-80,60);
}

task shotM
{
wait(20);
loop(2)
{
	ascent(i in -2..3)
	{
		SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+i*1.75,9,5);
	}
wait(60);
}
loop
{
SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer,9,5);
wait(5);
}
}

//////////////////////////////////////////
task shotE
{
wait(20);
loop(3)
{
	ascent(i in -3..4)
	{
		SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+i*1.75,9,5);
	}
wait(45);
}
loop
{
SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer-2,9,5);
SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+2,9,5);
SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer,9,5);
wait(5);
}
}
//////////////////////////////////////////////////
task shotA
{
wait(15);
loop(3)
{
	ascent(i in -4..5)
	{
		SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+i*1.75,9,5);
	}
wait(30);
}
loop
{
ascent(i in -2..3)
{
SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+i*2,9,5);
}
wait(5);
}
}
#include_function ".\..\txt/StageEnemydata.txt"
#include_function ".\..\lib\lib_anime_fairy.txt"
}

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