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

    @MainLoop {
	BulletNum=GetEnemyShotCount;
	SetGroundCollision(GetX,GetY,48);
	yield;
    }

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

        @Finalize
        {
		MagicCircleBreak(GetX,GetY,1,0.5);
		FinalizeItemAndShotnumWithDelete(5);
        } 

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

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

}


task move
{
	SetSpeed(GetSpeed);
	SetAngle(GetAngle);
}

task shotM
{
wait(30);
let angle=rand(0,360);
loop
{
ascent(let i in 0..15)
{
	GroundCreateShot01(GetX,GetY,5.0,angle+i*24,9,5);
}
angle+=4;
wait(5);
}
}
/////////////////////////////////////////////
task shotE
{
wait(30);
let angle=rand(0,360);
loop
{
ascent(let i in 0..24)
{
	GroundCreateShot01(GetX,GetY,4.0,angle+i*15,9,5);
}
angle+=3;
wait(5);
}
}
////////////////////////////////////////////////
task shotA
{
wait(30);
let angle=rand(0,360);
loop
{
ascent(let i in 0..30)
{
	GroundCreateShot01(GetX,GetY,4.75,angle+i*12,9,5);
}
angle+=3;
wait(5);
}

}

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

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