Fix formatting for Champion keyword

This commit is contained in:
drdev
2014-07-18 08:16:26 +00:00
parent d754c4efd0
commit fcc3818a00
3 changed files with 11 additions and 11 deletions

View File

@@ -2161,6 +2161,10 @@ public class CardFactoryUtil {
final String[] k = parse.split(":");
final String[] valid = k[1].split(",");
String desc = k.length > 2 ? k[2] : k[1];
String article = Lang.startsWithVowel(desc) ? "an" : "a";
if (desc.equals("Creature")) {
desc = "creature"; //use lowercase for "Champion a creature"
}
StringBuilder changeType = new StringBuilder();
for (String v : valid) {
@@ -2172,7 +2176,7 @@ public class CardFactoryUtil {
StringBuilder trig = new StringBuilder();
trig.append("Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | ");
trig.append("Execute$ ChampionAbility | TriggerDescription$ Champion a(n) ");
trig.append("Execute$ ChampionAbility | TriggerDescription$ Champion ").append(article + " ");
trig.append(desc).append(" (When this enters the battlefield, sacrifice it unless you exile another ");
trig.append(desc).append(" you control. When this leaves the battlefield, that card returns to the battlefield.)");

View File

@@ -23,11 +23,11 @@ import forge.game.card.Card;
import forge.game.card.CounterType;
import forge.game.mana.ManaCostBeingPaid;
import forge.game.zone.ZoneType;
import forge.util.Lang;
import forge.util.TextUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import com.google.common.collect.Lists;
@@ -643,8 +643,6 @@ public class Cost {
* <code>numNames="{zero, a, two, three, four, five, six, "{trunked}</code>
*/
private static final String[] NUM_NAMES = { "zero", "a", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" };
/** Constant <code>vowelPattern</code>. */
private static final Pattern VOWEL_PATTERN = Pattern.compile("^[aeiou]", Pattern.CASE_INSENSITIVE);
/**
* Convert amount type to words.
@@ -686,7 +684,7 @@ public class Cost {
if (i >= Cost.NUM_NAMES.length) {
sb.append(i);
}
else if ((1 == i) && Cost.VOWEL_PATTERN.matcher(type).find()) {
else if (i == 1 && Lang.startsWithVowel(type)) {
sb.append("an");
}
else {