Fixed test, fixed some code warnings

This commit is contained in:
Oleg Agafonov 2023-02-25 15:21:48 +04:00
parent 5c30467c48
commit e8ffe90d41
10 changed files with 21 additions and 20 deletions

View file

@ -111,11 +111,9 @@ class BecomeMonstrousSourceEffect extends OneShotEffect {
}
private String setText(int monstrosityValue) {
StringBuilder sb = new StringBuilder("Monstrosity ");
sb.append(monstrosityValue == Integer.MAX_VALUE ? "X" : monstrosityValue)
.append(". <i>(If this creature isn't monstrous, put ")
.append(monstrosityValue == Integer.MAX_VALUE ? "X" : CardUtil.numberToText(monstrosityValue))
.append(" +1/+1 counters on it and it becomes monstrous.)</i>").toString();
return sb.toString();
return "Monstrosity " + (monstrosityValue == Integer.MAX_VALUE ? "X" : monstrosityValue) +
". <i>(If this creature isn't monstrous, put " +
(monstrosityValue == Integer.MAX_VALUE ? "X" : CardUtil.numberToText(monstrosityValue)) +
" +1/+1 counters on it and it becomes monstrous.)</i>";
}
}

View file

@ -103,7 +103,7 @@ public abstract class TargetImpl implements Target {
StringBuilder sb = new StringBuilder();
int min = getMinNumberOfTargets();
int max = getMaxNumberOfTargets();
if (min != 1 || max != 1) {
if (!getTargetName().startsWith("X") && (min != 1 || max != 1)) {
if (min < max && max != Integer.MAX_VALUE) {
if (min == 1 && max == 2) {
sb.append("one or ");