Caster AI

Caster AI is an AI followed by the Caster class of enemies. Casters move exclusively via teleporting, and fire slow-moving projectiles that travel through Blocks.

Behavior
Casters always perform the following actions in succession:


 * 1) Teleport, usually to an on-screen location
 * 2) Fire 3 projectiles towards the player in succession
 * 3) Pause for about 3 seconds after firing
 * 4) Teleport to another on-screen location, beginning the cycle again.


 * If damage is taken while firing, a Caster will stop firing and begin the 3-second pause immediately, followed by a teleport.
 * If damage is taken during a 3-second pause, the pause countdown is reset back to 3 seconds, followed by a teleport. Taking repeated damage will continuously reset the countdown timer and prevent the Caster from firing.
 * Casters will never walk or jump. Their only method of movement is teleporting (aside from Knockback from being attacked).
 * Casters' projectiles travel through all block types, but each can be destroyed by a single swipe with any Weapon or Tool.

Strategies
Using a fast weapon which attacks continuously while holding the attack button makes for an effective shield against Casters' projectiles. Weapons like the Muramasa or Staff of Regrowth will work perfectly (even Pickaxes, Hammers, or Axes will work reasonably well, as their swings similarly don't require individual clicks).

The Vilethorn is effective both for taking down projectiles and attacking Casters, since it is the only weapon available to the player than can travel through walls. It has the best chance of stopping projectiles early, being capable of taking down projectiles at a reasonable distance even when they are coming through a thick wall. It is also good for attacking Casters when they are out of reach due to teleporting behind walls.

After Casters have fired their 3-projectile volley, there is a 3-second gap until they teleport; this is the perfect time to attack. Once you have started attacking, make sure you don't stop for too long, or else they will teleport again. Repeated attacks prevent Casters from firing or teleporting away.

Sometimes it is best to shield off their attacks when they are far away or in a hard-to-reach area, and wait until they teleport within attack range.

Trivia

 * The Caster AI is strikingly similar to the AI of the Magikoopas from Super Mario world, which teleported in, shot a spell off, and then teleported to a new location.