task missiles(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
	//{
		let aux; let gr = [AMULET_INV_RED, AMULET_INV_BLUE];
    
    let r = 90;
    let huh = 8;
	//}


  eightCurve(); wait(24); icy(); circle();
  while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
    
    huh = rand(30, 40);
    
    PlaySFXV(SFX_SHOT00, 18);
    ascent(j in 0..2){
      ascent(k in 0..2){
        ascent(i in 0..2){
          let a = r + 360/2*i;

          aux = CShotA2(bx + huh, by, 5, a + 180*j + 360/4*k, -1/13, 2+k/2, AMULET_INV_AZURE - 7*j, 15);
        }
      }

      huh *= -1;
    }

    r += 37;
    wait(60*1/12);
  }
}

task circle(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;}
  //{
    let x; let y; let rang = 180;
    let r = 0; let fr = 1.25;
    let range = [220, -40];

    let aux;
  //}

  wait(60*1);
  loop{
    x = range[0] * cos(rang)^3; y = range[1] * sin(rang)^3;

    PlaySFXV(SFX_SHOT01, 56);
    ascent(i in 0..24){
      let a = r + 360/24*i + 360/32;

      aux = CScaledShotA1(gx + x, (gy-110) + y, 3, a, LARGE_RED, 15, 1.6);
    }

    r = rand(0,360); fr *= -1;
    rang += 360/2; rang = NormalizeAngle(rang);
    wait(60*4/2);
  }
}

task icy(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;}
  //{
    let x; let y; let rang = 90;
    let r = 0; let fr = 0.85;
    let range = [220, -40];

    let aux; let pr = fr/absolute(fr);
  //}

  loop{
    x = range[0] * cos(90)^3; y = range[1] * sin(90)^3;

    PlaySFXV(SFX_SHOT02, 80);
    pr = fr/absolute(fr);
    ascent(j in 0..12){
      ascent(i in 0..19){
        let a = r + 360/19*i;

        aux = CScaledShotA1(gx + x, (gy-110) + y, 1+j/2.5, a + fr*j, NEEDLE_INV_GREEN + 4*pr, 15, 1.5);
        ObjMove_AddPatternA3(aux, 30, NO_CHANGE, NO_CHANGE, 1, 0, 1+(11-j)/2.5, NEEDLE_GREEN + 4*pr);
      }
    }

    r = rand(0,360); fr *= -1;
    wait(60*4);
  }
}

task eightCurve(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;}
  //{
    let x; let y; let rate = 0;
    let frame = 60*4; let range = [220, -40];
  //}

  x = range[0] * cos(90)^3; y = range[1] * sin(90)^3;
  Lerp_SetDestAtFrame(objBoss, gx + x, (gy-110) + y, 24); wait(24);
  Obj_SetValue(objBoss, "cast", 1);
  loop{
    ascent(i in 0..frame+1){
      rate = Interpolate_Linear(90, 360+90, i/frame);
      x = range[0] * cos(rate)^3; y = range[1] * sin(rate)^3;

      setpos(objBoss, gx + x, (gy-110) + y);
      yield;
    }
  }

}