[STX] more text fixes

This commit is contained in:
Evan Kranzler 2021-04-17 21:56:26 -04:00
parent ef8ee52b94
commit efb2a7f3de
12 changed files with 19 additions and 17 deletions

View file

@ -38,9 +38,7 @@ public class ExileFromGraveCost extends CostImpl {
+ CardUtil.numberToText(target.getMaxNumberOfTargets()))
+ ' ' + target.getTargetName();
} else {
this.text = "exile "
+ (target.getTargetName().startsWith("card ") ? "a " : "")
+ target.getTargetName();
this.text = "exile " + CardUtil.addArticle(target.getTargetName());
}
if (!this.text.endsWith(" from your graveyard")) {
this.text = this.text + " from your graveyard";

View file

@ -13,7 +13,7 @@ import mage.players.Player;
*/
public class ExileSpellEffect extends OneShotEffect {
private ExileSpellEffect() {
public ExileSpellEffect() {
super(Outcome.Exile);
staticText = "Exile {this}";
}

View file

@ -105,10 +105,7 @@ public class SearchLibraryPutInHandEffect extends SearchEffect {
sb.append(" and put them into your hand. If you do, shuffle");
}
} else {
if (!target.getTargetName().startsWith("a ") && !target.getTargetName().startsWith("an ")) {
sb.append("a ");
}
sb.append(target.getTargetName());
sb.append(CardUtil.addArticle(target.getTargetName()));
if (forceShuffle) {
sb.append(revealCards ? ", reveal it, put it" : ", put that card");
sb.append(" into your hand, then shuffle");

View file

@ -73,7 +73,7 @@ public class SearchLibraryPutOnLibraryEffect extends SearchEffect {
if (reveal) {
sb.append(", reveal it");
}
sb.append(", then shuffle and put that card on top of it");
sb.append(", then shuffle and put that card on top");
staticText = sb.toString();
}
}

View file

@ -911,6 +911,13 @@ public final class CardUtil {
}
}
public static String addArticle(String text) {
if (text.startsWith("a ") || text.startsWith("an ")) {
return text;
}
return "aeiou".contains("" + text.charAt(0)) ? "an " + text : "a " + text;
}
public static Set<UUID> getAllSelectedTargets(Ability ability, Game game) {
return ability.getModes().getSelectedModes()
.stream()
@ -1275,7 +1282,7 @@ public final class CardUtil {
int res;
try {
res = Integer.parseInt(value);
} catch(NumberFormatException ex) {
} catch (NumberFormatException ex) {
res = defaultValue;
}
return res;