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

    @Initialize {
        SetLife(30);
        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(480);
GetDamege;
move;

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

}


task move
{
	SetMovePosition03(GetX,GetCenterY-80,50,5);
	wait(90);
	SetMovePosition02(GetX,GetY,1);
	SetAngle(GetAngleToPlayer);
	let speed=0;
	loop
	{
		SetSpeed(speed);
		if(speed<5)
		{
		speed+=0.02;
		}
		yield;
	}
}

task shotM
{
wait(10);
loop(4)
{
	loop(5)
	{
	SkyCreateShot01(GetX,GetY,4.5,GetAngleToPlayer,9,5);
	wait(3);
	}
wait(45);
}
}

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

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