Friendly turrets attack hostile NPCs

Adds code to iterate over active npcs and consider them as targets. Npcs are hostile when they attitude is `NPCATT_KILL`. This is the same check that is done for the safe mode.

#9707 should be merged first because the shooting turret damages the armor of the npc, leading to the crash mentioned in that PR.

Fixes #9596