Cleaned up play_as_ai method