magarena/release/Magarena/scripts/Snake_Umbra.groovy

28 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-17 23:14:43 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
2012-09-21 09:10:24 -07:00
final MagicPermanent enchanted = permanent.getEnchantedCreature();
return (enchanted == damage.getSource() &&
enchanted.isOpponent(damage.getTarget())) ?
2012-06-17 05:19:08 -07:00
new MagicEvent(
2012-09-21 09:10:24 -07:00
enchanted,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
1,
2013-05-17 23:14:43 -07:00
MagicSimpleMayChoice.DEFAULT_NONE
),
this,
2013-06-15 07:27:32 -07:00
"PN may\$ draw a card."
) :
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-17 23:14:43 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicDrawAction(event.getPlayer()));
2012-06-17 05:19:08 -07:00
}
}
2013-05-17 23:14:43 -07:00
}
]