Search in sources :

Example 1 with SetToughnessSourceEffect

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

the class WallOfTombstonesEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int newToughness = CardUtil.overflowInc(1, new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE).calculate(game, source, this));
    game.addEffect(new SetToughnessSourceEffect(StaticValue.get(newToughness), Duration.Custom, SubLayer.SetPT_7b), source);
    return true;
}
Also used : SetToughnessSourceEffect(mage.abilities.effects.common.continuous.SetToughnessSourceEffect) CardsInControllerGraveyardCount(mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount)

Example 2 with SetToughnessSourceEffect

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

the class SentinelEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent targetPermanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
    if (controller != null && targetPermanent != null) {
        int newToughness = CardUtil.overflowInc(targetPermanent.getPower().getValue(), 1);
        game.addEffect(new SetToughnessSourceEffect(StaticValue.get(newToughness), Duration.Custom, SubLayer.SetPT_7b), source);
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) SetToughnessSourceEffect(mage.abilities.effects.common.continuous.SetToughnessSourceEffect)

Aggregations

SetToughnessSourceEffect (mage.abilities.effects.common.continuous.SetToughnessSourceEffect)2 CardsInControllerGraveyardCount (mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1 Player (mage.players.Player)1 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)1