integrating battle and client code