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

@@ -26,14 +26,8 @@ public class DrawEffect extends SpellAbilityEffect {
if (tgtPlayers.size() > 1) { if (tgtPlayers.size() > 1) {
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,30 +43,24 @@ 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) { final List<Card> drawn = p.drawCards(numCards);
throw new RuntimeException("This api option is no longer supported. Please file a bug report with the card that threw this error."); if (sa.hasParam("Reveal")) {
} else { p.getGame().getAction().reveal(drawn, p);
final List<Card> drawn = p.drawCards(numCards); }
if (sa.hasParam("Reveal")) { if (sa.hasParam("RememberDrawn")) {
p.getGame().getAction().reveal(drawn, p); for (final Card c : drawn) {
} source.addRemembered(c);
if (sa.hasParam("RememberDrawn")) { }
for (final Card c : drawn) {
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;
} }
/** /**