use of mage.abilities.effects.common.continuous.BoostTargetEffect 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.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class KjeldoranEliteGuardDelayedTriggeredAbility method apply.
@Override
public boolean apply(Game game, Ability source) {
if (game.getPermanent(source.getFirstTarget()) == null) {
return false;
}
// Target creature gets +2/+2 until end of turn.
BoostTargetEffect buffEffect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
buffEffect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
game.addEffect(buffEffect, source);
// When that creature leaves the battlefield this turn, sacrifice Kjeldoran Elite Guard.
game.addDelayedTriggeredAbility(new KjeldoranEliteGuardDelayedTriggeredAbility(source.getFirstTarget()), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class ProvokeTheTrollsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
return player.damage(3, source.getSourceId(), source, game) > 0;
}
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null || permanent.damage(3, source.getSourceId(), source, game) < 1) {
return false;
}
if (permanent.isCreature(game)) {
game.addEffect(new BoostTargetEffect(3, 0), source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class RookieMistakeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
ContinuousEffect effect = new BoostTargetEffect(0, 2, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent != null) {
ContinuousEffect effect = new BoostTargetEffect(-2, 0, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class SavageSwipeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
if (permanent.getPower().getValue() == 2) {
ContinuousEffect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
game.getState().processAction(game);
}
return new FightTargetsEffect().apply(game, source);
}
Aggregations