33 lines
1.4 KiB
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));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
]
|