script_enemy_main {
	#include_function ".\includeSatori.txt"
	#include_function ".\event.txt"
	task TMain {
		SetDamageRate(175, 75);
		while(GetEventStepEx != 1) { SetInvincibility(120); yield; }
		SetMovePosition03(GetCenterX-50, GetCenterY-125, 10, 9);
		while(OnEventEx) { yield; }
		SetMovePosition03(GetCenterX-100, GetCenterY-75, 10, 9);
		SetInvincibility(120); wait(60);
		TCharge(GetX, GetY);
		PlaySE2("charge");
		wait(60);
		attack1;
	}
	task attack1 {
		let side = 1;
		loop {
			let a = 0;
			let b = 135;
			let time = [6,3,2,3][GetDifficulty];
			let nums = floor(180/time);
			ascent(n in 0..nums) {
				PlaySE2("tan00");
				ascent(i in 0..[1,1,2,2][GetDifficulty]) { ascent(j in 0..2) {
					let ang = a*side;
					let ang2 = b*side+j*360/2;
					CreateShotA(0, GetX+(30+50*cos(ang))*side, GetY+50*sin(ang)*side, 20);
					SetShotDataA(0, 0, 0, 90-ang2, 0, 1/15, 0, 65-i*56);
					SetShotDataA(0, 30, 0, NULL, 0, 1/10, 3-i/3, NULL);
					FireShot(0);
					CreateShotA(0, GetX-(30+50*cos(ang))*side, GetY+50*sin(ang)*side, 20);
					SetShotDataA(0, 0, 0, 90+ang2, 0, 1/15, 0, 70-i*56);
					SetShotDataA(0, 30, 0, NULL, 0, 1/10, 3-i/3, NULL);
					FireShot(0);
				} }
				a+=[41,23,12,25][GetDifficulty];
				a%=360;
				b-=13;
				b%=360;
				wait(time);
			}
			wait(180-nums*time);
			TCharge(GetX, GetY);
			PlaySE2("charge");
			wait(60);
			SetMovePosition03(GetCenterX+100*side+rand(-30, 30), GetCenterY-75+rand(-30,30), 10, 9);
			wait(60);
			side*=-1;
		}
	}
}