39 lines
1.4 KiB
Groovy
39 lines
1.4 KiB
Groovy
[
|
|
new MagicWhenDamageIsDealtTrigger() {
|
|
@Override
|
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
|
|
return (damage.getSource() == permanent &&
|
|
damage.getTarget().isPlayer()) ?
|
|
new MagicEvent(
|
|
permanent,
|
|
new MagicMayChoice(
|
|
MagicTargetChoice.GOBLIN_CARD_FROM_HAND
|
|
),
|
|
MagicGraveyardTargetPicker.PutOntoBattlefield,
|
|
this,
|
|
"PN may\$ put a Goblin permanent card\$ from " +
|
|
"his or her hand onto the battlefield."
|
|
):
|
|
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.OwnersHand
|
|
));
|
|
game.doAction(new MagicPlayCardAction(
|
|
card,
|
|
event.getPlayer()
|
|
));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
]
|