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,36);
	yield;
    }

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

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

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(90);
loop(2)
{
let angle=rand(0,360);
ascent(let i in 0..12)
{
	ascent(let j in -3..4)
	{
		GroundCreateShot01(GetX,GetY,3.5,angle+i*30+j*2.0,9,5);
	}
}
angle+=15;
wait(30);
ascent(let i in 0..12)
{
	ascent(let j in -3..4)
	{
		GroundCreateShot01(GetX,GetY,3.5,angle+i*30+j*2.0,9,5);
	}
}
wait(60);
}
}
///////////////////////////////////////////////
task shotE
{
wait(90);
loop(2)
{
let angle=rand(0,360);
ascent(let i in 0..12)
{
	ascent(let j in -3..4)
	{
		GroundCreateShot01(GetX,GetY,3.0,angle+i*30+j*3,9,5);
	}
}
angle+=15;
wait(30);
ascent(let i in 0..12)
{
	ascent(let j in -3..4)
	{
		GroundCreateShot01(GetX,GetY,3.0,angle+i*30+j*3,9,5);
	}
}
angle-=15;
wait(30);
ascent(let i in 0..12)
{
	ascent(let j in -3..4)
	{
		GroundCreateShot01(GetX,GetY,3.0,angle+i*30+j*3,9,5);
	}
}
angle+=15;
wait(30);
ascent(let i in 0..12)
{
	ascent(let j in -3..4)
	{
		GroundCreateShot01(GetX,GetY,3.0,angle+i*30+j*3,9,5);
	}
}

wait(60);
}
}
/////////////////////////////////////////////////
task shotA
{
wait(90);
loop(3)
{
let angle=rand(0,360);
ascent(let i in 0..12)
{
	ascent(let j in -5..6)
	{
		GroundCreateShot01(GetX,GetY,4.5,angle+i*30+j*2,9,5);
	}
}
angle+=15;
wait(20);
ascent(let i in 0..12)
{
	ascent(let j in -5..6)
	{
		GroundCreateShot01(GetX,GetY,4.5,angle+i*30+j*2,9,5);
	}
}
angle+=15;
wait(20);
ascent(let i in 0..12)
{
	ascent(let j in -5..6)
	{
		GroundCreateShot01(GetX,GetY,4.5,angle+i*30+j*2,9,5);
	}
}
wait(60);
}
}

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

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