magarena/release/Magarena/scripts/Mirror_Entity.groovy

53 lines
2.0 KiB
Groovy
Raw Normal View History

2013-05-30 19:53:05 -07:00
[
2013-06-23 18:29:26 -07:00
new MagicPermanentActivation(
2013-05-30 19:53:05 -07:00
new MagicActivationHints(MagicTiming.Pump,true,1),
"X/X"
) {
2012-06-17 05:19:08 -07:00
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
2013-05-30 19:53:05 -07:00
return [
new MagicPayManaCostEvent(source,"{X}"),
new MagicPlayAbilityEvent(source)
];
2012-06-17 05:19:08 -07:00
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
final int x=payedCost.getX();
return new MagicEvent(
2013-05-30 19:53:05 -07:00
source,
x,
this,
"Creatures PN controls become RN/RN and gain all creature types until end of turn."
);
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-30 19:53:05 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
final int X = event.getRefInt();
2012-09-22 07:06:09 -07:00
final MagicPermanent permanent = event.getPermanent();
2012-06-17 05:19:08 -07:00
final MagicStatic PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void modPowerToughness(
2013-05-30 20:26:35 -07:00
final MagicPermanent S,
final MagicPermanent P,
2011-08-13 06:37:22 -07:00
final MagicPowerToughness pt) {
2012-06-17 05:19:08 -07:00
pt.set(X,X);
}
};
final MagicStatic ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
2012-06-17 05:19:08 -07:00
@Override
public void modSubTypeFlags(
2013-05-30 20:26:35 -07:00
final MagicPermanent P,
final Set<MagicSubType> flags) {
flags.addAll(MagicSubType.ALL_CREATURES);
2012-06-17 05:19:08 -07:00
}
2011-08-13 06:37:22 -07:00
};
final Collection<MagicPermanent> creatures=game.filterPermanents(
permanent.getController(),
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
for (final MagicPermanent creature : creatures) {
game.doAction(new MagicBecomesCreatureAction(creature,PT,ST));
2012-06-17 05:19:08 -07:00
}
}
2013-05-30 19:53:05 -07:00
}
]