Package mage.cards

Examples of mage.cards.Cards


    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null && player.getLibrary().size() > 0) {
            Card card = player.getLibrary().getFromTop(game);
            Cards cards = new CardsImpl();
            cards.add(card);
            player.revealCards("Cerebral Eruption", cards, game);
            game.getState().setValue(source.getSourceId().toString(), card);
            int damage = card.getManaCost().convertedManaCost();
            player.damage(damage, source.getSourceId(), game, false, true);
            for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
View Full Code Here


            if (player == null) {
                return false;
            }
            if (player.getLibrary().size() > 0) {
                Card card = player.getLibrary().getFromTop(game);
                Cards cards = new CardsImpl();
                cards.add(card);
                player.revealCards("Baneful Omen", cards, game);

                if (card != null) {
                    int loseLife = card.getManaCost().convertedManaCost();
                    Set<UUID> opponents = game.getOpponents(source.getControllerId());
View Full Code Here

        }

        GiftsUngivenTarget target = new GiftsUngivenTarget();
        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) {
                        cards.add(card);
                    }
                }
                player.revealCards(sourceCard.getName(), cards, game);

                CardsImpl cardsToKeep = new CardsImpl();
                if (cards.size() > 2) {
                    cardsToKeep.addAll(cards);

                    Player opponent;
                    if (game.getOpponents(player.getId()).size() > 1) {
                        TargetOpponent targetOpponent = new TargetOpponent();
                        player.chooseTarget(outcome, targetOpponent, source, game);
                        opponent = game.getPlayer(target.getFirstTarget());
                    } else {
                        opponent = game.getPlayer(game.getOpponents(player.getId()).iterator().next());
                    }
                    TargetCard targetDiscard = new TargetCard(2, Zone.PICK, new FilterCard("cards to put in graveyard"));
                    if (opponent != null && opponent.choose(Outcome.Discard, cards, targetDiscard, game)) {
                        cardsToKeep.removeAll(targetDiscard.getTargets());
                        cards.removeAll(cardsToKeep);
                    }
                }

                for (UUID cardId : cards) {
                    Card card = game.getCard(cardId);
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null && player.getHand().size() > 0) {
            Cards revealed = new CardsImpl();
            revealed.add(player.getHand().getRandom(game));
            player.revealCards("Hired Torturer", revealed, game);
            return true;
        }
        return false;
    }
View Full Code Here

            return false;
        }

        if (player.getLibrary().size() > 0) {
            Card card = player.getLibrary().getFromTop(game);
            Cards cards = new CardsImpl();
            cards.add(card);
            player.revealCards("Pain Seer", cards, game);

            if (card != null &&
                card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
                player.loseLife(card.getManaCost().convertedManaCost(), game);
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        if (player == null || controller == null) {
            return false;
        }
       
        Cards cards = new CardsImpl();
        int max = Math.min(player.getLibrary().size(), 7);
        for(int i = 0; i < max; i++){
            Card card = player.getLibrary().removeFromTop(game);
            if (card != null) {
                card.moveToExile(null, "", source.getSourceId(), game);
                cards.add(card);
            }
        }
        if(cards.getCards(new FilterCreatureCard(), game).size() > 0){
            TargetCard target = new TargetCard(Zone.EXILED, new FilterCreatureCard());
            if(controller.chooseTarget(Outcome.PutCreatureInPlay, cards, target, source, game)){
                Card card = cards.get(target.getFirstTarget(), game);
                if(card != null){
                    card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), source.getControllerId());
                }
            }
        }
View Full Code Here

            return false;
        }

        if (player.getLibrary().size() > 0) {
            Card card = player.getLibrary().getFromTop(game);
            Cards cards = new CardsImpl();
            cards.add(card);
            player.revealCards("Arbiter of the Ideal", cards, game);

            if (card != null) {
                if (filter.match(card, game) && player.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append("onto battlefield?").toString(), game)) {
                    card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
View Full Code Here

            }
            player.shuffleLibrary(game);
        }
        // Graveyard check
        if (player.chooseUse(Outcome.Benefit, "Do you want to search your graveyard for Scion of Darkness?", game)) {
            Cards graveyard = player.getGraveyard().copy();
            for (UUID card : graveyard) {
                Card checkCard = game.getCard(card);
                if (checkCard.getName().equals("Scion of Darkness")) {
                    checkCard.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
                    return true;
                }
            }
        }
        // Hand check
        if (player.chooseUse(Outcome.Benefit, "Do you want to search your hand for Scion of Darkness?", game)) {
            Cards hand = player.getHand().copy();
            for (UUID card : hand) {
                Card checkCard = game.getCard(card);
                if (checkCard.getName().equals("Scion of Darkness")) {
                    checkCard.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
                    return true;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player == null) {
            return false;
        }
        Cards cards = new CardsImpl(Zone.PICK);
        int count = Math.min(player.getLibrary().size(), 3);
        for (int i = 0; i < count; i++) {
            Card card = player.getLibrary().removeFromTop(game);
            if (card != null) {
                cards.add(card);
                game.setZone(card.getId(), Zone.PICK);
            }
        }
        player.lookAtCards("Petals of Insight", cards, game);
        if (player.chooseUse(outcome, "Put the cards on the bottom of your library in any order?", game)) {
            TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
            while (player.isInGame() && cards.size() > 1) {
                player.choose(Outcome.Neutral, cards, target, game);
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                }
                target.clearChosen();
            }
            if (cards.size() == 1) {
                Card card = cards.get(cards.iterator().next(), game);
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
            }
            game.getState().setValue(source.getSourceId().toString(), Boolean.TRUE);
        } else {
            for (UUID cardId: cards) {
View Full Code Here

        @Override
    public boolean checkIfClause(Game game) {
                Player player = game.getPlayer(this.getControllerId());
                if (player != null) {
                    Cards cards = new CardsImpl();
                    Card card = player.getLibrary().getFromTop(game);
                    cards.add(card);
                    player.revealCards("Harsh Deceiver", cards, game);
                    if (card != null && card.getCardType().contains(CardType.LAND)) {
                            return true;
                    }
                }
View Full Code Here

TOP

Related Classes of mage.cards.Cards

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.