function for attacks on map