


script_enemy_main{
	
#include_function ".\Boss.txt";
let lol = 0;
	
	@Initialize{
	

		//shotinit;
		Init(2000,5,"Momiji Inubashiri");		
		BossInit(false,99,2000000,false,[255,64,64],[255,64,64]);
		SetInvincibility(400);
		SetDamageRate(100,0);
		mainTask;
		Border;
		LoadUserShotData(CSD~"supershot.txt");
		SetMovePosition03(GetCenterX,GetCenterY-120,10,5);
		cutin("NAZRIN","Flash Forward [Game of Memory]",imgCut,0,0,512,512);
		SetEnemyMarker(true);
		
		
	}
	@MainLoop{
		SPMainLoop;
		if(GetLife>10000){
		if(OnBomb){
	SetDamageRate(50,10);
		}
	SetCollisionA(GetX,GetY,32);
		SetCollisionB(GetX,GetY,16);
		
}
		yield;
		
	}
	task DrawTask{
		Momizi;
	}
	task mainTask{
		fire;
	}

	task SPFinalize{
		CreateEnemyFromFile(CSD~"momizi7.txt",GetX,GetY,0,0,0);
		DeleteEnemyShotToItem(ALL);
		loop(55){
		let a = rand(0,360);
		let x = rand(30,80)*sin(a);   
		let y = rand(30,80)*cos(a);
		CreateMOFItem("POINT",GetX+x,GetY+y);
		}
	}
	
	task laser(rx,ry,angle,delay){
	PlaySEEx(CSD~"se\shadow.wav");
	CreateLaserA(1,GetX+rx,GetY+ry,512,10,BLUE01,999);
	SetLaserDataA(1,0,angle,0,0,0,0);
	SetShotKillTime(1,10);
	FireShot(1);
	let x = GetX+rx;
	let y = GetY+ry;
	wait(delay);
	PlaySEEx(CSD~"se\lazer01.wav");
	CreateLaser01(x,y,10,angle,300,13,WHITE01,0);
	}
	
	task fire{
		wait(200);
			let a = 0;
			let a2 = 0;
			wait(70);
			ascent(i in 0..30){
			laser(100,0,360/30*i,60-i);
			laser(-100,0,360/30*i,60-i);
			wait(1);
			}
			wait(120);
		loop{
			SetMovePositionHermite(420,50,12,0,10,270,60);
			ascent(i in 0..10){
			laser(0,0,180/10*i,30);
			wait(5);
			}
			wait(30);
			ascent(i in 0..20){
			laser(0,0,GetAngleToPlayer+rand(25,-25),40);
			}
			wait(50);
			SetMovePosition03(GetCenterX-100,GetCenterY-20,10,4);
			ascent(i in 0..60){
			laser(0,0,360/17*i,30);
			wait(3);
			}
			SetMovePosition03(GetCenterX,GetCenterY-120,10,5);
			wait(60);
			ascent(i in 0..120){
			laser(i*3,i,360/10*i,40);
			laser(-i*3,-i,360/10*i,40);
			yield;
			}
			wait(80);
			ascent(i in 0..30){
			laser(100,0,360/30*i,60-i);
			laser(-100,0,360/30*i,60-i);
			wait(1);
			}
			wait(80);
		}
	}
	




}