26 lines
1.1 KiB
Groovy
26 lines
1.1 KiB
Groovy
[
|
|
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
|
|
@Override
|
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent died) {
|
|
return (permanent == died && permanent.getOwner() == permanent.getController()) ?
|
|
new MagicEvent(
|
|
permanent,
|
|
new MagicSimpleMayChoice(MagicSimpleMayChoice.DRAW_CARDS, 0, MagicSimpleMayChoice.DEFAULT_NONE),
|
|
this,
|
|
"PN may\$ return SN to his/her hand."
|
|
):
|
|
MagicEvent.NONE;
|
|
}
|
|
@Override
|
|
public void executeEvent(
|
|
final MagicGame game,
|
|
final MagicEvent event) {
|
|
final MagicCard card = event.getPermanent().getCard()
|
|
if (event.isYes() && event.getPlayer().getGraveyard().contains(card)) {
|
|
game.doAction(new MagicRemoveCardAction(card,MagicLocationType.Graveyard));
|
|
game.doAction(new MagicMoveCardAction(card,MagicLocationType.Graveyard,MagicLocationType.OwnersHand));
|
|
}
|
|
}
|
|
}
|
|
]
|