#TouhouDanmakufu[Single}
#Title[faynl kard!!! !OIhj pouihr]
#Text[lazt!]
#Player[REIMU]
#ScriptVersion[2]
#PlayLevel[Normal]

script_enemy_main{

	let D = GetCurrentScriptDirectory;
	let imgBoss = D ~ ".\ReIMu.png";
	let s1 = D ~ "Shot.wav";

	@Initialize{
		SetLife(2000000);
		LoadGraphic(imgBoss);
		LoadSE(s1);
    		LoadUserShotData(D ~ "supershot.txt");
		fire;
		mov;
	}
	@MainLoop{
		SetCollisionA(GetX,GetY,32);
		SetCollisionB(GetX,GetY,16);
	yield;}
	@DrawLoop{
		SetTexture(imgBoss);
		SetRenderState(ALPHA);
		SetAlpha(255);
		SetGraphicRect(0,0,110,110);
		SetGraphicScale(0.7,0.7);
		SetGraphicAngle(0,0,0);
		DrawGraphic(GetX,GetY);
	}
	@BackGround{}
	@Finalize{
		loop(20){CreateItem(ITEM_SCORE,GetX+rand(-150,150),GetY+rand(50,200));}
		DeleteGraphic(imgBoss);
		DeleteSE(s1);
	}
	task mov{loop{SetMovePosition01(GetPlayerX,GetPlayerY,3);yield;}}
	task fire{
	wait(60);
	let dir = 0;
	let dxunhij = 0;
	loop{
		loop(16){
			CreateShotA(1,GetX,GetY,0);
			SetShotDataA(1,0,4,dir,0,0,2,96);
			FireShot(1);
		dir+=22.5;
		}
	dir+=dxunhij;
	dxunhij+=2;
	wait(3); PlaySE(s1);}
	}
	function wait(w){loop(w){yield;}}
}