magarena/release/Magarena/scripts/Looter_il_Kor.groovy

24 lines
867 B
Groovy

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