script_enemy_main{
	
#include_function ".\Boss.txt";
let lol = 0;
	
	@Initialize{
		//shotinit;
		Init(2000,10,"Momiji Inubashiri");		
		BossInit(false,66,1000000,false,[255,64,64],[255,64,64]);
		SetInvincibility(300);
		SetDamageRate(100,0);
		mainTask;
		Border;
		LoadUserShotData(CSD~"supershot.txt");
		SetMovePosition03(GetCenterX,GetCenterY-120,10,5);
		cutin("NAZRIN","Intimidation Sign [Fake Out]",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 shot1{
	PlaySEEx(CSD~"se\tan01.wav");
	ascent(i in 0..30){
	CreateShot01(GetX,GetY,6,360/30*i+GetAngleToPlayer+180/30,204,10);
	CreateShot01(GetX,GetY,5,360/30*i+GetAngleToPlayer+180/30,204,10);
	CreateShot01(GetX,GetY,3,360/30*i+GetAngleToPlayer+180/30,29,10);
	}
	SetMovePosition03(GetPlayerX+rand_int(-50,50),GetCenterY-100+rand(-20,20),10,7);
	
	}
	function kill{
	loop(10){
	PlaySEEx(CSD~"se\tan01.wav");
	let x = GetX+rand(-150,150);
	let y = GetY+rand(-50,50);
	let atp = 180+atan2(y-GetPlayerY,x-GetPlayerX);
	CreateShot01(x,y,3,atp,229,0);
	wait(15);
	}
	}
	task SPFinalize{
		CreateEnemyFromFile(CSD~"momizi2.txt",GetX,GetY,0,0,0);
		loop(15){
		let a = rand(0,360);
		let x = rand(30,60)*sin(a);
		let y = rand(30,60)*cos(a);
		CreateMOFItem("POINT",GetX+x,GetY+y);
		let a = rand(0,360);
		let x = rand(30,60)*sin(a);
		let y = rand(30,60)*cos(a);
		CreateMOFItem("VALUE_L",GetX+x,GetY+y);
		}
	}
	task fire{
		wait(200);
		loop{
			PlaySEEx(CSD~"se\se_ch00.wav");
			Concentration02(60);
			wait(50);
			loop(12){
			shot1;
			wait(5);
			}
			kill;
			wait(30);
		}
	}
	




}