#TouhouDanmakufu
#Title[Spell01]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {#include_function ".\Halo.txt"
  #include_function ".\AnimationLib.dnh"
  #include_function ".\function_cutin.txt"
  let imgNue = GetCurrentScriptDirectory ~ "KE.png";
  let Cut = GetCurrentScriptDirectory ~ "TW.png";
  let qwe = GetCurrentScriptDirectory ~ "supershot.txt";
 let cir = GetCurrentScriptDirectory ~ "circle.png";
 let cha = GetCurrentScriptDirectory ~ "ch.png";
 let spbg1 = GetCurrentScriptDirectory ~ "bg1.png";
 let spbg2 = GetCurrentScriptDirectory ~ "bg2.png";
 let name = GetCurrentScriptDirectory ~ "222.png";
 let name2 = GetCurrentScriptDirectory ~ "222.png";
  @Initialize {
  
  CreateAura01("AZURE",0,2);
   LoadUserShotData(qwe);
  
    SetLife(8000);
	SetTimer(50);
    SetDurableSpellCard;
    LoadGraphic(imgNue);
    LoadGraphic(name);
    LoadGraphic(name2);
    LoadGraphic(cir);
    LoadGraphic(cha);
    LoadGraphic(Cut);
    LoadGraphic(spbg1);
    LoadGraphic(spbg2);
    MagicCircle(false);
    InitializeAnimationData;
	inc;
 
  
  
    Animate("nue", "idle", true);
   mus;
    ShowOffNueAnimation;
   //cutin("NAZRIN", "",Cut,0,0,229,485); 
  }
  let po=0;
  let qwer=0;
  task mm{ loop{yield;
	SetMovePosition03(GetX,GetY-10,14,1);
		wait(30);
		SetMovePosition03(GetX,GetY+10,14,1);
		wait(30);
		
		
	
  }}
  let wai=120;
let angleb=0;let aa=0;
  task blasta{
  wait(240);wai=15;
  loop{
  
aa+=15;
   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  loop(5){
  as+=72;
  CreateShot01(GetX+40*cos(as),GetY+40*sin(as),2.5,angleb+aa,32,10);
  angleb+=360/5;
  }
  wait(wai);
  
  }
  
  
  }
  let yyyy2=0;
  task inc{wait(110);
  loop(30){
  xxxx+=10;
  yield;
  }
  loop(60){
  xxxx+=1;
  yield;
  }
  
  loop(10){
  xxxx+=7;
  yield;
  }
   loop(54){yyyy2+=0.5;
  yyyy+=yyyy2;
  yield;
  }
  yyyy=-190;xxxx=GetCenterX+155;
    loop(5){
  yyyy+=1;
  yield;
  }
  
  
  
  
  }
  @MainLoop {SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
    yield ;
	if(po>1){
	if(GetPlayerY<GetY+150){SetPlayerY(GetY+150);}
		
	
		
		
	
  }
  
  
  
  
  
  
  if(po>30){po=29;
 mm;}
  
  
  
  
  
  
  
  }let wave=0;
  let x=0;let y=0;let z=0;let dir=60;let dor=60; let sa=0;let xxxx=0; let yyyy=0;
  @DrawLoop {
    
	  

	  
	 
	 
	  
	     SetTexture(cir);SetAlpha(150);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(2+sin(wave)*0.2,2+sin(wave)*0.2);

wave+=3;x+=3;
	SetGraphicAngle(0, 0, x);
	DrawGraphic(GetX,GetY);
	
	
	 SetTexture(cir);SetAlpha(90);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(2.3+sin(wave)*0.2,2.3+sin(wave)*0.2);


	SetGraphicAngle(0, 0, -x);
	DrawGraphic(GetX,GetY);
	
	 SetTexture(cir);SetAlpha(40);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(2.6+sin(wave)*0.2,2.6+sin(wave)*0.2);


	SetGraphicAngle(0, 0, x);
	DrawGraphic(GetX,GetY);
	
   //////
   //GetX + dir*cos(dor), GetY + dir*sin(dor);
   

	
  
  
   
    SetTexture(imgNue);SetAlpha(255);SetGraphicScale(1,1);SetRenderState(ALPHA);
	  SetGraphicAngle(y, 0, 0);
    
	
	    SetTexture(name);SetAlpha(250);
 
	SetGraphicRect(0,0,325,36);
	SetGraphicScale(1,1);


	SetGraphicAngle(0, 0, 0);
	DrawGraphic(xxxx-150,230+yyyy);
	
	
	 dor+=6;
    DrawAnimatedSprite("nue", GetX, GetY+5*sin(dor));
	
	
  }let yyt=0;
  @BackGround{
  
  angle55+=yyt;
	
	
  
   
	
///	
	
	
	
	///
	
	  SetTexture(spbg2);SetAlpha(170);
 //SetRenderState(ADD);
	SetGraphicRect(0,0,512,512);
	SetGraphicScale(1+0.02*sin(dor),1+0.02*sin(dor));
//SetRenderState(ALPHA);

	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX,GetCenterY);
	
	
	
  
SetTexture(spbg1);SetAlpha(120);
	//SetRenderState(ADD);
 SetColor(210,210,230);
	SetGraphicRect(0,0,256,256);
	SetGraphicScale(1.7,1.8);
SetGraphicAngle(0, 0, 0);

	
	DrawGraphic(GetCenterX,GetCenterY);
	
  z=z+2;
  }let as=0;
 task charge{
 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration02(40);
 wait(60);
 }
  task mus{}
  @Finalize {
    DeleteGraphic(imgNue);
   
  }
  let ab=0;let ang=0;

 task bu{
f;
    task f{
   loop(20){yield;ab+=1;
   CreateShotA(11,Obj_GetX(obj216),Obj_GetY(obj216),5);
   SetShotDataA(11,0,0,ab,-0,0,0,58);
   SetShotDataA(11,180,0.5,NULL,-0,0,0,58);
   SetShotDataA(11,200,1,NULL,-0,0,0,58);
   SetShotDataA(11,220,1.5,NULL,-0,0,0,58);

   FireShot(11);
   wait(10);
   }}
 yyt=rand(0,1);
 
  let obj216=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj216,rand(10,GetClipMaxX-10));
	Obj_SetY(obj216,-10);
	Obj_SetSpeed(obj216,1);
	Obj_SetAngle(obj216,90);
	ObjShot_SetBombResist(obj216,true);
	ObjShot_SetGraphic(obj216,234);
ObjShot_SetDelay(obj216,5);
	while(!Obj_BeDeleted(obj216)){yield;
	Obj_SetAutoDelete(obj216,true);
	

 Obj_SetX(obj216,Obj_GetX(obj216)+2*sin(angle55));
 
 
 
 
 
 }}
 let choise=0;
	let choise2=0;
	let dx=0;
	let dy=0;
	let ds=0;
	
	let choise22=0;
	let choise222=0;
	let dx2=0;
	let dy2=0;
	let ds2=0;
	
	let choise223=0;
	let choise2223=0;
	let dx23=0;
	let dy23=0;
	let ds23=0;
	let qwer223=0;
	let sp23=0;
	////////////
	task fur3{
	 choise223=rand_int(1,2);
	 if(choise223==1){
	 dx23=GetClipMaxX;
	 }else{dx23=GetClipMinX;}
	 
	 choise2223=rand_int(1,2);
	  if(choise2223==1){
	 dx23=GetClipMaxY;
	 }else{dx23=GetClipMinY;}
	  let qwer2223=0;
	  let qwer323=0;
	 qwer223=rand(0,360);
	 qwer2223=rand(210,270);
	 qwer323=rand(310,70+360);
	 sp23=rand(1,2);
	let ranx23=rand_int(1,2);
	let rany23=rand_int(GetClipMinY+20,GetClipMaxY-20);
	dragonclimax23;
	 task dragonclimax23{

	 if(ranx23==1){
	 loop(rand_int(10,15)){dragon3(GetClipMaxX+10,GetCenterY,4,qwer2223);wait(5);
}}

if(ranx23==2){
	 loop(rand_int(10,15)){dragon3(GetClipMinX-10,GetCenterY,4,qwer323);wait(5);
}}





}}
	////////////
	task fur2{
	 choise22=rand_int(1,2);
	 if(choise22==1){
	 dx=GetClipMaxX;
	 }else{dx2=GetClipMinX;}
	 
	 choise222=rand_int(1,2);
	  if(choise222==1){
	 dx2=GetClipMaxY;
	 }else{dx2=GetClipMinY;}
	  let qwer222=0;
	  let qwer32=0;
	 qwer22=rand(0,360);
	 qwer222=rand(210,270);
	 qwer32=rand(310,70+360);
	 sp2=rand(1,2);
	let ranx2=rand_int(1,2);
	let rany2=rand_int(GetClipMinY+20,GetClipMaxY-20);
	dragonclimax2;
	 task dragonclimax2{

	 if(ranx2==1){
	 loop(rand_int(10,15)){dragon2(GetClipMaxX+10,GetCenterY,4,qwer222);wait(5);
}}

if(ranx2==2){
	 loop(rand_int(10,15)){dragon2(GetClipMinX-10,GetCenterY,4,qwer32);wait(5);
}}





}}
	///////
	
	
	let qwer22=0;
   task fur{
	 choise=rand_int(1,2);
	 if(choise==1){
	 dx=GetClipMaxX;
	 }else{dx=GetClipMinX;}
	 
	 choise2=rand_int(1,2);
	  if(choise2==1){
	 dx=GetClipMaxY;
	 }else{dx=GetClipMinY;}
	  let qwer2=0;
	  let qwer3=0;
	 qwer=rand(0,360);
	 qwer2=rand(210,270);
	 qwer3=rand(310,70+360);
	 sp=rand(1,2);
	let ranx=rand_int(1,2);
	let rany=rand_int(GetClipMinY+20,GetClipMaxY-20);
	
	}
	
 let spe=0.4;
 let spe2=0;
 let anga=0;
 let anga2=0;
 let angle=0;
 let a=0;
 let spe4=0.4;
 let spe24=0;
 let anga4=0;
 let anga24=0;

 task blz{
 
 spe=0.4;
 loop(120){
 anga+=240.9;
 anga2+=1;
 spe+=spe2;
 spe2+=0.0007;
 CreateShot01(GetX-26,GetY-15,spe,anga+90,11,5);
 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
 wait(1);
 }
 anga2=0;
 anga=0;
 spe2=0;
 spe=0.4;}
 
 ///////
 let app=0;
 let app2=0;
 task blz2{
 loop(120){
 anga4+=-240.9;
 anga24+=1;
 spe4+=spe2;
 spe24+=0.0003;
 CreateShot01(GetX-26,GetY-15,spe4,anga4+90,11,5);
 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
 wait(1);
 }
 anga24=0;
 anga4=0;
 spe24=0;
 spe4=0.4;}

 
 /////////
 let gra=0;
 let asd=40;
 task blz4{

 spe=0.4;
 loop(120){
 anga+=app;
 anga2+=1;
 spe+=spe2;
 spe2+=0.0004;
 CreateShot01(GetX-26,GetY-15,spe,anga+asd,gra,5);
 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
 wait(1);
 }
 anga2=0;
 anga=0;
 spe2=0;
 spe=0.4;}
 
 ///////
 task blz24{
 loop(120){
 anga4+=-app;
 anga24+=1;
 spe4+=spe2;
 spe24+=0.0004;
 CreateShot01(GetX-26,GetY-15,spe4,anga4+asd,gra,5);
 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
 wait(1);
 }
 anga24=0;
 anga4=0;
 spe24=0;
 spe4=0.4;}

 
 ///////
 
task blas{
wait(150);
PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration02(40);
 wait(760);
loop{
yield;
wait(90);
PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
fur;
wait(90);
PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
fur2;
wait(90);
PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
fur3;
wait(180);

}

}
  
let angle55=0;
let ae=0;let sp=0;let sp2=0;
let spd=0;




let angle2=0;

  task ShowOffNueAnimation {
 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_fault.wav");
let xc=60;


  task dragonclimax{

	sp=rand(1,2);
anga=90;
loop(40){
ds+=0.2;
ds2+=ds;PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
dragon(2,anga+ds2);
dragon(2,anga+180+ds2);
wait(2);

}


}
  
  
  
  let ytr=0;
  task dragonclimax2{

	ae=1;
	ytr=ae;
	loop(15){PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan00.wav");
loop(8){

CreateShotA(11,GetX,GetY-24,0);
   SetShotDataA(11,0,ae,angle2,-0,0,0,9);
   SetShotDataA(11,20,ae/2,NULL,-0,0,0,9);
   SetShotDataA(11,40,ae/6,NULL,-0,0,0,9);
   SetShotDataA(11,60,0,NULL,-0,0,0,9);
   SetShotDataA(11,90,0,90+rand(-20,20),-0,0,0,9);
   SetShotDataA(11,120,ae/6,NULL,-0,0,0,9);
   SetShotDataA(11,150,ae/5,NULL,-0,0,0,9);
   SetShotDataA(11,180,ae/4,NULL,-0,0,0,9);
   SetShotDataA(11,210,ae/3,NULL,-0,0,0,9);

   FireShot(11);
angle2+=360/8;
}ae+=0.5;
wait(5);


}
ae=0.5;
}
  
  
  
  
  
  
   
	
	
	 SetMovePosition03(GetCenterX, GetCenterY-90, 20, 4);
	 if(GetEnemyX<GetCenterX){
      SetNueMoveAnimation("right");}
	   if(GetEnemyX>GetCenterX){
      SetNueMoveAnimation("left");}
      yield ;
      while(GetSpeed>0.1){yield;}
	wait(90);
	Animate("nue", "start cast", false);
     wait(20);
	 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cat00.wav");
	  cutin("NAZRIN", "Poison '' Arsenic and Mercury '' ",Cut,0,0,519,521); 
	 // MotionBlurEx(ALL,180,50,ALPHA);
	   SetScore(30000);
	   
	  
	  
	wait(20);
	
	wait(30);
	   Animate("nue", "stop cast", false);
	   wait(20);
	   Animate("nue", "idle", true);
	 
	  wait(20);
	
	
	loop {yield ;  
	
	
	SetMovePosition03(GetPlayerX, GetClipMinY+rand(80, 120), 20, 4);
       SetNueMoveAnimation("left");
      
      yield ;
      while(GetSpeed>0.1){yield;}
	  wait(90);
	 Animate("nue", "start cast", false);
	wait(20); gra=rand_int(9,15);
	dragonclimax;
	
	wait(120);
	   Animate("nue", "stop cast", false);
	   wait(30);
	   Animate("nue", "idle", false);
	
	
	  wait(60);
	
	
	SetMovePosition03(GetPlayerX, GetClipMinY+rand(80, 120), 20, 4);
      SetNueMoveAnimation("right");
      
      yield ;
      while(GetSpeed>0.1){yield;}
	
	 wait(90);
	 Animate("nue", "start cast", false);
	 gra=rand_int(9,15);
		app2=rand_int(1,3);asd+=55;
dragonclimax2;wait(60);
	   Animate("nue", "stop cast", false);
	   wait(30);
	   Animate("nue", "idle", false);
	
	wait(60);
	
	
	
	
	}
	
	
	
  }
  
  
  let x2=0;let angleg=0;
  let ob=0;let angla=0;
  
  
  
  function wait(t){
    loop(t){yield;}
  }
  
sub InitializeAnimationData {
 CreateAnimation("nue", "idle", 1);
    SetAnimationFrame("nue", "idle", 0, imgNue,38, 10, 10, 55, 75);
  
   
    
    CreateAnimation("nue", "start move right", 4);
  SetAnimationFrame("nue", "start move right", 0, imgNue, 8, 13,86, 56, 158);
	SetAnimationFrame("nue", "start move right", 1, imgNue, 8, 77,86, 120, 154);
	
	SetAnimationFrame("nue", "start move right", 2, imgNue, 8, 138,82, 185, 154);
	SetAnimationFrame("nue", "start move right", 3, imgNue, 8, 200,82, 249, 151);
    
    CreateAnimation("nue", "stop move right", 4);
   SetAnimationFrame("nue", "stop move right", 0, imgNue, 8, 200,82, 249, 151);
   SetAnimationFrame("nue", "stop move right", 1, imgNue, 8, 138,82, 185, 154);
   SetAnimationFrame("nue", "stop move right", 2, imgNue, 8, 77,86, 120, 154);
   SetAnimationFrame("nue", "stop move right", 3, imgNue, 8, 13,86, 56, 158);
   
   
   
   
     
    CreateAnimation("nue", "start move left", 4);
  SetAnimationFrame("nue", "start move left", 0, imgNue, 8, 462,88, 506, 156);
	SetAnimationFrame("nue", "start move left", 1, imgNue, 8, 398,85, 441, 154);
	
	SetAnimationFrame("nue", "start move left", 2, imgNue, 8, 334,82, 382, 154);
	SetAnimationFrame("nue", "start move left", 3, imgNue, 8, 270,82, 318, 151);
    
   
    CreateAnimation("nue", "stop move left", 4);
   SetAnimationFrame("nue", "stop move left", 0, imgNue, 8, 270,82, 318, 151);
   SetAnimationFrame("nue", "stop move left", 1,imgNue, 8, 334,82, 382, 154);
   SetAnimationFrame("nue", "stop move left", 2, imgNue, 8, 398,85, 441, 154);
   SetAnimationFrame("nue", "stop move left", 3, imgNue, 8, 462,88, 506, 156);
   
   
   
   
    CreateAnimation("nue", "start cast", 4);
    SetAnimationFrame("nue", "start cast", 0, imgNue, 7   , 12, 165,55,235);
    SetAnimationFrame("nue", "start cast", 1, imgNue, 7    ,70, 165,120,235);
	
    SetAnimationFrame("nue", "start cast", 2, imgNue, 7    ,133, 165,184,234);
    SetAnimationFrame("nue", "start cast", 3, imgNue, 7    ,196, 165,247,235);
    
   

    
    CreateAnimation("nue", "stop cast", 4);
    SetAnimationFrame("nue", "stop cast", 0, imgNue, 7    ,196, 165,247,235);
  SetAnimationFrame("nue", "stop cast", 1,imgNue, 9    ,133, 165,184,234);
  SetAnimationFrame("nue", "stop cast", 2,imgNue, 9    ,70, 165,120,235);
  SetAnimationFrame("nue", "stop cast", 3, imgNue, 9   , 12, 165,55,235);
  
  }
   task SetNueMoveAnimation(direction) {
    if(direction == "left"){
      Animate("nue", "start move left", false);
      yield ;
      while(GetSpeed>0.1){
        yield ;
      }
      Animate("nue", "stop move left", false);
    }
    if(direction == "right"){
      Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){
        yield ;
      }
      Animate("nue", "stop move right", false);
    }
    wait(12);
    Animate("nue", "idle", true);
  }
  
  
  
  let asasa=rand(-40,40);
  let asasa2=rand(-60,60);
  let asasa3=rand(-80,80);
  
  task dragon(s,ang){
  
  let tyt=0;
  task pois{
  tyt=rand(0.5,1.5);a+=5; PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira02.wav");
  loop(3){
  bullul(Obj_GetX(obj),Obj_GetY(obj),tyt,10);
  angle+=360/3;
  }
  
  }
  
  
  
  
  task speed{
  
  
  loop{
  if(Obj_GetX(obj)>GetClipMaxX){
  
  Obj_SetSpeed(obj,0);wait(20);
  pois;ObjShot_FadeDelete(obj);break;
  
	}
	
	if(Obj_GetX(obj)<GetClipMinX){ Obj_SetSpeed(obj,0);
  wait(20);pois;ObjShot_FadeDelete(obj);
	break;}
	
	
	
	
	 if(Obj_GetY(obj)<GetClipMinY) 
         { Obj_SetSpeed(obj,0);
  wait(20);pois;ObjShot_FadeDelete(obj);break;
	}
                      
	
	
	if(Obj_GetY(obj)>GetClipMaxY) 
         { Obj_SetSpeed(obj,0);
  wait(20);pois;ObjShot_FadeDelete(obj);break;}
  
  yield;
  
  
  
  }
  }
let obj=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj,GetX);
	Obj_SetY(obj,GetY);
	Obj_SetSpeed(obj,s);
	
	
	Obj_SetAngle(obj,ang);
	
	
	ObjShot_SetBombResist(obj,true);
	ObjShot_SetGraphic(obj,226);
	ObjShot_SetDelay(obj,0);
	

	while(!Obj_BeDeleted(obj)){yield;
	Obj_SetAutoDelete(obj,true);
	

  speed;
  wait(1);
  break;
  


	
	
	}
  
  
  
  
  
  
  
  }
  
  
  
  
  
  //////////////
   task dragon2(x,y,s,ang){
  
  
  
  task speed{
  
  
  
  
  
  
      
	loop(20){as=Obj_GetSpeed(obj2);
	Obj_SetSpeed(obj2,Obj_GetSpeed(obj2)-Obj_GetSpeed(obj2)/10);
	
  wait(5);
  }Obj_SetSpeed(obj2,0); Obj_SetAngle(obj2,atan2(GetPlayerY-asasa-Obj_GetY(obj2),GetPlayerX-asasa-Obj_GetX(obj2)));
  wait(10);
  loop(20){as=Obj_GetSpeed(obj2);
	Obj_SetSpeed(obj2,Obj_GetSpeed(obj2)+3/10);
  wait(5);

  }
  loop(20){as=Obj_GetSpeed(obj2);
	Obj_SetSpeed(obj2,Obj_GetSpeed(obj2)-Obj_GetSpeed(obj2)/10);
	
  wait(5);
  }Obj_SetSpeed(obj2,0);Obj_SetAngle(obj2,Obj_GetAngle(obj2)+qwer);
  wait(10);
  loop(20){as=Obj_GetSpeed(obj2);
	Obj_SetSpeed(obj2,Obj_GetSpeed(obj2)+3/10);
  wait(5);

  }
  loop(20){as=Obj_GetSpeed(obj2);
	Obj_SetSpeed(obj2,Obj_GetSpeed(obj2)-Obj_GetSpeed(obj2)/10);
	
  wait(5);
  }Obj_SetSpeed(obj2,0);Obj_SetAngle(obj2,Obj_GetAngle(obj2)+qwer);
  wait(10);
  loop(20){as=Obj_GetSpeed(obj2);
	Obj_SetSpeed(obj2,Obj_GetSpeed(obj2)+4/10);
  wait(5);

  }
  
  
  
  
  
  }
  
  

let obj2=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj2,x);
	Obj_SetY(obj2,y);
	Obj_SetSpeed(obj2,s);
	
	
	Obj_SetAngle(obj2,ang);
	
	
	ObjShot_SetBombResist(obj2,true);
	ObjShot_SetGraphic(obj2,151);
	ObjShot_SetDelay(obj2,0);
	

	while(!Obj_BeDeleted(obj2)){yield;
	Obj_SetAutoDelete(obj2,true);
	

  speed;
  wait(1);
  break;
  


	
	
	}
  
  
  
  
  
  
  
  }
  
  
  
  //////////////
  
  task dragon3(x,y,s,ang){
  
  
  
  task speed{
  
  
  
  
  
  
      
	loop(20){as=Obj_GetSpeed(obj22);
	Obj_SetSpeed(obj22,Obj_GetSpeed(obj22)-Obj_GetSpeed(obj22)/10);
	
  wait(5);
  }Obj_SetSpeed(obj22,0);
   Obj_SetAngle(obj22,atan2(GetPlayerY-asasa-Obj_GetY(obj22),GetPlayerX-asasa-Obj_GetX(obj22)));
  wait(10);
  loop(20){as=Obj_GetSpeed(obj22);
	Obj_SetSpeed(obj22,Obj_GetSpeed(obj22)+3/10);
  wait(5);

  }
  loop(20){as=Obj_GetSpeed(obj22);
	Obj_SetSpeed(obj22,Obj_GetSpeed(obj22)-Obj_GetSpeed(obj22)/10);
	
  wait(5);
  }Obj_SetSpeed(obj22,0);Obj_SetAngle(obj22,Obj_GetAngle(obj22)+qwer);
  wait(10);
  loop(20){as=Obj_GetSpeed(obj22);
	Obj_SetSpeed(obj22,Obj_GetSpeed(obj22)+3/10);
  wait(5);

  }
  loop(20){as=Obj_GetSpeed(obj22);
	Obj_SetSpeed(obj22,Obj_GetSpeed(obj22)-Obj_GetSpeed(obj22)/10);
	
  wait(5);
  }Obj_SetSpeed(obj22,0);Obj_SetAngle(obj22,Obj_GetAngle(obj22)+qwer);
  wait(10);
  loop(20){as=Obj_GetSpeed(obj22);
	Obj_SetSpeed(obj22,Obj_GetSpeed(obj22)+4/10);
  wait(5);

  }
  
  
  
  
  
  }
  
  

let obj22=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj22,x);
	Obj_SetY(obj22,y);
	Obj_SetSpeed(obj22,s);
	
	
	Obj_SetAngle(obj22,ang);
	
	
	ObjShot_SetBombResist(obj22,true);
	ObjShot_SetGraphic(obj22,150);
	ObjShot_SetDelay(obj22,0);
	

	while(!Obj_BeDeleted(obj22)){yield;
	Obj_SetAutoDelete(obj22,true);
	

  speed;
  wait(1);
  break;
  


	
	
	}
  
  
  
  
  
  
  
  }
  
  
  task bullul(x,y,s,d){
  
  
  
  let obj22=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj22,x);
	Obj_SetY(obj22,y);
	Obj_SetSpeed(obj22,s);
	
	
	Obj_SetAngle(obj22,atan2(GetY - Obj_GetY(obj22),GetX - Obj_GetX(obj22)));
	
	
	ObjShot_SetBombResist(obj22,true);
	ObjShot_SetGraphic(obj22,190);
	ObjShot_SetDelay(obj22,d);
	

	while(!Obj_BeDeleted(obj22)){yield;
	Obj_SetAutoDelete(obj22,true);
	
  


	
	
	}
  
  
  
  
  }
  ///////
  
}

