magarena/release/Magarena/scripts/Angelic_Shield.groovy

33 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-28 01:21:26 -07:00
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Removal),
"Return"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
2013-05-28 01:21:26 -07:00
return [new MagicSacrificeEvent(source)];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.TARGET_CREATURE,
2013-06-30 01:53:17 -07:00
MagicBounceTargetPicker.create(),
2013-05-28 01:21:26 -07:00
this,
"Return target creature\$ 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 creature) {
game.doAction(new MagicRemoveFromPlayAction(creature,MagicLocationType.OwnersHand));
}
});
}
}
]