let Cut = GetCurrentScriptDirectory~"sprites\Cut.png";
let imageFile = GetCurrentScriptDirectory~"sprites\shinki.png";
let imageFile2 = GetCurrentScriptDirectory~"sprites\fan.png";
let background = GetCurrentScriptDirectory~"sprites\background.png";
let f = true;
let poof = GetCurrentScriptDirectory~"sfx\poof.wav";
let timestop = GetCurrentScriptDirectory~"sfx\timestop.wav";
let variation = 1;
let one = 1;
let last = false;
let drift = false;
let variable = 1;
let futo = GetCurrentScriptDirectory~"sprites\futo.png";
let frame = -60;
let shooting = false;
let frame2 = -60;
let familiarspawn = GetCurrentScriptDirectory~"sfx\Shadow.wav";
let die = GetCurrentScriptDirectory~"sfx\se_enep01.wav";
let dream = GetCurrentScriptDirectory~"sfx\dream.wav";
let frame3 = -60;
let slash = GetCurrentScriptDirectory~"sfx\slash.wav";
let border = GetCurrentScriptDirectory~"sfx\border.wav";
let orb = GetCurrentScriptDirectory~"sfx\orb.wav";
let shot3 = GetCurrentScriptDirectory~"sfx\shot3.wav";
let shot4 = GetCurrentScriptDirectory~"sfx\shot4.wav";
let shot2 = GetCurrentScriptDirectory~"sfx\shot2.wav";
let shot = GetCurrentScriptDirectory~"sfx\shot.wav";
let charge = GetCurrentScriptDirectory~"sfx\Charge.wav";
let wtf = GetCurrentScriptDirectory~"sfx\kira00.wav";
let b = 0;
let timer = GetTimer;
let alpha = 255;
let timer2 = 0;
let time1 = GetCurrentScriptDirectory~"sfx\time1.wav";
let time2 = GetCurrentScriptDirectory~"sfx\time2.wav";
let teleport = GetCurrentScriptDirectory~"sfx\teleport.wav";
let caution = GetCurrentScriptDirectory~"sfx\caution.wav";
let acc1 = 0;
let ping = GetCurrentScriptDirectory~"sfx\ping.wav";
let acc2 = 0;
let acc3 = 0;
let acc5 = 0;
let TimeStopped = false;
let ang = 0;
let anim1 = 0;
let yy = 0;
let YuyukoSensu_SizeX = 0;
 let YuyukoSensu_SizeY = 1/20;
let c = 0;
let angle = 0;
let anim2 = 0;
let anim3 = 0;
let radius = 0;
let angle = 0;
let decidedangle = rand(0, 360);
let CBG1 = GetCurrentScriptDirectory~"sprites\CBG1.png";
let CBG2 = GetCurrentScriptDirectory~"sprites\CBG2.png";
let ang = 0;
let shot3 = GetCurrentScriptDirectory~"sfx\shot3.wav";
let objbullets = [];
let objgrowers = [];
let variation = 0;
let imglifebar = GetCurrentScriptDirectory~"lifebar_thWW.png";
let familiarspawn = GetCurrentScriptDirectory~"sfx\Shadow.wav";
let bgm = GetCurrentScriptDirectory~"mu\bgm.mp3";
let SP = GetCurrentScriptDirectory~"sprites\futo.png";
let laser = GetCurrentScriptDirectory~"sfx\laser.wav";
let MC = GetCurrentScriptDirectory~"sprites\NMC.png";
	#include_function ".\lib\SHOT_REPLACE\shot_replace.dnh"
	#include_function ".\cutin.dnh"
	#include_function ".\DATA\lib_anime_Shinki.dnh"
	@MainLoop{
	
	if(GetTimer!=timer && (GetTimer < 10 && GetTimer>3)){
		PlaySE(time1);
			}

	if(GetTimer!=timer && GetTimer < 4){
		PlaySE(time2);
	

	
			}
	timer = GetTimer;
	if(TimeStopped==true){
	SetTimer(timer2);
	}
	
	
			SetCollisionB(GetX, GetY, 14.5); 
	                SetCollisionA(GetX, GetY, 32); 
	yield;


	
	}

function wait(w){ loop(w){ yield;} }



sub ExMove { ExMove_(GetClipMinY+120, 10, rand(15, 30)); }
function ExMove_(height, ud, length) {
	SetAction(ACT_MOVE, 180);
	if(GetPlayerX < GetX) {
		if(GetX - length <= GetClipMinX) {
			SetMovePosition03(GetX + length+20, rand(height+4 - ud, height + ud), 20, 2);
		} else {
			SetMovePosition03(GetX - length-20, rand(height - ud, height + ud), 20, 2);
		}
	} else {
		if(GetX + length >= GetClipMaxX) {
			SetMovePosition03(GetX - length-20, rand(height - ud, height + ud), 20, 2);
		} else {
			SetMovePosition03(GetX + length+20, rand(height - ud, height + ud), 20, 2);
		}
	}
}

sub ExMoveLower { ExMoveL_(GetClipMinY+150, 10, rand(15, 30)); }
function ExMoveL_(height, ud, length) {
	SetAction(ACT_MOVE, 180);
	if(GetPlayerX < GetX) {
		if(GetX - length <= GetClipMinX) {
			SetMovePosition03(GetX + length+20, rand(height+4 - ud, height + ud), 20, 2);
		} else {
			SetMovePosition03(GetX - length-20, rand(height - ud, height + ud), 20, 2);
		}
	} else {
		if(GetX + length >= GetClipMaxX) {
			SetMovePosition03(GetX - length-20, rand(height - ud, height + ud), 20, 2);
		} else {
			SetMovePosition03(GetX + length+20, rand(height - ud, height + ud), 20, 2);
		}
	}
}

sub ExMove2 { ExMove_2(GetClipMinY+120, 0, rand(20, 40)); }
function ExMove_2(height, ud, length) {
	SetAction(ACT_MOVE, 180);
	if(GetPlayerX < GetX) {
		if(GetX - length <= GetClipMinX) {
			SetMovePosition03(GetX + length+20, rand(height+4 - ud, height + ud), 5, 0.75);
		} else {
			SetMovePosition03(GetX - length-20, rand(height - ud, height + ud), 5, 0.75);
		}
	} else {
		if(GetX + length >= GetClipMaxX) {
			SetMovePosition03(GetX - length-20, rand(height - ud, height + ud), 5, 0.75);
		} else {
			SetMovePosition03(GetX + length+20, rand(height - ud, height + ud), 5, 0.75);
		}
	}
}


sub ExMove3 { ExMove___(GetCenterY-120, 10, rand(30, 60)); }
function ExMove___(height, ud, length) {
PlaySE(poof);
	
	if(GetPlayerX < GetX) {
		if(GetX - length <= GetClipMinX) {
			SetMovePosition02(GetX + length, rand(height+20 - ud, height + ud), 1);
		} else {
			SetMovePosition02(GetX - length, rand(height - ud, height + ud), 1);
		}
	} else {
		if(GetX + length >= GetClipMaxX) {
			SetMovePosition02(GetX - length, rand(height - ud, height + ud), 1);
		} else {
			SetMovePosition02(GetX + length, rand(height - ud, height + ud), 1);
		}
	}
}



function GetDistance(x1,y1,x2,y2){
return(((x2-x1)^2+(y2-y1)^2)^(1/2))
} 


 @DrawLoop {
SetGraphicAngle(0, 0, 0);
SetTexture(imageFile);
SetAlpha(alpha);
 SetGraphicScale(1,1);
DrawBoss(imageFile);


}


@Finalize {
if(GetCommonDataDefault("lastattack", false)==true){ PlaySE(die); }
loop(7-floor((GetMissCount+GetBombCount)/2)){
CreateItem(ITEM_SCORE, GetX+rand(-100, 100), GetY+rand(-45, 44));
}
}