use of mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect in project mage by magefree.
the class AetherRiftEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = controller.discardOne(true, false, source, game);
if (card != null && card.isCreature(game)) {
Effect returnEffect = new ReturnFromGraveyardToBattlefieldTargetEffect();
returnEffect.setTargetPointer(new FixedTarget(card.getId(), game));
Effect doEffect = new DoUnlessAnyPlayerPaysEffect(returnEffect, new PayLifeCost(5), "Pay 5 life to prevent " + card.getLogName() + " to return from graveyard to battlefield?");
return doEffect.apply(game, source);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect in project mage by magefree.
the class ConcoctEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
player.surveil(3, source, game);
Target target = new TargetCardInYourGraveyard(filter);
target.setNotTarget(true);
if (player.choose(outcome, target, source.getSourceId(), game)) {
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
effect.setTargetPointer(new FixedTarget(target.getFirstTarget(), game));
effect.apply(game, source);
}
return true;
}
Aggregations