magarena/release/Magarena/scripts/Apocalypse.groovy

26 lines
1.0 KiB
Groovy
Raw Normal View History

2013-07-20 18:26:44 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Exile all permanents. PN discards his or her hand."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> targets =
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_PERMANENT);
for (final MagicPermanent target : targets) {
game.doAction(new MagicRemoveFromPlayAction(target,MagicLocationType.Exile));
}
final MagicPlayer player = event.getPlayer();
final MagicCardList hand = new MagicCardList(player.getHand());
for (final MagicCard card : hand) {
game.doAction(new MagicDiscardCardAction(player,card));
}
}
}
]