Examples of moveToZone()


Examples of mage.cards.Card.moveToZone()

            if (amountExiled > 0) {
                int count = Math.min(controller.getLibrary().size(), amountExiled);
                for (int i = 0; i < count; i++) {
                    Card card = controller.getLibrary().removeFromTop(game);
                    if (card != null) {
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                    }
                }
            }
            game.informPlayers(controller.getName() + " moves " + amountExiled + " card" + (amountExiled == 1 ? " ":"s ") + "from library to hand");
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

    if (targets.choose(Outcome.ReturnToHand, controllerId, game)) {
      for (UUID targetId: targets.get(0).getTargets()) {
        Permanent permanent = game.getPermanent(targetId);
        if (permanent == null)
          return false;
        paid |= permanent.moveToZone(Zone.HAND, sourceId, game, false);
      }
    }
    return paid;
  }
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

  public boolean apply(Game game, Ability source) {
    switch (source.getTargets().get(0).getZone()) {
      case BATTLEFIELD:
        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())) {
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (player != null && permanent != null) {
      player.gainLife(5, game);
      permanent.moveToZone(Zone.LIBRARY, source.getId(), game, true);
      player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
      player.getGraveyard().clear();
      player.getLibrary().shuffle();
      return true;
    }
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      Player player = game.getPlayer(permanent.getControllerId());
      if (permanent.moveToZone(Zone.EXILED, source.getId(), game, false)) {
        if (player.chooseUse(Outcome.PutCardInPlay, "Use Path to Exile effect?", game)) {
          TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
          player.searchLibrary(target, game);
          Card card = player.getLibrary().remove(target.getFirstTarget(), game);
          if (card != null) {
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

  public boolean apply(Game game, Ability source) {
    switch (source.getTargets().get(0).getZone()) {
      case BATTLEFIELD:
        Permanent permanent = game.getPermanent(source.getFirstTarget());
        if (permanent != null) {
          return permanent.moveToZone(Zone.HAND, source.getId(), game, false);
        }
      case GRAVEYARD:
        Card card = game.getCard(source.getFirstTarget());
        for (Player player: game.getPlayers().values()) {
          if (player.getGraveyard().contains(card.getId())) {
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Permanent permanent = ((ZoneChangeEvent) event).getTarget();
        if (permanent != null) {
            if(permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false)) {
                game.informPlayers(new StringBuilder(permanent.getName()).append(" was put on the bottom of its owner's library").toString());
                return true;
            }
           
        }
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

        boolean result = false;
        switch (game.getState().getZone(source.getSourceId())) {
            case BATTLEFIELD:
                Permanent permanent = game.getPermanent(source.getSourceId());
                if (permanent != null) {
                    result |= permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, onTop);
                }
            case GRAVEYARD:
                Card card = game.getCard(source.getSourceId());
                if (card != null) {
                    for (Player player : game.getPlayers().values()) {
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

            Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
            if (controller.chooseTarget(outcome, target, source, game)) {
                game.getState().setValue(CardUtil.getCardZoneString("sweep", source.getSourceId(), game), target.getTargets().size());
                for (UUID uuid : target.getTargets()) {
                    Permanent land = game.getPermanent(uuid);
                    land.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                }
            }
            return true;
        }
        return false;
View Full Code Here

Examples of mage.game.permanent.Permanent.moveToZone()

                Permanent permanent = game.getPermanent(targetId);
                if (permanent == null) {
                    return false;
                }
                defendingPlayerId = game.getCombat().getDefenderId(permanent.getId());
                paid |= permanent.moveToZone(Zone.HAND, sourceId, game, false);
            }
        }
        return paid;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.