script_enemy_main
{
        let csd     = GetCurrentScriptDirectory;
	let speed = GetSpeed;
	let angle = GetAngle;
	let num = GetArgument;
	let imgEnemy;

		imgEnemy=csd~"..\lib\fairy_red.png";
	let imgFam  = csd ~ "..\img\familiar.png";

	let SelectedDifficult=GetCommonDataDefault("SELECTEDDIFFICULT","Normal");

    @Initialize {
        SetLife(550);
        SetDamageRate(100,100);
	SetTexture(imgEnemy);
	Initialize_Fairy(7);
	Tmain;
	}

    @MainLoop {
	ascent(let i in -1..2)
	{
	SetCollisionA(GetX()+i*50,GetY(),48);
        MSDSetCollisionB(GetX()+i*50,GetY(),8);
	}
	yield;
    }

        @DrawLoop {
		SetColor(ZakoColor[0],ZakoColor[1],ZakoColor[2]);
		DrawFairy(imgEnemy);
		SetTexture(imgFam);
        	setGraphic;
		DrawGraphic(GetX+50, GetY);
		SetTexture(imgFam);
        	setGraphic;
		DrawGraphic(GetX-50, GetY);
	}

        @Finalize
        {
		FinalizeItemSet(3);
		alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
		case("Moderate")
		{
			ReturnBurstShotnum(10);
		}
		case("Extream")
		{
			ReturnBurstShotnum(10);
			ReturnPowerShotnum(5);
		}
		case("Apocalypse")
		{
			ReturnBurstShotnum(10);
		}
        } 

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

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

}

task summon
{
        CreateEnemyFromScript("Familiar", GetX, GetY,
                              0, 0, 1);
        CreateEnemyFromScript("Familiar", GetX, GetY,
                              0, 0, -1);
}

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


task shotM
{
wait(45);
let angle=45;
loop(60)
{
	ascent(let i in 0..2)
	{
		CreateShot01(GetX+50,GetY,3,180*i+angle,9,5);
		CreateShot01(GetX-50,GetY,3,180*i-angle,9,5);
	}
	wait(10);
	angle+=5;
}
}
///////////////////////////////////////////////////////////////
task shotE
{
wait(45);
let angle=45;
loop(120)
{
	ascent(let i in 0..4)
	{
		CreateShot01(GetX+50,GetY,3,90*i+angle,9,5);
		CreateShot01(GetX-50,GetY,3,90*i-angle,9,5);
	}
	wait(5);
	angle+=5;
}
}
//////////////////////////////////////////////////////////////
task shotA
{
wait(45);
let angle=45;
loop(120)
{
	ascent(let i in 0..6)
	{
		CreateShot01(GetX+50,GetY,3,60*i+angle,9,5);
		CreateShot01(GetX-50,GetY,3,60*i-angle,9,5);
		CreateShot01(GetX+50,GetY,3.5,60*i+angle,9,5);
		CreateShot01(GetX-50,GetY,3.5,60*i-angle,9,5);
		CreateShot01(GetX+50,GetY,3.25,60*i+angle,9,5);
		CreateShot01(GetX-50,GetY,3.25,60*i-angle,9,5);
	}
	wait(5);
	angle+=5;
}
}

sub setGraphic{ SetGraphicRect( 0, 48, 48, 96); }
#include_function ".\..\txt/StageEnemydata.txt"
#include_function ".\..\lib\lib_anime_fairy.txt"
}

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