magarena/release/Magarena/scripts/Corpse_Dance.groovy

36 lines
1.5 KiB
Groovy
Raw Normal View History

2013-05-28 01:08:03 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
new MagicBuybackChoice(MagicManaCost.create("{2}")),
new MagicGraveyardTargetPicker(true),
this,
2013-05-28 01:15:24 -07:00
"Return the top creature card\$ of your graveyard to the battlefield. " +
2013-05-28 01:08:03 -07:00
"That creature gains haste until end of turn. " +
"Exile it at the beginning of the next end step. " +
2013-05-28 01:15:24 -07:00
"If the buyback cost was payed\$, return SN to its owner's hand as it resolves."
2013-05-28 01:08:03 -07:00
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
final List<MagicCard> targets =
game.filterCards(player,MagicTargetFilter.TARGET_CREATURE_CARD_FROM_GRAVEYARD);
if (targets.size() > 0) {
final MagicCard card = targets.get(targets.size()-1);
game.doAction(new MagicReanimateAction(
player,
card,
MagicPlayCardAction.HASTE_UEOT_REMOVE_AT_END_OF_TURN
));
}
if (event.isBuyback()) {
game.doAction(new MagicChangeCardDestinationAction(event.getCardOnStack(), MagicLocationType.OwnersHand));
}
}
}
]