Package mage.target.common

Examples of mage.target.common.TargetCardInLibrary


        }

        if (sacrificed) {
            // search
            FilterCreatureCard filter = new FilterCreatureCard();
            TargetCardInLibrary targetInLibrary = new TargetCardInLibrary(filter);
            Cards cards = new CardsImpl();
            if (player.searchLibrary(targetInLibrary, game)) {
                for (UUID cardId : targetInLibrary.getTargets()) {
                    Card card = player.getLibrary().remove(cardId, game);
                    if (card != null) {
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        cards.add(card);
                    }
View Full Code Here


        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // When Wirewood Herald dies, you may search your library for an Elf card, reveal that card, put it into your hand, then shuffle your library.
        this.addAbility(new DiesTriggeredAbility(
                new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true),
                true));
    }
View Full Code Here

    super(ownerId, 126, "Cateran Summons", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}");
    this.expansionSetCode = "MMQ";
    this.color.setBlack(true);
 
    // Search your library for a Mercenary card, reveal that card, and put it into your hand. Then shuffle your library.
        this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true));
    }
View Full Code Here

    this.color.setWhite(true);
    this.power = new MageInt(2);
    this.toughness = new MageInt(4);
 
    // {6}, {T}: Search your library for a Rebel permanent card with converted mana cost 5 or less and put it onto the battlefield. Then shuffle your library.
    Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), new TapSourceCost());
    ability.addManaCost(new GenericManaCost(6));
    this.addAbility(ability);
    }
View Full Code Here

        this.color.setRed(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // When Imperial Recruiter enters the battlefield, search your library for a creature card with power 2 or less, reveal it, and put it into your hand. Then shuffle your library.
        this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true)));
    }
View Full Code Here

    this.toughness = new MageInt(5);
 
    // Sacrifice a creature: Regenerate Cateran Overlord.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())));
    // {6}, {T}: Search your library for a Mercenary permanent card with converted mana cost 6 or less and put it onto the battlefield. Then shuffle your library.
    Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), new TapSourceCost());
    ability.addManaCost(new GenericManaCost(6));
    this.addAbility(ability);
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null && opponent != null) {
            TargetCardInLibrary target = new TargetCardInLibrary(0, 1, new FilterCreatureCard("creature card"));
            if (controller.searchLibrary(target, game, opponent.getId())) {
                List<UUID> targets = target.getTargets();
                for (UUID targetId : targets) {
                    Card card = opponent.getLibrary().remove(targetId, game);
                    if (card != null) {
                        controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
                    }
View Full Code Here

        this.expansionSetCode = "JOU";

        this.color.setGreen(true);

        // {1}{G}, Sacrifice Font of Fertility: Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.
        TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target, true, true, Outcome.PutLandInPlay), new ManaCostsImpl("{1}{G}"));
        ability.addCost(new SacrificeSourceCost());
        this.addAbility(ability);
    }
View Full Code Here

        this.expansionSetCode = "KTK";

        this.color.setGreen(true);

        // Whenever a face-down creature enters the battlefield under your control, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.
        Effect effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true);
        this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, effect, filter, true));
       
        // Whenever a permanent you control is turned face up, if it's a creature, it gets +2/+2 until end of turn.
        this.addAbility(new TrailOfMysteryTriggeredAbility());
    }
View Full Code Here

                        return false;
                    }
                    String targetName = new StringBuilder("card with converted mana cost of ").append(card.getManaCost().convertedManaCost()).toString();
                    FilterCard filter = new FilterCard(targetName);
                    filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, card.getManaCost().convertedManaCost()));
                    return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true).apply(game, source);                   
                }
            }
            return true;
        }
        return false;
View Full Code Here

TOP

Related Classes of mage.target.common.TargetCardInLibrary

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.