magarena/release/Magarena/scripts/Goblin_Lackey.groovy

40 lines
1.5 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.TARGET_GOBLIN_CARD_FROM_HAND
),
new MagicGraveyardTargetPicker(true),
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(),
MagicPlayCardAction.NONE
));
}
});
}
}
}
]