magarena/release/Magarena/scripts/Stronghold_Rats.groovy

23 lines
813 B
Groovy
Raw Normal View History

2013-04-12 19:58:51 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (damage.getSource() == permanent &&
damage.isCombat() &&
damage.getTarget().isPlayer()) ?
new MagicEvent(
permanent,
this,
"Each player discards a card."
):
MagicEvent.NONE;
}
@Override
2013-06-15 03:20:38 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:58:51 -07:00
for (final MagicPlayer player : game.getPlayers()) {
game.addEvent(new MagicDiscardEvent(event.getPermanent(),player));
2013-04-12 19:58:51 -07:00
}
}
}
]