battle logic