magarena/release/Magarena/scripts/Dimir_Cutpurse.groovy

24 lines
919 B
Groovy

[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (damage.getSource() == permanent &&
damage.isCombat() &&
damage.getTarget().isPlayer()) ?
new MagicEvent(
permanent,
permanent.getController(),
damage.getTarget(),
this,
"RN discards a card and PN draws a card"
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.addEvent(new MagicDiscardEvent(event.getSource(), event.getRefPlayer(), 1, false));
game.doAction(new MagicDrawAction(event.getPlayer(),1));
}
}
]