use of mage.abilities.effects.common.RevealLibraryPutIntoHandEffect in project mage by magefree.
the class DepalaPilotExemplarEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ManaCosts<ManaCost> cost = new ManaCostsImpl<>("{X}");
int xValue = controller.announceXMana(0, Integer.MAX_VALUE, "Choose the amount of mana to pay", game, source);
cost.add(new GenericManaCost(xValue));
if (cost.pay(source, game, source, source.getControllerId(), false) && xValue > 0) {
new RevealLibraryPutIntoHandEffect(xValue, filter, Zone.LIBRARY, false).apply(game, source);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.RevealLibraryPutIntoHandEffect in project mage by magefree.
the class WoodSageEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller == null || sourceObject == null) {
return false;
}
String cardName = ChooseACardNameEffect.TypeOfName.CREATURE_NAME.getChoice(controller, game, source, false);
FilterCreatureCard filter = new FilterCreatureCard("all of them with that name");
filter.add(new NamePredicate(cardName));
new RevealLibraryPutIntoHandEffect(4, filter, Zone.GRAVEYARD).apply(game, source);
return true;
}
use of mage.abilities.effects.common.RevealLibraryPutIntoHandEffect in project mage by magefree.
the class BrassHeraldEntersEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
FilterCard filter = new FilterCard("creature cards of the chosen type");
filter.add(ChosenSubtypePredicate.TRUE);
return new RevealLibraryPutIntoHandEffect(4, filter, Zone.LIBRARY).apply(game, source);
}
Aggregations