magarena/release/Magarena/scripts/Zodiac_Dragon.groovy

28 lines
1.1 KiB
Groovy

[
new MagicWhenOtherDiesTrigger() {
@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() && card.isInGraveyard()) {
game.doAction(new MagicRemoveCardAction(card,MagicLocationType.Graveyard));
game.doAction(new MagicMoveCardAction(card,MagicLocationType.Graveyard,MagicLocationType.OwnersHand));
}
}
}
]