added functions to be used in lua for battle