Examples of TargetCardInHand


Examples of mage.target.common.TargetCardInHand

    TargetCardInLibrary target = new TargetCardInLibrary(1, 1, filter);
    this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target), true));

    SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlayTargetWithoutPayingManaEffect(), new ManaCostsImpl("{1}{W}"));
    ability.addCost(new TapSourceCost());
    ability.addTarget(new TargetCardInHand(0, 1, filter));
    this.addAbility(ability);
  }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

    }
    return false;
  }

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    target.setRequired(true);
    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.getId(), game, true);
    }
    return true;
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            Target target = null;
            switch (zone) {
                case HAND:
                    target = new TargetCardInHand(Math.min(player.getHand().count(filter, game), amount), filter);
                    break;
                case GRAVEYARD:
                    target = new TargetCardInYourGraveyard(Math.min(player.getGraveyard().count(filter, game), amount), filter);
                    break;
                default:
View Full Code Here

Examples of mage.target.common.TargetCardInHand

    public DiscardCardCost(FilterCard filter) {
        this(filter, false);
    }

    public DiscardCardCost(FilterCard filter, boolean randomDiscard) {
        super(new TargetCardInHand(filter), randomDiscard);
    }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

            return false;
        }

        FilterCreatureCard filter = new FilterCreatureCard("Goblin creature card from your hand");
        filter.add(new SubtypePredicate("Goblin"));
        TargetCardInHand target = new TargetCardInHand(filter);
        if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
                card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
                return true;
            }
        }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

            int numberToReveal = this.numberCardsToReveal.calculate(game, source, this);
            if (numberToReveal > 0) {
                Cards revealedCards = new CardsImpl(Zone.HAND);               
                numberToReveal = Math.min(player.getHand().size(), numberToReveal);
                if (player.getHand().size() > numberToReveal) {
                    TargetCardInHand chosenCards = new TargetCardInHand(numberToReveal, numberToReveal, new FilterCard("card in target player's hand"));
                    chosenCards.setNotTarget(true);
                    if (chosenCards.canChoose(player.getId(), game) && player.choose(Outcome.Discard, player.getHand(), chosenCards, game)) {
                        if (!chosenCards.getTargets().isEmpty()) {
                            List<UUID> targets = chosenCards.getTargets();
                            for (UUID targetid : targets) {
                                Card card = game.getCard(targetid);
                                if (card != null) {
                                    revealedCards.add(card);
                                }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

            if (card != null) {
                if (card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId())) {
                    Permanent permanent = game.getPermanent(card.getId());
                    if (permanent != null) {
                        permanent.addCounters(CounterType.LUCK.createInstance(), game);
                        Cost cost = new ExileFromHandCost(new TargetCardInHand());
                        if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
                            cost.pay(source, game, source.getSourceId(), source.getControllerId(), true);
                        }
                    }
                }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        Player player = game.getPlayer(source.getControllerId());
        if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, choiceText, game)) {
            return false;
        }

        TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard());
        if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
                player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                return true;
            }
        }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        // Flying
        this.addAbility(FlyingAbility.getInstance());
       
        // Discard a card: Return Ephemeron to its owner's hand.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new DiscardTargetCost(new TargetCardInHand())));
    }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

*/
public class RetraceAbility extends ActivatedAbilityImpl {

    public RetraceAbility(Cost cost, TimingRule timingRule) {
        super(Zone.GRAVEYARD, new RetraceEffect(), cost);
        super.addCost(new DiscardTargetCost(new TargetCardInHand(new FilterLandCard())));
        this.timing = timingRule;
        this.usesStack = false;
    }
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.