Examples of removeFromTop()


Examples of mage.players.Library.removeFromTop()

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null && controller.getLibrary().size() > 0) {
            Library library = controller.getLibrary();
            Card card = library.removeFromTop(game);
            if (card != null) {
                controller.moveCardToExileWithInfo(card, source.getSourceId(), "Chandra Pyromaster <this card may be played the turn it was exiled>", source.getSourceId(), game, Zone.LIBRARY);
                ContinuousEffect effect = new ChandraPyromasterCastFromExileEffect();
                effect.setTargetPointer(new FixedTarget(card.getId()));
                game.addEffect(effect, source);
View Full Code Here

Examples of mage.players.Library.removeFromTop()

                Player player = game.getPlayer(spell.getControllerId());
                if (player != null && player.getLibrary().size() > 0) {
                    Library library = player.getLibrary();
                    Card card;
                    do {
                        card = library.removeFromTop(game);
                        if (card != null) {
                            card.moveToExile(source.getSourceId(), "Possibility Storm Exile", source.getSourceId(), game);
                        }
                    } while (library.size() > 0 && card != null && !sharesType(card, spell.getCardType()));
View Full Code Here

Examples of mage.players.Library.removeFromTop()

        if (controller != null && controller.getLibrary().size() > 0) {
            CardsImpl cards = new CardsImpl();
            Library library = controller.getLibrary();
            Card card = null;
            do {
                card = library.removeFromTop(game);
                if (card != null) {
                    cards.add(card);
                }
            } while (library.size() > 0 && card != null && !filter.match(card, game));
            // reveal cards
View Full Code Here

Examples of mage.players.Library.removeFromTop()

        if (player != null && player.getLibrary().size() > 0) {
            CardsImpl cards = new CardsImpl();
            Library library = player.getLibrary();
            Card card = null;
            do {
                card = library.removeFromTop(game);
                if (card != null) {
                    cards.add(card);
                }
            } while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND));
            // reveal cards
View Full Code Here

Examples of mage.players.Library.removeFromTop()

        Cards cards = new CardsImpl();

        Library library = player.getLibrary();
        int n = Math.min(3, library.size());
        for (int i = 0; i < n; i++) {
            cards.add(library.removeFromTop(game));
        }

        player.lookAtCards("Telling Time", cards, game);

        Card card = pickCard(game, player, cards, "card to put in your hand");
View Full Code Here

Examples of mage.players.Library.removeFromTop()

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
        if (sourcePermanent != null && controller != null && controller.getLibrary().size() > 0) {
            Library library = controller.getLibrary();
            Card card = library.removeFromTop(game);
            if (card != null) {
                String exileName = new StringBuilder(sourcePermanent.getName()).append(" <this card may be played the turn it was exiled>").toString();
                controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY);
                ContinuousEffect effect = new PropheticFlamespeakerCastFromExileEffect();
                effect.setTargetPointer(new FixedTarget(card.getId()));
View Full Code Here

Examples of mage.players.Library.removeFromTop()

        if (controller != null) {
            Library library = controller.getLibrary();
            List<Card> cards = new ArrayList<>();
            int count = Math.min(3, library.size());
            for (int i = 0; i < count; i++) {
                Card card = library.removeFromTop(game);
                if (card != null) {
                    cards.add(card);
                }
            }
            if (cards.size() > 0) {
View Full Code Here

Examples of mage.players.Library.removeFromTop()

        Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
        if (opponent != null && opponent.getLibrary().size() > 0) {
            Library library = opponent.getLibrary();
            Card card;
            do {
                card = library.removeFromTop(game);
                if (card != null) {
                    opponent.moveCardToExileWithInfo(card, source.getSourceId()"Stolen Goods", source.getSourceId(), game, Zone.LIBRARY);
                }
            } while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND));
View Full Code Here

Examples of mage.players.Library.removeFromTop()

                        Cards cards = new CardsImpl();
                        Card card = null;
                        boolean cardFound = false;
                        if (library.size() > 0) {
                            do {
                                card = library.removeFromTop(game);
                                cards.add(card);
                                if (filter.match(card, game)) {
                                    for (CardType cardType : permanent.getCardType()) {
                                        if (card.getCardType().contains(cardType)) {
                                            // a permanent card
View Full Code Here

Examples of mage.players.Library.removeFromTop()

        if (player != null && player.getLibrary().size() > 0) {
            CardsImpl cards = new CardsImpl();
            Library library = player.getLibrary();
            Card card = null;
            do {
                card = library.removeFromTop(game);
                if (card != null) {
                    cards.add(card);
                    card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                }
            } while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND));
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.