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

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

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

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

task Tmain
{
yield;
OutDamageRateZero;
AutoErazeTime(1200);
GetDamege;
MagicColor;
move;

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

}


task move
{
	SetSpeed(GetSpeed);
	SetAngle(GetAngle);
	wait(600);
	loop(60)
	{
		SetSpeed(GetSpeed+1/60);
		yield;
	}
}

task shotM
{
wait(60);
loop(8)
{
let Angle=GetAngleToPlayer;
ascent(let i in -2..3)
{
	GroundCreateShot01(GetX,GetY,4.0,Angle+i*15,9,5);
}
wait(15);
ascent(let i in -3..3)
{
	GroundCreateShot01(GetX,GetY,5.0,Angle+i*15+7.5,9,5);
}


wait(60);
}
}
///////////////////////////////////////////////
task shotE
{
wait(60);
loop(7)
{

let Angle=GetAngleToPlayer;
ascent(let i in -3..4)
{
	GroundCreateShot01(GetX,GetY,4.0,Angle+i*12,9,5);
}
wait(10);
ascent(let i in -4..4)
{
	GroundCreateShot01(GetX,GetY,5.0,Angle+i*12+6.0,9,5);
}
wait(10);
ascent(let i in -3..4)
{
	GroundCreateShot01(GetX,GetY,6.0,Angle+i*12,9,5);
}

wait(45);
}
}
/////////////////////////////////////////////////
task shotA
{
wait(60);
loop(5)
{
let Angle=GetAngleToPlayer;
ascent(let i in -5..6)
{
	GroundCreateShot01(GetX,GetY,4.0,Angle+i*8,9,5);
}
wait(10);
ascent(let i in -6..6)
{
	GroundCreateShot01(GetX,GetY,5.0,Angle+i*8+4.0,9,5);
}
wait(15);
ascent(let i in -7..8)
{
	GroundCreateShot01(GetX,GetY,6.0,Angle+i*6,9,5);
}
wait(10);
ascent(let i in -8..8)
{
	GroundCreateShot01(GetX,GetY,6.0,Angle+i*6+3.0,9,5);
}
wait(45);
}
}

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

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