removed code for 'NextUpkeep' because no cards left that use it

This commit is contained in:
Maxmtg
2013-05-29 14:31:38 +00:00
parent 3e7d885b3c
commit d733ddc7c7
2 changed files with 17 additions and 28 deletions

View File

@@ -27,13 +27,7 @@ public class DrawEffect extends SpellAbilityEffect {
sb.append(" each"); sb.append(" each");
} }
sb.append(Lang.joinVerb(tgtPlayers, " draw")).append(" "); sb.append(Lang.joinVerb(tgtPlayers, " draw")).append(" ");
sb.append(Lang.nounWithAmount(numCards, " card"));
sb.append(numCards).append(Lang.joinNounToAmount(numCards, " card"));
if (sa.hasParam("NextUpkeep")) {
sb.append(" at the beginning of the next upkeep");
}
sb.append("."); sb.append(".");
} }
@@ -49,17 +43,14 @@ public class DrawEffect extends SpellAbilityEffect {
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final boolean optional = sa.hasParam("OptionalDecider"); final boolean optional = sa.hasParam("OptionalDecider");
final boolean slowDraw = sa.hasParam("NextUpkeep");
for (final Player p : getDefinedPlayersBeforeTargetOnes(sa)) { for (final Player p : getDefinedPlayersBeforeTargetOnes(sa)) {
if ((tgt == null) || p.canBeTargetedBy(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa))
if (optional && !p.getController().confirmAction(sa, null, "Do you want to draw " + numCards + " cards(s)?")) if (optional && !p.getController().confirmAction(sa, null, "Do you want to draw " + Lang.nounWithAmount(numCards, " card") + "?"))
continue; continue;
//TODO: remove this deprecation exception //TODO: remove this deprecation exception
if (slowDraw) {
throw new RuntimeException("This api option is no longer supported. Please file a bug report with the card that threw this error.");
} else {
final List<Card> drawn = p.drawCards(numCards); final List<Card> drawn = p.drawCards(numCards);
if (sa.hasParam("Reveal")) { if (sa.hasParam("Reveal")) {
p.getGame().getAction().reveal(drawn, p); p.getGame().getAction().reveal(drawn, p);
@@ -69,10 +60,7 @@ public class DrawEffect extends SpellAbilityEffect {
source.addRemembered(c); source.addRemembered(c);
} }
} }
}
} }
} }
} // drawResolve() } // drawResolve()
}

View File

@@ -48,9 +48,10 @@ public class Lang {
return subjects.size() > 1 ? verb : verb + "s"; return subjects.size() > 1 ? verb : verb + "s";
} }
public static <T> String joinNounToAmount(int cnt, String noun) { public static <T> String nounWithAmount(int cnt, String noun) {
// Simpliest check // Simpliest check
return cnt > 1 ? noun : ( noun.endsWith("s") || noun.endsWith("x") ? noun + "es" : noun + "s"); String suffix = cnt <= 1 ? "" : ( noun.endsWith("s") || noun.endsWith("x") ? "es" : "s");
return String.valueOf(cnt) + " " + noun + suffix;
} }
/** /**