#TouhouDanmakufu
#Title[:V]
#Text[]
#Image[]
#Player[REIMU,MARISA]
#ScriptVersion[2]


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

		//shotinit;
		Init(2000,7,"Momiji Inubashiri");		
		BossInit(false,70,1400000,false,[255,64,64],[255,64,64]);
		SetInvincibility(700);
		SetDamageRate(50,0);
		mainTask;
		Border;
		LoadUserShotData(CSD~"supershot.txt");
		SetMovePosition03(GetCenterX,GetCenterY-120,10,5);
		cutin("NAZRIN","Bad Scoop [Eye Searing Pictures]",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;
		sound;
	}
	task sound{
	wait(200);
	loop{
	wait(5);
	PlaySEEx(CSD~"se\se_tan00.wav");
	}
	}

	task SPFinalize{
		CreateEnemyFromFile(CSD~"momizi5.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 = 0;
			let a2 = 0;
		
		loop{
			ascent(i in 0..5){
			CreateShot02(GetX,GetY,0,360/5*i+a,0.1,5,239+i,10);
			}
			a2++;
			a+=a2;
			wait(2);
		}
	}
	




}