script_enemy_main{
	/*\[XHۃp
	G^[i݁[2
	*/
	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{
		if(i>=0&&i<5){
		SetX(MinX-50);
		SetY(MinY-50);
		}else{
		SetX(MaxX+50);
		SetY(MinY-50);
		}
		SetLife(800);
		LoadGraphic(imgEnemy);
		LoadUserShotData(shotdir);
		SetMovePosition03(CenX,MinY+80,8,6);
		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==60){
			alternative(tdif)
			case("easy"){
				loop(5){
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,rand(2,5),rand(0,360),0,0,10,kBLUE01);
					FireShot(0);
				}
				if(timer>=600){
					loop(3){
						CreateShotA(0,GetX,GetY,10);
						SetShotDataA(0,0,rand(3,6),rand(0,360),0,0,10,kBLUE02a);
						FireShot(0);
					}
					PlaySE(kira);
				}
				PlaySE(tan);
				count=55;
			}case("normal"){
				loop(7){
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,rand(2,5),rand(0,360),0,0,10,kBLUE01);
					FireShot(0);
				}
				if(timer>=600){
					loop(5){
						CreateShotA(0,GetX,GetY,10);
						SetShotDataA(0,0,rand(3,6),rand(0,360),0,0,10,kBLUE02a);
						FireShot(0);
					}
					PlaySE(kira);
				}
				PlaySE(tan);
				count=55;
			}case("hard"){
				loop(9){
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,rand(2,5),rand(0,360),0,0,10,kBLUE01);
					FireShot(0);
				}
				if(timer>=600){
					loop(7){
						CreateShotA(0,GetX,GetY,10);
						SetShotDataA(0,0,rand(3,6),rand(0,360),0,0,10,kBLUE02a);
						FireShot(0);
					}
					PlaySE(kira);
				}
				PlaySE(tan);
				count=55;
			}case("lunatic"){
				loop(16){
					CreateShotA(0,GetX,GetY,10);
					SetShotDataA(0,0,rand(2,5),rand(0,360),0,0,10,kBLUE01);
					FireShot(0);
				}
				if(timer>=600){
					loop(12){
						CreateShotA(0,GetX,GetY,10);
						SetShotDataA(0,0,rand(3,6),rand(0,360),0,0,10,kBLUE02a);
						FireShot(0);
					}
					PlaySE(kira);
				}
				PlaySE(tan);
				count=55;
			}
		}
	
		if(frame==60){
			alternative(tdif)
			case("easy"){
				loop(10){
					FalseLaser(GetX,GetY,GetAngleToPlayer+angle,4,kPURPLE12a,"+",0,0);
					angle+=36;
				}
			}case("normal"){
				loop(20){
					FalseLaser(GetX,GetY,GetAngleToPlayer+angle,4,kPURPLE12a,"+",0,0);
					angle+=18;
				}
			}case("hard"){
				loop(10){
					FalseLaser(GetX,GetY,GetAngleToPlayer+angle,5,kPURPLE12a,"+",20,10);
					FalseLaser(GetX,GetY,GetAngleToPlayer+angle+18,6,kPURPLE12a,"-",20,10);
					angle+=36;
				}
			}case("lunatic"){
				loop(10){
					FalseLaser(GetX,GetY,GetAngleToPlayer+angle,5,kPURPLE12a,"+",20,10);
					FalseLaser(GetX,GetY,GetAngleToPlayer+angle+18,6,kPURPLE12a,"-",20,10);
					angle+=36;
				}
			}
			frame=0;
		}

		if(timer>=10980){
		SetLife(1);
		}

		//ʊ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"
}