magarena/release/Magarena/scripts/Artifact_Mutation.groovy

33 lines
1.4 KiB
Groovy
Raw Normal View History

2013-05-27 01:31:09 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_ARTIFACT,
MagicDestroyTargetPicker.DestroyNoRegen,
2013-05-27 01:31:09 -07:00
this,
2013-06-23 18:29:26 -07:00
"Destroy target artifact\$. It can't be regenerated. " +
2013-05-27 01:31:09 -07:00
"Put X 1/1 green Saproling creature tokens onto the battlefield, where X is that artifact'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(MagicChangeStateAction.Set(
permanent,
MagicPermanentState.CannotBeRegenerated
));
2013-05-27 01:31:09 -07:00
game.doAction(new MagicDestroyAction(permanent));
game.doAction(new MagicPlayTokensAction(
event.getPlayer(),
2013-10-23 00:58:05 -07:00
TokenCardDefinitions.get("1/1 green Saproling creature token"),
2013-05-27 01:38:37 -07:00
permanent.getConvertedCost()
2013-05-27 01:31:09 -07:00
));
}
});
}
}
]