Accounted for enemy attacks and added in a general goal to prevent random wondering when nothing to do locally.