Package mage.target.common

Examples of mage.target.common.TargetCardInHand


        this.expansionSetCode = "M13";

        // {1}, {tap}, Discard a card: You gain 4 life.
        Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(4), new GenericManaCost(1));
        ability1.addCost(new TapSourceCost());
        ability1.addCost(new DiscardTargetCost(new TargetCardInHand()));
        this.addAbility(ability1);
       
        // {1}, {tap}, Pay 1 life: Put a 0/1 white Goat creature token onto the battlefield.
        Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GoatToken()), new GenericManaCost(1));
        ability2.addCost(new TapSourceCost());
View Full Code Here


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

        // {tap}, Discard a card: Draw a card.
        SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new TapSourceCost());
        ability.addCost(new DiscardTargetCost(new TargetCardInHand()));
        this.addAbility(ability);
    }
View Full Code Here

        FilterCard filter = new FilterCard("artifact to discard");
        filter.add(new CardTypePredicate(CardType.ARTIFACT));
        if (you != null
                && you.getHand().count(filter, game) > 0
                && you.chooseUse(Outcome.Discard, "Do you want to discard an artifact?  If you don't, you must discard 2 cards", game)) {
            Cost cost = new DiscardTargetCost(new TargetCardInHand(filter));
            if (cost.canPay(source, source.getSourceId(), you.getId(), game)) {
                if (cost.pay(source, game, source.getSourceId(), you.getId(), false)) {
                    return true;
                }
            }
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {       
        Player player = game.getPlayer(source.getControllerId());       
        if (player != null){
            TargetCardInHand target = new TargetCardInHand(new FilterLandCard());
            Cost cost = new DiscardTargetCost(target);
            if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game) &&
                    player.chooseUse(outcome, "Discard land? (Otherwise Mox Diamond goes to graveyard)", game) &&
                    player.chooseTarget(Outcome.Discard, target, source, game)){
                player.discard(game.getCard(target.getFirstTarget()), source, game);
                return false;
            }
            else{
                Card card = game.getCard(event.getTargetId());
                if (card != null) {
View Full Code Here

                    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, owner.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

                                                    AttachmentType.AURA,
                                                    Duration.WhileOnBattlefield,"Enchanted creature doesn't untap during its controller's untap step.")));
       
        // Enchanted creature has "{1}, Discard a card: Untap this creature."
        Ability untapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{1}"));
        untapAbility.addCost(new DiscardTargetCost(new TargetCardInHand()));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
                                                new GainAbilityAttachedEffect(untapAbility,
                                                    AttachmentType.AURA,
                                                    Duration.WhileOnBattlefield, "Enchanted creature has \"{1}, Discard a card: Untap this creature.\"")));
    }
View Full Code Here

            while (!playerList.get().equals(source.getControllerId()) && controller.isInGame()) {
                playerList.getNext();
            }
            Player currentPlayer = game.getPlayer(playerList.get());
            UUID firstInactivePlayer = null;
            Target target = new TargetCardInHand(new FilterPermanentCard());

            while (controller.isInGame()) {
                if (currentPlayer != null && controller.getInRange().contains(currentPlayer.getId())) {
                    if (firstInactivePlayer == null) {
                        firstInactivePlayer = currentPlayer.getId();
                    }
                    target.clearChosen();
                    if (target.canChoose(source.getSourceId(), currentPlayer.getId(), game)
                            && currentPlayer.chooseUse(outcome, "Put permanent from your hand to play?", game)) {
                        if (target.chooseTarget(outcome, currentPlayer.getId(), source, game)) {
                            Card card = game.getCard(target.getFirstTarget());
                            if (card != null) {
                                currentPlayer.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                                firstInactivePlayer = null;
                            }
                        }
View Full Code Here

    public AncientAmphitheater(UUID ownerId) {
        super(ownerId, 266, "Ancient Amphitheater", Rarity.RARE, new CardType[]{CardType.LAND}, "");
        this.expansionSetCode = "LRW";

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

       
View Full Code Here

    public GiltLeafPalace(UUID ownerId) {
        super(ownerId, 268, "Gilt-Leaf Palace", Rarity.RARE, new CardType[]{CardType.LAND}, "");
        this.expansionSetCode = "LRW";

        // As Gilt-Leaf Palace enters the battlefield, you may reveal an Elf card from your hand. If you don't, Gilt-Leaf Palace enters the battlefield tapped.
       this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new RevealTargetFromHandCost(new TargetCardInHand(filter))), "you may reveal a Elf card from your hand. If you don't, {this} enters the battlefield tapped"));
        // {tap}: Add {B} or {G} to your mana pool.
        this.addAbility(new BlackManaAbility());
        this.addAbility(new GreenManaAbility());

    }
View Full Code Here

            for (UUID playerId : controller.getInRange()) {
                Player player = game.getPlayer(playerId);
                if (player != null) {
                    Cards cards = new CardsImpl();
                    TargetCardInHand target = new TargetCardInHand(minCard, new FilterCard());
                    if (target.choose(Outcome.Discard, player.getId(), source.getSourceId(), game)) {
                        for (Card card : player.getHand().getCards(game)) {
                            if (card != null && !target.getTargets().contains(card.getId())) {
                                cards.add(card);
                            }
                        }
                        cardsToDiscard.put(playerId, cards);
                    }
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.