This entire section is for "friendly" turrets, meaning they want to shoot monsters.
This code needs to avoid shooting the player and friendly monsters, and the next block (after "// Not friendly; hence, firing at the player") needs to avoid shooting unfriendly monsters.