#TouhouDanmakufu
#Title[sapel 0ne]
#Text[big explozhuns!!]
#Player[REIMU]
#ScriptVersion[2]
#PlayLevel[lunatik]

script_enemy_main{

	let D = GetCurrentScriptDirectory;
	let imgBoss = D ~ ".\ReIMu.png";
	let cut = D ~ ".\Raimu.png";
	let shot = D ~ "supershot.txt";
	let s1 = D ~ "Shot 2.wav";
	let slide = 0;

	@Initialize{
		SetLife(2000);
		SetTimer(30);
		SetScore(100000);
		LoadGraphic(imgBoss);
		LoadGraphic(cut);
    		LoadUserShotData(shot);
		LoadSE(s1);
		fire;
	CutIn(YOUMU,"cray-cray sign - amulets explodies ~ NORML -",cut,0,0,360,290);
	}
	@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{
		DeleteGraphic(imgBoss);
		DeleteGraphic(cut);
		DeleteSE(s1);
	}
task fire{
	loop(200){
	let thing = rand(GetClipMinX,GetClipMaxX);
		loop(10){CreateShot01(thing, GetClipMaxY, 1.5, rand(190,350), 96, 0);} 
		yield;
	PlaySE(s1);
}
	loop{
	let thing = rand(GetClipMinX,GetClipMaxX);
		loop(10){CreateShot01(thing, GetClipMaxY, 1.5, rand(190,350), 96, 0);} 
		loop(10){CreateShot01(thing, GetClipMinY, 1.5, rand(-190,-350), 96, 0);} 
		yield;
	PlaySE(s1);
}
}
	function wait(w){loop(w){yield;}}
}