


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

		//shotinit;
		Init(2000,6,"Momiji Inubashiri");		
		BossInit(false,70,1600000,false,[255,64,64],[255,64,64]);
		SetInvincibility(700);
		SetDamageRate(100,0);
		mainTask;
		Border;
		LoadUserShotData(CSD~"supershot.txt");
		SetMovePosition03(GetCenterX,GetCenterY-120,10,5);
		cutin("NAZRIN","Vast Memory [Past and Present Collide]",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~"momizi6.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 shot{
	let r = rand(0,360);
	ascent(i in 0..10){
	CreateShot01(GetX,GetY,3,360/10*i+r,218,0);
	CreateShot01(GetX,GetY,3,360/10*i+r+2,218,0);
	CreateShot01(GetX,GetY,3,360/10*i+r+4,218,0);
	CreateShot01(GetX,GetY,3,360/10*i+r+6,218,0);
	ascent(v in 0..4){
	CreateShotA(1,GetX,GetY,0);
	SetShotDataA(1,0,3,360/10*i+r+(v*2),0,0,0,218);
	SetShotDataA(1,20,0,360/10*i+r+(v*2),0,0,0,215);
	SetShotDataA(1,60,3,360/10*i+r+(v*2)-180,0,0,0,215);
	FireShot(1);
	}
	}
	wait(60);
	PlaySEEx(CSD~"se\se_kira00.wav");
	}
	
	task fire{
		wait(200);
			let a = 0;
			let a2 = 0;
			wait(50);
		loop{
			PlaySEEx(CSD~"se\se_tan00.wav");
			shot;
			SetMovePosition03(GetPlayerX+rand_int(-50,50),GetCenterY-100+rand(-20,20),10,7);
			wait(20);
			
		}
	}
	




}