From 36a3008f4c48c737c57ac759f4689d32bbc722b8 Mon Sep 17 00:00:00 2001 From: Andre Cabaca Date: Sun, 30 Aug 2020 12:49:24 +0100 Subject: [PATCH] Optimized "Return to hand" effect text Signed-off-by: Andre Cabaca --- .../common/ReturnToHandTargetEffect.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java index 0ad9ae1912..8c5e158eb4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java @@ -90,21 +90,17 @@ public class ReturnToHandTargetEffect extends OneShotEffect { } Target target = mode.getTargets().get(0); StringBuilder sb = new StringBuilder("return "); - if (target.getMinNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { + if (target.getMinNumberOfTargets() == 0 && target.getMaxNumberOfTargets() >= 1) { sb.append("up to "); - sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())); - if (!target.getTargetName().contains("target")) { - sb.append(" target "); - } - sb.append(target.getTargetName()); - } else { - if (target.getNumberOfTargets() > 1) { - sb.append(CardUtil.numberToText(target.getNumberOfTargets())).append(' '); - } - if (!target.getTargetName().startsWith("another")) { - sb.append("target "); - } + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); } + else if (!(target.getMinNumberOfTargets() == 1 || target.getMaxNumberOfTargets() == 1)) { + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); + } + if (!target.getTargetName().contains("target")) { + sb.append("target "); + } + sb.append(target.getTargetName()); if(target.getMaxNumberOfTargets() > 1) { sb.append(" to their owners' hand"); }