task missiles(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
	//{
    let r = -90; let aux;
    let schColor = [SMALL_BLACK, SMALL_BLUE, SMALL_GREEN, SMALL_INDIGO, SMALL_RED, SMALL_PINK, SMALL_GREY, SMALL_GREY];

    let n = 1;
	//}
	
  secPattern();
  while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
    
    ascent(i in -4..4){
      let a = r + 360/8*i;

      PlaySFXV(SFX_LASER00, 40);
      SetCommonData("Color", schColor[i+4]);
      ascent(j in 0..6){
        aux = CustomCLaser(bx, by, 0, a+360/6*j, schColor[i+4]+140, [3, 4, 10], BLEND_ADD_ARGB); 
        ObjMove_AddPatternA2(aux, 1, 0, NO_CHANGE, 1/10, -n*6, 6); 
        ObjMove_AddPatternA2(aux, 60*1, NO_CHANGE, NO_CHANGE, 1/20, -n*1, 6); 
        poop(aux, schColor[i+4]); ifoutofBounds(aux, 60);
      }
      
      n *= -1;
      wait(60*5);
    }

    wait(60*2);
  }
}

task secPattern(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
	//{
    let r = -90; let schColor;
    let x; let y; let aux;

    let frame = 3; let numBullets = 14;
    let heck = 2; let wow = 1;
	//}

  wait(30);
  while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
    
    frame = 4; numBullets = 23;
    ascent(count in 0..frame+1){
      if(Obj_IsDeleted(objBoss)){break;}

      x = Interpolate_Linear(bx-80, bx+80, count/frame);
      y = Interpolate_Overshoot(by+30, by-30, 3, count/frame);

      ascent(j in 0..20){
        schColor = GetCommonData("Color", SMALL_BLACK);

        PlaySFXV(SFX_SHOT03, 76);
        if(Obj_IsDeleted(objBoss)){break;}

        let b = rand(-heck, heck);
        ascent(i in 0..numBullets){
          let a = r + 360/numBullets*i;

          CScaledShotA1(x, y, 1+j/2, a + b, schColor + (287 + 7*wow), 15, 0.9);
        }

        wow *= -1;
        wait(4);
      }

      r += 360/(numBullets*2) + rand(-3, 3); heck *= -1;
      wait(27);
    }

    wait(45);

    frame = 24;
    ascent(count in 0..frame+1){
      if(Obj_IsDeleted(objBoss)){break;}
      
      x = Interpolate_Linear(bx+80, bx-80, count/frame);
      y = Interpolate_Overshoot(by-30, by+30, 3, count/frame);

      PlaySFXVDelay(SFX_LASER01, 56, 42);
      schColor = GetCommonData("Color", SMALL_BLACK); let angle = GetAngleFromTo(px, py, x, y);
      ascent(i in 0..5){
        aux = CreateSTLaser(x, y, angle+360/5*i, 800, 42, schColor+448, [42, 60]);
      }

      wait(5);
    }

    wait(45);
  }
}

task poop(obj, colorBase){icecirc(obj, colorBase);}
//-------------------------------------
task icecirc(obj, colorG){
  //{
    let a; let lkiller = 1;
    let ez = [];
  //} 

  wait(30);
  loop{
    if(Obj_IsDeleted(obj)){break;}

    PlaySFXV(SFX_SHOT00, 20);
    a = CustomFlowerA1(getx(obj), gety(obj), 0, geta(obj)+180, colorG+112, [8, geta(obj)+45, 1, 3*lkiller, 15, 15, 1.15], BLEND_ADD_ARGB);
    ObjMove_AddPatternA2(a, 11, 0, NO_CHANGE, 1/7, 0, 2); ObjShot_SetSpellResist(a, true);
    a = CScaledShotA1(getx(obj), gety(obj), 0, geta(obj)+180, colorG+742, 15, 0.85); ifoutofBounds(a, 15); lkiller *= -1;
    ObjMove_AddPatternA2(a, 11, 0, NO_CHANGE, 1/7, 0, 2); ObjShot_SetSpellResist(a, true);
    wait(22);
  }
}

