magarena/release/Magarena/scripts/Hoard_Smelter_Dragon.groovy

37 lines
1.4 KiB
Groovy

[
new MagicPermanentActivation(
[MagicConditionFactory.ManaCost("{3}{R}")],
new MagicActivationHints(MagicTiming.Removal),
"Destroy"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [new MagicPayManaCostEvent(source,"{3}{R}")];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.TARGET_ARTIFACT,
new MagicDestroyTargetPicker(false),
this,
"Destroy target artifact\$. SN gets +X/+0 " +
"until end of turn, 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(new MagicDestroyAction(permanent));
game.doAction(new MagicChangeTurnPTAction(
event.getPermanent(),
permanent.getConvertedCost(),
0
));
}
});
}
}
]