forked from External/mage
Create generic "Gains your choice of ability" effect, add [ACR] Assassin Initiate (#12619)
Create generic GainsChoiceOfAbilitiesEffect, covers both Target and Source cases. Adds Assassin Initiate
This commit is contained in:
parent
b70638acc9
commit
00770646f8
29 changed files with 381 additions and 1162 deletions
|
|
@ -103,10 +103,12 @@ public abstract class TargetImpl implements Target {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
int min = getMinNumberOfTargets();
|
||||
int max = getMaxNumberOfTargets();
|
||||
String targetName = getTargetName();
|
||||
if (min > 0 && max == Integer.MAX_VALUE) {
|
||||
sb.append(CardUtil.numberToText(min));
|
||||
sb.append(" or more ");
|
||||
} else if (!getTargetName().startsWith("X ") && (min != 1 || max != 1)) {
|
||||
} else if (!targetName.startsWith("X ") && (min != 1 || max != 1)) {
|
||||
targetName = targetName.replace("another", "other"); //If non-singular, use "other" instead of "another"
|
||||
if (min < max && max != Integer.MAX_VALUE) {
|
||||
if (min == 1 && max == 2) {
|
||||
sb.append("one or ");
|
||||
|
|
@ -122,10 +124,10 @@ public abstract class TargetImpl implements Target {
|
|||
boolean addTargetWord = false;
|
||||
if (!isNotTarget()) {
|
||||
addTargetWord = true;
|
||||
if (getTargetName().contains("target ")) {
|
||||
if (targetName.contains("target ")) {
|
||||
addTargetWord = false;
|
||||
} else if (getTargetName().endsWith("any target")
|
||||
|| getTargetName().endsWith("any other target")) {
|
||||
} else if (targetName.endsWith("any target")
|
||||
|| targetName.endsWith("any other target")) {
|
||||
addTargetWord = false;
|
||||
}
|
||||
// endsWith needs to be specific.
|
||||
|
|
@ -135,9 +137,9 @@ public abstract class TargetImpl implements Target {
|
|||
sb.append("target ");
|
||||
}
|
||||
if (isNotTarget() && min == 1 && max == 1) {
|
||||
sb.append(CardUtil.addArticle(getTargetName()));
|
||||
sb.append(CardUtil.addArticle(targetName));
|
||||
} else {
|
||||
sb.append(getTargetName());
|
||||
sb.append(targetName);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue