* Innane, Life Ascpect - Fixed the displayed up to number in tooltip text.

This commit is contained in:
LevelX2 2013-10-29 08:19:47 +01:00
parent 1cbe322da8
commit 4e35568bb5
3 changed files with 9 additions and 3 deletions

View file

@ -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<ReturnToHandTargetEf
Target target = mode.getTargets().get(0);
StringBuilder sb = new StringBuilder("Return ");
if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 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")) {

View file

@ -68,17 +68,19 @@ public abstract class TargetObject<T extends TargetObject<T>> 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();
}
@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;
}

View file

@ -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);
}