magarena/release/Magarena/scripts/Boomerang.groovy

24 lines
838 B
Groovy

[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_PERMANENT,
MagicBounceTargetPicker.create(),
this,
"Return target permanent\$ to its owner's hand."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent permanent) {
game.doAction(new MagicRemoveFromPlayAction(permanent,MagicLocationType.OwnersHand));
}
});
}
}
]