Package mage.target.common

Examples of mage.target.common.TargetCardInYourGraveyard


                if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
                    mode.getTargets().clear();
                    int xValue = ability.getManaCostsToPay().getX();
                    FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue +  " or less from your graveyard");
                    filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, xValue + 1));
                    mode.getTargets().add(new TargetCardInYourGraveyard(filter));
                }
                if (effect instanceof GainAbilityTargetEffect) {
                    mode.getTargets().clear();
                    int xValue = ability.getManaCostsToPay().getX();
                    FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures gain fear until end of turn");
View Full Code Here


        this.color.setBlue(true);

        // Return target instant or sorcery card from your graveyard to your hand.
        this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect());
        this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter));
    }
View Full Code Here

                if (card != null) {
                    player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                }
            }
            else {
                Target target = new TargetCardInYourGraveyard(0, 1, filter);
                target.choose(Outcome.PutCardInPlay, source.getControllerId(), source.getSourceId(), game);
                Card card = player.getGraveyard().get(target.getFirstTarget(), game);
                if (card != null) {
                    player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
                }
            }
            return true;
View Full Code Here

        this.color.setBlack(true);
        this.power = new MageInt(6);
        this.toughness = new MageInt(6);
        this.addAbility(new SwampwalkAbility());
        Ability ability = new BeginningOfUpkeepTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(false), TargetController.YOU, false);
        ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
        this.addAbility(ability);
        ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(new FilterCreaturePermanent(), 1, "that player "), TargetController.OPPONENT, false);
        this.addAbility(ability);
    }
View Full Code Here

        this.color.setWhite(true);
        this.power = new MageInt(4);
        this.toughness = new MageInt(6);
        this.addAbility(FlyingAbility.getInstance());
        Ability ability = new BeginningOfUpkeepTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), TargetController.YOU, true);
        ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
        this.addAbility(ability);
    }
View Full Code Here

        this.power = new MageInt(0);
        this.toughness = new MageInt(4);

        this.addAbility(DefenderAbility.getInstance());
        Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true);
        ability.addTarget(new TargetCardInYourGraveyard(filter));
        this.addAbility(ability);
    }
View Full Code Here

            int amount = source.getManaCostsToPay().getX();
            int discarded = Math.min(amount, player.getHand().size());
            player.discard(amount, source, game);
           
            // then return a card from your graveyard to your hand for each card discarded this way
            TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(discarded, new FilterCard());
            target.choose(Outcome.ReturnToHand, player.getId(), source.getSourceId(), game);
            for (UUID targetId : target.getTargets()) {
                Card card = game.getCard(targetId);
                if (card != null) {
                    player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD);
                }
            }
View Full Code Here

        this.color.setWhite(true);

        // Return target creature card from your graveyard to the battlefield.
        this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
        this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
    }
View Full Code Here

            Player controller = game.getPlayer(ability.getControllerId());
            if (controller != null) {
                // Target may only be added if possible target exists. Else the gain life effect won't trigger, becuase there is no valid target for the
                // return to hand ability
                if (controller.getGraveyard().count(new FilterCreatureCard(), ability.getSourceId(), ability.getControllerId(), game) > 0) {
                    ability.addTarget(new TargetCardInYourGraveyard(0,1,new FilterCreatureCard("creature card from your graveyard")));
                }
            }
        }

    }
View Full Code Here

        // {B}{B}, Pay 2 life, Sacrifice a Swamp: Return target creature card from your graveyard to the battlefield.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new ManaCostsImpl("{B}{B}"));
        ability.addCost(new PayLifeCost(2));
        ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
        this.addAbility(ability);
    }
View Full Code Here

TOP

Related Classes of mage.target.common.TargetCardInYourGraveyard

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.