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


let lol = 0;
	#include_function ".\Boss.txt";
	
	@Initialize{
		
		Init(8000,3,"Momiji Inubashiri");		
		BossInit(true,34,0,false,[255,255,255],[255,64,64]);
		SetInvincibility(100);
		SetDamageRate(200,200);
		mainTask;
		SetMovePosition03(GetCenterX,GetCenterY-120,10,5);
		LoadUserShotData(CSD~"supershot.txt");
		//SetEnemyMarker(true);
		
		
	}
	
	@MainLoop{
	SetCollisionA(GetX,GetY,32);
	
		SetCollisionB(GetX,GetY,16);
		SPMainLoop;
		

		

		yield;
		
	}
	task DrawTask{
		Momizi;
	}
	
	task mainTask{
		fire;
		
	}
	task SPFinalize{
		CreateEnemyFromFile(CSD~"spell8.txt",GetX,GetY,0,0,0);
			
		loop(120){
		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);
		
		}
		
	}
	task fire{
		wait(130);	
		let c = 20;
		loop{
			let r = rand(0,360);
			loop(3){
			PlaySEEx(CSD~"se\tan00.wav");
			ascent(i in 0..c){
				
				TReflectionLaser(GetX,GetY,7,360/c*i+GetAngleToPlayer+10,218,10,1);
				
			}
			wait(40);
			}
			SetMovePosition03(GetPlayerX+rand_int(-50,50),GetCenterY-100+rand(-20,20),10,7);
			
		}

	}

}