Package mage.filter.common

Examples of mage.filter.common.FilterPermanentCard


        if (cards.size() > 0) {
            controller.revealCards("Genesis Hydra", cards, game);
        }

        FilterCard filter = new FilterPermanentCard("a nonland permanent card with converted mana cost " + count + " or less to put onto the battlefield");
        filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
        filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, count + 1));
        TargetCard target1 = new TargetCard(Zone.LIBRARY, filter);
        target1.setRequired(false);
        if (cards.count(filter, controller.getId(), source.getSourceId(), game) > 0) {
            if (controller.choose(Outcome.PutCardInPlay, cards, target1, game)) {
                Card card = cards.get(target1.getFirstTarget(), game);
View Full Code Here


            while (!playerList.get().equals(source.getControllerId()) && controller.isInGame()) {
                playerList.getNext();
            }
            Player currentPlayer = game.getPlayer(playerList.get());
            UUID firstInactivePlayer = null;
            Target target = new TargetCardInHand(new FilterPermanentCard());

            while (controller.isInGame()) {
                if (currentPlayer != null && controller.getInRange().contains(currentPlayer.getId())) {
                    if (firstInactivePlayer == null) {
                        firstInactivePlayer = currentPlayer.getId();
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller == null) {
            return false;
        }
        FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card from your hand");
        filter.add(new SubtypePredicate("Goblin"));
        TargetCardInHand target = new TargetCardInHand(filter);
        if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
                controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
View Full Code Here

    public NaturesSpiral(UUID ownerId) {
        super(ownerId, 196, "Nature's Spiral", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{G}");
        this.expansionSetCode = "M10";
        this.color.setGreen(true);
        this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterPermanentCard("permanent card from your graveyard")));
        this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller == null) {
            return false;
        }
        FilterPermanentCard filter = new FilterPermanentCard("permanent card with converted mana cost X or less");
        //Set the mana cost one higher to 'emulate' a less than or equal to comparison.
        filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, source.getManaCostsToPay().getX() + 1));
        TargetCardInLibrary target = new TargetCardInLibrary(filter);
        if (controller.searchLibrary(target, game)) {
            if (target.getTargets().size() > 0) {
                Card card = controller.getLibrary().getCard(target.getFirstTarget(), game);
                if (card != null) {
View Full Code Here

            Card card = owner.getLibrary().getFromTop(game);
            if (card != null) {
                Cards cards = new CardsImpl();
                cards.add(card);
                owner.revealCards(sourceObject.getLogName(), cards, game);
              if (new FilterPermanentCard().match(card, game)) {
                    owner.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
                }
            }
        }
        return true;
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterPermanentCard

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.