end battle logic fixed.