Examples of searchLibrary()


Examples of mage.players.Player.searchLibrary()

                if (player.chooseUse(Outcome.PutCardInPlay, sb.toString(), game)) {
                    FilterCard filter = new FilterCard("card named " + cardName);
                    filter.add(new NamePredicate(cardName));
                    TargetCardInLibrary target = new TargetCardInLibrary(filter);

                    if (player.searchLibrary(target, game)) {
                        Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
                        if (card != null) {
                            chosenCards.add(card);
                        }
                    }
View Full Code Here

Examples of mage.players.Player.searchLibrary()

        TargetCardInLibrary targetBlack = new TargetCardInLibrary(filterBlack);
        TargetCardInLibrary targetRed = new TargetCardInLibrary(filterRed);
        TargetCardInLibrary targetGreen = new TargetCardInLibrary(filterGreen);

        if (you != null && you.getLibrary().size() > 0) {
            if (you.searchLibrary(targetWhite, game)) {
                if (targetWhite.getTargets().size() > 0) {
                    for (UUID cardId : (List<UUID>) targetWhite.getTargets()) {
                        Card card = you.getLibrary().remove(cardId, game);
                        if (card != null) {
                            cards.add(card);
View Full Code Here

Examples of mage.players.Player.searchLibrary()

                    }
                }
            }
        }
        if (you != null && you.getLibrary().size() > 0) {
            if (you.searchLibrary(targetBlue, game)) {
                if (targetBlue.getTargets().size() > 0) {
                    for (UUID cardId : (List<UUID>) targetBlue.getTargets()) {
                        Card card = you.getLibrary().remove(cardId, game);
                        if (card != null) {
                            cards.add(card);
View Full Code Here

Examples of mage.players.Player.searchLibrary()

                    }
                }
            }
        }
        if (you != null && you.getLibrary().size() > 0) {
            if (you.searchLibrary(targetBlack, game)) {
                if (targetBlack.getTargets().size() > 0) {
                    for (UUID cardId : (List<UUID>) targetBlack.getTargets()) {
                        Card card = you.getLibrary().remove(cardId, game);
                        if (card != null) {
                            cards.add(card);
View Full Code Here

Examples of mage.players.Player.searchLibrary()

                    }
                }
            }
        }
        if (you != null && you.getLibrary().size() > 0) {
            if (you.searchLibrary(targetRed, game)) {
                if (targetRed.getTargets().size() > 0) {
                    for (UUID cardId : (List<UUID>) targetRed.getTargets()) {
                        Card card = you.getLibrary().remove(cardId, game);
                        if (card != null) {
                            cards.add(card);
View Full Code Here

Examples of mage.players.Player.searchLibrary()

                    }
                }
            }
        }
        if (you != null && you.getLibrary().size() > 0) {
            if (you.searchLibrary(targetGreen, game)) {
                if (targetGreen.getTargets().size() > 0) {
                    for (UUID cardId : (List<UUID>) targetGreen.getTargets()) {
                        Card card = you.getLibrary().remove(cardId, game);
                        if (card != null) {
                            cards.add(card);
View Full Code Here

Examples of mage.players.Player.searchLibrary()

    }

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null && player.searchLibrary(target, game)) {
            if (target.getTargets().size() > 0) {
                for (UUID cardId: target.getTargets()) {
                    Card card = player.getLibrary().remove(cardId, game);
                    if (card != null){
                        card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
View Full Code Here

Examples of mage.players.Player.searchLibrary()

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player == null)
            return false;
        TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard());
        if (player.searchLibrary(target, game)) {
            if (target.getTargets().size() > 0) {
                UUID cardId = target.getTargets().get(0);
                Card card = player.getLibrary().remove(cardId, game);
                if (card != null) {
                    card.moveToExile(source.getSourceId(), "Strata Scythe", source.getSourceId(), game);
View Full Code Here

Examples of mage.players.Player.searchLibrary()

            }
            for(Map.Entry<UUID, Integer> entry : playerAmount.entrySet()) {
                Player player = game.getPlayer(entry.getKey());
                if (player != null) {
                    TargetCardInLibrary target = new TargetCardInLibrary(0, entry.getValue().intValue(), new FilterBasicLandCard());
                    if (player.searchLibrary(target, game)) {
                        if (target.getTargets().size() > 0) {
                            for (UUID cardId: (List<UUID>)target.getTargets()) {
                                Card card = player.getLibrary().getCard(cardId, game);
                                if (card != null) {
                                    card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId(), false);
View Full Code Here

Examples of mage.players.Player.searchLibrary()

            // search cards in Library
            // If the player has no nonland cards in his or her hand, you can still search that player's library and have him or her shuffle it.
            if (chosenCard != null || controller.chooseUse(outcome, "Search library anyway?", game)) {
                TargetCardInLibrary targetCardsLibrary = new TargetCardInLibrary(0, Integer.MAX_VALUE, filterNamedCards);
                controller.searchLibrary(targetCardsLibrary, game, targetPlayer.getId());
                for(UUID cardId:  targetCardsLibrary.getTargets()) {
                    Card card = game.getCard(cardId);
                    if (card != null) {
                        controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY);
                    }
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.