use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class PlaneswalkersFavorEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget());
if (opponent != null && !opponent.getHand().isEmpty()) {
Cards revealed = new CardsImpl();
Card card = opponent.getHand().getRandom(game);
if (card != null) {
revealed.add(card);
int boostValue = card.getManaValue();
opponent.revealCards("Planeswalker's Favor", revealed, game);
ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
game.addEffect(effect, source);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class PlaneswalkersScornEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget());
if (opponent != null && !opponent.getHand().isEmpty()) {
Cards revealed = new CardsImpl();
Card card = opponent.getHand().getRandom(game);
if (card != null) {
revealed.add(card);
int boostValue = -1 * card.getManaValue();
opponent.revealCards("Planeswalker's Scorn", revealed, game);
ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
game.addEffect(effect, source);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class RoarOfJukaiEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (new PermanentsOnTheBattlefieldCondition(filter).apply(game, source)) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(filterBlocked, source.getControllerId(), source.getSourceId(), game)) {
ContinuousEffect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class TaigamSidisisHandEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature != null) {
int amount = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof ExileFromGraveCost) {
amount = ((ExileFromGraveCost) cost).getExiledCards().size();
ContinuousEffect effect = new BoostTargetEffect(-amount, -amount, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getTargets().getFirstTarget(), game));
game.addEffect(effect, source);
}
}
}
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class NeyithOfTheDireHuntEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
int power = permanent.getPower().getValue();
game.addEffect(new BoostTargetEffect(power, 0, Duration.EndOfTurn), source);
game.addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfCombat), source);
return true;
}
Aggregations