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

script_enemy_main {

task tal{
  loop{
  yield;
  if(GetCommonData("spell")==3){
  if(GetLife<200){SetLife(2000);SetTimer(30);
     SetCommonData("spell",4);
  
  break;
  }
  
  if(GetTimer<1){SetTimer(30);SetLife(2000); SetCommonData("spell",4);
  
  break;}
  
  }
  
  }
  }

SetCommonData("samove",0);
SetCommonData("sumove",0);
  #include_function ".\AnimationLib.dnh"
  #include_function ".\Halo.txt"
  let imgNue = GetCurrentScriptDirectory ~ "sa.png";
  let imgNue2 = GetCurrentScriptDirectory ~ "sa.png";
  let cir = GetCurrentScriptDirectory ~ "circle.png";
  let qwe = GetCurrentScriptDirectory ~ "supershot.txt";
  #include_function ".\function_cutin.txt"
  let Cut = GetCurrentScriptDirectory ~ "sasucut.png";
  let sp1= GetCurrentScriptDirectory ~ "sp2.png";
  let sp2= GetCurrentScriptDirectory ~ "bgsa.png";
  let sp22= GetCurrentScriptDirectory ~ "spbg1.png";
  let spn= GetCurrentScriptDirectory ~ "sn5.png";
  let spn2= GetCurrentScriptDirectory ~ "sn6.png";
    let spn3= GetCurrentScriptDirectory ~ "sn7.png";
  let spn23= GetCurrentScriptDirectory ~ "sn8.png";
 
  @Initialize {
  tal;
    LoadGraphic(sp1);
    LoadGraphic(spn);
    LoadGraphic(spn3);
    LoadGraphic(spn2);
    LoadGraphic(spn23);
    LoadGraphic(sp2);
    LoadGraphic(sp22);
  
  //CreateAura01("RED",0,1);
   LoadUserShotData(qwe);
    SetLife(2000);
    //SetY(-120);
    LoadGraphic(imgNue);
    LoadGraphic(Cut);
    LoadGraphic(imgNue2);
    LoadGraphic(cir);
    //PlayMusic(GetCurrentScriptDirectory ~ ".\Sounds\Nue.mp3");
    InitializeAnimationData;
	SetTimer(70);
    MagicCircle(false);
    Animate("nue", "idle", true);
   mus;
    ShowOffNueAnimation;
  
  }let aq=0;
  let aaaa=0;
  let anglet=0;
  let anglet2=0;
   let dam=0;
  @MainLoop {
  
  SetDamageRate(25,8);
  
  
  SetCollisionA(GetX,GetY,10);
  SetCollisionB(GetX,GetY,10);
    yield ;
  }
  let wave=0;
  let x=0;let h=0;let cha=0;
  @DrawLoop {
     
	 
	 if(cha==0){SetTexture(imgNue);}
	 if(cha==1){SetTexture(imgNue2);}
	 
	 
	 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;
   
	    SetTexture(cir);SetAlpha(230+aaaa);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(2+aq+sin(wave)*0.2,2+aq+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.02-ss,1.02-ss);


	SetGraphicAngle(0,-xx, ann2);
	DrawGraphic(GetCenterX,GetCenterY-yy-15);
	
	
     SetTexture(spn2);SetAlpha(aa);
 SetGraphicRect(0,0,1054,80);
	
	SetGraphicScale(1.02-ss,1.02-ss);


	SetGraphicAngle(0,-xx, ann);
	DrawGraphic(GetCenterX,GetCenterY-yy+20);
	
	
	
	 
     SetTexture(spn3);SetAlpha(aa2);
 SetGraphicRect(0,0,1054,80);
	
	SetGraphicScale(1.02-ss2,1.02-ss2);


	SetGraphicAngle(0,-xx2, 0);
	DrawGraphic(GetCenterX,GetCenterY-yy2-15);
	
	
     SetTexture(spn23);SetAlpha(aa2);
 SetGraphicRect(0,0,1054,80);
	
	SetGraphicScale(1.02-ss2,1.02-ss2);


	SetGraphicAngle(0,-xx2, 0);
	DrawGraphic(GetCenterX,GetCenterY-yy2+20);
	 
	 

   
  }
  let ann=0;
  let ann2=0;
  let xx2=0;
  let aa2=0;
  let ss2=0;
  let yy2=0;
  task del{
  
   loop(90){
  yield;
  aa+=-2.8;
  ann+=0.4;
  ann2+=-1;
  
  yy+=-2;
  }
  //DeleteGraphic(spn);
  //DeleteGraphic(spn2);
  
  }
  
  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;
  }
  
  
  
  }
  
  
  
  //
  
  
  task u2{
  b;
  c;
  
  
  task c{
  wait(70);
  loop(13){
  yield;
  yy2+=8;
  }
  
  loop(10){
  yield;
  yy2+=4;
  }
  loop(5){
  yield;
  yy2+=3;
  }
  
  loop(10){
  yield;
  yy2+=2;
  }
  
  
  loop(10){
  yield;
  yy2+=1;
  }
  
  
  
  
  
  
  }
  
  
  
  task b{
  
  loop(60){
  yield;
  xx2+=6;
  }
  }
  task a{
  loop(60){yield;
  ss2+=0.011111;
  }
  }
  
  a;
  loop(90){
  yield;
  aa2+=2.8;
  }
  
  
  
  }
  
  
  
  
  
  
  
  
  let yy=0;
  let aa=0;
  let ss=0;
  let xx=0;
  let col=0;
  @BackGround{
  
  
  
      SetTexture(sp2);SetAlpha(255);
 
	SetGraphicRect(0,0,384,448);
	SetGraphicScale(1,1);


	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX,GetCenterY);
	
	
	   SetTexture(sp1);
	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(sp1);
	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;
  
  task mus{PlayMusic(GetCurrentScriptDirectory ~ ".\Sounds\Nue1.mp3");}
  @Finalize {
    DeleteGraphic(imgNue);
   
  }
  let angle=270;let sp=3;let a=0;let angle2=0;
 
 task gh{
 loop(110){
 aaaa+=-2;
 aq+=-0.02;
 
 wait(1);
 
 }
 
 }
 
 task gh2{
 loop(110){
 aaaa+=2;
 aq+=0.02;
 
 wait(1);
 
 }
 
 }
 
 
 
 task ras{
 
 loop{
 
  if(GetCommonData("spell")==1){
 CreateShot01(GetX,GetY,4,GetAngle-90+rand(-20,20),12,10);
 CreateShot01(GetX,GetY,3,GetAngle-90+rand(-20,20),12,10);
 CreateShot01(GetX,GetY,2,GetAngle-90+rand(-20,20),12,10);
 CreateShot01(GetX,GetY,1,GetAngle-90+rand(-20,20),12,10);}
 
  if(GetCommonData("spell")==3){
  
  break;}
 wait(2);
 }
 
 }
 
 
 task show2{
 
 loop{
 yield;
 
 if(GetTimer==0){SetTimer(70);SetLife(2000);SetCommonData("spell",3);
 break;
 }
 if(GetLife<200){SetLife(2000);SetTimer(70);SetCommonData("spell",3);
 break;}
 
 
 
 }
 
 }
 task show{
 
 show2;
 DeleteEnemyShot(CHILD);
 PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_fault.wav");
  
  
  
  
  
  
  
  
  
  
  
  //wait(60);
   if(GetX>GetCenterX){la=180; DeleteEnemyShot(CHILD);
	SetMovePosition03(GetCenterX, GetCenterY-150, 13, 3); DeleteEnemyShot(CHILD);
     Animate("nue", "start move right", false);} DeleteEnemyShot(CHILD);
	   if(GetX<GetCenterX){ DeleteEnemyShot(CHILD);
	SetMovePosition03(GetCenterX, GetCenterY-150, 13, 3); DeleteEnemyShot(CHILD);
     Animate("nue", "start move right", false);} DeleteEnemyShot(CHILD);
	    if(GetX==GetCenterX){ DeleteEnemyShot(CHILD);
	SetMovePosition03(GetCenterX, GetCenterY-150, 13, 3); DeleteEnemyShot(CHILD);
      Animate("nue", "start move right", false);} DeleteEnemyShot(CHILD);
      yield ; DeleteEnemyShot(CHILD);
	  la=0;
      while(GetSpeed>0.1){yield;} DeleteEnemyShot(CHILD);
wait(50);
Animate("nue", "stop move right", false);
wait(20);
      Animate("nue", "start cast", false); DeleteEnemyShot(CHILD);
	  wait(20);
	  
	  SetScore(30000);
	  u;
	  cutin("NAZRIN", "",Cut,0,0,375,555);
	  //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(120);
	   
	      Animate("nue", "start cast", false); 
	  wait(20);
	   
	   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\Charge.wav");
	   move;
	   ras;
	   assa;
 
 
 }
 
 
 
 task sp12{
 
 loop{
 yield;
 if(GetTimer<50){SetLife(999);}
 if(GetLife<1500){SetCommonData("spell",1);
 
 show;break;
 }
 
 }
 
 
 
 
 
 
 }
  task ShowOffNueAnimation {
  //gh;
  SetCommonData("spell",0);
  sp12;
  wait(30);
  CreateEnemyFromScript("fam1",GetClipMaxX+50,GetCenterY,0,0,0);
  	PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);
 Concentration01(80);
 Concentration01(80);
 Concentration01(80);
//Animate("nue", "start move left",false);
    	SetMovePosition03(GetCenterX,GetCenterY-100, 20, 2);
la=180;     
// ani2;
	  Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){yield;}
	
	
     while(GetSpeed>0.1){yield;}
	 
wait(20);
let yg=0;
let yg2=0;
	 Animate("nue", "idle", true);
	 wait(30);
	 

 loop{yield;
 
 if(GetCommonData("spell")==1){
 yield;
 }
 
 if(GetCommonData("spell")==0){
 
 
  Animate("nue", "start cast", false);
  wait(20);
   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
  loop(50){
  nonb(yg+yg2);
  yg+=360/50;
  }yg2+=19.2349287;
 wait(20);
 Animate("nue", "stop cast", false);
  wait(120);
 }
 }
 
 
 
  }
  
  let as=0;
  let as2=0;
  let as22=0;
  let as222=0;
  let f=0;
 
  let la=0;
  
  
  
  let yx=0;
  let ang2=0;
  let ang3=0;
  let ang4=0;
 
  let nan=0;
  let ox=0;let yt=rand(0,360);
  let oy=0;
  let ox2=0;
  let oy2=0;let ang=0;
 
  
  task SetNueMoveAnimation(direction) {
    if(direction == "left"){la=180;
     Animate("nue", "start move right3", false);
      yield ;
      while(GetSpeed>0.1){
        yield ;
      }
      Animate("nue", "stop move right3", false);
    }
    if(direction == "right"){la=0;
      Animate("nue", "start move right3", false);
      yield ;
      while(GetSpeed>0.1){
        yield ;
      }
      Animate("nue", "stop move right3", false);
    }
    wait(12);
    Animate("nue", "idle3", true);
  }
  
  function wait(t){
    loop(t){yield;}
  }
  
  let dir=0;
  task move{
  
  
  loop{dir+=2;
  
  if(GetCommonData("spell")==1){
  SetMovePosition03(GetCenterX+310*cos(dir),GetCenterY+310*sin(dir),5,7.5);}
   if(GetCommonData("spell")==3){
   
   DeleteEnemyShot(CHILD);
 
   wait(60);
   del;
   	PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");
 Concentration02(30);
 Concentration02(40);
 Concentration02(30);DeleteEnemyShot(CHILD);
 Concentration01(80);
 Concentration01(80);
 Concentration01(80);
//Animate("nue", "start move left",false);
    	DeleteEnemyShot(CHILD);SetMovePosition03(GetCenterX,GetCenterY, 20, 4);
//la=180;     DeleteEnemyShot(CHILD);
// ani2;
	  Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){yield;}
	Animate("nue", "stop move right", false);
	wait(20);
	Animate("nue", "idle", true);
	wait(20);
	Animate("nue", "start cast", false);
	
	wait(20);

  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cat00.wav");dam=1;	
	cutin("NAZRIN", "",Cut,0,0,375,555);
	u2;
	wait(60);
	Animate("nue", "stop cast", false);
	wait(20);
	Animate("nue", "idle", true);
	
	/////
	
	loop{
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	wait(60);
	Animate("nue", "start cast", false);
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	wait(20);
if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
  wave1;
	wait(60);
	
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	Animate("nue", "stop cast", false);
	wait(20);
	Animate("nue", "idle", true);
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	wait(180);
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	}
	//break;
	 
   
   }
  yield;
  
  }
  
  }
  
  
  
  
  
  task mover{
  
  loop{yield;
  
  if(GetCommonData("samove")==1){
  
  SetMovePosition03(GetX+5,GetY-600, 20, 4);
la=180;     
// ani2;
	  Animate("nue", "start move right", false);
  wait(100);	PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
  DeleteMusic(GetCurrentScriptDirectory ~ ".\Sounds\boss.mp3");
  VanishEnemy;
  }
  
  }
  
  }
  
  
  let wan=0;
  let wan2=0;
  
  task wave1{
  
  
  if(GetCommonData("spell")!=4){
  
  loop(10){wan2+=15.534;
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
  loop(8){
  
  CreateShotA(1,GetX, GetY,5);
		SetShotDataA(1,0,4,wan+wan2,6,0,0,245);
			SetShotDataA(1,30,3,NULL,4,0,0,245);
			SetShotDataA(1,60,2,NULL,2,0,0,245);
			SetShotDataA(1,90,1,NULL,0.2,0,0,245);
		
			
		
				
				FireShot(1);
				wan+=360/8;
  
  }
  wait(5);
  }
  wait(60);
   loop(10){wan2+=15.534;
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
  loop(8){
  
  CreateShotA(1,GetX, GetY,5);
		SetShotDataA(1,0,4,wan-wan2,-6,0,0,245);
			SetShotDataA(1,30,3,NULL,-4,0,0,245);
			SetShotDataA(1,60,2,NULL,-2,0,0,245);
			SetShotDataA(1,90,1,NULL,-0.2,0,0,245);
		
			
		
				
				FireShot(1);
				wan+=360/8;
  
  }
  wait(5);
  }
  wait(60);
  
  loop(10){
  
//  wan2+=15.534;
  sap+=0.16;
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
  loop(5+sap2){
 
  CreateShotA(1,GetX, GetY,5);
		SetShotDataA(1,0,1+sap,wan+wan2,0,0,0,243);
			SetShotDataA(1,10,0.8+sap,NULL,0,0,0,243);
			SetShotDataA(1,20,0.6+sap,NULL,0,0,0,243);
			SetShotDataA(1,30,0.4+sap,NULL,0,0,0,243);
			SetShotDataA(1,40,0,NULL,0,0,0,243);
			SetShotDataA(1,60,0.2,NULL,1,0,0,243);
			SetShotDataA(1,70,0.4,NULL,0.9,0,0,243);
			SetShotDataA(1,80,0.6,NULL,0.8,0,0,243);
			SetShotDataA(1,90,0.8,NULL,0.4,0,0,243);
			SetShotDataA(1,100,1,NULL,0,0,0,243);
		
			
		
				
				FireShot(1);
				 CreateShotA(1,GetX, GetY,5);
		SetShotDataA(1,0,1+sap,wan+wan2,0,0,0,243);
			SetShotDataA(1,10,0.8+sap,NULL,0,0,0,243);
			SetShotDataA(1,20,0.6+sap,NULL,0,0,0,243);
			SetShotDataA(1,30,0.4+sap,NULL,0,0,0,243);
			SetShotDataA(1,40,0,NULL,0,0,0,243);
			SetShotDataA(1,60,0.2,NULL,-1,0,0,243);
			SetShotDataA(1,70,0.4,NULL,-0.9,0,0,243);
			SetShotDataA(1,80,0.6,NULL,-0.8,0,0,243);
			SetShotDataA(1,90,0.8,NULL,-0.4,0,0,243);
			SetShotDataA(1,100,1,NULL,0,0,0,243);
		
			
		
				
				FireShot(1);
				wan+=360/(5+sap2);
  
  }
  wait(5);
  }sap=0;
  
  
  }}
  let sap=0;
  let sap2=0;
  sub InitializeAnimationData {
 CreateAnimation("nue", "idle", 8);
    SetAnimationFrame("nue", "idle", 0, imgNue, 13, 15, 2, 48, 61);
   
    SetAnimationFrame("nue", "idle", 1, imgNue, 13, 79, 3, 112, 61);
    SetAnimationFrame("nue", "idle", 2, imgNue, 13, 143, 3, 176, 61);
    SetAnimationFrame("nue", "idle", 3, imgNue, 13, 207, 3, 240, 61);
	
	  SetAnimationFrame("nue", "idle", 4,  imgNue, 13, 15, 2, 48, 61);
   
    SetAnimationFrame("nue", "idle", 5, imgNue, 13, 79, 3, 112, 61);
    SetAnimationFrame("nue", "idle", 6, imgNue, 13, 143, 3, 176, 61);
    SetAnimationFrame("nue", "idle", 7, imgNue, 13, 207, 3, 240, 61);
	
	
    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, 64, 65, 118, 125);
    SetAnimationFrame("nue", "start move right", 2, imgNue, 1, 130, 65, 182, 122);
    SetAnimationFrame("nue", "start move right", 3, imgNue, 8, 195, 65, 246, 122);
    
    CreateAnimation("nue", "stop move right", 4);
    SetAnimationFrame("nue", "stop move right", 0, imgNue, 4, 195, 65, 246, 122);
    SetAnimationFrame("nue", "stop move right", 1, imgNue, 4,  130, 65, 182, 122);
    SetAnimationFrame("nue", "stop move right", 2, imgNue, 4,  64, 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", 3);
    SetAnimationFrame("nue", "start cast", 0, imgNue, 6, 10,147,46,215);
    SetAnimationFrame("nue", "start cast", 1, imgNue, 6, 74,139,110,215);
    SetAnimationFrame("nue", "start cast", 2, imgNue, 6, 138,131,174,215);
   
    
    
    CreateAnimation("nue", "stop cast", 3);
    SetAnimationFrame("nue", "stop cast", 0, imgNue, 6, 138,131,174,215);
    SetAnimationFrame("nue", "stop cast", 1, imgNue,  6, 74,139,110,215);
    SetAnimationFrame("nue", "stop cast", 2, imgNue, 6, 10,147,46,215);
    

	
	
 }
 
 
 task assa{
 
 
 loop{
 wait(5);
 
 if(GetCommonData("spell")==1){
 rdrop;
 rdrop;
 
 }
 
 if(GetCommonData("spell")==3){
 
 
 break;
 }
 
 //rdrop;
 }
 
 }
 
 
 
 
 
 task rdrop{
 
 
 
 
  
let obj1=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj1,GetX);
	Obj_SetY(obj1,GetY);
	Obj_SetSpeed(obj1,rand(0.1,0.4));
	Obj_SetAngle(obj1,atan2(GetCenterY - Obj_GetY(obj1), GetCenterX - Obj_GetX(obj1))+rand(-15,15));
	ObjShot_SetBombResist(obj1,true);
	ObjShot_SetGraphic(obj1,163);
	ObjShot_SetDelay(obj1,10);
	Obj_SetAutoDelete(obj1,true);

	while(!Obj_BeDeleted(obj1)){yield;
	Obj_SetAutoDelete(obj1,true);
	wait(rand(280,860));
	ObjShot_FadeDelete(obj1);
 }
 
 
 }
 
 
 
  
  task nonb(an){
  
  
  
  task circ(naa){
  
  
  
  
  
let obj1=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj1,Obj_GetX(obj));
	Obj_SetY(obj1,Obj_GetY(obj));
	Obj_SetSpeed(obj1,2);
	Obj_SetAngle(obj1,naa);
	ObjShot_SetBombResist(obj1,true);
	ObjShot_SetGraphic(obj1,250);
	ObjShot_SetDelay(obj1,10);
	Obj_SetAutoDelete(obj1,true);

	while(!Obj_BeDeleted(obj1)){yield;
	Obj_SetAutoDelete(obj1,true);
	
	
loop(20){
Obj_SetSpeed(obj1,Obj_GetSpeed(obj1)-0.1);
wait(3);}


ObjShot_SetGraphic(obj1,248);
	Obj_SetAngle(obj1,Obj_GetAngle(obj1)+rand(-250,250));
	
	
	
loop(28){
Obj_SetSpeed(obj1,Obj_GetSpeed(obj1)-0.05);
wait(3);}

	
loop(1){
Obj_SetSpeed(obj1,Obj_GetSpeed(obj1)+0.25);
wait(3);}
break;
	}
  
  }
  
  
  
let obj=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj,GetX);
	Obj_SetY(obj,GetY);
	Obj_SetSpeed(obj,3);
	Obj_SetAngle(obj,an);
	ObjShot_SetBombResist(obj,true);
	ObjShot_SetGraphic(obj,125);
	ObjShot_SetDelay(obj,10);
	Obj_SetAutoDelete(obj,true);

	while(!Obj_BeDeleted(obj)){yield;
	Obj_SetAutoDelete(obj,true);
	
loop(30){
Obj_SetSpeed(obj,Obj_GetSpeed(obj)-0.1);
wait(3);}
	
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_kira00.wav");
	circ(45);
	circ(135);
	circ(0);
	circ(180);
	
	yield;
  Obj_Delete(obj);
  
  
}
}
 
 
 
 }
 
  
  
  
  task nonb(an){
  
  
  
  
let obj=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj,GetX);
	Obj_SetY(obj,GetY);
	Obj_SetSpeed(obj,2);
	Obj_SetAngle(obj,an);
	ObjShot_SetBombResist(obj,true);
	ObjShot_SetGraphic(obj,125);
	ObjShot_SetDelay(obj,10);
	Obj_SetAutoDelete(obj,true);

	while(!Obj_BeDeleted(obj)){yield;
	Obj_SetAutoDelete(obj,true);
	
loop(20){
Obj_SetSpeed(obj,Obj_GetSpeed(obj)-0.1);
}
	
	
	yield;
  Obj_Delete;
  
  
}
}


}














let obj=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj,GetX);
	Obj_SetY(obj,GetY);
	Obj_SetSpeed(obj,5);
	Obj_SetAngle(obj,rand(0,360));
	ObjShot_SetBombResist(obj,true);
	ObjShot_SetGraphic(obj,203);
	ObjShot_SetDelay(obj,10);
	

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

  if(Obj_GetX(obj)<GetClipMinX) 
         {Obj_SetAngle(obj,180-Obj_GetAngle(obj)+rand(-5,5));
                       
         
                    }

                    if(Obj_GetX(obj)>GetClipMaxX) 
         { Obj_SetAngle(obj,180-Obj_GetAngle(obj));
                        
           
                    }

      


	
	
	}}



	
	
	

script_enemy fam1{let fi=0;
 #include_function ".\AnimationLib.dnh"
    let cir = GetCurrentScriptDirectory ~ "circle.png";
  let dir=0;
  let r=80;
   let imgNue = GetCurrentScriptDirectory ~ "su.png";
  @Initialize{
  SetLife(1);InitializeAnimationData;
  LoadGraphic(imgNue);
  LoadGraphic(cir);
 //  Animate("nue", "idle", true);
  main;
  }
  SetCommonData("sanae",0);
  @MainLoop{yield;
  SetDamageRateEx(0,0,100,30);
SetCollisionB(GetX,GetY,10);
SetCollisionA(GetX,GetY,10);
  }let h=0;
  let wave=0;
  let x=0;
  task gh{
 loop(110){
 aaaa+=-2;
 aq+=-0.02;
 
 wait(1);
 
 }
 
 }
 
 task gh2{
 loop(110){
 aaaa+=2;
 aq+=0.02;
 
 wait(1);
 
 }
 
 }
  let aq=0;
  let aaaa=0;
  @DrawLoop{
  
    
	  SetTexture(cir);SetAlpha(0+aaaa);
 
	SetGraphicRect(0,0,128,127);
	SetGraphicScale(0+aq+sin(wave)*0.2,0+aq+sin(wave)*0.2);

wave+=3;x+=5;
	SetGraphicAngle(0, 0, x);
	
	DrawGraphic(GetX,GetY);

	
  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;
  
  }
  @Finalize{
  
  }
  let angle=0;let gf=0;
 
  let as=0;
  task fir{
  
  
    PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  
  CreateShot01(GetX,GetY,1.4,angle+gf,122,5);
  CreateShot01(GetX,GetY,1.5,angle+gf+5,122,5);
  CreateShot01(GetX,GetY,1.6,angle+gf+10,122,5);
  CreateShot01(GetX,GetY,1.6,angle+gf+15,122,5);
  CreateShot01(GetX,GetY,1.5,angle+gf+20,122,5);
  CreateShot01(GetX,GetY,1.4,angle+gf+25,122,5);
  
  loop(3){
  CreateShot01(GetX,GetY,1.4,angle+gf+90+as,122,5);
  CreateShot01(GetX,GetY,1.5,angle+gf+5+90+as,122,5);
  CreateShot01(GetX,GetY,1.6,angle+gf+10+90+as,122,5);
  CreateShot01(GetX,GetY,1.6,angle+gf+15+90+as,122,5);
  CreateShot01(GetX,GetY,1.5,angle+gf+20+90+as,122,5);
  CreateShot01(GetX,GetY,1.4,angle+gf+25+90+as,122,5);
  as+=90;
  }as=0;
  
  
  gf+=rand(0,360);
  }
  let non=0;
  
  let ane=0;
  
  task fire{
   PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  loop(5){
  tre(2,ane);
  ane+=360/5;
  }
  }
  
  
  task main2{
  
  loop{yield;
 if(GetCommonData("spell")==1){non=1;
 yield;
 
 Animate("nue", "start move right", false);
 SetMovePosition03(GetCenterX, GetEnemyY+100, 15, 3);
     // SetNueMoveAnimation("right");
      yield ;
      while(GetSpeed>0.1){yield;}
	  
 Animate("nue", "stop move right", false);
 wait(20);faf;
 Animate("nue", "idle", true);
 break;
 }
  
  }
  }
  
  
  task razor{
  
  
  loop{
  loop(5){
  
  loop(10){
  
  razz(GetX,GetY,asdsa+asdsa2);
  asdsa+=360/10;
  }
  //asdsa2+=14.6234234;
  wait(10);
  }
  wait(180);
  }
  }
  
  
  
  let asdsa=0;
  let asdsa2=0;
  
  task razz(x,y,an){
  
  
  
  
let obj6=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj6,x);
	Obj_SetY(obj6,y);
	Obj_SetSpeed(obj6,2);
	Obj_SetAngle(obj6,an);
	ObjShot_SetBombResist(obj6,true);
	ObjShot_SetGraphic(obj6,244);
	ObjShot_SetDelay(obj6,10);
	
	
	while(!Obj_BeDeleted(obj6)){yield;
	Obj_SetAutoDelete(obj6,true);
	loop(20){Obj_SetSpeed(obj6,Obj_GetSpeed(obj6)-0.1);wait(3);}
	
	//wait(90);
  ObjShot_FadeDelete(obj6);
  
  
  }
  
  
  }
  
  
  
  
  task faf{DeleteEnemyShot(CHILD);
  wait(120);
  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);
	
	
	loop{
	yield;
	if(GetCommonData("spell")==1){
	 Animate("nue", "start cast", false);
	  wait(20);
	 ty=rand(-8,8);
	 blast;
	 fire;
		 wait(20); 
		  Animate("nue", "stop cast", false);
	  wait(20);
	   Animate("nue", "idle", true);
	   
	   wait(160);}
	
	if(GetCommonData("spell")==3){
	DeleteEnemyShot(CHILD);
	PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_ch02.wav");

	 Concentration02(30);
 Concentration02(40);
 Concentration02(30);let fg=0;
 Concentration02(40);
 Concentration02(30);let anga=0;
 Concentration02(40);
 
 	SetMovePosition03(GetCenterX,GetCenterY-100, 20, 2);

	  Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){yield;}
	
	
     Animate("nue", "stop move right", false);
 wait(20);
 Animate("nue", "idle", true);
 let gfgf=0;
let gfgf2=0;
let ranran=0;
wait(120);
wait(120);
dsa;
let cc=0;
let vv=0;
task dsa{
loop{

yield;

if(GetCommonData("spell")!=4){
if(GetPlayerX<GetCenterX-50||GetPlayerX>GetCenterX+50){

 vv+=19.34556;
 	PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
	loop(10){
	
	CreateShot01(GetX,GetY,1.5,cc+vv,203,10);
	cc+=360/10;
	}
wait(20);
}
}
}}
wait(120);
 loop{
	
	if(GetCommonData("spell")==4){
	
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	  
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	
ranran=rand(4,7);


	 //Animate("nue", "start cast", false);
	 wait(20);if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	 fgfg+=17.34556;
	loop(15){
	
	CreateShot01(GetX,GetY,1.5,az+fgfg,202,10);
	az+=360/15;
	}if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	 loop(6){
	adda(gfgf,5,ranran);
	gfgf+=360/6;
	}if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	gfgf2+=19.4653;
	
	
   SetMovePosition03(GetCenterX-rand(20,40), GetY+rand(-10,10), 15, 4);
   la=180;
      Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){yield;}
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
      Animate("nue", "stop move right", false);
	wait(20);la=0;
 Animate("nue", "idle", true);
 if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	
	
wait(60);
ranran=rand(-4,-7);
if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}

	 //Animate("nue", "start cast", false);
	 wait(20);
	 fgfg+=17.34556;if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	loop(15){
	
	CreateShot01(GetX,GetY,1.5,az+fgfg,202,10);
	az+=360/15;
	}if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	 loop(6){
	adda(gfgf,5,ranran);
	gfgf+=360/6;
	}
	gfgf2+=19.4653;
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	
   SetMovePosition03(GetCenterX+rand(20,40), GetY+rand(-10,10), 15, 4);
   //la=180;
      Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){yield;}
	
      Animate("nue", "stop move right", false);
	wait(20);la=0;if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
 Animate("nue", "idle", true);
 
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	wait(60);
	if(GetCommonData("spell")==4){
	  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
	DeleteEnemyShot(CHILD);CreateEventFromScript("test");
	wait(60);DeleteEnemyShot(CHILD);
	Animate("nue", "idle", true);mover;
	break;
	
	}
	}}
	}
	
	
	
  
  
  }
  
  
  
  task mover{
  
  loop{yield;
  
  if(GetCommonData("sumove")==1){
  
  SetMovePosition03(GetX-15,GetY-600, 20, 4);
la=180;     
// ani2;
	  Animate("nue", "start move right", false);
  wait(100);	
  
  //PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_cardget.wav");
  VanishEnemy;
  }
  
  }
  
  }
  
  
  
  let angle1=0;
  let ff=0;
  
  task blast{
  PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_tan01.wav");
  loop(30){
  
 
  CreateShot01(GetX,GetY,1,angle1+ff,13,10);
  angle1+=360/30;
  
  }ff+=12.56;
  }
  
  task main{a=180;gh2;
  main2;
  
	   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;}
	  

  
 Animate("nue", "start move right", false);
 SetMovePosition03(GetCenterX, GetCenterY-180, 20, 3);
     // SetNueMoveAnimation("right");
      yield ;
      while(GetSpeed>0.1){yield;}la=180;
wait(120);
 Animate("nue", "stop move right", false);
 wait(20);
      Animate("nue", "idle", true);
wait(20);

loop{yield;
if(non==0){
la=0;
if(non==0){
fir;
Animate("nue", "start move right", false);
if(non==0){
 SetMovePosition03(GetCenterX+70, GetCenterY-100, 15, 3);
     // SetNueMoveAnimation("right");
      yield ;
      while(GetSpeed>0.1){yield;}
	 
	if(non==0){  
la=180;fir;
Animate("nue", "start move right", false);
if(non==0){
 SetMovePosition03(GetCenterX, GetCenterY, 15, 3);
     // SetNueMoveAnimation("right");
      yield ;
      while(GetSpeed>0.1){yield;}
	 

fir;
if(non==0){	  
Animate("nue", "start move right", false);
if(non==0){
 SetMovePosition03(GetCenterX-70, GetCenterY-100, 15, 3);
     // SetNueMoveAnimation("right");
      yield ;
      while(GetSpeed>0.1){yield;}
	  Animate("nue", "stop move right", false);
	if(non==0){
fir;if(non==0){
	 la=0;
Animate("nue", "start move right", false);
if(non==0){
 SetMovePosition03(GetCenterX, GetCenterY-180, 15, 3);
     // SetNueMoveAnimation("right");
      yield ;
      while(GetSpeed>0.1){yield;}
	  Animate("nue", "stop move right", false);
	 }}}}}}}}}}
}
	  
	  
	  
	
  }
  
  
  task df{
 
  }
  let la=0;
  task SetNueMoveAnimation(direction) {
    if(direction == "left"){
      Animate("nue", "start move right", false);
      yield ;
      while(GetSpeed>0.1){
        yield ;
      }
     Animate("nue", "stop move right", 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);
  }
  
  function wait(t){
    loop(t){yield;}
  }
  let a=0;
  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 ty=0;
  
  task tre(sp,an){
  
  
  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,0);
	ObjShot_SetBombResist(obj2,true);
	ObjShot_SetGraphic(obj2,248);
	ObjShot_SetDelay(obj2,10);
	

	while(!Obj_BeDeleted(obj2)){yield;
	Obj_SetAutoDelete(obj2,true);
	wait(30);
	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 {


loop{


loop(200){Obj_SetAngle(obj,Obj_GetAngle(obj)+ty);wait(4);}

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;
  
  task adda(an,sp,anna){
  
  
  task circle1(an){
  
let obj611=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj611,Obj_GetX(obj61));
	Obj_SetY(obj611,Obj_GetY(obj61));
	Obj_SetSpeed(obj611,1.3+spp);
	Obj_SetAngle(obj611,an);
	ObjShot_SetBombResist(obj611,true);
	ObjShot_SetGraphic(obj611,assa);
	ObjShot_SetDelay(obj611,30);
	
  
spsp;
task spsp{
wait(30);
loop(13){
Obj_SetSpeed(obj611,Obj_GetSpeed(obj611)-0.1);wait(3);
}
wait(10);
ObjShot_FadeDelete(obj611);
}
	while(!Obj_BeDeleted(obj611)){yield;
	Obj_SetAutoDelete(obj611,true);
	
	}
  }
  
let obj61=Obj_Create(OBJ_SHOT);
	Obj_SetX(obj61,GetX);
	Obj_SetY(obj61,GetY);
	Obj_SetSpeed(obj61,sp);
	Obj_SetAngle(obj61,an);
	ObjShot_SetBombResist(obj61,true);
	ObjShot_SetGraphic(obj61,158);
	ObjShot_SetDelay(obj61,0);
	
	circir;
	
	task circir{
	
	
	
	loop(8){spp+=0.2;
		PlaySE(GetCurrentScriptDirectory ~ ".\Sounds\se_don00.wav");
	loop(10){
	circle1(az);
	az+=360/10;
	
	
	}spp=0;
	wait(10);assa+=1;
if(assa>17){assa=14;}yield;
	
	}
	
	
	}
	while(!Obj_BeDeleted(obj61)){yield;
	Obj_SetAutoDelete(obj61,true);
wait(5);
	Obj_SetAngle(obj61,Obj_GetAngle(obj61)+anna);
	
	
	}
  
  }
  
  
  
  
  let fgfg=0;
  }
  
  
  
  
  
  










script_event test {
 function wait(n) {loop(n){yield;} }
    let CSD = GetCurrentScriptDirectory;
    let su = CSD ~ ".\suf.png";
    let suw = CSD ~ ".\sufwtf.png";
    let suh = CSD ~ ".\sufh.png";
    let sac = CSD ~ ".\safc.png";
    let sas = CSD ~ ".\safs.png";
    let saa = CSD ~ ".\safa.png";
    let sau = CSD ~ ".\safu.png";
    let saw = CSD ~ ".\safw.png";
    let sa = CSD ~ ".\saf.png";
 
@Initialize {
        LoadGraphic(su);
        LoadGraphic(suw);
        LoadGraphic(suh);
        LoadGraphic(sac);
        LoadGraphic(sa);
		
        LoadGraphic(sas);
        LoadGraphic(saa);
        LoadGraphic(sau);
        LoadGraphic(saw);
 //SetTexture(imgReimu);
		
 }
 
@MainLoop{



SetChar(RIGHT, suw); 
SetGraphicRect(RIGHT, 0, 0, 256, 256);  
MoveChar(RIGHT, FRONT); 
TextOutA("That's enough!"); 

   SetCommonData("sumove",1);
TextOutA("You are so annoying!"); 

MoveChar(RIGHT, BACK);
SetCommonData("sumove",1);


  SetStep(3);
  
  wait(120);
  
  
  
DeleteGraphic(suw);
SetChar(LEFT, saw); 
SetGraphicRect(LEFT, 0, 0, 256, 256);  
MoveChar(LEFT, FRONT); 
TextOutA("Suwako-sama!"); 


MoveChar(LEFT, BACK);


SetChar(LEFT, sau); 
SetGraphicRect(LEFT, 0, 0, 256, 256);  
MoveChar(LEFT, FRONT); 
TextOutA("But we had one spellcard left.."); 


MoveChar(LEFT, BACK);

  
    SetCommonData("samove",1);
SetChar(LEFT, sau); 
SetGraphicRect(LEFT, 0, 0, 256, 256);  
MoveChar(LEFT, FRONT); 
TextOutA("Wait for me!"); 


MoveChar(LEFT, BACK);

  
  SetStep(4);
  
 End;           //This ends the event.

  
 
 
 }}
	
	



	