script_enemy_main {
	#include_function ".\includeKoishi.txt"
	task TMain {
		SetDamageRate(125, 50);
		SetMovePosition03(GetCenterX, GetCenterY-100, 10, 9);
		SetInvincibility(180);
		while(OnPlayerMissed || OnBomb) { SetInvincibility(180); yield; }
		wait(120);
		TCharge(GetX, GetY);
		PlaySE2("charge");
		wait(60);
		attack1;
	}
	task attack1 {
		let side = 1;
		let aim = false;
		task time { wait(270); aim = true; } time;
		loop {
			let a = 90+90*side+rand(-10,10);
			SetMovePosition03(GetCenterX+rand(-30, 30)+60*side, GetCenterY-125+rand(-20,20), 10, 4);
			loop([3, 5, 6, 9][GetDifficulty]) {
				if(aim) {
					PlaySE2("tan00");
					ascent(i in 0..1) {
						let v = 3+i/4;
						CreateShotA(0, GetX, GetY, 10);
						SetShotDataA(0, 0, 4, a, 0, -1/15, 0, 70);
						SetShotDirectionType(PLAYER);
						SetShotDataA(0, 60, 0, 0, 0, v/30, v, NULL);
						SetShotDirectionType(ABSOLUTE);
						FireShot(0);
					}
					a+=27*side;
				}
				wait([30, 20, 15, 10][GetDifficulty]+rand(-2,2));
			}
			side*=-1;
		}
	}
}