magarena/release/Magarena/scripts/AEther_Mutation.groovy

29 lines
1.2 KiB
Groovy

[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE,
MagicBounceTargetPicker.create(),
this,
"Return target creature\$ to its owner's hand. " +
"Put X 1/1 green Saproling creature tokens onto the battlefield, where X is that creature's converted mana cost."
);
}
@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));
game.doAction(new MagicPlayTokensAction(
event.getPlayer(),
TokenCardDefinitions.get("Saproling"),
permanent.getConvertedCost()
));
}
});
}
}
]