magarena/release/Magarena/scripts/Gravedigger.groovy

29 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-25 19:26:27 -07:00
[
new MagicWhenComesIntoPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
2013-06-19 07:23:35 -07:00
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPayedCost payedCost) {
2013-04-12 19:32:25 -07:00
return new MagicEvent(
permanent,
new MagicMayChoice(
MagicTargetChoice.TARGET_CREATURE_CARD_FROM_GRAVEYARD
),
MagicGraveyardTargetPicker.ReturnToHand,
2013-04-12 19:32:25 -07:00
this,
2013-05-25 19:43:47 -07:00
"PN may\$ return target creature card\$ from " +
2013-05-25 19:26:27 -07:00
"his or her graveyard to his or her hand."
2013-04-12 19:32:25 -07:00
);
}
2013-06-23 18:29:26 -07:00
2013-04-12 19:32:25 -07:00
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
2013-08-28 00:43:55 -07:00
event.processTargetCard(game, {
final MagicCard card ->
2013-04-12 19:32:25 -07:00
game.doAction(new MagicRemoveCardAction(card,MagicLocationType.Graveyard));
game.doAction(new MagicMoveCardAction(card,MagicLocationType.Graveyard,MagicLocationType.OwnersHand));
2013-08-28 00:43:55 -07:00
} as MagicCardAction);
2013-04-12 19:32:25 -07:00
}
}
2013-05-25 19:26:27 -07:00
}
]