#TouhouDanmakufu
#Title[Secant spell]
#Text[SECANTCOSINE!]
#Player[FREE]
#ScriptVersion[2]
#BackGround[User(.\moon.png, 0, 0)]

script_enemy_main {
	#include_function ".\include.dnh"
	task TMain {
		SetLife(630); CreateLifebar(1, 0.8); dmgratemax=30; dmgrateup=2;
		SetBossAnimation(BossMode_MOVE, 45); SetMovePosition03(GetCenterX, GetCenterY-175/2, 15, 9); waitInv(60);
		SetBossAnimation(BossMode_SPELL, 120); CutIn(KOUMA, "Electroluminescence "\""Light-Emitting Diode"\", cutcut, 0, 0, 256, 300);
		SetScore(1000000); declare; waitInv(120);
		attack1; attack2;
	}
	task attack1 {
		let a = 0; let b = 0;
		loop {  
			loop(60) {  PlaySE(shot); ascent(i in 0..3) { ascent(j in 0..2) {
				CreateShot01(GetX, GetY, 19/8+j/2, a+i*360/3, RED57, 0);
			} } a+=15+7+sin(b); a%=360; b+=47/(pi); b%=360;
			wait(3); } ExMove;
		}
	}

task declare{
	wait(10);
	PlaySE(seCard1);
	}
	task attack2 {
		let a = 0;
		loop {  PlaySE(bounce);
			ascent(i in -9..10) { ascent(j in -0..1) {
				CreateShot01(GetX, GetY, 4-(|i|)/4+rand(-1/15, 1/15), GetAngleToPlayer+i+rand(-1/3, 1/3)+j*37, [BLUE57, GREEN57][absolute(i)<=3], 0);
			} }
			wait(100);
		}
	}
}