script_enemy_main {
	#include_function ".\includeKoishi.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 {
			loop([2,3,6,9][GetDifficulty]) {
				PlaySE2("kira00");
				ascent(i in 0..15) {
					let v = [2+i*2,2+i*2,2+i*3/2,3/2+i*1][GetDifficulty];
					CreateShotA(0, GetX, GetY, 10);
					SetShotDataA(0, 0, v, GetAngleToPlayer+90, 0, -v/45, 0, 47);
					SetShotDataA(0, 60, 3, GetAngleToPlayer, 0, 0, 0, NULL);
					FireShot(0);
					CreateShotA(0, GetX, GetY, 10);
					SetShotDataA(0, 0, v, GetAngleToPlayer-90, 0, -v/45, 0, 47);
					SetShotDataA(0, 60, 3, GetAngleToPlayer, 0, 0, 0, NULL);
					FireShot(0);
				}
				wait([90,60,30,20][GetDifficulty]);
			}
			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;
		}
	}
}