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

script_enemy_main { #include_function ".\Halo.txt"let xp=0.5;let ty=0;
  #include_function ".\AnimationLib.dnh"
  let imgNue = GetCurrentScriptDirectory ~ "KE.png";
  let qwe = GetCurrentScriptDirectory ~ "supershot.txt";
 let cir = GetCurrentScriptDirectory ~ "circle.png";
 let cha = GetCurrentScriptDirectory ~ "ch.png";
 let back1= GetCurrentScriptDirectory ~ "bg1.png";
 let back2= GetCurrentScriptDirectory ~ "bg2.png";
 let back3= GetCurrentScriptDirectory ~ "bg3.png";
  @Initialize {CreateAura01("RED",0,2);
  SetCommonData("back",10);
   LoadUserShotData(qwe);
    SetLife(4700);
    
    LoadGraphic(imgNue);
    LoadGraphic(cir);
    LoadGraphic(cha);
    SetTimer(40);
    InitializeAnimationData;
	
  SetCommonData("speed",1);
    Animate("nue", "idle", true);
   mus;
    ShowOffNueAnimation;
    
  }
  
  
  
  
  
  @MainLoop {SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
    yield ;
  }let wave=0;
  let x=0;let y=0;let z=0;let dir=60;let dor=60; let sa=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);
	
	
	
	
   
   //////
   //GetX + dir*cos(dor), GetY + dir*sin(dor);
   

	 
  
  
 
   
    SetTexture(imgNue);SetAlpha(255);SetGraphicScale(1.3,1.3);SetRenderState(ALPHA);
	  SetGraphicAngle(y, x-x, x-x);
	   dor+=6;
    DrawAnimatedSprite("nue", GetX, GetY+5*sin(dor));
  }
  
 
  task mus{PlayMusic(GetCurrentScriptDirectory ~ ".\Sounds\boss3.mp3");}
  @Finalize {
    DeleteGraphic(imgNue);
   
  }
  let angle=270;let sp=0.4;let a=0;let angle2=0;let xx=610;let yy=0;let an=0;let spd=1;
 let as=0;
 let angle23=0;
 let angle55=0;
 task blast{a2+=1;
 //PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_boon01.wav");
 loop(10){

 //136
 a+=4;
 sp+=0.1;
 loop(10){
 if(a2==0){
 CreateShot01(GetX,GetY,0.5+sp,angle2+a,140,0);
 
 }
 
 if(a2==1){
 CreateShot01(GetX,GetY,0.5+sp,angle2-a,140,0);
 
 }
 
 angle2+=360/10;
 
 
 }
 if(a2==2){yield;a2=0;}

 
 
 
 
 }
 sp=0.4;
 }
 task asp{loop(300){yield;as+=0.001;}as=0;}
 let a2=0;
  task ShowOffNueAnimation { 
  
 wait(60);
 SetMovePosition03(GetCenterX, GetCenterY-80, 20, 6);
      Animate("nue", "spin", false);
	  ///
	  
	  
	  ///
      
      yield ;
      while(GetSpeed>0.1){yield;}
		PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration02(40);
 wait(60);
	 
	  wait(20);
 
    wait(20);
	 wait(20);
	  Animate("nue", "spin", false);
	  wait(20);
	 angle55=1;
	//firet;
	
	 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_option.wav");
	CreateEnemyFromScript("fam22",GetX,GetY,0,0,0);
	CreateEnemyFromScript("fam222",GetX,GetY,0,0,0);
	CreateEnemyFromScript("fam2222",GetX,GetY,0,0,0);
	CreateEnemyFromScript("fam22222",GetX,GetY,0,0,0);
	////////////
	
	//////////
	  
	  
	
	 // PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
	  wait(60);
  
	Animate("nue", "idle", false);
	 y=0;yield;
     
      wait(90);
	  SetCommonData("spinn",1);
   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration02(40);
 wait(60);
	 
	  wait(40);
  Animate("nue", "spin", true);
 
  }
  
  task SetNueMoveAnimation(direction) {
  
  }
  
  
  
  
  
 
  task bullet2(x,y,sp,ang){
 
 
 
  
  
  
  
  let obj2166=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj2166,x);
	Obj_SetY(obj2166,y);
	Obj_SetSpeed(obj2166,sp);
	Obj_SetAngle(obj2166,ang);
	ObjShot_SetBombResist(obj2166,true);
	ObjShot_SetGraphic(obj2166,125);
ObjShot_SetDelay(obj2166,5);
	while(!Obj_BeDeleted(obj2166)){yield;
	Obj_SetAutoDelete(obj2166,true);
	
	loop(20){
	Obj_SetSpeed(obj2166,Obj_GetSpeed(obj2166)-Obj_GetSpeed(obj2166)/10);
  wait(5);
  }Obj_SetSpeed(obj2166,0);
  wait(40);
  Obj_SetAngle(obj2166,Obj_GetAngle(obj2166)+ty);
ObjShot_SetGraphic(obj2166,60);
  loop(290){Obj_SetAngle(obj2166,Obj_GetAngle(obj2166)-1);
	Obj_SetSpeed(obj2166,Obj_GetSpeed(obj2166)+0.03);
  wait(1);
  }break;
  
  
  
  }}
  
  
  function wait(t){
    loop(t){yield;}
  }
  
sub InitializeAnimationData {
 CreateAnimation("nue", "idle", 4);
    SetAnimationFrame("nue", "idle", 0, imgNue,38, 17, 3, 48, 62);
    SetAnimationFrame("nue", "idle", 1, imgNue,38, 81, 3, 112, 62);
    SetAnimationFrame("nue", "idle", 2, imgNue,38, 145, 3, 176, 62);
    SetAnimationFrame("nue", "idle", 3, imgNue,38, 209, 3, 240, 62);
  
   
    
    CreateAnimation("nue", "spin", 8);
  SetAnimationFrame("nue", "spin", 0, imgNue, 8, 17,68, 48, 125);
	SetAnimationFrame("nue", "spin", 1, imgNue, 8, 81,68, 112, 125);
	
	SetAnimationFrame("nue", "spin", 2, imgNue, 8, 145,68, 176, 125);
	SetAnimationFrame("nue", "spin", 3, imgNue, 8, 209,68, 240, 125);
	
	SetAnimationFrame("nue", "spin", 4, imgNue, 8, 16,131, 47, 187);
	
	SetAnimationFrame("nue", "spin", 5, imgNue, 8, 80,131, 111, 189);
	
	SetAnimationFrame("nue", "spin", 6, imgNue, 8, 144,131, 175, 188);
	SetAnimationFrame("nue", "spin", 7, imgNue, 8, 209,131, 240, 190);
    
	
   
   
    
   

  
  }
}




////////


script_enemy fam22{let fi=0;
    let gr = GetCurrentScriptDirectory ~ "circle2.png";
  let dir=0;
  let r=80;
  @Initialize{
  SetLife(2000);foi;
  LoadGraphic(gr);
  main;
  }
  @MainLoop{yield;
  
  }
  @DrawLoop{
   SetTexture(gr);SetAlpha(150);
 SetGraphicAngle(0,0,-dir*2);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0.5,0.5);
	DrawGraphic(GetX,GetY);
	
	SetTexture(gr);SetAlpha(130);
 SetGraphicAngle(0,0,dir);
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0.3,0.3);
	DrawGraphic(GetX,GetY);
	

  }
  @Finalize{
  
  }
  let angle=0;
  task main{
  fire;
  
   fir22;
  loop{yield;
  
  SetMovePosition03(GetEnemyX+90*cos(dir),GetEnemyY+90*sin(dir),15,23);
  dir+=2;
  
  }
  
   loop(180){yield; dir+=2;
  }}
  let angle2=0;
  task f{
  
  fi=1;
  
  }
  task fg{
  loop{yield;a++;}
  }
  let a=0;let s=0;let g=0;
  
  task fir2{
  wait(240);
  
  
  
  
  
  
  }
  //
  let s2=0;
  let a2=0;
  
   task fir22{
  wait(240);
 
  
  
  
  
  
  }
  
  let aq=0;
  //
  
  
  
  task fir{
  
  loop{
  
  yield;
  wait(2);aq+=8.7563;
    PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
	
	
  
 
  CreateShot01(GetX,GetY,1.8,aq+90+90+90,103,0);
 
  
  
  
  }
  
  
  }
 let yu=0;let yu2=0;
 
 
 task foi{
 wait(180);
 loop{yield;
 if(GetCommonData("spinn")==1){
 	
 wait(60);
	 
	  wait(40);
 
 loop{
 
wait(10);
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan00.wav");
  loop(4){
  CreateShot01(GetEnemyX,GetEnemyY,2,yu-yu2,30,10);
  CreateShot01(GetEnemyX,GetEnemyY,2,yu+yu2,30,10);
  
  yu+=360/4;
  }yu2+=-16.85;
  
  
 }
 wait(120);
 
 
 }}break;}
 
 
 
  task fire{
  
  fir;
  fir2;
  loop{
  yield;
  wait(5);
  
  CreateShot01(GetX,GetY,3,3,176,20);
  }
  }
  
   function wait(t){
    loop(t){yield;}
  }
  }
  


  

////////


script_enemy fam222{let fi=0;
    let gr = GetCurrentScriptDirectory ~ "circle2.png";
  let dir=0;
  let r=80;
  @Initialize{
  SetLife(2000);
  LoadGraphic(gr);
  main;
  }
  @MainLoop{yield;
  
  }
  @DrawLoop{
   SetTexture(gr);SetAlpha(150);
 SetGraphicAngle(0,0,-dir*2);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0.5,0.5);
	DrawGraphic(GetX,GetY);
	
	SetTexture(gr);SetAlpha(130);
 SetGraphicAngle(0,0,dir);
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0.3,0.3);
	DrawGraphic(GetX,GetY);
	

  }
  @Finalize{
  
  }
  let angle=0;
  task main{
  fire;
  
   fir22;
  loop{yield;
  
  SetMovePosition03(GetEnemyX+90*sin(dir),GetEnemyY-90*cos(dir),15,23);
  dir+=2;
  
  }
  
   loop(180){yield; dir+=2;
  }}
  let angle2=0;
  task f{
  
  fi=1;
  
  }
  task fg{
  loop{yield;a++;}
  }
  let a=0;let s=0;let g=0;
  
  task fir2{
  wait(240);
  
  
  
  
  
  
  }
  //
  let s2=0;
  let a2=0;
  
   task fir22{
  wait(240);
 
  
  
  
  
  
  }
  
  let aq=0;
  //
  
  
  
  task fir{
  
  loop{
  
  yield;
 wait(2);aq+=8.7563;
    PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
	
	
  
 
  CreateShot01(GetX,GetY,1.8,aq+90+90,103,0);
  
  
  }
  
  
  }
 let yu=0;let yu2=0;
 
 
 
 
  task fire{
  
  fir;
  fir2;
  loop{
  yield;
  wait(5);
  
  CreateShot01(GetX,GetY,3,3,176,20);
  }
  }
  
   function wait(t){
    loop(t){yield;}
  }
  }
  
////////

  


script_enemy fam2222{let fi=0;
    let gr = GetCurrentScriptDirectory ~ "circle2.png";
  let dir=0;
  let r=80;
  @Initialize{
  SetLife(2000);
  LoadGraphic(gr);
  main;
  }
  @MainLoop{yield;
  
  }
  @DrawLoop{
   SetTexture(gr);SetAlpha(150);
 SetGraphicAngle(0,0,-dir*2);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0.5,0.5);
	DrawGraphic(GetX,GetY);
	
	SetTexture(gr);SetAlpha(130);
 SetGraphicAngle(0,0,dir);
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0.3,0.3);
	DrawGraphic(GetX,GetY);
	

  }
  @Finalize{
  
  }
  let angle=0;
  task main{
  fire;
  
   fir22;
  loop{yield;
  
  SetMovePosition03(GetEnemyX-90*cos(dir),GetEnemyY-90*sin(dir),15,23);
  dir+=2;
  
  }
  
   loop(180){yield; dir+=2;
  }}
  let angle2=0;
  task f{
  
  fi=1;
  
  }
  task fg{
  loop{yield;a++;}
  }
  let a=0;let s=0;let g=0;
  
  task fir2{
  wait(240);
  
  
  
  
  
  
  }
  //
  let s2=0;
  let a2=0;
  
   task fir22{
  wait(240);
 
  
  
  
  
  
  }
  
  let aq=0;
  //
  
  
  
  task fir{
  
  loop{
  
  yield;
  wait(2);aq+=8.7563;
    PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
	
	
  
 
  CreateShot01(GetX,GetY,1.8,aq+90,103,0);
  
  
  }
  
  
  }
 let yu=0;let yu2=0;
 
 
 
 
  task fire{
  
  fir;
  fir2;
  loop{
  yield;
  wait(5);
  
  CreateShot01(GetX,GetY,3,3,176,20);
  }
  }
  
   function wait(t){
    loop(t){yield;}
  }
  }
  
////////

  


script_enemy fam22222{let fi=0;
    let gr = GetCurrentScriptDirectory ~ "circle2.png";
  let dir=0;
  let r=80;
  @Initialize{
  SetLife(2000);
  LoadGraphic(gr);
  main;
  }
  @MainLoop{yield;
  
  }
  @DrawLoop{
   SetTexture(gr);SetAlpha(150);
 SetGraphicAngle(0,0,-dir*2);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0.5,0.5);
	DrawGraphic(GetX,GetY);
	
	SetTexture(gr);SetAlpha(130);
 SetGraphicAngle(0,0,dir);
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0.3,0.3);
	DrawGraphic(GetX,GetY);
	

  }
  @Finalize{
  
  }
  let angle=0;
  task main{
  fire;
  
   fir22;
  loop{yield;
  
  SetMovePosition03(GetEnemyX-90*sin(dir),GetEnemyY+90*cos(dir),15,23);
  dir+=2;
  
  }
  
   loop(180){yield; dir+=2;
  }}
  let angle2=0;
  task f{
  
  fi=1;
  
  }
  task fg{
  loop{yield;a++;}
  }
  let a=0;let s=0;let g=0;
  
  task fir2{
  wait(240);
  
  
  
  
  
  
  }
  //
  let s2=0;
  let a2=0;
  
   task fir22{
  wait(240);
 
  
  
  
  
  
  }
  
  let aq=0;
  //
  
  
  
  task fir{
  
  loop{
  
  yield;
  wait(2);aq+=8.7563;
    PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
	
	
  
 CreateShot01(GetX,GetY,1.8,aq,103,0);
  
  
  
  }
  
  
  }
 let yu=0;let yu2=0;
 
 
 
 
  task fire{
  
  fir;
  fir2;
  loop{
  yield;
  wait(5);
  
  CreateShot01(GetX,GetY,3,3,176,20);
  }
  }
  
   function wait(t){
    loop(t){yield;}
  }
  }
  
////////

  






