magarena/release/Magarena/scripts/Novablast_Wurm.groovy

25 lines
1001 B
Groovy
Raw Normal View History

2013-05-18 00:35:37 -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) ?
new MagicEvent(
2013-05-18 00:35:37 -07:00
permanent,
this,
"Destroy all creatures other than SN."
) :
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-18 00:35:37 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2012-09-06 07:16:07 -07:00
final MagicPermanent permanent=event.getPermanent();
2013-06-23 18:29:26 -07:00
final MagicTargetFilter<MagicPermanent> targetFilter =
new MagicOtherPermanentTargetFilter(
2012-06-17 05:19:08 -07:00
MagicTargetFilter.TARGET_CREATURE,permanent);
final Collection<MagicPermanent> targets=
game.filterPermanents(permanent.getController(),targetFilter);
2012-06-17 05:19:08 -07:00
game.doAction(new MagicDestroyAction(targets));
}
2013-05-18 00:35:37 -07:00
}
]