Package mage.target.common

Examples of mage.target.common.TargetCardInExile


                    }
                }
            }
            game.informPlayers(controller.getName() + " moves " + amountExiled + " card" + (amountExiled == 1 ? " ":"s ") + "from library to hand");

            TargetCardInExile target2 = new TargetCardInExile(filter2, source.getSourceId());
            ExileZone scrollRackExileZone = game.getExile().getExileZone(source.getSourceId());
            if (scrollRackExileZone != null) {
                while (controller.isInGame() && scrollRackExileZone.count(filter, game) > 1) {
                    controller.lookAtCards("exiled cards with " + sourceObject.getLogName(), scrollRackExileZone, game);
                    controller.choose(Outcome.Neutral, scrollRackExileZone, target2, game);
                    Card card = game.getCard(target2.getFirstTarget());
                    if (card != null) {
                        game.getExile().removeCard(card, game);
                        controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, true, false);
                    }
                    target2.clearChosen();
                }
                if (scrollRackExileZone.count(filter, game) == 1) {
                    Card card = scrollRackExileZone.get(scrollRackExileZone.iterator().next(), game);
                    controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, true, false);
                }
View Full Code Here


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

        // When Riftsweeper enters the battlefield, choose target face-up exiled card. Its owner shuffles it into his or her library.
        Ability ability = new EntersBattlefieldTriggeredAbility(new RiftsweeperEffect(), false);
        ability.addTarget(new TargetCardInExile(1, 1, filter, null, true));
        this.addAbility(ability);
    }
View Full Code Here

        this.expansionSetCode = "ISD";

        this.color.setBlue(true);

        // Return target exiled card with flashback you own to your hand.
        TargetCardInExile target = new TargetCardInExile(filter, null);
        this.getSpellAbility().addTarget(target);
        this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
    }
View Full Code Here

                }
            }
            ExileZone exileZone = game.getExile().getExileZone(exileId);
            while (exileZone != null && exileZone.count(filter, game) > 0
                    && controller.chooseUse(Outcome.PlayForFree, "Cast cards exiled with " + mageObject.getLogName() +"  without paying its mana cost?", game)) {
                TargetCardInExile target = new TargetCardInExile(0,1, filter, exileId, false);
                while (exileZone.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, exileZone, target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {                           
                        controller.cast(card.getSpellAbility(), game, true);
                    } else {
                        break;
                    }
                    target.clearChosen();
                }
            }
            return true;
        }
View Full Code Here

                topCard.moveToExile(source.getSourceId(), "Cards exiled by Hellcarver Demon", source.getSourceId(), game);
            }
        }

        while (player != null && player.isInGame() && player.chooseUse(Outcome.PlayForFree, "Cast another nonland card exiled with Hellcarver Demon without paying that card's mana cost?", game)) {
            TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId());
            while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(source.getSourceId()), target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        game.getExile().removeCard(card, game);
                        player.cast(card.getSpellAbility(), game, true);
                    }
                    target.clearChosen();
            }
            return true;
        }    
        return false;
    }
View Full Code Here

        targetChoice.setMessage("Choose what to target");
        targetChoice.getChoices().add("Permanent");
        targetChoice.getChoices().add("Suspended Card");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2,0,Duration.EndOfTurn), new ManaCostsImpl("{1}{R}"));
        ability.addChoice(targetChoice);
        ability.addCost(new RemoveCounterFromCardCost(new TargetCardInExile(1,1,filter, null, true), CounterType.TIME));
        this.addAbility(ability);
    }
View Full Code Here

            Choice targetChoice = ability.getChoices().get(0);
            if (targetChoice.getChoice().equals("Permanent")) {
                ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(), CounterType.TIME));
            }
            if (targetChoice.getChoice().equals("Suspended Card")) {
                ability.addCost(new RemoveCounterFromCardCost(new TargetCardInExile(1,1,filter, null, true), CounterType.TIME));
            }
        }
    }
View Full Code Here

            }
        }

        FilterCard filter = new FilterCreatureCard(new StringBuilder("creature card with converted mana cost {").append(cmc).append("} exiled with Ashiok, Nightmare Weaver").toString());
        filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, cmc));
        Target target = new TargetCardInExile(filter, CardUtil.getCardExileZoneId(game, source));

        if (target.canChoose(source.getSourceId(), player.getId(), game)) {
            if (player.chooseTarget(Outcome.PutCreatureInPlay, target, source, game)) {
                Card card = game.getCard(target.getFirstTarget());
                if (card != null && player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId())) {
                    // why is this change of controller neccessary?
                    Permanent permanent = game.getPermanent(card.getId());
                    if (permanent != null) {
                        permanent.changeControllerId(source.getControllerId(), game);
View Full Code Here

                    Choice targetChoice = ability.getChoices().get(0);
                    if (targetChoice.getChoice().equals("Permanent")) {
                        ability.addTarget(new TargetCreaturePermanent());
                    }
                    if (targetChoice.getChoice().equals("Suspended Card")) {
                        Target target = new TargetCardInExile(1,1, filter, null, true);
                        ability.addTarget(target);
                    }
                }
            }
        }
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, "Cast an instant or sorcery from exile?", game)) {
                TargetCardInExile target = new TargetCardInExile(new FilterInstantOrSorceryCard(), CardUtil.getCardExileZoneId(game, source));
                if (controller.choose(Outcome.PlayForFree, game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)), target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        game.getExile().removeCard(card, game);
                        return controller.cast(card.getSpellAbility(), game, true);
                    }
                }
View Full Code Here

TOP

Related Classes of mage.target.common.TargetCardInExile

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.