use of mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect in project mage by magefree.
the class CustomTestCard method addCustomEffect_ReturnFromAnyToHand.
/**
* Return target card to hand that can be called by text "return from ..."
*
* @param controller
*/
protected void addCustomEffect_ReturnFromAnyToHand(TestPlayer controller) {
// graveyard
Ability ability = new SimpleActivatedAbility(new ReturnFromGraveyardToHandTargetEffect().setText("return from graveyard"), new ManaCostsImpl(""));
ability.addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD));
addCustomCardWithAbility("return from graveyard for " + controller.getName(), controller, ability);
// exile
ability = new SimpleActivatedAbility(new ReturnFromExileEffect(Zone.HAND).setText("return from exile"), new ManaCostsImpl(""));
ability.addTarget(new TargetCardInExile(StaticFilters.FILTER_CARD));
addCustomCardWithAbility("return from exile for " + controller.getName(), controller, ability);
// library
ability = new SimpleActivatedAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD)).setText("return from library"), new ManaCostsImpl(""));
addCustomCardWithAbility("return from library for " + controller.getName(), controller, ability);
}
use of mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect in project mage by magefree.
the class TianaShipsCaretakerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
effect.setTargetPointer(new FixedTarget(card, game));
effect.setText("return that card to your hand at the beginning of the next end step");
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
return true;
}
return false;
}
use of mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect in project mage by magefree.
the class EdgarsAwakeningTriggeredAbility method makeAbility.
private static final ReflexiveTriggeredAbility makeAbility() {
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), false, "return target creature card from your graveyard to your hand");
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
return ability;
}
use of mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect in project mage by magefree.
the class RienneAngelOfRebirthEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
effect.setTargetPointer(new FixedTarget(card, game));
effect.setText("return that card to your hand at the beginning of the next end step");
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
return true;
}
return false;
}
Aggregations