Polarities Mod/Gigabat

The Gigabat is a Pre-Hardmode boss intended to be fought just before Queen Bee.

While it is alive, its exclusive Squeaking Doom will play; if the Polarities Mod Music sidemod is not enabled, the vanilla track Boss 1 will play instead.

Spawn
Gigabat does not spawn on its own, and requires the player to summon it by releasing Gemflies in the cavern layer and waiting for it to spawn, or by using a there. It can only be summoned in the cavern layer.

Behavior
Gigabat summons a swarm of swarm bats that form a circular arena, enclosing the player. If the player exits the arena, the swarm will reposition itself to keep the player enclosed. The swarm starts with a maximum of 64 total swarm bats, which increases to 100 when the boss reaches 65% health. If the swarm is not at its maximum capacity, Gigabat will occasionally slow down, briefly pausing in its attacks, and summon bats to fill the swarm back to its cap.

The boss alternates, mostly randomly, between several attacks:


 * Charge Series- Gigabat charges the player three times, shooting a slow-moving echolocation projectile at the player which passes through tiles inflicts Pinpointed, giving its attacks a 50% chance to deal double damage to the player, at the start of the first charge. Below 65% health, the boss will shoot a spread of three of these projectiles with the first charge, and it charges four times instead of three. In Expert Mode, the boss shoots an echolocation projectile with every charge, not just the first. After the last charge in the series, the boss will remain still for a few seconds, allowing the player to deal damage. The charge series attack has a 20-second cooldown, but it will always use the attack if it's available.


 * Swarm Streams- Gigabat circles the arena rapidly. A brief telegraph that resembles the effects of the echolocation projectile will appear from either the four orthogonal or four diagonal edges of the arena, after which swarm bats will come from these locations and fly slowly across the arena at the player. Below 65% health, the bats will come from both the orthogonal and diagonal directions.


 * Swarm Jet- Gigabat will freeze in place at the edge of the arena, a brief telegraph effect appearing midway between it and the arena center. After a short time, it will begin to flap its wings rapidly, sending a stream of bats towards the center of the arena which begin to fan out after reaching the point indicated by the telegraph. Below 65% health, the bats in the stream move much more quickly.


 * Enclosing Swarm- Gigabat circles the arena rapidly. Bats from the swarm will dart across it in chords that gradually draw closer and closer to the center of the arena. Below 65% health, Gigabat will circle much more slowly during this attack, and a telegraph will appear in the middle, after which the boss will dash across the arena, shooting three echolocation projectiles in a wide spread.

Aftermath
Once the Gigabat has been defeated for the first time, the following will occur:
 * s will begin spawning naturally.
 * The will begin selling.

Tips

 * Due to the fact that the boss creates its own arena, your arena does not need to be large. A few platforms with campfires and heart lanterns in an open underground space should suffice.
 * Staying near the center of the arena trivializes the enclosing swarm attack when below 65% health, and it also keeps the player as far from the edge as possible, ensuring the player is in a good position to dodge the boss' other attacks.
 * The swarm does not regenerate immediately, so using a piercing weapon can help to keep their numbers down and make hitting the main bat easier.