magarena/release/Magarena/scripts/Omnibian.groovy

47 lines
1.5 KiB
Groovy

def PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.set(3,3);
}
};
def ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
@Override
public void modSubTypeFlags(final MagicPermanent permanent,final Set<MagicSubType> flags) {
flags.removeAll(MagicSubType.ALL_CREATURES);
flags.add(MagicSubType.Frog);
}
};
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Removal),
"Frog"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [new MagicTapEvent(source)];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.TARGET_CREATURE,
new MagicBecomeTargetPicker(3,3,false),
this,
"Target creature\$ becomes a 3/3 Frog until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,PT,ST));
});
}
}
]