Search in sources :

Example 1 with AddManaInAnyCombinationEffect

use of mage.abilities.effects.mana.AddManaInAnyCombinationEffect in project mage by magefree.

the class PlasmCaptureCounterEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
    if (spell != null) {
        game.getStack().counter(getTargetPointer().getFirst(game, source), source, game);
        // mana gets added also if counter is not successful
        int mana = spell.getManaValue();
        AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(new AddManaInAnyCombinationEffect(mana), false, TargetController.YOU, PhaseSelection.NEXT_PRECOMBAT_MAIN);
        game.addDelayedTriggeredAbility(delayedAbility, source);
        return true;
    }
    return false;
}
Also used : AtTheBeginOfMainPhaseDelayedTriggeredAbility(mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility) Spell(mage.game.stack.Spell) TargetSpell(mage.target.TargetSpell) AddManaInAnyCombinationEffect(mage.abilities.effects.mana.AddManaInAnyCombinationEffect)

Aggregations

AtTheBeginOfMainPhaseDelayedTriggeredAbility (mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility)1 AddManaInAnyCombinationEffect (mage.abilities.effects.mana.AddManaInAnyCombinationEffect)1 Spell (mage.game.stack.Spell)1 TargetSpell (mage.target.TargetSpell)1