magarena/release/Magarena/scripts/Diminish.groovy

29 lines
1004 B
Groovy

def PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void modPowerToughness(final MagicPermanent source, final MagicPermanent permanent, final MagicPowerToughness pt) {
pt.set(1,1);
}
}
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_CREATURE,
new MagicDestroyTargetPicker(true),
this,
"Target creature\$ becomes 1/1 until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,PT));
} as MagicPermanentAction);
}
}
]