Package mage.target.common

Examples of mage.target.common.TargetCardInHand


    public WanderwineHub(UUID ownerId) {
        super(ownerId, 280, "Wanderwine Hub", Rarity.RARE, new CardType[]{CardType.LAND}, "");
        this.expansionSetCode = "LRW";

        // As Wanderwine Hub enters the battlefield, you may reveal a Merfolk card from your hand. If you don't, Wanderwine Hub enters the battlefield tapped.
        this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new RevealTargetFromHandCost(new TargetCardInHand(filter))), "you may reveal a Merfolk card from your hand. If you don't, {this} enters the battlefield tapped"));
        // {tap}: Add {W} or {U} to your mana pool.
        this.addAbility(new WhiteManaAbility());
        this.addAbility(new BlueManaAbility());

    }
View Full Code Here


        this.color.setBlack(true);

        // Discard two cards: Put a 2/2 black Zombie creature token onto the battlefield.
        SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
                new CreateTokenEffect(new ZombieToken("M12")),
                new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards"))));
        this.addAbility(ability);
    }
View Full Code Here

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

        // As an additional cost to cast Wren's Run Vanquisher, reveal an Elf card from your hand or pay {3}.
        this.getSpellAbility().addCost(new OrCost(
                new RevealTargetFromHandCost(new TargetCardInHand(filter)),
                new GenericManaCost(3),
                "reveal a Elf card from your hand or pay {3}"));

        // Deathtouch
        this.addAbility(DeathtouchAbility.getInstance());
View Full Code Here

       
        //Whenever Borborygmous Enraged deals combat damage to a player, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard.
        this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new BorborygmosEnragedEffect(), false, false));
       
        //Discard a land card: Borborygmos Enraged deals 3 damage to target creature or player
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), new DiscardTargetCost(new TargetCardInHand(new FilterLandCard())));
        ability.addTarget(new TargetCreatureOrPlayer());
        this.addAbility(ability);
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player shuffler = game.getPlayer(this.getTargetPointer().getFirst(game, source));
        if (shuffler != null) {
            if (shuffler.getHand().size() > 0) {
                TargetCardInHand target = new TargetCardInHand();
                target.setTargetName("a card from your hand to put on top of your library");
                shuffler.choose(Outcome.Detriment, target, source.getSourceId(), game);
                Card card = shuffler.getHand().get(target.getFirstTarget(), game);
                if (card != null) {
                    shuffler.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);

                }
            }
View Full Code Here

        return new SacellumGodspeakerEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        TargetCardInHand target = new TargetCardInHand(0,Integer.MAX_VALUE, filter);
        if (target.choose(Outcome.Benefit, source.getControllerId(), source.getSourceId(), game)) {
            game.getPlayer(source.getControllerId()).getManaPool().addMana(Mana.GreenMana(target.getTargets().size()), game, source);
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, game)) {
                TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard());
                if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        if (controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) {
                            Permanent permanent = game.getPermanent(card.getId());
                            if (permanent != null) {
                                ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
View Full Code Here

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

        // As an additional cost to cast Goldmeadow Stalwart, reveal a Kithkin card from your hand or pay {3}.
        this.getSpellAbility().addCost(new OrCost(
                new RevealTargetFromHandCost(new TargetCardInHand(filter)),
                new GenericManaCost(3),
                "reveal a Kithkin card from your hand or pay {3}"));
    }
View Full Code Here

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

        // As an additional cost to cast Flamekin Bladewhirl, reveal an Elemental card from your hand or pay {3}.
        this.getSpellAbility().addCost(new OrCost(
                new RevealTargetFromHandCost(new TargetCardInHand(filter)),
                new GenericManaCost(3),
                "reveal a Elemental card from your hand or pay {3}"));
    }
View Full Code Here

           
            // reveal hand of target player
            targetPlayer.revealCards(sourceObject.getLogName(), targetPlayer.getHand(), game);
           
            // You choose a nonland card from it
            TargetCardInHand target = new TargetCardInHand(new FilterNonlandCard());
            target.setNotTarget(true);
            Card chosenCard = null;
            if (controller.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) {
                chosenCard = game.getCard(target.getFirstTarget());
            }
           
           
            // Exile all cards with the same name
            // Building a card filter with the name
            FilterCard filterNamedCards = new FilterCard();
            if (chosenCard != null) {
                filterNamedCards.add(new NamePredicate(chosenCard.getName()));                           
            } else {
                filterNamedCards.add(new NamePredicate("----")); // so no card matches
            }

            // The cards you're searching for must be found and exiled if they're in the graveyard because it's a public zone.
            // Finding those cards in the hand and library is optional, because those zones are hidden (even if the hand is temporarily revealed).
            // search cards in graveyard
            if (chosenCard != null) {
                for (Card checkCard : targetPlayer.getGraveyard().getCards(game)) {
                    if (checkCard.getName().equals(chosenCard.getName())) {
                        controller.moveCardToExileWithInfo(checkCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD);
                    }
                }

                // search cards in hand
                TargetCardInHand targetCardsHand = new TargetCardInHand(0, Integer.MAX_VALUE, filterNamedCards);
                controller.chooseTarget(outcome, targetPlayer.getGraveyard(), targetCardsHand, source, game);
                for(UUID cardId:  targetCardsHand.getTargets()) {
                    Card card = game.getCard(cardId);
                    if (card != null) {
                        controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.HAND);
                    }
                }
View Full Code Here

TOP

Related Classes of mage.target.common.TargetCardInHand

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.