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;
}
Aggregations