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


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

		//shotinit;
		Init(2000,8,"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","Deadly Cuts [Painful Illusion]",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~"momizi4.txt",GetX,GetY,0,0,0);
		DeleteEnemyShotToItem(ALL);
		loop(25){
		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 trap1(duration){
	PlaySEEx(CSD~"se\kira00.wav");
	loop(duration/2){
	ascent(i in 0..30){
			CreateShotA(1,GetX,GetY,10);
			SetShotDataA(1,0,3,360/30*i,3,0,0,202);
			SetShotDataA(1,30,6,NULL,0,0,0,202);
			//SetShotDataA(1,40,6,360/30*i-180,-3,0,0,70);
			SetShotDataA(1,60,2,360/30*i-180+rand(180,-180),0,0,0,70);
			
			FireShot(1);
			}
	wait(2);
	}
	}
	task trap2(duration){
	PlaySEEx(CSD~"se\kira00.wav");
	loop(duration/2){
	ascent(i in 0..30){
			CreateShotA(1,GetX,GetY,10);
			SetShotDataA(1,0,3,360/30*i,-3,0,0,204);
			SetShotDataA(1,30,6,NULL,0,0,0,204);
			//SetShotDataA(1,40,6,360/30*i-180,3,0,0,74);
			SetShotDataA(1,60,2,360/30*i-180+rand(180,-180),0,0,0,74);
			FireShot(1);
			}
	wait(2);
	}
	}
	task knife1{
	ascent(l in 0..15){
	let r = rand(0,180);
	PlaySEEx(CSD~"se\se_tan00.wav");
		ascent(i in 0..6){
		CreateShot01(GetX+l*12,GetY,3,360/6*i+r,70,30);
		
		}
	wait(3);
	}
	
	}
	task knife2{
	ascent(l in 0..15){
	let r = rand(0,180);
	PlaySEEx(CSD~"se\se_tan00.wav");
		ascent(i in 0..6){
		CreateShot01(GetX-l*12,GetY,3,360/6*i+r,74,30);
		
		}
	wait(3);
	}
	
	}
	task fire{
		wait(200);
		
			wait(50);
		loop{
			knife1;
			wait(60);
			knife2;
			wait(60);
			knife1;
			wait(60);
			knife2;
			wait(60);
			knife1;
			wait(20);
			knife2;
			wait(20);
			knife1;
			wait(20);
			knife2;
			wait(20);
			knife1;
			wait(20);
			knife2;
			wait(20);
			knife1;
			wait(20);
			knife2;
			wait(20);
			knife1;
			wait(20);
			knife2;
			wait(20);
			knife1;
			wait(20);
			knife2;
			wait(20);
			knife1;
			wait(20);
			knife2;
			wait(20);
			knife1;
			wait(20);
			knife2;
			wait(100);
			
			yield;
		}
	}
	




}