magarena/release/Magarena/scripts/Turn_to_Frog.groovy

50 lines
1.9 KiB
Groovy
Raw Normal View History

2013-05-30 19:27:16 -07:00
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);
}
};
def AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
@Override
public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
flags.clear();
}
};
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);
}
};
def C = new MagicStatic(MagicLayer.Color, MagicStatic.UntilEOT) {
@Override
public int getColorFlags(final MagicPermanent permanent,final int flags) {
return MagicColor.Blue.getMask();
}
};
[
public static final MagicSpellCardEvent E = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_CREATURE,
new MagicBecomeTargetPicker(1,1,false),
this,
"Target creature\$ loses all abilities " +
"and becomes a 1/1 blue Frog until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent creature ->
//Does not lose static or triggers
game.doAction(new MagicSetAbilityAction(creature,MagicAbility.CantActivateAbilities));
game.doAction(new MagicBecomesCreatureAction(creature,PT,AB,ST,C));
} as MagicPermanentAction);
}
}
]