magarena/release/Magarena/scripts/Murder_of_Crows.groovy

29 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-18 19:51:58 -07:00
[
new MagicWhenOtherDiesTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (permanent != otherPermanent && otherPermanent.isCreature()) ?
new MagicEvent(
permanent,
permanent.getController(),
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
1,
MagicSimpleMayChoice.DEFAULT_NONE
),
this,
2013-05-18 19:51:58 -07:00
"You may\$ draw a card. If you do, discard a card."
):
2013-04-12 19:32:25 -07:00
MagicEvent.NONE;
}
@Override
2013-05-18 19:51:58 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
final MagicPlayer player=event.getPlayer();
game.doAction(new MagicDrawAction(player));
game.addEvent(new MagicDiscardEvent(event.getSource(),player));
2013-04-12 19:32:25 -07:00
}
}
2013-05-18 19:51:58 -07:00
}
]