fix text: BecomesColorTargetEffect

This commit is contained in:
xenohedron 2023-07-19 20:26:20 -04:00
parent 46567ce2a5
commit f944408252
7 changed files with 19 additions and 25 deletions

View file

@ -135,15 +135,14 @@ public class BecomesColorTargetEffect extends ContinuousEffectImpl {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
StringBuilder sb = new StringBuilder();
sb.append("Target ").append(mode.getTargets().get(0).getTargetName());
sb.append(" becomes ");
StringBuilder sb = new StringBuilder(getTargetPointer().describeTargets(mode.getTargets(), "it"));
sb.append(getTargetPointer().isPlural(mode.getTargets()) ? " become " : " becomes ");
if (setColor == null) {
sb.append("the color of your choice");
} else {
sb.append(setColor.getDescription());
}
if (!duration.toString().equals("")) {
if (!duration.toString().isEmpty()) {
sb.append(' ').append(duration.toString());
}
return sb.toString();

View file

@ -45,15 +45,15 @@ public abstract class TargetImpl implements Target {
@Override
public abstract TargetImpl copy();
public TargetImpl() {
protected TargetImpl() {
this(false);
}
public TargetImpl(boolean notTarget) {
protected TargetImpl(boolean notTarget) {
this.notTarget = notTarget;
}
public TargetImpl(final TargetImpl target) {
protected TargetImpl(final TargetImpl target) {
this.targetName = target.targetName;
this.zone = target.zone;
this.maxNumberOfTargets = target.maxNumberOfTargets;
@ -103,7 +103,10 @@ public abstract class TargetImpl implements Target {
StringBuilder sb = new StringBuilder();
int min = getMinNumberOfTargets();
int max = getMaxNumberOfTargets();
if (!getTargetName().startsWith("X") && (min != 1 || max != 1)) {
if (min > 0 && max == Integer.MAX_VALUE) {
sb.append(CardUtil.numberToText(min));
sb.append(" or more ");
} else if (!getTargetName().startsWith("X") && (min != 1 || max != 1)) {
if (min < max && max != Integer.MAX_VALUE) {
if (min == 1 && max == 2) {
sb.append("one or ");