[ new MagicSpellCardEvent() { @Override public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) { final int amount = payedCost.getX(); return new MagicEvent( cardOnStack, new MagicBuybackChoice( MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER, MagicManaCost.create("{3}") ), new MagicDamageTargetPicker(amount), amount, this, "SN deals RN damage to target creature or player\$. " + "If the buyback cost was payed\$, return SN to its owner's hand as it resolves." ); } @Override public void executeEvent(final MagicGame game, final MagicEvent event) { event.processTarget(game,new MagicTargetAction() { public void doAction(final MagicTarget target) { final MagicDamage damage = new MagicDamage( event.getSource(), target, event.getRefInt() ); game.doAction(new MagicDealDamageAction(damage)); if (event.isBuyback()) { game.doAction(new MagicChangeCardDestinationAction(event.getCardOnStack(), MagicLocationType.OwnersHand)); } } }); } } ]