use of mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect in project mage by magefree.
the class ScatteringStrokeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Spell spell = (Spell) game.getStack().getStackObject(getTargetPointer().getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && spell != null) {
game.getStack().counter(spell.getId(), source, game);
if (ClashEffect.getInstance().apply(game, source)) {
Effect effect = new AddManaToManaPoolSourceControllerEffect(new Mana(0, 0, 0, 0, 0, 0, 0, spell.getManaValue()));
AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, true, TargetController.YOU, AtTheBeginOfMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN);
game.addDelayedTriggeredAbility(delayedAbility, source);
}
return true;
}
return false;
}
Aggregations