@Override
 public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
   Player controller = game.getPlayer(controllerId);
   if (controller != null) {
     if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) {
       for (UUID targetId : targets.get(0).getTargets()) {
         mage.cards.Card targetCard = game.getCard(targetId);
         if (targetCard == null) {
           return false;
         }
         paid |= controller.moveCardToHandWithInfo(targetCard, sourceId, game, Zone.HAND);
       }
     }
   }
   return paid;
 }
Ejemplo n.º 2
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player controller = game.getPlayer(source.getControllerId());
   if (controller != null) {
     ExileZone exZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
     if (exZone != null) {
       for (Card card : exZone.getCards(game)) {
         if (card != null) {
           controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED);
         }
       }
       return true;
     }
   }
   return false;
 }
Ejemplo n.º 3
0
 @Override
 public boolean apply(Game game, Ability source) {
   TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
   Player player = game.getPlayer(source.getControllerId());
   if (player.searchLibrary(target, game)) {
     if (target.getTargets().size() > 0) {
       Cards revealed = new CardsImpl();
       for (UUID cardId : target.getTargets()) {
         Card card = player.getLibrary().getCard(cardId, game);
         revealed.add(card);
       }
       player.revealCards("Kodama's Reach", revealed, game);
       if (target.getTargets().size() == 2) {
         TargetCard target2 = new TargetCard(Zone.PICK, filter);
         player.choose(Outcome.Benefit, revealed, target2, game);
         Card card = revealed.get(target2.getFirstTarget(), game);
         if (card != null) {
           player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true);
           revealed.remove(card);
         }
         card = revealed.getCards(game).iterator().next();
         if (card != null) {
           player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
         }
       } else if (target.getTargets().size() == 1) {
         Card card = revealed.getCards(game).iterator().next();
         if (card != null) {
           player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true);
         }
       }
     }
     player.shuffleLibrary(game);
     return true;
   }
   player.shuffleLibrary(game);
   return false;
 }