use of mage.abilities.condition.common.ManaWasSpentCondition 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;
}
Aggregations