magarena/release/Magarena/scripts/Shatterstorm.groovy

22 lines
855 B
Groovy
Raw Normal View History

2013-05-18 00:16:53 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Destroy all artifacts. They can't be regenerated."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> targets =
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_ARTIFACT);
for (final MagicPermanent target : targets) {
game.doAction(new MagicChangeStateAction(target,MagicPermanentState.CannotBeRegenerated,true));
}
game.doAction(new MagicDestroyAction(targets));
}
}
]