Update battle engine code