#TouhouDanmakufu[Single]
#Title[Koishi - Nonspell #2]
#BackGround[User(.\bgNon.png, 0, 0)]
#BGM[.\music0.mp3]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {

	#include_function ".\Include.~ath"

	task codeInit {
		SetLife(10000); SetTimer(62);
		SetMovePosition03(GetCenterX, GetCenterY/2, 10, 4);
		//cutin("???",imgBossCut,0,0,255,511); SetScore(1000000);
		SetInvincibility(120);
		wait(120);
		attack1;
	}
	task attack1 {
		let a = rand(0,360);
		let b = rand(0,360);
		loop {
			loop(4) { loop(9) {
				PlaySE2("se_shot_tan2");
				ascent(i in -2..3) { ascent(j in 0..2) { ascent(k in 0..2) {
					CreateShotA(0, GetX+100*sin(b)*cos(a+k*360/2), GetY+100*sin(a+k*360/2), 10);
					SetShotDataA(0, 0, 4, a+b+i*5+j*360/2, 0, -4/20, 0, RED23);
					let v = 3+sin(a)*1/2;
					SetShotDataA(0, 20, 0, NULL, -i/13, (v)/60, v, NULL);
					SetShotDataA(0, 90, v, NULL, 0, 0, 0, NULL);
					FireShot(0);
				} } }
				a+=11; a%=360; b+=5; b%=360;
				wait(4);
			} ascent(i in 0..9) { CreateShot01(GetX, GetY, 2, a+i*360/9, BLUE03, 10); } }
			ExMove03_(GetCenterY/2, rand(25, 60), rand(10, 30), 7, 1);
		}
	}
	task attack1UNUSED {
		let a = rand(0,360);
		loop {
			loop(6) {
				let r = 3;
				loop(7) {
					PlaySE2("se_shot_tan");
					ascent(i in 0..14) {
						CreateShot01(GetX, GetY, r, a+i*360/14, RED13, 10);
					}
					a+=pi*3/5; a%=360; r+=1/7;
				wait(3);
				} a-=15/pi; a%=360;
			} ExMove03_(GetCenterY/2, rand(25, 60), rand(10, 30), 7, 1);
		}
	}
}