magarena/release/Magarena/scripts/Edric__Spymaster_of_Trest.g...

29 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 04:40:29 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (permanent.isOpponent(damage.getTarget()) &&
damage.getSource().isCreature() &&
damage.isCombat()) ?
new MagicEvent(
permanent,
damage.getSource().getController(),
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
1,
2013-05-18 04:40:29 -07:00
MagicSimpleMayChoice.DEFAULT_NONE
),
2013-04-12 19:32:25 -07:00
this,
2013-05-18 04:40:29 -07:00
"PN may\$ draw a card."
2013-04-12 19:32:25 -07:00
) :
MagicEvent.NONE;
}
@Override
2013-05-18 04:40:29 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
game.doAction(new MagicDrawAction(event.getPlayer(),1));
}
}
2013-05-18 04:40:29 -07:00
}
]