script_enemy_main{
	/*\[XHۃp
	ߋ肳́E
	*/
	let count	= 0;
	let frame	= 0;
	let timer	= 0;
	let angle	= 0;
	let cx		= GetCenterX();//STGV[̒SxW擾
	let csd		= GetCurrentScriptDirectory;
	let imgAngle	= 0;
	let shotAngle	= 0;
	let kira	= csd~".\se\shot2.wav";
	let tan		= csd~".\se\shot1.wav";
	let shotdir	= csd~"kshotData.txt";
	let imgEnemy	= csd~".\img\fairy_ex2.png";//RR̉摜ςƕς({
	let MinX	= GetClipMinX;
	let MaxX	= GetClipMaxX;
	let MinY	= GetClipMinY;
	let MaxY	= GetClipMaxY;
	let CenX	= GetCenterX;
	let CenY	= GetCenterY;
	let i		= trunc(rand(0,10));

	// ACe𗎂Ƃ
	let Inam_1up	= 0;
	let Inam_Bomb	= 0;
	let Inam_Item	= 0;

	@Initialize{
		SetX(MinX-50);
		SetY(MinY);
		SetLife(200);
		LoadGraphic(imgEnemy);
		LoadUserShotData(shotdir);
		SetMovePosition03(MaxX+150,MinY+50,8,1);
		SetTexture(imgEnemy);
		Initialize_Fairy(GetArgument,100,100,255);//[߂Ƃ̏ΉĂ(7܂
		/*
		0	ŏ
		1	ŏiȖсj
		2	
		3	iXqj
		4	
		5	i{j
		6	
		7	ij
		*/
	}
	
	@MainLoop{
		let tdif = GetCommonDataEx("title","Diffi");//{҂̓Փx("easy"`"lunatic")

		frame++;
		count++;
		timer++;

		if(count==120){
			alternative(tdif)
			case("easy"){
				loop(6){
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,3,angle,0,0,10,202);
					FireShot(0);
					angle+=360/6;
				}
			}case("normal"){
				loop(7){
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,3,angle,0,0,10,202);
					FireShot(0);
					angle+=360/7;
				}
			}case("hard"){
				loop(14){
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,4,angle,0,0,10,202);
					FireShot(0);
					angle+=360/14;
				}
			}case("lunatic"){
				loop(20){
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,3,angle+9,0,0,10,202);
					FireShot(0);
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,4,angle,0,0,10,202);
					FireShot(0);
					angle+=360/20;
				}
			}
		angle+=rand(0,360);
		PlaySE(kira);
		count=60;
		}

		//ʊOɏoƎ
		if(GetX<MinX-100&&!enmfin){
		VanishEnemy;
		}
		if(GetX>MaxX+100&&!enmfin){
		VanishEnemy;
		}
		if(GetY<MinY-100&&!enmfin){
		VanishEnemy;
		}
		if(GetY>MaxY+100&&!enmfin){
		VanishEnemy;
		}
		//
		SetCollisionA(GetX(),GetY(),16);
		SetCollisionB(GetX(),GetY(),16);
		yield;
	}
	
	@Finalize{
		//DeleteEnemyShotToItem(CHILD);
		loop(Inam_1up) {
			CreateItem(ITEM_1UP,GetX(),GetY());
		}
		loop(Inam_Bomb) {
			CreateItem(ITEM_BOMB,GetX(),GetY());
		}
		if (GetLife()<=0) {
			ascent (i in 0..Inam_Item) {
				CreateItem(ITEM_SCORE,GetX()+rand(-i*10,i*10),GetY()+rand(-i*10,i*10));
			}
		}
	}
	
	@DrawLoop
	{//`
		DrawFairy(imgEnemy);//킸ȁB
	}
#include_function".\lib_anime_fairy.txt"
#include_function".\lib_kshot.txt"
#include_function".\Obj_Shot.txt"
}