Search in sources :

Example 6 with RevealTargetFromHandCost

use of mage.abilities.costs.common.RevealTargetFromHandCost in project mage by magefree.

the class ScentOfNightshadeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source, source.getControllerId(), true)) {
        return false;
    }
    int xValue = -1 * cost.getNumberRevealedCards();
    game.addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
    return true;
}
Also used : RevealTargetFromHandCost(mage.abilities.costs.common.RevealTargetFromHandCost) TargetCardInHand(mage.target.common.TargetCardInHand) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 7 with RevealTargetFromHandCost

use of mage.abilities.costs.common.RevealTargetFromHandCost in project mage by magefree.

the class IvySeerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source, source.getControllerId(), true)) {
        return false;
    }
    int xValue = cost.getNumberRevealedCards();
    game.addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
    return true;
}
Also used : RevealTargetFromHandCost(mage.abilities.costs.common.RevealTargetFromHandCost) TargetCardInHand(mage.target.common.TargetCardInHand) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 8 with RevealTargetFromHandCost

use of mage.abilities.costs.common.RevealTargetFromHandCost in project mage by magefree.

the class JasmineSeerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source, source.getControllerId(), true)) {
        return false;
    }
    int xValue = cost.getNumberRevealedCards();
    return new GainLifeEffect(2 * xValue).apply(game, source);
}
Also used : RevealTargetFromHandCost(mage.abilities.costs.common.RevealTargetFromHandCost) TargetCardInHand(mage.target.common.TargetCardInHand) GainLifeEffect(mage.abilities.effects.common.GainLifeEffect)

Example 9 with RevealTargetFromHandCost

use of mage.abilities.costs.common.RevealTargetFromHandCost in project mage by magefree.

the class TitansPresenceEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0);
    Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
    Player controller = game.getPlayer(source.getControllerId());
    if (cost != null && creature != null && controller != null) {
        List<Card> revealedCards = cost.getRevealedCards();
        if (!revealedCards.isEmpty()) {
            Card card = revealedCards.iterator().next();
            if (card != null && card.getPower().getValue() >= creature.getPower().getValue()) {
                controller.moveCards(creature, Zone.EXILED, source, game);
            }
        }
        return true;
    }
    return false;
}
Also used : RevealTargetFromHandCost(mage.abilities.costs.common.RevealTargetFromHandCost) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) FilterCreatureCard(mage.filter.common.FilterCreatureCard) Card(mage.cards.Card)

Example 10 with RevealTargetFromHandCost

use of mage.abilities.costs.common.RevealTargetFromHandCost in project mage by magefree.

the class CinderSeerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source, source.getControllerId(), true)) {
        return false;
    }
    int xValue = cost.getNumberRevealedCards();
    return new DamageTargetEffect(xValue).apply(game, source);
}
Also used : RevealTargetFromHandCost(mage.abilities.costs.common.RevealTargetFromHandCost) TargetCardInHand(mage.target.common.TargetCardInHand) DamageTargetEffect(mage.abilities.effects.common.DamageTargetEffect)

Aggregations

RevealTargetFromHandCost (mage.abilities.costs.common.RevealTargetFromHandCost)14 TargetCardInHand (mage.target.common.TargetCardInHand)10 BoostTargetEffect (mage.abilities.effects.common.continuous.BoostTargetEffect)5 Permanent (mage.game.permanent.Permanent)3 GenericManaCost (mage.abilities.costs.mana.GenericManaCost)2 CounterUnlessPaysEffect (mage.abilities.effects.common.CounterUnlessPaysEffect)2 DamageTargetEffect (mage.abilities.effects.common.DamageTargetEffect)2 GainLifeEffect (mage.abilities.effects.common.GainLifeEffect)2 Card (mage.cards.Card)2 Player (mage.players.Player)2 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)2 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 FilterCreatureCard (mage.filter.common.FilterCreatureCard)1 FixedTarget (mage.target.targetpointer.FixedTarget)1