magarena/release/Magarena/scripts/Stronghold_Rats.groovy

25 lines
854 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
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
for (final MagicPlayer player : game.getPlayers()) {
game.addEvent(new MagicDiscardEvent(event.getPermanent(),player,1,false));
}
}
}
]