magarena/release/Magarena/scripts/Unhallowed_Pact.groovy

31 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 06:07:02 -07:00
[
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPermanent died) {
final MagicPermanent enchanted = permanent.getEnchantedCreature();
return (enchanted == died) ?
new MagicEvent(
permanent,
enchanted.getCard(),
this,
"Return RN to the battlefield under your control."
):
MagicEvent.NONE;
}
@Override
2013-05-18 06:07:02 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final MagicCard card = event.getRefCard();
if (card.getOwner().getGraveyard().contains(card)) {
game.doAction(new MagicReanimateAction(
event.getPlayer(),
card,
MagicPlayCardAction.NONE
));
}
}
2013-05-18 06:07:02 -07:00
}
]