diff --git a/Mage/src/mage/abilities/effects/common/ReturnToHandTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToHandTargetEffect.java index c9bfcee1d9..a841ff5d41 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToHandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToHandTargetEffect.java @@ -38,6 +38,7 @@ import mage.cards.Card; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; +import mage.util.CardUtil; /** @@ -103,7 +104,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect 0) { - sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" target ").append(target.getTargetName()).append(" to their owners' hand"); + sb.append("up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()).append(" to their owners' hand"); return sb.toString(); } else { if (!target.getTargetName().startsWith("another")) { diff --git a/Mage/src/mage/target/TargetObject.java b/Mage/src/mage/target/TargetObject.java index 4d1775705f..12e664c001 100644 --- a/Mage/src/mage/target/TargetObject.java +++ b/Mage/src/mage/target/TargetObject.java @@ -68,8 +68,9 @@ public abstract class TargetObject> extends TargetImpl StringBuilder sb = new StringBuilder(); for (UUID targetId: getTargets()) { MageObject object = game.getObject(targetId); - if (object != null) + if (object != null) { sb.append(object.getName()).append(" "); + } } return sb.toString(); } @@ -77,8 +78,9 @@ public abstract class TargetObject> extends TargetImpl @Override public boolean canTarget(UUID id, Game game) { MageObject object = game.getObject(id); - if (object != null && game.getState().getZone(id).match(zone)) + if (object != null && game.getState().getZone(id).match(zone)) { return getFilter().match(object, game); + } return false; } diff --git a/Mage/src/mage/util/CardUtil.java b/Mage/src/mage/util/CardUtil.java index 300954d7ea..e3b493fbbc 100644 --- a/Mage/src/mage/util/CardUtil.java +++ b/Mage/src/mage/util/CardUtil.java @@ -343,6 +343,9 @@ public class CardUtil { if (number >= 0 && number < 21) { return numberStrings[number]; } + if (number == Integer.MAX_VALUE) { + return "any number of"; + } return Integer.toString(number); }