use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class GoblinMachinistEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
CardsImpl cards = new CardsImpl();
for (Card card : controller.getLibrary().getCards(game)) {
if (card != null) {
cards.add(card);
if (!card.isLand(game)) {
if (card.getManaValue() > 0) {
game.addEffect(new BoostSourceEffect(card.getManaValue(), 0, Duration.EndOfTurn), source);
}
break;
}
}
}
controller.revealCards(source, cards, game);
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class GroundPounderTriggeredAbility method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
int amount = controller.rollDice(outcome, source, game, 6);
game.addEffect(new BoostSourceEffect(amount, amount, Duration.EndOfTurn), source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class ManaChargedDragonEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int xSum = 0;
xSum += ManaUtil.playerPaysXGenericMana(false, "Mana Charged Dragon", controller, source, game);
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
if (!Objects.equals(playerId, controller.getId())) {
Player player = game.getPlayer(playerId);
if (player != null && player.canRespond()) {
xSum += ManaUtil.playerPaysXGenericMana(false, "Mana Charged Dragon", player, source, game);
}
}
}
if (xSum > 0) {
ContinuousEffect effect = new BoostSourceEffect(xSum, 0, Duration.EndOfTurn);
game.addEffect(effect, source);
}
// prevent undo
controller.resetStoredBookmark(game);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class SentryOakEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
if (game.getPermanent(source.getSourceId()) != null) {
ContinuousEffect continuousEffect = new BoostSourceEffect(2, 0, Duration.EndOfTurn);
game.addEffect(continuousEffect, source);
continuousEffect = new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.EndOfTurn);
game.addEffect(continuousEffect, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class UrzasScienceFairProjectEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int amount = controller.rollDice(outcome, source, game, 6);
Effect effect = null;
// 6 - gets +2/+2 until end of turn";
if (amount == 1) {
game.addEffect(new BoostSourceEffect(-2, -2, Duration.EndOfTurn), source);
} else if (amount == 2) {
game.addEffect(new PreventCombatDamageBySourceEffect(Duration.EndOfTurn), source);
} else if (amount == 3) {
game.addEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn), source);
} else if (amount == 4) {
game.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), source);
} else if (amount == 5) {
game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), source);
} else if (amount == 6) {
game.addEffect(new BoostSourceEffect(+2, +2, Duration.EndOfTurn), source);
}
return true;
}
return false;
}
Aggregations