Updated ai function to use projDealy for NPC attack