magarena/release/Magarena/scripts/Paraselene.groovy

24 lines
912 B
Groovy
Raw Normal View History

2013-05-18 04:43:27 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Destroy all enchantments. " +
"PN gains 1 life for each enchantment destroyed this way."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
final Collection<MagicPermanent> targets =
game.filterPermanents(player,MagicTargetFilter.TARGET_ENCHANTMENT);
game.doAction(new MagicDestroyAction(targets));
if (targets.size() > 0) {
game.doAction(new MagicChangeLifeAction(player,targets.size()));
}
}
}
]