mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Merge pull request #7026 from acabaca24/branch-for-issue6643
Duplicated code in "return to its owner's hand" effect
This commit is contained in:
commit
bbf30c6f74
1 changed files with 11 additions and 15 deletions
|
@ -90,26 +90,22 @@ 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");
|
||||
sb.append(" to their owners' hands");
|
||||
}
|
||||
else {
|
||||
sb.append(target.getTargetName()).append(" to its owner's hand");
|
||||
sb.append(" to its owner's hand");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue