#TouhouDanmakufu[Single}
#Title[Challenge 10 Normal]
#Text[Challenge attempt :D]
#Player[REIMU]
#BGM[.\BGM.wav]
#ScriptVersion[2]
#PlayLevel[Normal]

script_enemy_main{
let D = GetCurrentScriptDirectory;
let shot = D ~ "supershot.txt";
let cut = D ~ "Reimu.png";
let s1 =D~ "Shot.wav";
let s2 =D~ "Shot 2.wav";
let t1 =D~ "t1.wav";
let t2 =D~ "t2.wav";
	@Initialize{
		SetLife(2000);
		SetTimer(78);
		SetScore(250000);
		LoadUserShotData(shot); 
		SetEffectForZeroLife(80, 255, 1);
		LoadSE(s1);
		LoadSE(s2);
		LoadSE(t1);
		LoadSE(t2);
		SetDurableSpellCard;
		ForbidShot(true);
		SetDamageRate(0,0);
		CutIn(YOUMU,"Parsee thing - Normal -",cut,0,0,215,329);
		fire;
		kewl;
		SetMovePosition01(GetCenterX,GetCenterY,3);

	}
	@MainLoop{yield;}
	@DrawLoop{}
	@BackGround{}
	@Finalize{
		DeleteSE(s1);
		DeleteSE(s2);
		DeleteSE(t1);
		DeleteSE(t2);
	}
	task kewl{wait(4120); 
	loop(7){
		PlaySE(t1);
	wait(60);
}
	loop(3){
		PlaySE(t2);
	wait(60);
}}
	task fire{
	wait(90);
	let dir = 0;
	let hi = 1;
	let iop = 0;
	loop(2){
		loop(10){
		loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir,GREEN05,10); dir+=20; }
	dir += 1;
	PlaySE(s1);
	wait(8);
}
		loop(10){
		loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir,GREEN05,10); dir+=20; }
	dir += iop;
	iop -= 1;
	PlaySE(s1);
	wait(8);
}
	loop(65){
		loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir,GREEN05,10); dir+=20; }
	dir += iop;
	iop += 4;
	hi+=0.005;
	PlaySE(s1);
	wait(8);
}
		loop(3){
		loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir-180,GREEN05,10); dir+=20; }
	dir += 1;
	PlaySE(s1);
	wait(8);
}
		loop(3){
		loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir-180,GREEN05,10); dir+=20; }
	dir += iop;
	iop -= 1;
	PlaySE(s1);
	wait(8);
}
	loop(65){
		loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir,GREEN05,10); dir+=20; }
	dir += iop;
	iop -= 4;
	hi+=0.01;
	PlaySE(s1);
	wait(8);
	}}
hi=0.5;
wait(60);
iop=30;
	loop(15){
	loop(4){
		loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir,GREEN05,10); dir+=20;} hi+=0.5; }
	dir+=17; 
	hi = 0.5; 
	iop-=2;
	PlaySE(s2);
	wait(20); }
wait(230);
	loop(20){
	loop(4){
		loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir,GREEN05,10); dir+=20;} hi+=0.5; }
	dir-=17; 
	hi = 0.5; 
	iop+=2;
	PlaySE(s2);
	wait(20); }
hi=1;
wait(180);
loop(200){
loop(18){CreateShot01(GetEnemyX+iop*cos(dir),GetEnemyY+iop*sin(dir),hi,dir,GREEN05,20); dir+=20;}
dir+=rand(36,50); hi+=0.035; iop-=1; PlaySE(s1); wait(10); }
}
	function wait(w){loop(w){yield;}}
}