magarena/release/Magarena/scripts/Skinshifter.groovy

140 lines
4.7 KiB
Groovy

// becomes a 4/4 Rhino and gains trample
def PT1 = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.set(4,4);
}
};
def AB1 = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
@Override
public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
flags.add(MagicAbility.Trample);
}
};
def ST1 = 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.Rhino);
}
};
// becomes a 2/2 Bird and gains flying
def PT2 = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.set(2,2);
}
};
def AB2 = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
@Override
public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
flags.add(MagicAbility.Flying);
}
};
def ST2 = 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.Bird);
}
};
// becomes a 0/8 Plant
def PT3 = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.set(0,8);
}
};
def ST3 = 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.Plant);
}
};
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Animate,1),
"Rhino"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source,"{G}"),
new MagicPlayAbilityEvent(source)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"Until end of turn, SN becomes a 4/4 Rhino and gains trample."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicBecomesCreatureAction(event.getPermanent(),PT1,AB1,ST1));
}
},
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Animate,1),
"Bird"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source,"{G}"),
new MagicPlayAbilityEvent(source)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"Until end of turn, SN becomes a 2/2 Bird and gains flying."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicBecomesCreatureAction(event.getPermanent(),PT2,AB2,ST2));
}
},
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Animate,1),
"Plant"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source,"{G}"),
new MagicPlayAbilityEvent(source)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"Until end of turn, SN becomes a 0/8 Plant."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicBecomesCreatureAction(event.getPermanent(),PT3,ST3));
}
}
]