Package mage.cards

Examples of mage.cards.CardsImpl


    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Player player = game.getPlayer(controllerId);

        Card card = player.getHand().get(ability.getSourceId(), game);
        if (card != null) {
            Cards cards = new CardsImpl(card);
            player.revealCards("Ninjutsu", cards, game);
            paid = true;
            return paid;
        }
        return false;
View Full Code Here


        if (!controller.getLibrary().isEmptyDraw()) {
            Card card = controller.getLibrary().getFromTop(game);
            if (card == null) {
                return false;
            }
            controller.lookAtCards(sourceObject.getLogName(), new CardsImpl(card), game);
            boolean toBottom = controller.chooseUse(outcome, "Put card on the bottom of your library?", game);
            return controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, !toBottom, false);
        }
        return true;
    }
View Full Code Here

        if (player == null) {
            return false;
        }
        if (player.searchLibrary(target, game)) {
            if (target.getTargets().size() > 0) {
                Cards cards = new CardsImpl();
                for (UUID cardId: target.getTargets()) {
                    Card card = player.getLibrary().remove(cardId, game);
                    if (card != null){
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        if (revealCards) {
                            cards.add(card);
                        }
                    }
                }
                if (revealCards) {
                    String name = "Reveal";
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        if (player == null) {
            return false;
        }

        Cards cards = new CardsImpl(Zone.PICK);
        Cards cardsToReveal = new CardsImpl();
        int count = Math.min(player.getLibrary().size(), 3);
        for (int i = 0; i < count; i++) {
            Card card = player.getLibrary().removeFromTop(game);
            if (card != null) {
                cardsToReveal.add(card);
                if (card.hasSubtype("Island")) {
                    card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                } else {
                    cards.add(card);
                    game.setZone(card.getId(), Zone.PICK);
View Full Code Here

        MageObject sourceObject = game.getObject(source.getSourceId());
        if (controller == null || sourceObject ==  null) {
            return false;
        }

        Cards cards = new CardsImpl();
        int count = Math.min(controller.getLibrary().size(), 3);
        for (int i = 0; i < count; i++) {
            Card card = controller.getLibrary().removeFromTop(game);
            if (card != null) {
                cards.add(card);
                if (card.getCardType().contains(CardType.CREATURE)) {
                    controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                } else {
                    controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                }
            } else {
                return false;
            }
        }

        if (!cards.isEmpty()) {
            controller.revealCards(sourceObject.getLogName(), cards, game);
        }

        return true;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());

        Cards cards = new CardsImpl(Zone.PICK);
        int count = Math.min(player.getLibrary().size(), 7);
        for (int i = 0; i < count; i++) {
            Card card = player.getLibrary().removeFromTop(game);
            if (card != null) {
                cards.add(card);
            }
        }

        if (!cards.isEmpty()) {
            TargetCard target = new TargetCard(Zone.PICK,
                    new FilterCreatureCard(
                    "creature card to put on the battlefield"));
            if (player.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.putOntoBattlefield(game, Zone.PICK,
                            source.getSourceId(), source.getControllerId());
                }
            }
            if (cards.size() > 0) {
                TargetCard target2 = new TargetCard(Zone.PICK,
                        new FilterCard(
                        "card to put on the bottom of your library"));
                while (player.isInGame() && cards.size() > 1) {
                    player.choose(Outcome.Benefit, cards, target2,
                            game);
                    Card card = cards.get(target2.getFirstTarget(), game);
                    if (card != null) {
                        cards.remove(card);
                        player.getLibrary().putOnBottom(card, game);
                    }
                    target2.clearChosen();
                }
                Card card = cards.get(cards.iterator().next(), game);
                cards.remove(card);
                player.getLibrary().putOnBottom(card, game);
            }
        }

        return false;
View Full Code Here

            return false;
        }

        Card card = player.getLibrary().getFromTop(game);
        if (card != null) {
            Cards cards = new CardsImpl();
            cards.add(card);
            player.lookAtCards("Explorer's Scope", cards, game);
            if (card.getCardType().contains(CardType.LAND)) {
                String message = "Put " + card.getName() + " onto the battlefield tapped?";
                if (player.chooseUse(Outcome.PutLandInPlay, message, game)) {
                    if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId())) {
View Full Code Here

        if (card != null) {
            for (Ability ability : card.getAbilities()) {
                if (ability instanceof MiracleAbility) {
                    Player controller = game.getPlayer(ability.getControllerId());
                    if (controller != null) {
                        Cards cards = new CardsImpl();
                        cards.add(card);
                        controller.lookAtCards("Miracle", cards, game);
                        if (controller.chooseUse(Outcome.Benefit, "Reveal card to be able to use Miracle?", game)) {
                            controller.revealCards("Miracle", cards, game);
                            game.fireEvent(GameEvent.getEvent(GameEvent.EventType.MIRACLE_CARD_REVEALED, card.getId(), card.getId(),controller.getId()));
                            break;
View Full Code Here

        }
    }

    public Cards createRevealed(String name) {
        if (!this.containsKey(name)) {
            this.put(name, new CardsImpl());
        }
        return this.get(name);
    }
View Full Code Here

            int numCards = target.getTargets().size();
            for(UUID uuid : target.getTargets()){
                Card card = player.getHand().get(uuid, this);
                if(card != null){
                    if(!mulliganedCards.containsKey(playerId)){
                        mulliganedCards.put(playerId, new CardsImpl());
                    }
                    card.setFaceDown(true);
                    card.moveToExile(null, "", null, this);
                    mulliganedCards.get(playerId).add(card);
                }
View Full Code Here

TOP

Related Classes of mage.cards.CardsImpl

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.