use of mage.abilities.effects.common.DoUnlessAnyPlayerPaysEffect 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;
}
Aggregations