use of mage.abilities.costs.common.RevealTargetFromHandCost in project mage by magefree.
the class InduceDespairEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0);
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
if (cost != null && creature != null) {
int cmcBoost = -1 * cost.manaValues;
ContinuousEffect effect = new BoostTargetEffect(cmcBoost, cmcBoost, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game)));
game.addEffect(effect, source);
return true;
}
return false;
}
use of mage.abilities.costs.common.RevealTargetFromHandCost in project mage by magefree.
the class NightshadeSeerEffect 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 LivingDestinyEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0);
if (cost != null) {
Player player = game.getPlayer(source.getControllerId());
int CMC = cost.manaValues;
if (player != null) {
player.gainLife(CMC, game, source);
}
}
return true;
}
use of mage.abilities.costs.common.RevealTargetFromHandCost in project mage by magefree.
the class ChargeOfTheForeverBeastEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0);
if (permanent == null || cost == null) {
return false;
}
Card card = cost.getRevealedCards().get(0);
if (card == null) {
return false;
}
return permanent.damage(card.getPower().getValue(), source.getSourceId(), source, game) > 0;
}
Aggregations