magarena/release/Magarena/scripts/Murder_of_Crows.groovy

29 lines
1.1 KiB
Groovy

[
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@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,
"You may\$ draw a card. If you do, discard a card."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
final MagicPlayer player=event.getPlayer();
game.doAction(new MagicDrawAction(player));
game.addEvent(new MagicDiscardEvent(event.getSource(),player));
}
}
}
]