Function for changing battle state