#TouhouDanmakufu[Single]
#Title[Koishi - Spell #3]
#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("Subtle Symbol "\""Animal Magnetism"\",imgBossCut,0,0,255,511); SetScore(1000000);
		SetInvincibility(120);
		wait(120);
		attack1;
		attack2;
		attack3;
	}
	task attack1 {
		let a = 45;
		let b = 0;
		let c = 0;
		let d = 90;
		loop {
			PlaySE2("se_shot_tan");
			ascent(i in 0..2) { ascent(j in 0..4) {
				CreateShotA(0, GetX+125*cos(b+i*360/2), GetY+100*sin(c), 10);
				SetShotDataA(0, 0, 0, 90+j*360/4+(a+90)*((-1)^i), 0, 0, 0, RED24);
				SetShotDataA(0, 60, 0, NULL, 0, 1/30, 2, NULL);
				FireShot(0);
			} }
			a-=19/pi; a%=360;
			b+=8; b%=360;
			c+=8*2/3; c%=360;
			SetMovePosition02(GetCenterX+25*cos(d), GetCenterY-125+15*sin(d), 5);
			d+=3; d%=360;
			wait(5);
		}
	}
	task attack2 {
		wait(180);
		let a = 90;
		let b = -30;
		loop {
			ascent(i in 0..6) {
				CreateShotA(0, GetX+50*cos(a), GetY+50*sin(a), 20);
				SetShotDataA(0, 0, 0, b-a+i*360/6, 0, 0, 0, BLUE33);
				SetShotDataA(0, 10, 0, NULL, 0, 1/30, 3, NULL);
				FireShot(0);
			}
			a-=5; a%=360;
			b+=2; b%=360;
			wait(6);
		}
	}
	task attack3 {
		wait(270);
		let a = 0;
		let b = 180;
		loop {
			ascent(i in 0..6) {
				CreateShotA(0, GetX+100*cos(a), GetY+100*sin(b), 15);
				SetShotDataA(0, 0, 0, a+5*sin(b)+i*360/6, 0, 0, 0, GREEN06);
				SetShotDataA(0, 10, 0, NULL, 0, 1/60, 3/2, NULL);
				FireShot(0);
			}
			a+=4*pi; a%=360;
			b-=5; b%=360;
			wait(7);
		}
	}
}