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

script_enemy_main {let us=0;
  #include_function ".\AnimationLib.dnh"
 let yh=0;let yu=0;
  let imgNue = GetCurrentScriptDirectory ~ "su.png";
  let cir = GetCurrentScriptDirectory ~ "circle.png";
  let qwe = GetCurrentScriptDirectory ~ "supershot.txt";
  let co=rand_int(1,5);
  let sp1= GetCurrentScriptDirectory ~ "sp13.png";
  let sp2= GetCurrentScriptDirectory ~ "sp2.png";
  let sp22= GetCurrentScriptDirectory ~ "spbg1.png";
  let spn= GetCurrentScriptDirectory ~ "sn9.png";
  
  
  let rtt=0;
   let Cut = GetCurrentScriptDirectory ~ "sucut2.png";
 #include_function ".\function_cutin.txt"
 //#include_function ".\fam1.txt"
  #include_function ".\Halo.txt"
   let imagefile4 = GetCurrentScriptDirectory ~ "1q.png";
  @Initialize { 
      SetEffectForZeroLife(120,40,1);
  //CreateAura01("RED",0,2);
   LoadUserShotData(qwe);
    SetLife(4000);
	SetTimer(95);
    //SetY(-120);
	yim;
    LoadGraphic(imgNue);
    LoadGraphic(cir);
    LoadGraphic(Cut);
    LoadGraphic(imagefile4);
    LoadGraphic(sp1);
    LoadGraphic(spn);
    LoadGraphic(sp2);
    LoadGraphic(sp22);
    // SetDurableSpellCard;
	
    InitializeAnimationData;
	  MagicCircle(false);
	  
	  //
 PlayMusic(GetCurrentScriptDirectory ~ ".\Sounds\boss2.mp3");
    Animate("nue", "idle", true);
   mus;
    ShowOffNueAnimation;
    // CreateAura01;
  }
  
  let angu=0;
  let angu2=0;
  
  task spir{
  
  
  
 
	   Animate("nue", "start cast", false);
	   
	 wait(20);	
	  task kk{wait(60);
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);}
		kk;
  
  loop(120){
  
  	PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  CreateShot01(GetX,GetY,1.4,180+angu,31,15);
  CreateShot01(GetX,GetY,1.4,0+angu,31,15);
  angu+=angu2;
  angu2+=0.5;
  wait(5);
  }
  
  
  
  loop(20){
  
  	PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  CreateShot01(GetX,GetY,1,angu,28,15);
  CreateShot01(GetX,GetY,0.5,angu+45,28,15);
 
  angu+=360/20;
  
  }PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  loop(10){
  
  	
  CreateShot01(GetX,GetY,1.3,angu,28,15);
  CreateShot01(GetX,GetY,0.65,angu+45,28,15);
 
  angu+=360/10;
  
  }
  
  
  }
  
  
  
  task yim{loop{yield;
  
   if(GetTimer<11&&GetTimer>=0){PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_timeout.wav");wait(60);}
 
  }}let dam=0;
  @MainLoop {
   yield ;

   if(dam==0){SetDamageRate(0,0);}
   if(dam==1){SetDamageRate(10,7);}
   
  SetCollisionA(GetX,GetY,10);
  SetCollisionB(GetX,GetY,10);
   
    }
  let wave=0;
  let x=0;
  
  let xx=0;
  let aa=0;
  let yy=0;
  
  task u{
  b;
  c;
  
  
  task c{
  wait(70);
  loop(13){
  yield;
  yy+=8;
  }
  
  loop(10){
  yield;
  yy+=4;
  }
  loop(5){
  yield;
  yy+=3;
  }
  
  loop(10){
  yield;
  yy+=2;
  }
  
  
  loop(10){
  yield;
  yy+=1;
  }
  
  
  
  
  
  
  }
  
  
  
  task b{
  
  loop(60){
  yield;
  xx+=6;
  }
  }
  task a{
  loop(60){yield;
  ss+=0.011111;
  }
  }
  
  a;
  loop(90){
  yield;
  aa+=2.8;
  }
  
  
  
  }let ss=0;let h=0;
  @DrawLoop {
  
  
  
	 
   
	    SetTexture(cir);SetAlpha(210);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(2+sin(wave)*0.2,2+sin(wave)*0.2);

wave+=3;x+=5;
	SetGraphicAngle(0, 0, x);
	DrawGraphic(GetX,GetY);
  
  
	 
	 
	 
     SetTexture(spn);SetAlpha(aa);
 SetGraphicRect(0,0,1054,80);
	
	SetGraphicScale(1.05-ss,1.05-ss);


	SetGraphicAngle(0,-xx, 0);
	DrawGraphic(GetCenterX,GetCenterY-yy);
	 
	 lasang+=0.01;
  
      
  
  SetTexture(imgNue);SetAlpha(255);
 SetGraphicRect(0,0,0,0);
	
	SetGraphicScale(1,1);


	SetGraphicAngle(la, 0, 0);
	DrawGraphic(GetX,GetY);
        DrawAnimatedSprite("nue", GetX, GetY-5*sin(h));
  

   h+=4;
   
   
  
  
  
  
  
  }
  task mus{PlayMusic(GetCurrentScriptDirectory ~ ".\Sounds\Nue1.mp3");}
  
  let col=0;
  
   @BackGround{
  
 
	 
	
  
   SetAlpha(255);
   SetTexture(imagefile4);SetColor(255,255,255);
      SetGraphicRect(0, 0, 1111, 1111);
SetGraphicScale(1,1);
      SetGraphicAngle(0, 0,180);
      DrawGraphic(GetCenterX,GetCenterY);
  
      SetTexture(sp1);SetAlpha(255);
 
	SetGraphicRect(0,0,384,448);
	SetGraphicScale(1,1);


	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX,GetCenterY);
	
	
	
	
	
	
	
	
  
   SetAlpha(67); SetColor(255,255,255);SetRenderState(ALPHA);
   SetTexture(sp22);SetColor(255,255,255);
      SetGraphicRect(0, 0, 1111, 1111);
SetGraphicScale(2,2);
      SetGraphicAngle(0, 0,x/24);
      DrawGraphic(GetCenterX-533,GetCenterY-133);
	  
	  col+=4;
	  
	  
	   SetTexture(sp2);
	SetColor(200+cos(col)*3,130+cos(col)*2,160+cos(col));
	 SetAlpha(255);
 SetRenderState(ALPHA);
	SetGraphicRect(0,0,-684-cx,848);
	SetGraphicScale(1,1);
	

cx+=1;
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX,GetCenterY);
	  
	  
	    SetTexture(sp2);
	SetColor(200+cos(col)*3,130+cos(col)*2,160+cos(col));
	 SetAlpha(110);
 SetRenderState(ALPHA);
	SetGraphicRect(0,0,-684-cx/1.434567,848);
	SetGraphicScale(1,1);
	

cx+=1;
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX,GetCenterY-50);
	  
	
  }
  
  let cx=0;
  let cx2=0;
  
  
  @Finalize {
  DeleteMusic(GetCurrentScriptDirectory ~ ".\Sounds\boss2.mp3");
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_enep01.wav");
    DeleteGraphic(imgNue);
   
  }
  
  
 let su=0;
  

  
  task ShowOffNueAnimation {
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_fault.wav");
  
  
  
  
  
  
  
  
  
  
  
  //wait(60);
   if(GetX>GetCenterX){la=180;
	SetMovePosition03(GetCenterX, GetCenterY-50, 13, 3);
     Animate("nue", "start move right", false);}
	   if(GetX<GetCenterX){
	SetMovePosition03(GetCenterX, GetCenterY-50, 13, 3);
     Animate("nue", "start move right", false);}
	    if(GetX==GetCenterX){
	SetMovePosition03(GetCenterX, GetCenterY-50, 13, 3);
      Animate("nue", "start move right", false);}
      yield ;
	  la=0;
      while(GetSpeed>0.1){yield;}
wait(50);
Animate("nue", "stop move right", false);
wait(20);
      Animate("nue", "start cast", false);
	  wait(20);
	  
	  SetScore(30000);
	  u;
	  cutin("NAZRIN", "",Cut,0,0,256,512);dam=1;
	  //PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_boon01.wav");
	    
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cat00.wav");
		
		 wait(20); 
		  Animate("nue", "stop cast", false);
	  wait(20);
	   Animate("nue", "idle", true);
	   
	   wait(60);
	   
	   
	   SetMovePosition03(GetCenterX, GetCenterY-80, 13, 4);
	   SetNueMoveAnimation("right");
	   
	
	   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");

	 Concentration02(30);
 Concentration02(40);
 Concentration02(30);let fg=0;
 Concentration02(40);
 Concentration02(30);let anga=0;
 Concentration02(40);
 while(GetSpeed>0.1){yield;}
	  
	wait(100);
	  
	 
	  
	  
	   Animate("nue", "start cast", false);
	   ty=rand(-8,8);
	   
	 wait(20);
	
	blow(0);
	wait(300);
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);
		
let gggg=0;	  
	  
	 
	 wait(100);
	  
	 
	  
	  
	   Animate("nue", "start cast", false);
	   ty=rand(-8,8);
	   
	 wait(20);
	
	blow(30);
	wait(300);
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);
		
let gggg=0;	  


 wait(100);
	  
	 
	  
	  
	   Animate("nue", "start cast", false);
	   ty=rand(-8,8);
	   
	 wait(20);
	
	blow(60);
	wait(300);
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);
		
let gggg=0;	  
	   
	   
	    wait(20); wait(20); wait(20);wait(20);wait(20);
	    wait(20); wait(20); wait(20);wait(20);wait(20);
	   
	   
	   SetMovePosition03(GetCenterX, GetCenterY, 13, 4);
	   SetNueMoveAnimation("right");
	   
	
	   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");

	 Concentration02(30);
 Concentration02(40);
 Concentration02(30);let fg=0;
 Concentration02(40);
 Concentration02(30);let anga=0;
 Concentration02(40);
 while(GetSpeed>0.1){yield;}
	  
	wait(100);
	  
	 
	  
	  
	   Animate("nue", "start cast", false); 
	   
	 
	    Animate("nue", "start cast", false);
	   
	   
	 wait(20);
	
	cicles(GetX+75,GetY+75);
	cicles(GetX+75,GetY-75);
	cicles(GetX-75,GetY-75);
	cicles(GetX-75,GetY+75);
	
	
	
	cicles2(GetClipMinX+30,GetClipMinY+30);
	cicles2(GetClipMinX+30,GetClipMaxY-30);
	cicles2(GetClipMaxX-30,GetClipMinY+30);
	cicles2(GetClipMaxX-30,GetClipMaxY-30);
	
	
	
	wait(120);gggg+=45;
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);
	   
	   wait(180);
	   
	   spir;
	   
	   
	   wait(600);
	   
	   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");

	 Concentration02(30);
 Concentration02(40);
 Concentration02(30);let fg=0;
 Concentration02(40);
 Concentration02(30);let anga=0;
 Concentration02(40);
	   wait(100);
	   
	   
	   let gdgd=0;
 
	   Animate("nue", "start cast", false);
	   sta;
	 wait(20);	 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
	 
	gdgd=rand(20,50);
	 polus(270-gdgd,270+gdgd);graa+=-1;
	
	  wait(60);
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);
		
  wait(180);
  
     Animate("nue", "start cast", false);
	   
	 wait(20);	 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");wa2=30;
	 gdgd=rand(20,50);
	 polus(270-gdgd,270+gdgd);graa+=-1;
	
	  wait(60);
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);
		
  wait(180);
  
     Animate("nue", "start cast", false);
	   
	 wait(20);	 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");wa2=40;
	gdgd=rand(20,50);
	 polus(270-gdgd,270+gdgd);graa+=-1;
	
	  wait(60);
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);
		
  wait(620);
  che=1;
	   
	   
	   ////////
	   
  wait(80);
   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");

	 Concentration02(30);
 Concentration02(40);
 Concentration02(30);let fg=0;
 Concentration02(40);
 Concentration02(30);let anga=0;
 Concentration02(40);
	   wait(100);
	   
     Animate("nue", "start cast", false);
	   
	 wait(20);	 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");wa2=40;
	 
	 //let ffff=0;
	 //ffff=rand(60,-60);
	 bar(270+60);
	 bar(270+60+180);
	 bar(270-60);
	 bar(270-60+180);
	 
	 
	
	  wait(60);
	   Animate("nue", "stop cast", false);
	   wait(20);
	    Animate("nue", "idle", true);
	   
	   
	   
blo;
	   kru;
	   loop(30){
	   
	   
	   
	   
	   
	   
	  
	    laser(lasang+90);
	   laser(lasang+90+90);
	   laser(lasang+90+90+90);
	   laser(lasang+90+90+90+90);
	   
	   
	   
	   wait(120);
	   
	   
	    laser2(lasang+90);
	   laser2(lasang+90+90);
	   laser2(lasang+90+90+90);
	   laser2(lasang+90+90+90+90);
	   
	   
	   
	   wait(120);
	   
	   
	   }
	   
	   
	   che=2;
	   
	   
	   
	   
	   
  }let graa=0;
  let mm3=0;
  let xs=0;
  let ys=0;
  
  //blow;
  let anan=0;
  let anan2=0;
  xs=0;ys=0;
  
  
  
  
  
  let ty=0;

  let la=0;
  task SetNueMoveAnimation(direction) {
    if(direction == "left"){la=180;
     Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){
        yield ;
      }
      Animate("nue", "stop move right", false);
    }
    if(direction == "right"){la=0;
      Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){
        yield ;
      }
      Animate("nue", "stop move right", false);
    }
    wait(12);
    Animate("nue", "idle", true);
  }
  
  function wait(t){
    loop(t){yield;}
  }
  
  sub InitializeAnimationData {
    CreateAnimation("nue", "idle", 8);
    SetAnimationFrame("nue", "idle", 0, imgNue, 8, 14, 0, 51, 65);
    SetAnimationFrame("nue", "idle", 1, imgNue, 8, 77, 0, 114, 65);
    SetAnimationFrame("nue", "idle", 2, imgNue, 8, 141, 0, 177, 65);
    SetAnimationFrame("nue", "idle", 3, imgNue, 8, 205, 0, 240, 64);
	
    SetAnimationFrame("nue", "idle", 4, imgNue, 8, 205, 0, 240, 64);
    SetAnimationFrame("nue", "idle", 5, imgNue, 8, 141, 0, 177, 65);
	 SetAnimationFrame("nue", "idle", 6, imgNue, 8, 77, 0, 114, 65);
	 SetAnimationFrame("nue", "idle", 7, imgNue, 8, 14, 0, 51, 65);
	
	
    CreateAnimation("nue", "start move right", 4);
    SetAnimationFrame("nue", "start move right", 0, imgNue, 8, 12, 65, 54, 125);
    SetAnimationFrame("nue", "start move right", 1, imgNue, 8, 75, 65, 118, 125);
    SetAnimationFrame("nue", "start move right", 2, imgNue, 1, 139, 65, 182, 122);
    SetAnimationFrame("nue", "start move right", 3, imgNue, 8, 203, 65, 246, 122);
    
    CreateAnimation("nue", "stop move right", 4);
    SetAnimationFrame("nue", "stop move right", 0, imgNue, 4, 203, 65, 246, 122);
    SetAnimationFrame("nue", "stop move right", 1, imgNue, 4, 139, 65, 182, 122);
    SetAnimationFrame("nue", "stop move right", 2, imgNue, 4, 75, 65, 118, 125);
    SetAnimationFrame("nue", "stop move right", 3, imgNue, 4, 12, 65, 54, 125);
    
	
	
	
    CreateAnimation("nue", "start move left", 4);
    SetAnimationFrame("nue", "start move left", 0, imgNue, 8, 203, 195, 245, 255);
    SetAnimationFrame("nue", "start move left", 1, imgNue, 8, 139, 195, 182, 255);
    SetAnimationFrame("nue", "start move left", 2, imgNue, 2, 75, 195, 118, 253);
    SetAnimationFrame("nue", "start move left", 3, imgNue, 8, 11, 195, 54, 252);
    
    CreateAnimation("nue", "stop move left", 4);
    SetAnimationFrame("nue", "stop move left", 0, imgNue, 4, 11, 195, 54, 252);
    SetAnimationFrame("nue", "stop move left", 1, imgNue, 4,75, 195, 118, 253);
    SetAnimationFrame("nue", "stop move left", 2, imgNue, 4, 139, 195, 182, 255);
    SetAnimationFrame("nue", "stop move left", 3, imgNue, 4,  203, 195, 245, 255);
    
    CreateAnimation("nue", "start cast", 4);
    SetAnimationFrame("nue", "start cast", 0, imgNue, 4, 13,130,51,189);
    SetAnimationFrame("nue", "start cast", 1, imgNue, 4, 81,130,109,191);
    SetAnimationFrame("nue", "start cast", 2, imgNue, 4, 146,130,174,190);
    SetAnimationFrame("nue", "start cast", 3, imgNue, 4, 210,130,238,189);
    
    
    CreateAnimation("nue", "stop cast", 4);
    SetAnimationFrame("nue", "stop cast", 0, imgNue, 4, 210,130,238,189);
    SetAnimationFrame("nue", "stop cast", 1, imgNue,  4, 146,130,174,190);
    SetAnimationFrame("nue", "stop cast", 2, imgNue, 4, 81,130,109,191);
    SetAnimationFrame("nue", "stop cast", 3, imgNue,  4, 13,130,51,189);
 
  }
  
  let wa=500;
  let wa2=20;
  
  task blo{
  
  
  
  wait(555);
  loop{
  
  
  
   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
  
  loop(15){
  
  	
  CreateShot01(GetX,GetY,1,angu+angu2,67,10);
  
 
  angu+=360/15;
  
  }
  
  angu2+=19.63345345;
  wait(60);
  
  }
  
  
  
  }
  
  let che=0;
  task sta{
  wait(20);
  while(che!=1){yield;
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  
  loop(15){
  
  	
  CreateShot01(GetX,GetY,1.2,angu+angu2,11,10);
  
 
  angu+=360/15;
  
  }angu2+=8.4645;
  
  wait(wa2);
  }}
  
  let anna=0;
  let anna2=0;
  
  task blow(nap){

  
  tre(2,90+nap,90);
  tre(2,90+nap,-90);
 
  tre(2,90+90+nap,90);
  tre(2,90+90+nap,-90);


  tre(2,90+90+90+nap,90);
  tre(2,90+90+90+nap,-90);

  tre(2,90+90+90+90+nap,90);
  tre(2,90+90+90+90+nap,-90);

  anna2+=17.56;
  task tre(sp,an,az){
  
  let ggg=0;
  task sss{
 
let obj2=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj2,Obj_GetX(obj));
	Obj_SetY(obj2,Obj_GetY(obj));
	Obj_SetSpeed(obj2,0);
	Obj_SetAngle(obj2,ggg);
	ObjShot_SetBombResist(obj2,true);
	ObjShot_SetGraphic(obj2,249);
	ObjShot_SetDelay(obj2,10);
	

	while(!Obj_BeDeleted(obj2)){yield;
	Obj_SetAutoDelete(obj2,true);
	
	if(Obj_GetX(obj2)<GetCenterX){
	ggg+=8.54;}
	if(Obj_GetX(obj2)==GetCenterX){
	ggg+=8.54;}
	if(Obj_GetX(obj2)>GetCenterX){
	ggg+=-8.54;}
	
	wait(180);
loop(10){wait(5);
Obj_SetSpeed(obj2,Obj_GetSpeed(obj2)+0.1);
}
	break;
	//ObjShot_FadeDelete(obj2);
	
	}
  
  }
  
  //let ty=1;
let obj=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj,GetX);
	Obj_SetY(obj,GetY);
	Obj_SetSpeed(obj,sp);
	Obj_SetAngle(obj,an);
	ObjShot_SetBombResist(obj,true);
	ObjShot_SetGraphic(obj,203);
	ObjShot_SetDelay(obj,10);
	
dfdf;
task dfdf {

wait(60);
loop{


Obj_SetAngle(obj,Obj_GetAngle(obj)+az);
wait(50);

loop(10){wait(2);
Obj_SetSpeed(obj,Obj_GetSpeed(obj)-0.2);
}
//wait(20);
Obj_SetAngle(obj,Obj_GetAngle(obj)+az-rtt);
loop(20){wait(3);

if(az==90){

Obj_SetAngle(obj,Obj_GetAngle(obj)+1);}



if(az==-90){

Obj_SetAngle(obj,Obj_GetAngle(obj)-1);}



loop(20){wait(3);

if(az==90){

Obj_SetAngle(obj,Obj_GetAngle(obj)+5);}



if(az==-90){

Obj_SetAngle(obj,Obj_GetAngle(obj)-5);}

Obj_SetSpeed(obj,Obj_GetSpeed(obj)+0.2);
}





}


break;
//ObjShot_FadeDelete(obj);
}





}
	while(!Obj_BeDeleted(obj)){yield;
	Obj_SetAutoDelete(obj,true);
  wait(2);
  sss;
	
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
	

      


	
	
	}
  
  
  
  }
  
  
  
  let az=0;
  let assa=14;
  let spp=0;
  
  
  
  
  
  
  
}


let anka=0;

task cicles2(x,y){

 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");

loop(15){

cirq(x,y,anka,0.4,56);
cirq(x,y,anka,0.3,57);
anka+=360/15;
}

}

task cicles(x,y){



loop(15){

cirq(x,y,anka,1,54);
cirq(x,y,anka,0.8,56);
anka+=360/15;
}

}

task cirq(x,y,an,sp,gr){


let obj61=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj61,x);
	Obj_SetY(obj61,y);
	Obj_SetSpeed(obj61,sp);
	Obj_SetAngle(obj61,an);
	ObjShot_SetBombResist(obj61,true);
	ObjShot_SetGraphic(obj61,gr);
	ObjShot_SetDelay(obj61,10);
	
wait(60);
	while(!Obj_BeDeleted(obj61)){yield;
	Obj_SetAutoDelete(obj61,true);
	
	loop(200){
	wait(5);
	
	
	Obj_SetAngle(obj61,Obj_GetAngle(obj61)+4.3);
	
	nak=0.0002;
	}
	break;
	}


}

let nak=5;


let angg=0;
let anggg=0;
task polus(na,na2){
polus2;


task polus2{





task blasta{

PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
loop(20){


  
  
  CreateShot01(Obj_GetX(obj234),Obj_GetY(obj234),rand(0.3,0.8),angg+anggg,134,15);
  
  
  
  CreateShot01(Obj_GetX(obj612),Obj_GetY(obj612),rand(0.3,0.8),angg+anggg,134,15);
 
 	
 
 
 
  angg+=360/20;
  
  
}anggg+=17.34556;

}



let obj234=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj234,GetX);
	Obj_SetY(obj234,GetY);
	Obj_SetSpeed(obj234,1.8);
	Obj_SetAngle(obj234,na2);
	ObjShot_SetBombResist(obj234,true);
	ObjShot_SetGraphic(obj234,199+graa);
	ObjShot_SetDelay(obj234,10);
	
wait(60);
	while(!Obj_BeDeleted(obj234)&&che==0){yield;
	Obj_SetAutoDelete(obj234,true);
	if(Collision_Obj_Obj(obj612,obj234)==true){
	
	
	blasta;
	Obj_SetAngle(obj234,Obj_GetAngle(obj612));
	Obj_SetAngle(obj612,180-Obj_GetAngle(obj612));
	wait(10);
	
	}
	
	
	
	

  if(Obj_GetX(obj234)<GetClipMinX) 
         {Obj_SetAngle(obj234,180-Obj_GetAngle(obj234));
                  
                    }

                    if(Obj_GetX(obj234)>GetClipMaxX) 
         { Obj_SetAngle(obj234,180-Obj_GetAngle(obj234));
		
                    }
     if(Obj_GetY(obj234)<GetClipMinY) 
         { Obj_SetAngle(obj234,-Obj_GetAngle(obj234));
		 
           
                    }
					
					 if(Obj_GetY(obj234)>GetClipMaxY) 
         { Obj_SetAngle(obj234,-Obj_GetAngle(obj234));
		 
           
                    }
	
	
	

}}



let obj612=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj612,GetX);
	Obj_SetY(obj612,GetY);
	Obj_SetSpeed(obj612,1.8);
	Obj_SetAngle(obj612,na);
	ObjShot_SetBombResist(obj612,true);
	ObjShot_SetGraphic(obj612,199+graa);
	ObjShot_SetDelay(obj612,10);
	
wait(60);
	while(!Obj_BeDeleted(obj612)&&che==0){yield;
	Obj_SetAutoDelete(obj612,true);
	
	

  if(Obj_GetX(obj612)<GetClipMinX) 
         {Obj_SetAngle(obj612,180-Obj_GetAngle(obj612));
                  
                    }

                    if(Obj_GetX(obj612)>GetClipMaxX) 
         { Obj_SetAngle(obj612,180-Obj_GetAngle(obj612));
		
                    }
     if(Obj_GetY(obj612)<GetClipMinY) 
         { Obj_SetAngle(obj612,-Obj_GetAngle(obj612));
		 
           
                    }
					
					 if(Obj_GetY(obj612)>GetClipMaxY) 
         { Obj_SetAngle(obj612,-Obj_GetAngle(obj612));
		 
           
                    }
	
	
	
	}




}




task bar(an){


let obj2344=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj2344,GetX);
	Obj_SetY(obj2344,GetY);
	Obj_SetSpeed(obj2344,3);
	Obj_SetAngle(obj2344,an);
	ObjShot_SetBombResist(obj2344,true);
	ObjShot_SetGraphic(obj2344,236);
	ObjShot_SetDelay(obj2344,10);
	trial;
wait(60);
task trial{

task tr(x,y){


let obj23444=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj23444,x);
	Obj_SetY(obj23444,y);
	Obj_SetSpeed(obj23444,0);
	Obj_SetAngle(obj23444,an);
	ObjShot_SetBombResist(obj23444,true);
	ObjShot_SetGraphic(obj23444,157);
	ObjShot_SetDelay(obj23444,10);
	
	wait(120);
ObjShot_FadeDelete(obj23444);
}





  while(!Obj_BeDeleted(obj2344)&&che==1){
 
 
 tr(Obj_GetX(obj2344),Obj_GetY(obj2344));
 
  wait(2)
}

}
	while(!Obj_BeDeleted(obj2344)&&che==1){yield;
	Obj_SetAutoDelete(obj2344,true);
	
	

  if(Obj_GetX(obj2344)<GetClipMinX) 
         {Obj_SetAngle(obj2344,180-Obj_GetAngle(obj2344));
                  
                    }

                    if(Obj_GetX(obj2344)>GetClipMaxX) 
         { Obj_SetAngle(obj2344,180-Obj_GetAngle(obj2344));
		
                    }
     if(Obj_GetY(obj2344)<GetClipMinY) 
         { Obj_SetAngle(obj2344,-Obj_GetAngle(obj2344));
		 
           
                    }
					
					 if(Obj_GetY(obj2344)>GetClipMaxY) 
         { Obj_SetAngle(obj2344,-Obj_GetAngle(obj2344));
		 
           
                    }
	
	
	
	}


}









let lasang=0;
let lasang2=0;
let lasang3=0;
task laser(an){







 let qw1 = Obj_Create(OBJ_LASER);
    // initial settings
   Obj_SetPosition   (qw1, GetX, GetY);
    Obj_SetAngle      (qw1,an+lasang);
    ObjLaser_SetWidth (qw1, -5);
	Obj_SetCollisionToPlayer(qw1,false);
    ObjLaser_SetLength (qw1, 380);
    ObjShot_SetGraphic(qw1, 5);
	//Obj_SetCollisionToPlayer(qw1,false);
    ObjShot_SetDelay(qw1, 15);
    ObjLaser_SetSource(qw1, false);
  let anglel=0;
  del;
  task del{
  wait(120);
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_lazer01.wav");
  loop(20){ObjLaser_SetWidth (qw1, ObjLaser_GetWidth (qw1)+1);wait(1);}
  wait(40);
  ObjShot_FadeDelete(qw1);
  }
  while(!Obj_BeDeleted(qw1)){yield;
	Obj_SetAutoDelete(qw1,true);
	Obj_SetAngle      (qw1,Obj_GetAngle(qw1)+0.2);
	
	}









}




task laser2(an){







 let qw1 = Obj_Create(OBJ_LASER);
    // initial settings
   Obj_SetPosition   (qw1, GetX, GetY);
    Obj_SetAngle      (qw1,an+lasang);
    ObjLaser_SetWidth (qw1, -5);
	Obj_SetCollisionToPlayer(qw1,false);
    ObjLaser_SetLength (qw1, 380);
    ObjShot_SetGraphic(qw1, 2);
	//Obj_SetCollisionToPlayer(qw1,false);
    ObjShot_SetDelay(qw1, 15);
    ObjLaser_SetSource(qw1, false);
  let anglel=0;
  del;
  task del{
  wait(120);
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_lazer01.wav");
  loop(20){ObjLaser_SetWidth (qw1, ObjLaser_GetWidth (qw1)+1);wait(1);}
  wait(40);
  ObjShot_FadeDelete(qw1);
  }
  while(!Obj_BeDeleted(qw1)){yield;
	Obj_SetAutoDelete(qw1,true);
	Obj_SetAngle      (qw1,Obj_GetAngle(qw1)-0.2);
	
	}









}











task kru{

wait(300);

while(che==1){
 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  
  loop(12){
  
  	
  CreateShot01(GetX,GetY,-1.2,angu+angu2,239,10);
  CreateShot01(GetX,GetY,-0.6,angu+angu2,239,10);
  
 
  angu+=360/12;
  
  }angu2+=19.4645;
wait(wawa);

wawa-=4;
if(wawa<30){wawa=30;}
}

}

let wawa=90;
}


////////////////////////////
