use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class PacksDisdainEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
if (player != null && player.choose(Outcome.UnboostCreature, typeChoice, game)) {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
filter.add(SubType.byDescription(typeChoice.getChoice()).getPredicate());
DynamicValue negativePermanentsCount = new PermanentsOnBattlefieldCount(filter, -1);
ContinuousEffect effect = new BoostTargetEffect(negativePermanentsCount, negativePermanentsCount, Duration.EndOfTurn, true);
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
game.addEffect(effect, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class RegentsAuthorityEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
if (!permanent.isEnchantment(game) && (!permanent.isCreature(game) || !permanent.isLegendary())) {
game.addEffect(new BoostTargetEffect(2, 2), source);
return true;
}
permanent.addCounters(CounterType.P1P1.createInstance(), source, game);
game.addEffect(new BoostTargetEffect(1, 1), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class SkulduggeryEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
ContinuousEffect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent != null) {
ContinuousEffect effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class SkyclavePickAxeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (permanent == null || game.getPermanent(permanent.getAttachedTo()) == null) {
return false;
}
game.addEffect(new BoostTargetEffect(2, 2).setTargetPointer(new FixedTarget(permanent.getAttachedTo(), game)), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class SquealingDevilEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
ManaCosts cost = new ManaCostsImpl("{X}");
if (player != null) {
if (player.chooseUse(Outcome.BoostCreature, "Pay " + cost.getText() + "?", source, game)) {
int costX = player.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
cost.add(new GenericManaCost(costX));
if (cost.pay(source, game, source, source.getControllerId(), false, null)) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null && permanent.isCreature(game)) {
ContinuousEffect effect = new BoostTargetEffect(costX, 0, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
return true;
}
return false;
}
}
}
return false;
}
Aggregations