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;
}
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;
}
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);
}
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;
}
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);
}
Aggregations