Search in sources :

Example 1 with BoostControlledEffect

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

the class SacredRitesEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller == null) {
        return false;
    }
    int numDiscarded = controller.discard(0, Integer.MAX_VALUE, false, source, game).size();
    if (numDiscarded > 0) {
        game.addEffect(new BoostControlledEffect(0, numDiscarded, Duration.EndOfTurn), source);
    }
    return true;
}
Also used : Player(mage.players.Player) BoostControlledEffect(mage.abilities.effects.common.continuous.BoostControlledEffect)

Example 2 with BoostControlledEffect

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

the class PathbreakerIbexEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int maxPower = 0;
    for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
        if (perm.getPower().getValue() > maxPower) {
            maxPower = perm.getPower().getValue();
        }
    }
    ContinuousEffect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES);
    game.addEffect(effect, source);
    if (maxPower != 0) {
        effect = new BoostControlledEffect(maxPower, maxPower, Duration.EndOfTurn);
        game.addEffect(effect, source);
    }
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) GainAbilityControlledEffect(mage.abilities.effects.common.continuous.GainAbilityControlledEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) BoostControlledEffect(mage.abilities.effects.common.continuous.BoostControlledEffect)

Example 3 with BoostControlledEffect

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

the class FinaleOfDevastationEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int xValue = source.getManaCostsToPay().getX();
    if (xValue >= 10) {
        ContinuousEffect effect1 = new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn);
        game.addEffect(effect1, source);
        ContinuousEffect effect2 = new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent());
        game.addEffect(effect2, source);
    }
    return true;
}
Also used : FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) GainAbilityControlledEffect(mage.abilities.effects.common.continuous.GainAbilityControlledEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) BoostControlledEffect(mage.abilities.effects.common.continuous.BoostControlledEffect)

Example 4 with BoostControlledEffect

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

the class ExhilaratingElocutionEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent == null) {
        return false;
    }
    permanent.addCounters(CounterType.P1P1.createInstance(2), source.getControllerId(), source, game);
    FilterCreaturePermanent filterPermanent = new FilterCreaturePermanent();
    filterPermanent.add(Predicates.not(new MageObjectReferencePredicate(new MageObjectReference(permanent, game))));
    game.addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, filterPermanent), source);
    return true;
}
Also used : FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) TargetControlledCreaturePermanent(mage.target.common.TargetControlledCreaturePermanent) MageObjectReferencePredicate(mage.filter.predicate.mageobject.MageObjectReferencePredicate) BoostControlledEffect(mage.abilities.effects.common.continuous.BoostControlledEffect) MageObjectReference(mage.MageObjectReference)

Example 5 with BoostControlledEffect

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

the class OverwhelmingStampedeInitEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int maxPower = 0;
    for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
        if (perm.getPower().getValue() > maxPower) {
            maxPower = perm.getPower().getValue();
        }
    }
    ContinuousEffect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent());
    game.addEffect(effect, source);
    if (maxPower != 0) {
        effect = new BoostControlledEffect(maxPower, maxPower, Duration.EndOfTurn);
        game.addEffect(effect, source);
    }
    return true;
}
Also used : FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) GainAbilityControlledEffect(mage.abilities.effects.common.continuous.GainAbilityControlledEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) BoostControlledEffect(mage.abilities.effects.common.continuous.BoostControlledEffect)

Aggregations

BoostControlledEffect (mage.abilities.effects.common.continuous.BoostControlledEffect)9 GainAbilityControlledEffect (mage.abilities.effects.common.continuous.GainAbilityControlledEffect)4 Permanent (mage.game.permanent.Permanent)4 Player (mage.players.Player)4 ContinuousEffect (mage.abilities.effects.ContinuousEffect)3 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)3 MageObjectReference (mage.MageObjectReference)1 CreaturesYouControlHint (mage.abilities.hint.common.CreaturesYouControlHint)1 MageObjectReferencePredicate (mage.filter.predicate.mageobject.MageObjectReferencePredicate)1 TargetControlledCreaturePermanent (mage.target.common.TargetControlledCreaturePermanent)1