23 lines
897 B
Groovy
23 lines
897 B
Groovy
[
|
|
new MagicWhenOtherDiesTrigger() {
|
|
@Override
|
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent died) {
|
|
return (permanent.getEnchantedCreature() == died) ?
|
|
new MagicEvent(
|
|
permanent,
|
|
this,
|
|
"Return SN to its owner's hand."
|
|
):
|
|
MagicEvent.NONE;
|
|
}
|
|
@Override
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
|
final MagicCard card = event.getPermanent().getCard();
|
|
if (card.isInGraveyard()) {
|
|
game.doAction(new MagicRemoveCardAction(card,MagicLocationType.Graveyard));
|
|
game.doAction(new MagicMoveCardAction(card,MagicLocationType.Graveyard,MagicLocationType.OwnersHand));
|
|
}
|
|
}
|
|
}
|
|
]
|