Search in sources :

Example 1 with ManaWasSpentCondition

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;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) ManaWasSpentCondition(mage.abilities.condition.common.ManaWasSpentCondition) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Aggregations

ManaWasSpentCondition (mage.abilities.condition.common.ManaWasSpentCondition)1 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 BoostTargetEffect (mage.abilities.effects.common.continuous.BoostTargetEffect)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1 Player (mage.players.Player)1 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)1 FixedTarget (mage.target.targetpointer.FixedTarget)1