magarena/release/Magarena/scripts/Wrath_of_God.groovy

22 lines
855 B
Groovy

[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Destroy all creatures. 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_CREATURE);
for (final MagicPermanent target : targets) {
game.doAction(new MagicChangeStateAction(target,MagicPermanentState.CannotBeRegenerated,true));
}
game.doAction(new MagicDestroyAction(targets));
}
}
]