magarena/release/Magarena/scripts/Mind_Peel.groovy

27 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-25 19:31:51 -07:00
[
new MagicSpellCardEvent() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_PLAYER,
2013-04-12 19:32:25 -07:00
this,
2013-05-25 19:43:47 -07:00
"Target player\$ discards a card. " +
"If the buyback cost was payed, return SN to its owner's hand as it resolves."
2013-05-25 19:31:51 -07:00
);
2013-04-12 19:32:25 -07:00
}
@Override
2013-05-25 19:31:51 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
game.addEvent(new MagicDiscardEvent(event.getSource(),player));
2013-04-12 19:32:25 -07:00
if (event.isBuyback()) {
game.doAction(new MagicChangeCardDestinationAction(event.getCardOnStack(), MagicLocationType.OwnersHand));
2013-06-23 18:29:26 -07:00
}
2013-04-12 19:32:25 -07:00
}
});
}
2013-05-25 19:31:51 -07:00
}
]