use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class EndlingEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player == null || permanent == null) {
return false;
}
int boost = player.chooseUse(outcome, "Give +1/-1 or -1/+1?", null, "+1/-1", "-1/+1", source, game) ? 1 : -1;
game.addEffect(new BoostSourceEffect(boost, -1 * boost, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class HarshDeceiverEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
Cards cards = new CardsImpl(card);
controller.revealCards(sourceObject.getIdName(), cards, game);
if (card.isLand(game)) {
new UntapSourceEffect().apply(game, source);
game.addEffect(new BoostSourceEffect(1, 1, Duration.EndOfTurn), source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class ImpetuousProtegeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int maxPower = 0;
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
maxPower = Math.max(maxPower, creature.getPower().getValue());
}
game.addEffect(new BoostSourceEffect(maxPower, 0, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class LedevChampionEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int tappedAmount = 0;
TargetCreaturePermanent target = new TargetCreaturePermanent(0, Integer.MAX_VALUE, filter, true);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game) && target.choose(Outcome.Tap, source.getControllerId(), source.getSourceId(), game)) {
for (UUID creatureId : target.getTargets()) {
Permanent creature = game.getPermanent(creatureId);
if (creature != null) {
creature.tap(source, game);
tappedAmount++;
}
}
}
if (tappedAmount > 0) {
game.addEffect(new BoostSourceEffect(tappedAmount, tappedAmount, Duration.EndOfTurn), source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class SpellboundDragonEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
Permanent dragon = game.getPermanent(source.getSourceId());
if (you != null) {
you.drawCards(1, source, game);
TargetDiscard target = new TargetDiscard(you.getId());
you.choose(Outcome.Discard, target, source.getSourceId(), game);
Card card = you.getHand().get(target.getFirstTarget(), game);
if (card != null && you.discard(card, false, source, game)) {
int cmc = card.getManaValue();
if (dragon != null) {
game.addEffect(new BoostSourceEffect(cmc, 0, Duration.EndOfTurn), source);
return true;
}
}
}
return false;
}
Aggregations