magarena/release/Magarena/scripts/Curiosity.groovy

27 lines
967 B
Groovy
Raw Normal View History

2013-05-17 22:47:07 -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 (damage.getSource() == permanent.getEnchantedCreature() &&
permanent.isOpponent(damage.getTarget())) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
1,
2013-05-17 22:47:07 -07:00
MagicSimpleMayChoice.DEFAULT_NONE
),
2013-04-12 19:32:25 -07:00
this,
2013-05-17 22:47:07 -07:00
"PN may\$ draw a card."
2013-04-12 19:32:25 -07:00
) :
MagicEvent.NONE;
}
@Override
2013-05-17 22:47:07 -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()));
2013-04-12 19:32:25 -07:00
}
}
2013-05-17 22:47:07 -07:00
}
]