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 SelectedDifficult=GetCommonDataDefault("SELECTEDDIFFICULT","Normal");

    @Initialize {
        SetLife(5);
        SetDamageRate(100,100);
	SetTexture(imgEnemy);
	Initialize_Fairy(0);
	Tmain;
	}

    @MainLoop {
	SetCollisionA(GetX(),GetY(),32);
        MSDSetCollisionB(GetX(),GetY(),8);
	yield;
    }

        @DrawLoop {
	//	SetColor(ZakoColor[0],ZakoColor[1],ZakoColor[2]);
	//	DrawFairy(imgEnemy);

	}

        @Finalize
        {
		FinalizeItemAndShotnum(0);
	//	alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
	//	case("Moderate")
	//	{
			CreateShotA(0,GetX,GetY,5);
			SetShotDataA(0,0,0,GetAngleToPlayer,0,0.10,6,9);
			FireShot(0);
	/*	}
		case("Extream")
		{
		ascent(i in -1..2)
		{
			CreateShotA(0,GetX,GetY,5);
			SetShotDataA(0,0,0,GetAngleToPlayer+i*45,0,0.10,6,9);
			FireShot(0);
		}
		
		}
		case("Apocalypse")
		{	
		ascent(i in -1..2)
		{
			CreateShotA(0,GetX,GetY,5);
			SetShotDataA(0,0,0,GetAngleToPlayer+i*45,0,0.10,6,9);
			FireShot(0);
		}		
		}
*/
        } 

task Tmain
{
yield;
ElementalEffect(255,0,0,0.5);
OutDamageRateZero;
AutoErazeTime(900);
GetDamege;
move;

}

task move
{
loop(60)
{
	SetSpeed(4);
	SetAngle(GetAngleToPlayer);
yield;
}
}

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

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