magarena/release/Magarena/scripts/Reanimate.groovy

27 lines
1.2 KiB
Groovy
Raw Normal View History

2013-05-25 22:59:23 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_CREATURE_CARD_FROM_ALL_GRAVEYARDS,
new MagicGraveyardTargetPicker(false), // no mana cost but payed with life
this,
2013-05-25 23:04:44 -07:00
"Put target creature card\$ from a graveyard onto the battlefield under your control. " +
2013-05-25 22:59:23 -07:00
"PN loses life equal to its converted mana cost."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetCard(game,new MagicCardAction() {
public void doAction(final MagicCard targetCard) {
final MagicPlayer player=event.getPlayer();
game.doAction(new MagicReanimateAction(player,targetCard,MagicPlayCardAction.NONE));
game.doAction(new MagicChangeLifeAction(player,-targetCard.getCardDefinition().getConvertedCost()));
}
});
}
}
]