Refactored Djinn of Wishes

This commit is contained in:
magenoxx 2011-08-08 21:53:54 +04:00
parent 846d1479a2
commit fabd7edda4

View file

@ -116,22 +116,10 @@ class DjinnOfWishesEffect1 extends OneShotEffect<DjinnOfWishesEffect1> {
cards.add(card); cards.add(card);
player.revealCards("Djinn Of Wishes", cards, game); player.revealCards("Djinn Of Wishes", cards, game);
Choice abilityChoice = new ChoiceImpl();
abilityChoice.setMessage("Play " + card.getName() + " without paying its mana cost?");
Set<String> abilities = new HashSet<String>();
abilities.add("Yes");
abilities.add("No");
abilityChoice.setChoices(abilities);
player.choose(Constants.Outcome.PlayForFree, abilityChoice, game);
System.out.println(abilityChoice);
System.out.println(abilityChoice.getChoice());
player.getLibrary().removeFromTop(game); player.getLibrary().removeFromTop(game);
boolean used = false; boolean used = false;
if (abilityChoice.getChoice() != null && abilityChoice.getChoice().equals("Yes")) { if (player.chooseUse(Constants.Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", game)) {
if (card.getCardType().contains(CardType.LAND)) { if (card.getCardType().contains(CardType.LAND)) {
// If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn. // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn.
if (game.getActivePlayerId().equals(player.getId()) && player.getLandsPlayed() < player.getLandsPerTurn()) { if (game.getActivePlayerId().equals(player.getId()) && player.getLandsPlayed() < player.getLandsPerTurn()) {