29 lines
1.0 KiB
Groovy
29 lines
1.0 KiB
Groovy
|
[
|
||
|
new MagicWhenDamageIsDealtTrigger() {
|
||
|
@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,
|
||
|
MagicSimpleMayChoice.DEFAULT_NONE
|
||
|
),
|
||
|
this,
|
||
|
"PN may\$ draw a card."
|
||
|
) :
|
||
|
MagicEvent.NONE;
|
||
|
}
|
||
|
@Override
|
||
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||
|
if (event.isYes()) {
|
||
|
game.doAction(new MagicDrawAction(event.getPlayer(),1));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|