magarena/release/Magarena/scripts/Myr_Galvanizer.groovy

32 lines
1.1 KiB
Groovy

[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Tapping),
"Untap"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [new MagicTapEvent(source), new MagicPayManaCostEvent(source, "{1}")];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"Untap each other Myr you control."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent = event.getPermanent();
final Collection<MagicPermanent> targets = game.filterPermanents(
event.getPlayer(),
MagicTargetFilter.TARGET_MYR_YOU_CONTROL);
for (final MagicPermanent target : targets) {
if (target != permanent) {
game.doAction(new MagicUntapAction(target));
}
}
}
}
]