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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations