task missiles(){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
	
  ObjMove_SetDestAtFrameWeight(objBoss, gx, gy, 30);
  ascent(i in 0..31){ObjRender_SetAlpha(objBoss, Interpolate_Smooth(255, 200, i/30)); yield;}
  Obj_SetValue(objBoss, "cast", 1); dreamcath(30.7, 1);
}

task dreamcath(spin, n){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
  //{
		let aux = []; let range;
    let bull;
    
    let r = 30; let rain = 0;
    let numBullets = 3; let z = 0;
	//}

  let timer = 60*2.5;
  ascent(counter in 0..timer+1){
    PlaySFXV(SFX_SHOT04, 20);

    z = Interpolate_Smoother(-205*n, 205*n, counter/timer);
    range = Interpolate_Linear(600, 0, counter/timer);
    ascent(i in 0..5){
      let a = r + 360/5*i;

      bull = CScaledShotA1(bx + range*cos(a), by + range*sin(a), 0, a+z+180, CRYSTAL_GREEN, 30, 1.1);
      ObjShot_SetSpellResist(bull, true); ObjShot_SetAutoDelete(bull, false); ifoutofBounds(bull, 72);
      aux = aux ~ [bull];
    }

    range = Interpolate_Linear(0, 600, counter/timer);
    ascent(i in 0..5){
      let a = r + 360/5*i;

      bull = CScaledShotA1(bx + range*cos(a), by + range*sin(a), 0, a+z+180, CRYSTAL_MINT, 30, 1.1);
      ObjShot_SetSpellResist(bull, true); ObjShot_SetAutoDelete(bull, false); ifoutofBounds(bull, 72);
      aux = aux ~ [bull];
    }

    r -= spin; r = NormalizeAngle(r);
    wait(60*1/40);
  }

  PlaySFXVDelay(SFX_MAGIC02, 56, 21);
  for each(let bullshit : aux){
    ObjMove_AddPatternA2(bullshit, 21, 0, NO_CHANGE, 1/60, 0, 0.8);
    ObjMove_AddPatternA2(bullshit, 60*5, NO_CHANGE, NO_CHANGE, 1/120, 0, 2);
  }
  
  wait(60*5);
  mfwave(spin, n);
}

task mfwave(spin, n){
  if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
  //{
		let aux = []; let range;
    let bull;
    
    let r = 0; let rain = 0;
    let gain = 0; let z = 0.4;

    let fever = [SMALL_PURPLE, SMALL_GREEN, SMALL_MINT]; let angele = 0;
	//}

  z = 0.4;
  ascent(i in 0..16+1){

    PlaySFXV(SFX_SHOT02, 36+i);
    range = Interpolate_Linear(1, 2, i/16);
    r = Interpolate_Smooth(-360, 360, i/16);

    rain = rand(-30, 30); gain = rand(-60, -30);
    ascent(i in 0..12){
      let a = r + 360/12*i;

      bull = CScaledShotA1(bx + rain, by + gain, 3.3, a, SMALL_INV_INDIGO, 17, range); ObjMove_SetAngularVelocity(bull, z); ObjShot_SetSpellResist(bull, true);
      bull = CustomCLaser2(bx + rain, by + gain, 3.3, [a, 180], SMALL_INV_PURPLE, [9, 10, 3, range], BLEND_ADD_ARGB, false); ObjMove_SetAngularVelocity(bull, z);
    }

    z *= -1;
    wait(15);
  }

  wait(20); z = 0.5;
  descent(i in 0..12){
    PlaySFXV(SFX_HUGESHOT, 56);

    range = Interpolate_Linear(-50, 50, i/9);
    aux = PolygonShot(bx + range*n, by-50, 6, 45, 4, 10, 1, fever[angele]+686, 15, 0.8, BLEND_ALPHA);
    for each(let obj : aux){
      let vs = getvalue(obj, "var_speed");
      ObjMove_AddPatternA2(obj, 15, 0, NO_CHANGE, (1/8) * vs, 0, vs * (2+i/2));
    }

    z *= -1;
    angele++; angele = (angele > 2) ? 0 : angele;
    wait(9);
  }

  wait(60*2);
  dreamcath(-spin, -n);
}