magarena/release/Magarena/scripts/Woebearer.groovy

33 lines
1.4 KiB
Groovy
Raw Normal View History

2013-06-02 22:35:52 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (damage.getSource() == permanent &&
damage.isCombat() &&
damage.getTarget().isPlayer()) ?
new MagicEvent(
permanent,
new MagicMayChoice(
MagicTargetChoice.TARGET_CREATURE_CARD_FROM_GRAVEYARD
2013-06-02 22:35:52 -07:00
),
MagicGraveyardTargetPicker.ReturnToHand,
2013-06-02 22:35:52 -07:00
this,
"PN may\$ return target creature card\$ from " +
2013-06-02 22:35:52 -07:00
"his or her graveyard to his or her hand."
) :
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 MagicRemoveCardAction(card,MagicLocationType.Graveyard));
game.doAction(new MagicMoveCardAction(card,MagicLocationType.Graveyard,MagicLocationType.OwnersHand));
}
});
}
}
}
]