magarena/release/Magarena/scripts/Goblin_Piledriver.groovy

26 lines
1005 B
Groovy
Raw Normal View History

2013-05-17 23:14:07 -07:00
[
new MagicWhenAttacksTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
return (permanent==creature) ?
2011-08-13 08:52:26 -07:00
new MagicEvent(
2012-09-01 23:42:25 -07:00
permanent,
this,
2013-05-17 23:14:07 -07:00
"SN gets +2/+0 until end of turn for each other attacking Goblin."
):
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-17 23:14:07 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2012-09-01 23:42:25 -07:00
final MagicPermanent creature=event.getPermanent();
final Collection<MagicPermanent> targets=
game.filterPermanents(creature.getController(),MagicTargetFilter.TARGET_ATTACKING_GOBLIN);
2012-09-01 23:42:25 -07:00
//excluding itself
final int power = targets.size() - 1;
2012-06-17 05:19:08 -07:00
if (power>0) {
game.doAction(new MagicChangeTurnPTAction(creature,power,0));
}
}
2013-05-17 23:14:07 -07:00
}
]