task missiles(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
	//{
		let aux; let an;
    
    let r = 0; let l = 0; let meow = 0; let n = 1;
    let counter = 20; let graphic = [AMULET_INV_RED, AMULET_INV_AZURE];
    let cumdown = 20;
	//}
	
  bar();
  while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){

    counter = 36;
    ascent(i in 0..counter+1){
      
      PlaySFXV(SFX_SHOT02, 56);
      ascent(j in -3..4){
        an = GetAngleFromTo(px, py, stx[0] + midX(counter)*i, 0);
        CScaledShotA1(stx[0] + midX(counter)*i, 0, 9, an + 17*j, ARROWHEAD_RED, 15, 1.35);

        an = GetAngleFromTo(px, py, stx[1] - midX(counter)*i, 0);
        CScaledShotA1(stx[1] - midX(counter)*i, 0, 9, an + 17*j, ARROWHEAD_BLUE, 15, 1.35);
      }      
      wait(cumdown); 

      cumdown -= 3; cumdown = (cumdown < 5) ? 5 : cumdown;
    }

    Obj_SetValue(objBoss, "cast", 1);
    loop(25){
      
      PlaySFXV(SFX_SHOT00, 20);
      ascent(i in 0..28){
        an = r + 360/28*i;

        aux = CShotA1(bx, by, 3, meow, graphic[l], 15); ObjShot_SetSpellResist(aux, true);
        ObjMove_AddPatternA2(aux, 15, 2, an, 1/30, 0, 4);
        l++; l = (l > 1) ? 0 : l;
      }

      meow += (360/20 + rand(-10, 10))*n; meow = NormalizeAngle(meow);

      r += 360/56 + rand(-5, 5); r = NormalizeAngle(r);
      wait(60*1/5);
    }

    wait(60*0.5); n *= -1;
    Obj_SetValue(objBoss, "cast", 0);
    wait(60*1);
  }
}

task bar(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
	//{
		let aux; let an;
    
    let r = 0; let l = 0; let meow = 0;
    let counter = 20; let graphic = [AMULET_INV_RED, AMULET_INV_AZURE];
	//}

  wait(6*36);
  while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){

    PlaySFXV(SFX_MAGIC00, 25);
    ascent(i in 0..23){
      an = r + 360/23*i;

      aux = CScaledShotA2(bx, by, 2, an, 1/35, 6, LARGE_INV_PURPLE, 45, 1.8);
      ObjRender_SetBlendType(aux, BLEND_ADD_ARGB); ObjShot_SetSpellResist(aux, true);
    }

    r += 360/46 + rand(-5, 5); r = NormalizeAngle(r);
    wait(60);
  }
}