Package mage.target.common

Examples of mage.target.common.TargetCardInHand


    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Target target = new TargetCardInHand(new FilterArtifactCard("an Equipment card from your hand"));
            if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
                    && controller.chooseUse(outcome, "Put an Equipment from your hand to battlefield?", game)
                    && controller.chooseTarget(outcome, target, source, game)) {
                Card card = game.getCard(target.getFirstTarget());
                if (card != null) {
                     controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                }
            }
            return true;
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            TargetCardInHand target = new TargetCardInHand(filter);
            if (target.canChoose(source.getSourceId(), controller.getId(), game)
                    &&controller.chooseUse(Outcome.PutCreatureInPlay, query, game)) {
                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

        this.expansionSetCode = "ROE";

        this.color.setGreen(true);

        // As an additional cost to cast Living Destiny, reveal a creature card from your hand.
        TargetCardInHand targetCard = new TargetCardInHand(new FilterCreatureCard("a creature card"));
        this.getSpellAbility().addCost(new RevealTargetFromHandCost(targetCard));
      
        // You gain life equal to the revealed card's converted mana cost.
        this.getSpellAbility().addEffect(new LivingDestinyEffect());
    }
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            if (controller.getHand().count(filter, game) > 0) {
                if (controller.chooseUse(Outcome.PutCreatureInPlay,
                        "Put a green creature card onto the battlefield?", game)) {
                    Target target = new TargetCardInHand(filter);
                    if (controller.chooseTarget(outcome, target, source, game)) {
                        Card card = game.getCard(target.getFirstTarget());
                        if (card != null) {
                            controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                        }
                    }
                }
View Full Code Here

        if (player == null || player.getHand().count(filter, game) == 0
                || !player.chooseUse(this.outcome, choiceText, game)) {
            return false;
        }

        TargetCardInHand target = new TargetCardInHand(filter);
        if (player.choose(this.outcome, target, source.getSourceId(), game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
                card.moveToExile(CardUtil.getCardExileZoneId(game, source), "Panoptic Mirror", source.getSourceId(), game);
                Permanent PanopticMirror = game.getPermanent(source.getSourceId());
                if(PanopticMirror != null){
                    PanopticMirror.imprint(card.getId(), game);
View Full Code Here

        this.expansionSetCode = "CSP";

        this.color.setRed(true);

        // You may exile two red cards from your hand rather than pay Fury of the Horde's mana cost.
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(2, filter))));
       
        // Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase.
        this.getSpellAbility().addEffect(new FuryOfTheHordeUntapEffect());
        this.getSpellAbility().addEffect(new FuryOfTheHordeAddPhasesEffect());
        this.addWatcher(new AttackedThisTurnWatcher());
View Full Code Here

            if (player != null) {
                Cards hand = player.getHand();
                FilterCard filter = new FilterCard("card to keep in hand");
                filter.add(new OwnerIdPredicate(player.getId()));
                int numberInHand = Math.min(7, hand.size());
                TargetCardInHand target = new TargetCardInHand(0, numberInHand, filter);
                if (player.choose(Outcome.Benefit, target, source.getSourceId(), game)) {
                    for (Card card : hand.getCards(game)) {
                        if (!target.getTargets().contains(card.getId())) {
                            card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                        }
                    }
                }
                player.shuffleLibrary(game);
View Full Code Here

    public RusticClachan(UUID ownerId) {
        super(ownerId, 34, "Rustic Clachan", Rarity.RARE, new CardType[]{CardType.LAND}, "");
        this.expansionSetCode = "DDF";

        // As Rustic Clachan enters the battlefield, you may reveal a Kithkin card from your hand. If you don't, Rustic Clachan enters the battlefield tapped.
        this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new RevealTargetFromHandCost(new TargetCardInHand(filter))), "you may reveal a Kithkin card from your hand. If you don't, {this} enters the battlefield tapped"));

        // {tap}: Add {W} to your mana pool.
        this.addAbility(new WhiteManaAbility());
        // Reinforce 1-{1}{W}
        this.addAbility(new ReinforceAbility(1, new ManaCostsImpl("{1}{W}")));
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            TargetCardInHand target = new TargetCardInHand();
            player.chooseTarget(Outcome.ReturnToHand, target, source, game);
            Card card = player.getHand().get(target.getFirstTarget(), game);
            if (card != null) {
                player.getHand().remove(card);
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
            }
            return true;
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        if (player == null) {
            return false;
        }

        TargetCardInHand target = new TargetCardInHand(0, 2, new FilterCreatureCard("creature cards"));
        if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            for (UUID targetId: target.getTargets()) {
                Card card = game.getCard(targetId);
                if (card != null) {
                    card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
                }
            }
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.