Search in sources :

Example 31 with BoostSourceEffect

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;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Player(mage.players.Player) CardsImpl(mage.cards.CardsImpl) Card(mage.cards.Card)

Example 32 with BoostSourceEffect

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;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent)

Example 33 with BoostSourceEffect

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;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Player(mage.players.Player) ContinuousEffect(mage.abilities.effects.ContinuousEffect) UUID(java.util.UUID)

Example 34 with BoostSourceEffect

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;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) LoseAbilitySourceEffect(mage.abilities.effects.common.continuous.LoseAbilitySourceEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 35 with BoostSourceEffect

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;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Player(mage.players.Player) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect) OneShotEffect(mage.abilities.effects.OneShotEffect) PreventCombatDamageBySourceEffect(mage.abilities.effects.common.PreventCombatDamageBySourceEffect) BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Effect(mage.abilities.effects.Effect) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect) PreventCombatDamageBySourceEffect(mage.abilities.effects.common.PreventCombatDamageBySourceEffect)

Aggregations

BoostSourceEffect (mage.abilities.effects.common.continuous.BoostSourceEffect)41 Player (mage.players.Player)25 Permanent (mage.game.permanent.Permanent)21 Card (mage.cards.Card)9 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)7 UUID (java.util.UUID)6 MageObject (mage.MageObject)5 SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)5 CardsImpl (mage.cards.CardsImpl)5 Ability (mage.abilities.Ability)4 LeavesBattlefieldTriggeredAbility (mage.abilities.common.LeavesBattlefieldTriggeredAbility)4 ExileTargetEffect (mage.abilities.effects.common.ExileTargetEffect)4 GainLifeEffect (mage.abilities.effects.common.GainLifeEffect)4 GainAbilitySourceEffect (mage.abilities.effects.common.continuous.GainAbilitySourceEffect)4 TargetPermanent (mage.target.TargetPermanent)4 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)4 Test (org.junit.Test)4 ContinuousEffect (mage.abilities.effects.ContinuousEffect)3 Cards (mage.cards.Cards)3 FilterControlledCreaturePermanent (mage.filter.common.FilterControlledCreaturePermanent)3