#TouhouDanmakufu{Single}
#Title[no Spell two]
#Text[2222222222222222222222222]
#Player[REIMU]
#ScriptVersion[2]
#PlayLevel[Normal]

script_enemy_main{

	let D	= GetCurrentScriptDirectory;
	let imgBoss = D ~ ".\ReIMu.png";
	let shot = D ~ "supershot.txt";
	let s1 = D ~ "Shot 2.wav";
	@Initialize{
		SetLife(1000);
		SetTimer(30);
		SetEnemyMarker(true);
		LoadGraphic(imgBoss);
		LoadSE(s1);
		SetInvincibility(120);
		LoadUserShotData(shot); 
		fire;
		fireb;
		movement;
	}
	@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); DeleteSE(s1);}
task movement{
	loop{
		SetMovePosition01(rand(GetClipMaxX,GetClipMinX),rand(GetClipMaxY,GetClipMinY),10);
		wait(7);
		}
	}
	task fire{
		let dir = 0;
		loop{
			loop(8){
			CreateLaser01(GetX, GetY, 5, dir, 150, 150, rand_int(94,107), 0); 
			PlaySE(s1);
			dir+=45;
		}
		dir = 0;
		wait(60);
		}
       }
	task fireb{
let dir = GetAngleToPlayer;
		loop{
			loop(8){ CreateShot01(GetX,GetY,3,dir,RED03,0); dir+=45; }
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			PlaySE(s1);
			wait(1);
		}
	}
	function wait(w){loop(w){yield;}}
}