private void NukePlatforms()
        {
            if (AttackTimer == 1)
            {
                List <Vector2> possibleLocations = new List <Vector2>(crystalLocations);
                possibleLocations.ForEach(n => n += new Vector2(0, -32));
                for (int k = 0; k < crystals.Count; k++)
                {
                    NPC crystalNpc            = crystals[k];
                    VitricBossCrystal crystal = crystalNpc.modNPC as VitricBossCrystal;

                    crystal.StartPos = crystalNpc.Center;
                    Vector2 target = possibleLocations.OrderBy(n => Vector2.Distance(crystalNpc.Center, n)).ToList()[0]; //sort the remaining possible unique platforms by distance, this ensures crystals go to theirn earest unique platform
                    crystal.TargetPos = target;
                    possibleLocations.Remove(target);
                    crystalNpc.ai[1] = 0; //reset the crystal's timers
                    crystalNpc.ai[2] = 1; //set them into this attack's mode
                }
            }
            if (AttackTimer == 180)
            {
                crystals.FirstOrDefault(n => n.ai[0] == 2).ai[0] = 0;
            }

            if (AttackTimer >= 720)
            {
                ResetAttack();
            }
        }
        private void CrystalCage()
        {
            if (AttackTimer % 110 == 0 && AttackTimer != 0 && AttackTimer < 800) //the sand cones the boss fires
            {
                RandomizeTarget();
                int index = Projectile.NewProjectile(npc.Center, Vector2.Zero, ProjectileType <SandCone>(), 1, 0); //spawn a sand cone attack
                Main.projectile[index].rotation = (npc.Center - Main.player[npc.target].Center).ToRotation() + Main.rand.NextFloat(-0.5f, 0.5f);
            }

            for (int k = 0; k < 4; k++) //each crystal
            {
                NPC crystal = crystals[k];
                VitricBossCrystal crystalModNPC = crystal.modNPC as VitricBossCrystal;
                if (AttackTimer == 1) //set the crystal's home position to where they are
                {
                    crystalModNPC.StartPos = crystal.Center;
                    favoriteCrystal        = Main.rand.Next(4); //randomize which crystal will have the opening
                }

                if (AttackTimer > 1 && AttackTimer <= 60) //suck the crystals in
                {
                    crystal.Center = npc.Center + (Vector2.SmoothStep(crystalModNPC.StartPos, npc.Center, AttackTimer / 60) - npc.Center).RotatedBy(AttackTimer / 60f * 3.14f);
                }

                if (AttackTimer == 61)  //Set the crystal's new endpoints. !! actual endpoints are offset by pi !!
                {
                    crystalModNPC.StartPos  = crystal.Center;
                    crystalModNPC.TargetPos = npc.Center + new Vector2(0, -800).RotatedBy(1.57f * k);
                    crystal.ai[2]           = 2; //set them into this mode to get the rotational effect
                }

                if (AttackTimer >= 120 && AttackTimer < 360) //spiral outwards slowly
                {
                    crystal.Center = npc.Center + (Vector2.SmoothStep(crystalModNPC.StartPos, crystalModNPC.TargetPos, (AttackTimer - 120) / 240) - npc.Center).RotatedBy((AttackTimer - 120) / 240 * 3.14f);
                }

                if (AttackTimer >= 360 && AttackTimer < 840) //come back in
                {
                    crystal.Center = npc.Center + (Vector2.SmoothStep(crystalModNPC.TargetPos, crystalModNPC.StartPos, (AttackTimer - 360) / 480) - npc.Center).RotatedBy(-(AttackTimer - 360) / 480 * 4.72f);

                    //the chosen "favorite" or master crystal is the one where our opening should be
                    if (k != favoriteCrystal)
                    {
                        for (int i = 0; i < 8; i++)
                        {
                            Dust d = Dust.NewDustPerfect(npc.Center + (crystal.Center - npc.Center).RotatedBy(Main.rand.NextFloat(1.57f)), DustType <Dusts.BlueStamina>(), Vector2.Zero, 0, default, 2);
        private void NukePlatforms()
        {
            if (AttackTimer == 1)
            {
                List <Vector2> possibleLocations = new List <Vector2>(crystalLocations);
                possibleLocations.ForEach(n => n += new Vector2(0, -32));
                for (int k = 0; k < crystals.Count; k++)
                {
                    NPC crystalNpc            = crystals[k];
                    VitricBossCrystal crystal = crystalNpc.modNPC as VitricBossCrystal;

                    crystal.StartPos = crystalNpc.Center;
                    Vector2 target = possibleLocations.OrderBy(n => Vector2.Distance(crystalNpc.Center, n)).ToList()[0]; //sort the remaining possible unique platforms by distance, this ensures crystals go to theirn earest unique platform
                    crystal.TargetPos = target;
                    possibleLocations.Remove(target);
                    crystalNpc.ai[1] = 0; //reset the crystal's timers
                    crystalNpc.ai[2] = 1; //set them into this attack's mode
                }
            }

            if (AttackTimer == 180)
            {
                crystals.FirstOrDefault(n => n.ai[0] == 2).ai[0] = 0;
            }

            if (AttackTimer > 180 && AttackTimer % 15 == 0)
            {
                Vector2 pos = crystalLocations[Main.rand.Next(crystalLocations.Count)] + new Vector2(0, -20);
                Projectile.NewProjectile(pos + new Vector2(Main.rand.Next(-100, 60), 64), Vector2.Zero, ProjectileType <BossSpikeSmall>(), 5, 0);
            }

            if (AttackTimer >= 720)
            {
                ResetAttack();
            }
        }