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:
ssk97 2024-08-22 13:34:40 -07:00 committed by GitHub
parent b70638acc9
commit 00770646f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 381 additions and 1162 deletions

View file

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