Examples of TargetCardInLibrary


Examples of mage.target.common.TargetCardInLibrary

        // As an additional cost to cast Harrow, sacrifice a land.
        this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));

        // Search your library for up to two basic land cards and put them onto the battlefield. Then shuffle your library.
        TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
        this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay));
    }
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

        this.color.setWhite(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(2);

        // When Kor Cartographer enters the battlefield, you may search your library for a Plains card, put it onto the battlefield tapped, then shuffle your library.
        this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBySubtypeCard("Plains")), true), true));
    }
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

        Card sourceCard = game.getCard(source.getSourceId());

        if (sourceCard != null && player != null) {
            FilterCard filter = new FilterCard("card with converted mana cost " + sourceCard.getManaCost().convertedManaCost());
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, sourceCard.getManaCost().convertedManaCost()));
            TargetCardInLibrary target = new TargetCardInLibrary(1, filter);
            if (player.searchLibrary(target, game)) {
                if (target.getTargets().size() > 0) {
                    Cards revealed = new CardsImpl();
                    for (UUID cardId : target.getTargets()) {
                        Card card = player.getLibrary().remove(cardId, game);
                        if (card != null) {
                            player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                            revealed.add(card);
                        }
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

        if (searchedLibrary == null) {
            return false;
        }
        GameEvent event = GameEvent.getEvent(GameEvent.EventType.SEARCH_LIBRARY, targetPlayerId, playerId, playerId, Integer.MAX_VALUE);
        if (!game.replaceEvent(event)) {
            TargetCardInLibrary newTarget = target.copy();
            int count;
            int librarySearchLimit = event.getAmount();
            if (librarySearchLimit == Integer.MAX_VALUE) {
                count = searchedLibrary.count(target.getFilter(), game);
            } else {
                newTarget.setCardLimit(librarySearchLimit);
                count = Math.min(searchedLibrary.count(target.getFilter(), game), librarySearchLimit);
            }

            if (count < target.getNumberOfTargets()) {
                newTarget.setMinNumberOfTargets(count);
            }
            if (newTarget.choose(Outcome.Neutral, playerId, targetPlayerId, game)) {
                target.getTargets().clear();
                for(UUID targetId: newTarget.getTargets()){
                    target.add(targetId, game);
                }
                game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LIBRARY_SEARCHED, targetPlayerId, playerId));
            }
            return true;
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

    }

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        TargetCardInLibrary target = new TargetCardInLibrary(filter);
        if (player != null && player.searchLibrary(target, game)) {
            Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
            if (card != null) {
                card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
            }
            player.shuffleLibrary(game);
            return true;
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

class IntuitionEffect extends SearchEffect {

   

    public IntuitionEffect() {
        super(new TargetCardInLibrary(3, new FilterCard()), Outcome.Benefit);
        staticText = "Search your library for three cards and reveal them. Target opponent chooses one. Put that card into your hand and the rest into your graveyard. Then shuffle your library";
    }
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

        this.toughness = new MageInt(1);

        // A deck can have any number of cards named Shadowborn Apostle.
        this.addInfo("rule", "A deck can have any number of cards named Shadowborn Apostle.");
        // {B}, Sacrifice six creatures named Shadowborn Apostle: Search your library for a Demon creature and put it onto the battlefield. Then shuffle your library.
        Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false, true);
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{B}"));
        ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(6,6,filterApostle, false)));
        this.addAbility(ability);
    }
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

  protected TargetCardInLibrary target;
 
  public HoardingDragonEffect(UUID exileId) {
    super(Outcome.Exile);
    this.exileId = exileId;
    target = new TargetCardInLibrary();
  }
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

    Costs<Cost> costs = new CostsImpl();
    costs.add(new ColoredManaCost(ColoredManaSymbol.G));
    costs.add(new TapSourceCost());
    costs.add(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard())));
    Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard())), costs);
    this.addAbility(ability);
  }
View Full Code Here

Examples of mage.target.common.TargetCardInLibrary

class SignalTheClansEffect extends SearchEffect {


    public SignalTheClansEffect() {
        super(new TargetCardInLibrary(3, new FilterCreatureCard()), Outcome.DrawCard);
        staticText = "Search your library for three creature cards and reveal them. If you reveal three cards with different names, choose one of them at random and put that card into your hand. Shuffle the rest into your 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.