From 6b508ecaccc07c666e399574364eae03265fee87 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sat, 24 Oct 2020 20:38:46 -0500 Subject: [PATCH] Targeting interface now says "Select up to one..." when the target is optional (bug #7046). --- Mage/src/main/java/mage/target/TargetImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/target/TargetImpl.java b/Mage/src/main/java/mage/target/TargetImpl.java index c800d552b5..a7772147a7 100644 --- a/Mage/src/main/java/mage/target/TargetImpl.java +++ b/Mage/src/main/java/mage/target/TargetImpl.java @@ -117,7 +117,11 @@ public abstract class TargetImpl implements Target { || targetName.startsWith("an ") || targetName.startsWith("any ")) { return "Select " + targetName + suffix; - } else if (targetName.startsWith("a") || targetName.startsWith("e") || targetName.startsWith("i") || targetName.startsWith("o") || targetName.startsWith("u")) { + } + if (getMinNumberOfTargets() == 0 && getMaxNumberOfTargets() == 1) { + return "Select up to one " + targetName + suffix; + } + if (targetName.startsWith("a") || targetName.startsWith("e") || targetName.startsWith("i") || targetName.startsWith("o") || targetName.startsWith("u")) { return "Select an " + targetName + suffix; } return "Select a " + targetName + suffix;