if (controller != null && spell != null) {
game.getStack().counter(spell.getId(), source.getSourceId(), game);
if (ClashEffect.getInstance().apply(game, source)) {
Effect effect = new AddManaToManaPoolEffect(new Mana(0,0,0,0,0,spell.getConvertedManaCost(),0), "your");
effect.setTargetPointer(new FixedTarget(source.getControllerId()));
AtTheBeginOMainPhaseDelayedTriggeredAbility delayedAbility =
new AtTheBeginOMainPhaseDelayedTriggeredAbility(effect, true, TargetController.YOU, AtTheBeginOMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;
}
return false;