magarena/release/Magarena/scripts/Mind_Peel.groovy

30 lines
1.1 KiB
Groovy

[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
new MagicBuybackChoice(
MagicTargetChoice.NEG_TARGET_PLAYER,
MagicManaCost.create("{2}{B}{B}")
),
this,
"Target player\$ discards a card. " +
"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.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
game.addEvent(new MagicDiscardEvent(event.getSource(),player,1,false));
if (event.isBuyback()) {
game.doAction(new MagicChangeCardDestinationAction(event.getCardOnStack(), MagicLocationType.OwnersHand));
}
}
});
}
}
]