magarena/release/Magarena/scripts/Rabble_Rouser.groovy

41 lines
1.4 KiB
Groovy

[
new MagicPermanentActivation(
[
MagicCondition.CAN_TAP_CONDITION,
MagicConditionFactory.ManaCost("{R}")
],
new MagicActivationHints(MagicTiming.Block),
"Pump"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostTapEvent(source,"{R}")
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"Attacking creatures get +X/+0 until end of turn, " +
"where X is SN's power."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent = event.getPermanent();
final Collection<MagicPermanent> targets = game.filterPermanents(
permanent.getController(),
MagicTargetFilter.TARGET_ATTACKING_CREATURE);
for (final MagicPermanent target : targets) {
game.doAction(new MagicChangeTurnPTAction(
target,
permanent.getPower(),
0
));
}
}
}
]