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 imgCircle=csd~"..\img\circle.png";
	let SelectedDifficult=GetCommonDataDefault("SELECTEDDIFFICULT","Normal");

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

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

        @DrawLoop {
		SetGraphicScale(1,1);
		SetColor(ZakoColor[0],ZakoColor[1],ZakoColor[2]);
		DrawFairy(imgEnemy);
		SetTexture(imgCircle);
		SetGraphicRect(256,256,512,512);
		SetGraphicScale(0.5,0.5);
		SetColor(ZakoMagicColor[0],ZakoMagicColor[1],ZakoMagicColor[2]);
		DrawGraphic(GetX,GetY);
	}

        @Finalize
        {
		FinalizeItemSet(5);
		alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
		case("Moderate")
		{
			ReturnBurstShotnum(10);
		}
		case("Extream")
		{
			ReturnBurstShotnum(10);
			ReturnPowerShotnum(5);
			if(!BeVanished)
			{
			SetCommonData("DeleteBulletNum",BulletNum);
			SetCommonData("DeleteBulletX",GetX);
			SetCommonData("DeleteBulletY",GetY);
			DeleteEnemyShotToItem(SHOT);
			}
		}
		case("Apocalypse")
		{
			ReturnBurstShotnum(10);
			if(!BeVanished)
			{
			SetCommonData("DeleteBulletNum",BulletNum);
			SetCommonData("DeleteBulletX",GetX);
			SetCommonData("DeleteBulletY",GetY);
			DeleteEnemyShotToItem(SHOT);
			}
		}
        } 

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(120);
loop(6)
{
let angle=GetAngleToPlayer;
ascent(let i in 0..18)
{
	GroundCreateShot01(GetX+72*cos(angle+i*20),GetY+72*sin(angle+i*20),3.5,angle+i*20,9,5);
	GroundCreateShot01(GetX+72*cos(angle+i*20),GetY+72*sin(angle+i*20),3.75,angle+i*20,9,5);
	GroundCreateShot01(GetX+72*cos(angle+i*20),GetY+72*sin(angle+i*20),4.0,angle+i*20,9,5);
}
wait(30);
}
}
/////////////////////////////////////////////
task shotE
{
wait(120);
loop(10)
{
let angle=GetAngleToPlayer;
ascent(let i in 0..24)
{
	GroundCreateShot01(GetX+72*cos(angle+i*15),GetY+72*sin(angle+i*15),3.5,angle+i*15,9,5);
	GroundCreateShot01(GetX+72*cos(angle+i*15),GetY+72*sin(angle+i*15),3.75,angle+i*15,9,5);
	GroundCreateShot01(GetX+72*cos(angle+i*15),GetY+72*sin(angle+i*15),4.0,angle+i*15,9,5);
}
wait(20);
}
}
////////////////////////////////////////////////
task shotA
{
wait(120);
loop(6)
{
let angle=GetAngleToPlayer;
ascent(let j in 0..15)
{
ascent(let i in 0..36)
{
	GroundCreateShot01(GetX+72*cos(angle+i*10),GetY+72*sin(angle+i*10),4.0+0.5*j,angle+i*10,9,5);
}
wait(2);
}
wait(30);
}

}

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

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