use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class LilianaOfTheDarkRealmsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
int swamps = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
if (swamps < 1) {
return false;
}
String plusMessage = "+" + swamps + "/+" + swamps;
String minusMessage = "-" + swamps + "/-" + swamps;
if (!player.chooseUse(outcome, "Give " + plusMessage + " or " + minusMessage + "?", null, plusMessage, minusMessage, source, game)) {
swamps *= -1;
}
game.addEffect(new BoostTargetEffect(swamps, swamps, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class NantukoMentorEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetPermanent != null) {
ContinuousEffect effect = new BoostTargetEffect(targetPermanent.getPower().getValue(), targetPermanent.getPower().getValue(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(targetPermanent, game));
game.addEffect(effect, source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class OliviasMidnightAmbushEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int boost = NightCondition.instance.apply(game, source) ? -13 : -2;
game.addEffect(new BoostTargetEffect(boost, boost), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class SharedAnimosityEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent == null) {
return false;
}
FilterPermanent filter = new FilterAttackingCreature();
filter.add(new SharesCreatureTypePredicate(permanent));
filter.add(AnotherPredicate.instance);
int count = game.getBattlefield().count(filter, permanent.getId(), source.getControllerId(), game);
if (count > 0) {
game.addEffect(new BoostTargetEffect(count, 0, Duration.EndOfTurn).setTargetPointer(new FixedTarget(permanent, game)), source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class WillOfTheAllHunterEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
if (permanent.getBlocking() > 0) {
return permanent.addCounters(CounterType.P1P1.createInstance(2), source.getControllerId(), source, game);
}
game.addEffect(new BoostTargetEffect(2, 2), source);
return true;
}
Aggregations