Package mage.cards

Examples of mage.cards.Card


    Player player = game.getPlayer(source.getControllerId());
    player.searchLibrary(target, game);
    if (target.getTargets().size() > 0) {
      Cards revealed = new CardsImpl();
      for (UUID cardId: (List<UUID>)target.getTargets()) {
        Card card = player.getLibrary().remove(cardId, game);
        if (card != null) {
          card.moveToZone(Zone.HAND, source.getId(), game, false);
          revealed.add(card);
        }
      }
      player.shuffleLibrary(game);
      player.revealCards(revealed, game);
View Full Code Here


    super(target);
  }

  @Override
  public boolean canTarget(UUID id, Ability source, Game game) {
    Card card = game.getCard(id);
    if (card != null && game.getZone(card.getId()) == Zone.GRAVEYARD)
      return filter.match(card);
    return false;
  }
View Full Code Here

    super(target);
  }

  @Override
  public boolean canTarget(UUID id, Ability source, Game game) {
    Card card = game.getCard(id);
    if (card != null && game.getZone(card.getId()) == Zone.GRAVEYARD)
      if (game.getPlayer(source.getControllerId()).getGraveyard().contains(id))
        return filter.match(card);
    return false;
  }
View Full Code Here

    this.playerId = target.playerId;
  }

  @Override
  public boolean canTarget(UUID id, Ability source, Game game) {
    Card card = game.getPlayer(playerId).getHand().get(id, game);
    if (card != null)
      return filter.match(card);
    return false;
  }
View Full Code Here

  }

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    Card card = player.getGraveyard().get(source.getSourceId(), game);
    if (card != null) {
      player.removeFromGraveyard(card, game);
      if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId())) {
        if (tapped) {
          Permanent permanent = game.getPermanent(card.getId());
          if (permanent != null)
            permanent.setTapped(true);
        }
        return true;
      }
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
    player.searchLibrary(target, game);
    List<Card> cards = new ArrayList<Card>();
        if (target.getTargets().size() > 0) {
            for (UUID cardId: (List<UUID>)target.getTargets()) {
                Card card = player.getLibrary().remove(cardId, game);
                if (card != null)
          cards.add(card);
            }
            player.shuffleLibrary(game);
      for (Card card: cards) {
        card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
      }
        }
        return true;
    }
View Full Code Here

        Permanent permanent = game.getPermanent(source.getFirstTarget());
        if (permanent != null) {
          return permanent.moveToZone(Zone.LIBRARY, source.getId(), game, onTop);
        }
      case GRAVEYARD:
        Card card = game.getCard(source.getFirstTarget());
        for (Player player: game.getPlayers().values()) {
          if (player.getGraveyard().contains(card.getId())) {
            player.getGraveyard().remove(card);
            return card.moveToZone(Zone.LIBRARY, source.getId(), game, onTop);
          }
        }
    }
    return false;
  }
View Full Code Here

  @Override
  public boolean apply(Game game, Ability source) {
    ExileZone exile = game.getExile().getExileZone(exileId);
    if (exile != null) {
      for (UUID cardId: exile) {
        Card card = game.getCard(cardId);
        card.moveToZone(zone, source.getId(), game, tapped);
      }
      exile.clear();
      return true;
    }
    return false;
View Full Code Here

  }

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getFirstTarget());
    Card card;
    for (int i = 0; i < amount; i++) {
      card = player.getLibrary().removeFromTop(game);
      if (card != null)
        player.getGraveyard().add(card);
      else
View Full Code Here

    super(effect);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    Card card;
    Player player = game.getPlayer(source.getControllerId());
    ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade");
    int sourceCost = game.getObject(source.getSourceId()).getManaCost().convertedManaCost();
    do {
      card = player.getLibrary().removeFromTop(game);
      if (card == null)
        break;
      card.moveToExile(exile.getId(), exile.getName(), source.getId(), game);
    } while (card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost);

    if (card != null) {
      if (player.chooseUse(outcome, "Use cascade effect on " + card.getName() + "?", game)) {
        player.cast(card.getSpellAbility(), game, true);
        exile.remove(card.getId());
      }
    }

    while (exile.size() > 0) {
      card = exile.getRandom(game);
      exile.remove(card.getId());
      card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
    }

    return true;
  }
View Full Code Here

TOP

Related Classes of mage.cards.Card

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.