magarena/release/Magarena/scripts/Synapse_Sliver.groovy

31 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-19 00:46:54 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicSource source=damage.getSource();
return (source.hasSubType(MagicSubType.Sliver) &&
damage.isCombat() &&
damage.getTarget().isPlayer()) ?
new MagicEvent(
permanent,
2013-06-06 06:36:05 -07:00
source.getController(),
2013-05-19 00:46:54 -07:00
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
1,
MagicSimpleMayChoice.DEFAULT_NONE
),
this,
2013-05-19 00:59:20 -07:00
"PN may\$ draw a card."
2013-05-19 00:46:54 -07:00
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicDrawAction(event.getPlayer()));
2013-05-19 00:46:54 -07:00
}
}
}
]