//#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Sp1"]
#Text[""]
#include"./Default_ShotConst.txt"
#include"./Default_Effect.txt"
#include"./effect.txt"

#include"./Effects/Effects.txt"

#include"./Cutin.txt"

let cirr = GetCurrentScriptDirectory ~ "circle2.png" ;
	
	
	
	
let ss = GetCurrentScriptDirectory~"./Sounds/lastw.mp3";
let mus = ObjSound_Create;
	

let cirrr = GetCurrentScriptDirectory ~ "circle3.png" ;
let mo = GetCurrentScriptDirectory ~ "mouse.png" ;
let mo2 = GetCurrentScriptDirectory ~ "sh2.png" ;
let mo3 = GetCurrentScriptDirectory ~ "arrow.png" ;
let cir = GetCurrentScriptDirectory ~ "circle.png" ;
let bg = GetCurrentScriptDirectory ~ "spbg.jpg" ;
let cut = GetCurrentScriptDirectory ~ "Cut.png" ;
let bg2 = GetCurrentScriptDirectory ~ "spbg2.jpg" ;
let cha = GetCurrentScriptDirectory ~ "./Sounds/se_ch02.wav" ;
let bon = GetCurrentScriptDirectory ~ "./Sounds/se_boon01.wav" ;
let cha2 = GetCurrentScriptDirectory ~ "./Sounds/se_enep02.wav" ;
let tana = GetCurrentScriptDirectory ~ "./Sounds/se_tan01.wav" ;
let bgam = GetCurrentScriptDirectory ~ "./Sounds/se_cardget.wav" ;
let ki = GetCurrentScriptDirectory ~ "./Sounds/se_kira00.wav" ;
let boo = GetCurrentScriptDirectory ~ "./Sounds/se_cat00.wav" ;
let last = GetCurrentScriptDirectory ~ "./Sounds/lastw.mp3" ;
let ded = GetCurrentScriptDirectory ~ "./Sounds/se_focus.wav" ;
let bamm = GetCurrentScriptDirectory ~ "./Sounds/se_enep01.wav" ;

let lass = GetCurrentScriptDirectory ~ "./Sounds/se_lazer01.wav" ;
let img=GetCurrentScriptDirectory ~ "KE.png";
let shield=GetCurrentScriptDirectory ~ "sh.png";
function wait(w){loop(w){yield;}}
let frame = 0;
let af1=0;
let af2=0;
let af3=0;
let dam=0;

let objEnemy;
@Initialize{

objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	ObjEnemy_Regist(objEnemy);
	animate;yield;
	
	ObjMove_SetDestAtWeight(objEnemy, 192, 120, 10,3);
	
TExplosionA(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),5,1);
TExplosionA(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),2,0.1);
	
	move;
	LoadSound(cha);
	LoadSound(cha2);
	LoadSound(lass);
	LoadSound(ded);
	LoadSound(bamm);
	ObjSound_Load(mus,ss);
	LoadSound(bon);
	LoadSound(tana);
	LoadSound(last);
	LoadSound(boo);
	LoadSound(bgam);
	LoadSound(ki);
PlaySE(bgam);
	
	end;
back;

	//ObjMove_SetDestAtWeight(objEnemy, -120, -120, 10,12);
	let cx = GetStgFrameWidth() / 2;
	}

let t=0;
let ff=0;
let ff2=0;
let gg=0;
let gg2=0;
let tt=0;

////////////////////////////////////////////////////////////////////////////////////////
let h=0;let ciral=133;
let bossal=255;
let asd=0;
let asd2=0;
let scale=0;
task back{
	let bg133=ObjPrim_Create(OBJ_SPRITE_2D);
	ObjRender_SetBlendType(bg133, BLEND_ADD_RGB);
	ObjPrim_SetTexture(bg133,cir);
	ObjSprite2D_SetSourceRect(bg133,0,0,132,132);
	ObjSprite2D_SetDestCenter(bg133);
	////
	

	let hh=0;
	dd;

	task dd{
		while(!Obj_IsDeleted(bg133)){yield;
		ObjRender_SetAlpha(bg133,ciral);
		ObjRender_SetPosition(bg133,ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0);
		ObjRender_SetAngleZ(bg133,asd2/2);
			ObjRender_SetScaleXYZ(bg133,1.8+0.3*cos(hh),1.8+0.3*cos(hh),0);
			if(ccc==1){Obj_Delete(bg133);}
		hh+=2;
			Obj_SetRenderPriorityI(bg133,22);
			
			////
			
			asd2+=6;}}}
let dir;
	let speed;
	let time=0;
	
	
	
	
	
	let ccc=0;
	
	
task animate{
	
	
	
	
	

while(!Obj_IsDeleted(objEnemy)){
	ObjPrim_SetTexture(objEnemy,img);
	ObjSprite2D_SetDestRect(objEnemy,-61.5,-83+5*sin(h),61.5,83+5*sin(h));
	ObjRender_SetScaleXYZ(objEnemy,0.7,0.7,0);
	ObjRender_SetAlpha(objEnemy,bossal);
	dir=ObjMove_GetAngle(objEnemy);
	speed=ObjMove_GetSpeed(objEnemy);
	h+=4;

	if(speed==0){
	af1=0;
		if(af3==1){time++;
//af1=0;
		if(time<15){ObjSprite2D_SetSourceRect(objEnemy,373, 256, 511, 454);}
		if(time>=15+1 && af1<=20+1){ObjSprite2D_SetSourceRect(objEnemy,533,255, 671, 453);
		
		
		
		
if(time>80){
		time=0;
		af3=0;}
		
		}
		
		}
	else{
	
if(af1<15){ObjSprite2D_SetSourceRect(objEnemy,0, 0, 136, 197);}
		if(af1>=30+1 && af1<=45+1){ObjSprite2D_SetSourceRect(objEnemy,137,0, 274, 197);}
		if(af1>=46+1 && af1<=60+1){ObjSprite2D_SetSourceRect(objEnemy,137+137,0, 411, 197);}
		if(af1>=61+1 && af1<=76+1){ObjSprite2D_SetSourceRect(objEnemy,137,0, 274, 197);}
		
if(af1>77){ObjSprite2D_SetSourceRect(objEnemy,0, 0, 136, 197);}
		}


		}

	if(speed>0 && cos(dir)>0 ){
		ObjRender_SetAngleY(objEnemy,0);
		if(af2>12){ObjSprite2D_SetSourceRect(objEnemy,6, 234, 144, 431);}
		if(af2>24){ObjSprite2D_SetSourceRect(objEnemy,6, 234, 144, 431);}
		if(af2>36){af1=0;}
		af2++;}

	if(speed>0 && cos(dir)<0 ){
		//ObjRender_SetAngleY(objEnemy,180);
		if(af2>12){ObjSprite2D_SetSourceRect(objEnemy,144, 234, 282, 431);}
		if(af2>24){ObjSprite2D_SetSourceRect(objEnemy,144, 234, 282, 431);}
		if(af2>36){af1=0;}
		af2++;}

	af1++;
	if(af1>120){af1=0;}yield;}}
let spellal=1;

task end{
	while(ObjEnemy_GetInfo(objEnemy,INFO_LIFE)>0){yield;}
	StartSlow(TARGET_ALL,30);
	PlaySE(ded);ded3=0;
	MakeConcentration("SAKURA",objEnemy,155,155,255,60);
	
wait(90);
PlaySE(bamm);

dec;


MakeExplosion("MAPLE",objEnemy,0,255,255);

TExplosionA(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),5,0.3);
TExplosionA(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),10,0.5);

TExplosionA(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),2,0.1);
TExplosionA(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),15,0.7);
StartSlow(TARGET_ALL,60);
task ssa{

loop(100){

	ObjSound_SetVolumeRate(mus,ObjSound_GetVolumeRate(mus)-1);yield;}
}
ssa;

	bossal=0;
	ciral=0;
	ccc=1;
	spellal=0;
	
	DeleteShotAll(TYPE_ALL,TYPE_ITEM);
	
	
	
	
	wait(180);
	Obj_Delete(objEnemy);
	CloseScript(GetOwnScriptID);
	}

@Event{
	alternative(GetEventType())
	case(EV_REQUEST_LIFE){SetScriptResult(1800);}
	case(EV_REQUEST_TIMER){SetScriptResult(90);}
	case(EV_REQUEST_SPELL_SCORE){SetScriptResult(15000);}}

	
	
	let ggg=0;
	let ggg2=0;
	let ttt=0;
	let ttt2=0;
	
let ang=0;
let ang2=0;
let xc=4;



task move2{

wait(300);

loop{
	ObjMove_SetDestAtWeight(objEnemy, GetStgFrameWidth/2-rand(30,90),  GetStgFrameHeight/2-70-rand(60,80), 20,2);

	wait(180);
	af3=1;
	wait(5);
	goaway;
	wait(180);
	
ObjMove_SetDestAtWeight(objEnemy, GetStgFrameWidth/2+rand(30,90),  GetStgFrameHeight/2-70-rand(60,80), 20,2);
wait(180);
	af3=1;
	wait(5);
	goaway;
	wait(180);

	
	}
}



let asd22=0;
task kok{
let shh=ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(shh,shield);
ObjSprite2D_SetSourceRect(shh,0,0,128,128);
ObjRender_SetAlpha(shh,0);
ObjRender_SetScaleXYZ(shh,4,4,4);
ObjSprite2D_SetDestCenter(shh);
ObjRender_SetPosition(shh,ObjMove_GetX(objEnemy)-3,ObjMove_GetY(objEnemy)-40,0);




let wwq=ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(wwq,shield);
ObjSprite2D_SetSourceRect(wwq,0,0,128,128);
ObjRender_SetAlpha(wwq,0);
ObjRender_SetScaleXYZ(wwq,4,4,4);
ObjSprite2D_SetDestCenter(wwq);
ObjRender_SetPosition(wwq,ObjMove_GetX(GetPlayerObjectID),ObjMove_GetY(GetPlayerObjectID),0);



ddd2(wwq);
dddd2(wwq);


ddd(shh);
dddd(shh);



task dddd(o){

loop{

yield;
if(ccc==1){Obj_Delete(shh);}
ObjSprite2D_SetDestRect(shh,-64,-64+5*sin(h),64,64+5*sin(h));
	


}




}



task ddd(ii){

loop(60){

yield;
asd22+=3;
ObjRender_SetAlpha(shh,0);
ObjRender_SetScaleXYZ(shh,xc,xc,xc);
xc+=-3.7/60;
}




}

//

task dddd2(o){

loop{

yield;
if(ccc==1){Obj_Delete(shh);}
ObjSprite2D_SetDestRect(shh,-64,-64+5*sin(h),64,64+5*sin(h));
	


}




}



task ddd2(ii){

loop(60){

ObjRender_SetPosition(wwq,ObjMove_GetX(GetPlayerObjectID),ObjMove_GetY(GetPlayerObjectID),0);

yield;
ObjRender_SetAlpha(ii,asd22/2);
ObjRender_SetScaleXYZ(ii,xc+0.5,xc+0.5,xc+0.5);
}


kks;
task kks{
loop{yield;if(ccc==0){
let f=0;
let all=20;
let wwq=ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(wwq,shield);
ObjSprite2D_SetSourceRect(wwq,0,0,128,128);
ObjRender_SetAlpha(wwq,all);
ObjRender_SetScaleXYZ(wwq,xc+0.7+f,xc+0.7+f,xc+0.7+f);
ObjSprite2D_SetDestCenter(wwq);
ObjRender_SetPosition(wwq,ObjMove_GetX(GetPlayerObjectID),ObjMove_GetY(GetPlayerObjectID),0);
ObjShot_FadeDelete(wwq);
loop(60){yield;

if(ccc==1){ObjRender_SetAlpha(wwq,0);break;}
ObjRender_SetAlpha(wwq,all);
ObjRender_SetScaleXYZ(wwq,xc+0.7+f,xc+0.7+f,xc+0.7+f);

all+=-0.33;
f+=0.05;
}wait(60);}}
}
loop{
yield;

if(ccc==1){let rr=250/120;let rr2=0;
loop(60){
yield;
rr2+=-3;
ObjRender_SetAlpha(wwq,rr2);
}
}

ObjRender_SetPosition(ii,ObjMove_GetX(GetPlayerObjectID),ObjMove_GetY(GetPlayerObjectID),0);

}


}

}



let alpha2=95;
let alpha1=255;


task dec{dec2;
let f=255/120;

loop(120){
alpha1+=-f;
yield;
}


}



task dec2{
let f=155/120;

loop(120){
alpha2+=-f;
yield;
}


}

let tutu=0;
let anglel=0;
let anglel2=0;let spa=0.5;
task kk{loop(60*8-60){yield;tut+=0.1;r=5+80*cos(tut);}
loop{yield;tut+=0.5;r=5+80*cos(tut);}
}


task kk2{loop{tut+=0.1;r=0+480*cos(tut);yield;}
}


let fd=17;
task fire3(ang){
}

let hhh2=0;
task wavv{




}


task wav1{

}



task kkk{
}

task las2{

}
task fire2{



}



task goaway{
let ggg=0;
let a=0;
provocation;
wait(120);




}


task provocation{

let ggg=0;
let a=0;

if(ccc==0){
loop(4){
loop(5){

PlaySE(tana);
let asd=round(rand(73,80));

let obj = CreateShotA1(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0.5,ang,asd,10);


ObjMove_SetAngle(obj,atan2(ObjMove_GetY(GetPlayerObjectID)-ObjMove_GetY(obj),ObjMove_GetX(GetPlayerObjectID)-ObjMove_GetX(obj))+ang-a);


let as = CreateShotA1(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0.5,ang,asd,10);


ObjMove_SetAngle(as,atan2(ObjMove_GetY(GetPlayerObjectID)-ObjMove_GetY(as),ObjMove_GetX(GetPlayerObjectID)-ObjMove_GetX(as))+ang+a);



ang+=360/5;

}
a+=2.1656;

}


wait(30);

loop(60){

PlaySE(tana);
let asd=round(rand(73,80));

let obj = CreateShotA1(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0.5,ang,asd,10);


ObjMove_SetAngle(obj,90+a);

let as = CreateShotA1(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0.5,ang,asd,10);


ObjMove_SetAngle(as,90-a);


a+=5.9656;

wait(1);


}


}



}



task creep{


let ggg=rand(0,360);



let obj1 = CreateShotA1(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0.5,ggg,172,10);
let obj2 = CreateShotA1(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0.5,ggg+120,172,10);
let obj3 = CreateShotA1(ObjMove_GetX(objEnemy),ObjMove_GetY(objEnemy),0.5,ggg+240,172,10);


u(obj1);
u(obj2);
u(obj3);

task u(obj){
loop{

yield;
if(ObjMove_GetX(obj)<0){ObjMove_SetAngle(obj,180-ObjMove_GetAngle(obj));}
if(ObjMove_GetX(obj)>GetStgFrameWidth){ObjMove_SetAngle(obj,180-ObjMove_GetAngle(obj));}


if(ObjMove_GetY(obj)<0){ObjMove_SetAngle(obj,-ObjMove_GetAngle(obj));}
if(ObjMove_GetY(obj)>GetStgFrameHeight){ObjMove_SetAngle(obj,-ObjMove_GetAngle(obj));}


}}


}



let ded3=1;
let sos=0;
task fire1{
//SetPlayerInvincibilityFrame(12000);	

let rt=50;
ll;
loop{

if(ded3==1){
sss(GetStgFrameWidth/2,-20,90);
sss(GetStgFrameWidth/2-GetStgFrameWidth/3-20,-20,90);
sss(GetStgFrameWidth/2+GetStgFrameWidth/3+20,-20,90);
}



wait(120)

}


task ll{


wait(2*60);
so;
wait(23*60);



let as = CreateLooseLaserA1(GetStgFrameWidth,GetStgFrameHeight/2,2,180,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as,false);


let as3 = CreateLooseLaserA1(GetStgFrameWidth,GetStgFrameHeight/2+GetStgFrameHeight/3+10,2,180,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as3,false);


let as33 = CreateLooseLaserA1(GetStgFrameWidth,GetStgFrameHeight/2-GetStgFrameHeight/3-10,2,180,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as33,false);
ls;
task ls{

let as = CreateLooseLaserA1(GetStgFrameWidth,GetStgFrameHeight/2,2,0,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as,false);


let as3 = CreateLooseLaserA1(GetStgFrameWidth,GetStgFrameHeight/2+GetStgFrameHeight/3+10,2,0,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as3,false);


let as33 = CreateLooseLaserA1(GetStgFrameWidth,GetStgFrameHeight/2-GetStgFrameHeight/3-10,2,0,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as33,false);

}

task so{
loop{
if(ded3==1){
sss(GetStgFrameWidth+800,GetStgFrameHeight/2,180);
sss(GetStgFrameWidth+800,GetStgFrameHeight/2+GetStgFrameHeight/3+10,180);
sss(GetStgFrameWidth+800,GetStgFrameHeight/2-GetStgFrameHeight/3-10,180);
}
wait(120);}
}}


task sss(x,y,ang){let spp=0;
let sada=0;
let yy = CreateShotA1(x,y,0.5,ang,120,10);
ObjShot_SetAutoDelete(yy,false);
ObjRender_SetScaleXYZ(yy,0.7+sada,0.7+sada,0.7+sada);
sa;
PlaySE(ki);
task sa{
let a=0;
let b=rand(-0.1,0.1);


loop{yield;
if(ObjMove_GetX(yy)>ObjMove_GetX(GetPlayerObjectID)-rt && ObjMove_GetX(yy)<ObjMove_GetX(GetPlayerObjectID)+rt && ObjMove_GetY(yy)>ObjMove_GetY(GetPlayerObjectID)-rt && ObjMove_GetY(yy)<ObjMove_GetY(GetPlayerObjectID)+rt){
ObjShot_SetIntersectionCircleA1(yy,5+spp);

ObjMove_SetSpeed(yy,ObjMove_GetSpeed(yy)-0.007);

spp+=0.05;
if(spp>25){spp=25;}
ObjRender_SetScaleXYZ(yy,0.7+sada,0.7+sada,0.7+sada);
sada+=0.007;
if(sada>2.3){sada=2.3;}
a+=b;

ObjMove_SetAngle(yy,a+atan2(ObjMove_GetY(GetPlayerObjectID)-ObjMove_GetY(yy),ObjMove_GetX(GetPlayerObjectID)-ObjMove_GetX(yy))/1.2);
if(ObjMove_GetSpeed(yy)<0.05){
ObjMove_SetSpeed(yy,0.05);}

}else{
ObjMove_SetSpeed(yy,0.5);}

}}



}




}




task sss{



move2;







let bg1q=ObjPrim_Create(OBJ_SPRITE_2D);
bax(bg1q);
ObjPrim_SetTexture(bg1q,bg);
ObjSprite2D_SetSourceRect(bg1q,0,0,1024,1024);
ObjRender_SetAlpha(bg1q,255);
ObjSprite2D_SetDestCenter(bg1q);
ObjRender_SetPosition(bg1q,GetStgFrameWidth/2,GetStgFrameHeight/2,0);



/////


let qw=ObjPrim_Create(OBJ_SPRITE_2D);

ObjPrim_SetTexture(qw,bg2);
ObjSprite2D_SetSourceRect(qw,20000,20000,1024,20024);
ObjRender_SetAlpha(qw,alpha2);
ObjSprite2D_SetDestCenter(qw);
ObjRender_SetPosition(qw,GetStgFrameWidth/2,GetStgFrameHeight/2,0);
baxx(qw);




////
let hhh=0;
task bax(vv){
while(!Obj_IsDeleted(vv)){
yield;
ObjRender_SetAlpha(bg1q,alpha1);
ObjRender_SetAlpha(qw,alpha2);

ObjRender_SetScaleY(bg1q,1+scale);
ObjRender_SetAngleZ(bg1q,3*cos(hhh*5)+5);
hhh+=0.1;
}
}




task baxx(vv){let gg=0;
while(!Obj_IsDeleted(vv)){
yield;
SetForbidPlayerShot(true);
SetForbidPlayerSpell(true);
ObjRender_SetAlpha(vv,alpha2);
	ObjSprite2D_SetSourceRect(vv,20000,20000,256,256);
	ObjSprite2D_SetDestCenter(vv);
	ObjRender_SetPosition(vv,0,gg,0);
			gg+=-0.5;
hhh+=0.1;
}
}




ObjRender_SetScaleXYZ(bg1q,0.7,0.7,0);

Obj_SetRenderPriorityI(bg1q,20);


ObjRender_SetScaleXYZ(qw,0.7,0.7,0);
//ObjRender_SetBlendType(qw,BLEND_MULTIPLY);
Obj_SetRenderPriorityI(qw,20);






}








task spinn{

loop(60){
scale+=-2/60;
yield;



}

}



let arr=0;
let arr2=0;





task turn2{




}





task turn{
PlaySE(cha);
	MakeConcentration("SAKURA",objEnemy,155,155,255,50);
	
wait(90);

MakeExplosion("SAKURA",objEnemy,155,155,255);
PlaySE(cha2);

PlaySE(bon);
loop(90){
arr+=-1;
arr2+=-1;
yield;

}


}




task turn3{
PlaySE(cha);
	MakeConcentration("SAKURA",objEnemy,155,155,255,50);
	
wait(90);

MakeExplosion("SAKURA",objEnemy,155,155,255);
PlaySE(cha2);

PlaySE(bon);
loop(90){
alp+=-3.5;
yield;

}


}



let alp=255;let qw=0;
task m{




qw=ObjPrim_Create(OBJ_SPRITE_2D);

ObjPrim_SetTexture(qw,mo);
ObjSprite2D_SetSourceRect(qw,0,0,512,512);
ObjRender_SetAlpha(qw,255);
ObjSprite2D_SetDestCenter(qw);
ObjRender_SetPosition(qw,GetStgFrameWidth+145,GetStgFrameHeight/2+135,0);



let qw22=ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(qw22,mo2);
ObjSprite2D_SetSourceRect(qw22,0,0,256,256);
ObjRender_SetAlpha(qw22,255);
ObjSprite2D_SetDestCenter(qw22);
ObjRender_SetPosition(qw22,GetStgFrameWidth+145,GetStgFrameHeight/2+135,0);




let qw223=ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(qw223,mo3);
ObjSprite2D_SetSourceRect(qw223,0,0,768,256);
ObjRender_SetAlpha(qw223,255);
ObjSprite2D_SetDestCenter(qw223);
ObjRender_SetPosition(qw223,GetStgFrameWidth+145,GetStgFrameHeight/2+135,0);


let qw2233=ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(qw2233,mo3);
ObjSprite2D_SetSourceRect(qw2233,0,0,768,256);
ObjRender_SetAlpha(qw2233,255);
ObjSprite2D_SetDestCenter(qw2233);
ObjRender_SetPosition(qw2233,GetStgFrameWidth+145,GetStgFrameHeight/2+135,0);

appear(qw);



ObjRender_SetScaleXYZ(qw,0,0.2,0.2);
ObjRender_SetScaleXYZ(qw22,0,0.8,0.8);
ObjRender_SetScaleXYZ(qw223,0,0.8,0.8);
ObjRender_SetScaleXYZ(qw2233,0,0.8,0.8);
grow;
task grow{
let ggg=0;

loop(100){

ObjRender_SetScaleXYZ(qw,ggg,0.2,0.2);
ObjRender_SetScaleXYZ(qw22,ggg*4,0.8,0.8);
ObjRender_SetScaleXYZ(qw223,ggg+0.1,0.3,0.3);
ObjRender_SetScaleXYZ(qw2233,ggg+0.1,0.3,0.3);
ggg+=0.002;
yield;

}


}



task appear(ii){



ObjRender_SetScaleXYZ(qw,0.2,0.2,0.2);
Obj_SetRenderPriorityI(qw,91);


ObjRender_SetScaleXYZ(qw22,0.8,0.8,0.8);
Obj_SetRenderPriorityI(qw22,90);


ObjRender_SetScaleXYZ(qw223,0.3,0.3,0.3);
Obj_SetRenderPriorityI(qw223,90);

ObjRender_SetScaleXYZ(qw2233,0.3,0.3,0.3);
Obj_SetRenderPriorityI(qw2233,90);

let hh=0;
loop{hh+=1;

ObjRender_SetAngleZ(qw22,hh);
ObjRender_SetAngleZ(qw223,arr);
ObjRender_SetAngleZ(qw2233,arr2+90);
ObjRender_SetScaleXYZ(qw,0.17+0.05*cos(hh),0.17+0.05*cos(hh),0);


ObjRender_SetAlpha(qw,alp);
ObjRender_SetAlpha(qw22,alp);
ObjRender_SetAlpha(qw223,alp);
ObjRender_SetAlpha(qw2233,alp);


yield;
}


}




}




task move{
	
	
	wait(120);
	
	
	

wait(60);


	PlaySE(cha);
	MakeConcentration("SAKURA",objEnemy,255,255,255,50);
	
wait(90);




	
	
	
af3=1;
wait(15);
PlaySE(boo);sss;
ObjCutin_SetSpellcardS4(" Vacuum '' Isolated field '' ", cut, NAZRIN, 240, 104, 104);
ObjCutin_LaunchS3(NAZRIN, cut, "normal");

MakeExplosion("SAKURA",objEnemy,255,255,255);

ObjSound_Play(mus);




let as = CreateLooseLaserA1(GetStgFrameWidth/2,0,2,90,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as,false);


let as3 = CreateLooseLaserA1(GetStgFrameWidth/2-GetStgFrameWidth/3-20,0,2,90,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as3,false);


let as33 = CreateLooseLaserA1(GetStgFrameWidth/2+GetStgFrameWidth/3+20,0,2,90,13700,-2,161,0);
ObjShot_SetIntersectionEnable(as33,false);

PlaySE(cha2);

wait(60);


	PlaySE(cha);
	MakeConcentration("SAKURA",objEnemy,155,155,255,50);
	
wait(90);
PlaySE(bon);
spinn;m;
MakeExplosion("SAKURA",objEnemy,155,155,255);
PlaySE(cha2);creep;


wait(60);


	PlaySE(cha);
	MakeConcentration("SAKURA",objEnemy,155,155,255,50);
	
wait(90);
kok;
MakeExplosion("SAKURA",objEnemy,155,155,255);
PlaySE(cha2);







af3=1;
wait(5);

fire1;

PlaySE(cha2);
turn2;
//////zSetPlayerInvincibilityFrame(120);	
loop(4000-50){yield;
ObjMove_SetX(GetPlayerObjectID,GetMouseX-30);
ObjMove_SetY(GetPlayerObjectID,GetMouseY-30);

}


SetPlayerInvincibilityFrame(120);
turn3;
loop(180){
ObjMove_SetY(GetPlayerObjectID,GetMouseY-20);
ObjMove_SetX(GetPlayerObjectID,GetMouseX-20);
yield;
}
SetPlayerInvincibilityFrame(120);	
let asddsa=1;
loop(770){asddsa+=-0.001;

//Set2DCameraRatioX(asddsa);
	yield;}
	loop(60){asddsa+=0.013;
//Set2DCameraRatioX(asddsa);
	yield;}
	}

	
	
	task bullet(ang){
	
	}
	///
	
	
@MainLoop{yield;
	SetAutoDeleteObject(true);
	if(dam==0){ObjEnemy_SetDamageRate(objEnemy,0,0);}
	if(dam==1){ObjEnemy_SetDamageRate(objEnemy,25,10);}
	let ex = ObjMove_GetX(objEnemy);
	let ey = ObjMove_GetY(objEnemy);

	let px = GetPlayerX();
	let py = GetPlayerY();
	let ATP = atan2(py - ey, px - ex);


ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32);
ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey+30, 20);
ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey+60, 10);
ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 32);
ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey+20, 20);
ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey+30, 10);
ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey+40, 10);
ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey+50, 5);
ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey-20,32);
frame++;}
SetCommonData("lel",0);
let lasa=0;
task sdd{




}


let r=60;
	let tut=0;
	let angle=0;