added functions for switching phases and checking if all vehicles have attacked