magarena/release/Magarena/scripts/Reiterate.groovy

28 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-26 04:05:37 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
2013-06-15 07:27:32 -07:00
cardOnStack,
MagicTargetChoice.TARGET_INSTANT_OR_SORCERY_SPELL,
2013-06-15 07:27:32 -07:00
this,
2013-06-23 18:29:26 -07:00
"Copy target instant or sorcery spell\$. " +
"PN may choose new targets for the copy. " +
"If the buyback cost was payed, return SN to its owner's hand as it resolves."
2013-06-15 07:27:32 -07:00
);
2013-05-26 04:05:37 -07:00
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetCardOnStack(game,new MagicCardOnStackAction() {
public void doAction(final MagicCardOnStack targetSpell) {
game.doAction(new MagicCopyCardOnStackAction(event.getPlayer(),targetSpell));
if (event.isBuyback()) {
game.doAction(new MagicChangeCardDestinationAction(event.getCardOnStack(), MagicLocationType.OwnersHand));
2013-06-23 18:29:26 -07:00
}
2013-05-26 04:05:37 -07:00
}
});
}
}
]