Search in sources :

Example 26 with BoostSourceEffect

use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.

the class TargNarDemonFangGnollEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = source.getSourcePermanentIfItStillExists(game);
    if (permanent == null) {
        return false;
    }
    game.addEffect(new BoostSourceEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn), source);
    return true;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Permanent(mage.game.permanent.Permanent)

Example 27 with BoostSourceEffect

use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.

the class ErraticCyclopsTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    Spell spell = game.getStack().getSpell(event.getTargetId());
    if (spell != null && spell.isControlledBy(controllerId) && spell.isInstantOrSorcery(game)) {
        this.getEffects().clear();
        this.addEffect(new BoostSourceEffect(spell.getManaValue(), 0, Duration.EndOfTurn));
        return true;
    }
    return false;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Spell(mage.game.stack.Spell)

Example 28 with BoostSourceEffect

use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.

the class KraulHarpoonerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent sourcePerm = game.getPermanent(source.getSourceId());
    Player player = game.getPlayer(source.getControllerId());
    if (sourcePerm == null || player == null) {
        return false;
    }
    int xValue = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game);
    game.addEffect(new BoostSourceEffect(xValue, 0, Duration.EndOfTurn), source);
    game.getState().processAction(game);
    Permanent creature = game.getPermanent(source.getFirstTarget());
    if (creature == null || !player.chooseUse(outcome, "Have " + sourcePerm.getLogName() + " fight " + creature.getLogName() + "?", source, game)) {
        return true;
    }
    return creature.fight(sourcePerm, source, game);
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Player(mage.players.Player) FilterPermanent(mage.filter.FilterPermanent) Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) TargetPermanent(mage.target.TargetPermanent)

Example 29 with BoostSourceEffect

use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.

the class MindshriekerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player targetPlayer = game.getPlayer(source.getFirstTarget());
    if (targetPlayer == null) {
        return false;
    }
    int totalCMC = targetPlayer.millCards(1, source, game).getCards(game).stream().filter(Objects::nonNull).mapToInt(MageObject::getManaValue).sum();
    if (totalCMC > 0) {
        game.addEffect(new BoostSourceEffect(totalCMC, totalCMC, Duration.EndOfTurn), source);
    }
    return false;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) TargetPlayer(mage.target.TargetPlayer) Player(mage.players.Player) Objects(java.util.Objects)

Example 30 with BoostSourceEffect

use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.

the class StormchaserChimeraEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    Permanent sourcePermanent = game.getPermanentOrLKIBattlefield((source.getSourceId()));
    if (player == null || sourcePermanent == null) {
        return false;
    }
    if (player.getLibrary().hasCards()) {
        Card card = player.getLibrary().getFromTop(game);
        Cards cards = new CardsImpl(card);
        player.revealCards(sourcePermanent.getName(), cards, game);
        if (card != null) {
            game.addEffect(new BoostSourceEffect(card.getManaValue(), 0, 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) Cards(mage.cards.Cards) CardsImpl(mage.cards.CardsImpl) Card(mage.cards.Card)

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