use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class PutridCyclopEffect 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) {
new ScryEffect(1).apply(game, source);
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
int unboost = card.getManaValue() * -1;
ContinuousEffect effect = new BoostSourceEffect(unboost, unboost, Duration.EndOfTurn);
game.addEffect(effect, source);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class SiegeStrikerEffect 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 OutcomesTest method test_FromEffects_MultiCombine.
@Test
public void test_FromEffects_MultiCombine() {
Ability ability = new SimpleStaticAbility(new GainLifeEffect(10));
ability.addEffect(new BoostSourceEffect(10, 10, Duration.EndOfTurn));
ability.addEffect(new ExileTargetEffect());
Assert.assertEquals(1 + 1 + -1, ability.getEffects().getOutcomeScore(ability));
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class BalduvianFallenAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
this.getEffects().clear();
if (event.getTargetId().equals(this.getSourceId()) && event instanceof ManaEvent) {
ManaEvent manaEvent = (ManaEvent) event;
int total = manaEvent.getMana().getBlack() + manaEvent.getMana().getRed();
if (total > 0) {
this.getEffects().add(new BoostSourceEffect(total, 0, Duration.EndOfTurn));
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class BioplasmEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Library library = player.getLibrary();
if (library == null || !library.hasCards()) {
return false;
}
Card card = library.getFromTop(game);
if (card == null) {
return false;
}
if (player.moveCards(card, Zone.EXILED, source, game) && card.isCreature(game)) {
game.addEffect(new BoostSourceEffect(card.getPower().getValue(), card.getToughness().getValue(), Duration.EndOfTurn), source);
}
return true;
}
Aggregations