task missiles(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
	//{
		let aux; let ga;
    
    let r = 30; let wvel = 0.4;
	//}

  coin();
  while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){

    PlaySFXV(SFX_MAGIC00, 30);
    let pu = wvel/absolute(wvel); pu *= 0.7;
    ascent(i in 0..8){
      let a = r + 360/8*i;

      aux = CreateMoveDuoSTLaser(bx, by, 3, a, [a, 70], 40, 17, [LASER_TIP_INDIGO, AMULET_INDIGO], [15, 60*99]);
      ObjMove_SetAngularVelocity(aux, wvel); ObjMove_AddPatternA2(aux, 40, -2, NO_CHANGE, 1/20, pu, 5);

      aux = CreateMoveDuoSTLaser(bx, by, 3, a, [a, 180+70], 40, 17, [LASER_TIP_INDIGO, AMULET_INDIGO], [15, 60*99]);
      ObjMove_SetAngularVelocity(aux, wvel); ObjMove_AddPatternA2(aux, 40, -2, NO_CHANGE, 1/20, pu, 5);
      
      aux = CustomCLaser(bx, by, 3, a, BL_SMALL_INDIGO, [1.5, 4, 10], BLEND_ADD_ARGB);
      ObjMove_SetAngularVelocity(aux, wvel); ObjMove_AddPatternA2(aux, 40, -2, NO_CHANGE, 1/20, pu, 5);
    }

    r = 360/16 + rand(-7,7); wvel *= -1;
    wait(50);
  }
}

task coin(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
	//{
		let aux; let ga;
    
    let r = 30; let wvel = 0.4;
	//}

  wait(50*7); Obj_SetValue(objBoss, "cast", 1);
  while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
    
    loop(7){
      PlaySFXV(SFX_SHOT02, 40);

      let al = rand(-10, 10);
      ascent(i in 0..13){
        let a = r + 360/13*i;

        aux = CScaledShotA1(bx, by, 3, a, COIN_YELLOW, 15, 1.23);
        ObjMove_AddPatternA2(aux, 60, 0, 90+al, 1/20, 0, 3); 
      }
      ascent(i in 0..26){
        let a = r + 360/26*i;

        aux = CScaledShotA1(bx, by, 3, a, ORB_YELLOW, 15, 0.75);
      }

      r = 360/26 + rand(-20,20); wvel *= -1;
      wait(40);
    }

    wait(60*2);
  }
}