magarena/release/Magarena/scripts/Guiltfeeder.groovy

27 lines
865 B
Groovy

[
new MagicWhenAttacksUnblockedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
return (creature == permanent) ?
new MagicEvent(
permanent,
permanent.getOpponent(),
this,
"PN loses 1 life for each card in his or her graveyard."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
game.doAction(new MagicChangeLifeAction(
player,
-player.getGraveyard().size()
));
}
}
]