Search in sources :

Example 1 with RevealLibraryPutIntoHandEffect

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;
}
Also used : Player(mage.players.Player) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) ManaCost(mage.abilities.costs.mana.ManaCost) RevealLibraryPutIntoHandEffect(mage.abilities.effects.common.RevealLibraryPutIntoHandEffect) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl)

Example 2 with RevealLibraryPutIntoHandEffect

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;
}
Also used : Player(mage.players.Player) FilterCreatureCard(mage.filter.common.FilterCreatureCard) NamePredicate(mage.filter.predicate.mageobject.NamePredicate) RevealLibraryPutIntoHandEffect(mage.abilities.effects.common.RevealLibraryPutIntoHandEffect) MageObject(mage.MageObject)

Example 3 with RevealLibraryPutIntoHandEffect

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);
}
Also used : FilterCard(mage.filter.FilterCard) RevealLibraryPutIntoHandEffect(mage.abilities.effects.common.RevealLibraryPutIntoHandEffect)

Aggregations

RevealLibraryPutIntoHandEffect (mage.abilities.effects.common.RevealLibraryPutIntoHandEffect)3 Player (mage.players.Player)2 MageObject (mage.MageObject)1 GenericManaCost (mage.abilities.costs.mana.GenericManaCost)1 ManaCost (mage.abilities.costs.mana.ManaCost)1 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)1 FilterCard (mage.filter.FilterCard)1 FilterCreatureCard (mage.filter.common.FilterCreatureCard)1 NamePredicate (mage.filter.predicate.mageobject.NamePredicate)1