use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class CankerousThirstEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (new ManaWasSpentCondition(ColoredManaSymbol.B).apply(game, source)) {
Permanent targetCreature1 = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature1 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature1.getIdName() + " get -3/-3 until end of turn?", source, game)) {
ContinuousEffect effect = new BoostTargetEffect(-3, -3, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(targetCreature1, game));
game.addEffect(effect, source);
}
}
if (new ManaWasSpentCondition(ColoredManaSymbol.G).apply(game, source)) {
Permanent targetCreature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (targetCreature2 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature2.getIdName() + " get +3/+3 until end of turn?", source, game)) {
ContinuousEffect effect = new BoostTargetEffect(+3, +3, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(targetCreature2, game));
game.addEffect(effect, source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class AkromaVisionOfIxidorEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
Abilities abilities = permanent.getAbilities(game);
int count = classes.stream().map(clazz -> abilities.stream().anyMatch(clazz::isInstance)).mapToInt(b -> b ? 1 : 0).sum();
if (count > 0) {
ContinuousEffect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent.getId(), game));
game.addEffect(effect, source);
}
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class ArahboEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
if (creature != null && creature.isCreature(game)) {
int pow = creature.getPower().getValue();
ContinuousEffect effect = new BoostTargetEffect(pow, pow, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(creature, game));
game.addEffect(effect, source);
effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(creature, game));
game.addEffect(effect, source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class BerserkMurlodontEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent == null) {
return false;
}
int blockers = game.getCombat().getGroups().stream().filter(combatGroup -> combatGroup.getAttackers().contains(permanent.getId())).map(CombatGroup::getBlockers).mapToInt(List::size).sum();
game.addEffect(new BoostTargetEffect(blockers, blockers, 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 ClearTheStageEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
game.addEffect(new BoostTargetEffect(-3, -3), source);
if (!FerociousCondition.instance.apply(game, source)) {
return true;
}
Player player = game.getPlayer(source.getControllerId());
if (player == null || !player.chooseUse(Outcome.Benefit, "Return a creature card from your graveyard to your hand?", source, game)) {
return false;
}
Card card = game.getCard(source.getTargets().get(1).getFirstTarget());
if (card == null) {
return false;
}
return player.moveCards(card, Zone.HAND, source, game);
}
Aggregations