
#TouhouDanmakufu
#Title[TEST THIS]
#Text[]
#Image[]
#Player[REIMU,MARISA]
#ScriptVersion[2]

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

		//shotinit;
		Init(2000,2,"Momiji Inubashiri");
		
			LoadMusic(GetCurrentScriptDirectory~"system\peerless.wav");
			PlayMusic(GetCurrentScriptDirectory~"system\peerless.wav");
		
		BossInit(false,39,2400000,true,[255,64,64],[255,64,64]);
		SetInvincibility(400);
		SetDamageRate(0,0);
		mainTask;
		Border;
		LoadUserShotData(CSD~"supershot.txt");
		SetMovePosition03(GetCenterX,GetCenterY-120,10,5);
		cutin("BYAKUREN","Game Of Wits [Sightread Insanity]",imgCut,0,0,512,512);
		SetEnemyMarker(true);
		
		
	}
	@MainLoop{
		SPMainLoop;
		if(GetLife>10000){
		if(OnBomb){
	SetDamageRate(0,0);
		}
	SetCollisionA(GetX,GetY,32);
		SetCollisionB(GetX,GetY,16);
		
}
		yield;
		
	}
	task DrawTask{
		Momizi;
	}
	task mainTask{
		fire;
	}

	task SPFinalize{
		CreateEnemyFromFile(CSD~"spell10.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 fire{
		wait(200);
			let a = 30;
			let a2 = 0;
			wait(50);
		
			let i = 0;
		loop{
		if(int(sctimer/60)<=30){
			CreateShot01(GetX,GetY,rand(1,6),rand(0,360),45,10);
		}
		if(int(sctimer/60)<=20){
			CreateShot01(GetX,GetY,rand(1,6),rand(0,360),45,10);
		}
		if(int(sctimer/60)<=10){
			CreateShot01(GetX,GetY,rand(1,6),rand(0,360),45,10);
		}
		if(int(sctimer/60)<=5){
			CreateShot01(GetX,GetY,rand(1,6),rand(0,360),230,10);
		}
		CreateShot01(GetX,GetY,rand(1,6),rand(0,360),45,10);
		PlaySEEx(CSD~"se\se_tan00.wav");
		wait(3);
		}
	}
	




}