magarena/release/Magarena/scripts/Angelic_Destiny.groovy

22 lines
925 B
Groovy

[
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@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.getOwner().getGraveyard().contains(card)) {
game.doAction(new MagicRemoveCardAction(card,MagicLocationType.Graveyard));
game.doAction(new MagicMoveCardAction(card,MagicLocationType.Graveyard,MagicLocationType.OwnersHand));
}
}
}
]