magarena/release/Magarena/scripts/Teneb__the_Harvester.groovy

33 lines
1.4 KiB
Groovy

[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicPlayer player=permanent.getController();
return (damage.getSource()==permanent&&damage.getTarget().isPlayer()&&damage.isCombat()) ?
new MagicEvent(
permanent,
player,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{2}{B}")),
MagicTargetChoice.TARGET_CREATURE_CARD_FROM_ALL_GRAVEYARDS
),
this,
"You may\$ pay {2}{B}\$. If you do, put target creature card\$ " +
"in a graveyard into play under your control."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTargetCard(game,new MagicCardAction() {
public void doAction(final MagicCard card) {
game.doAction(new MagicReanimateAction(event.getPlayer(),card,MagicPlayCardAction.NONE));
}
});
}
}
}
]