magarena/release/Magarena/scripts/Deathgreeter.groovy

26 lines
943 B
Groovy
Raw Normal View History

2013-05-17 21:09:45 -07:00
[
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (permanent != otherPermanent &&
otherPermanent.isCreature()) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.GAIN_LIFE,
1,
MagicSimpleMayChoice.DEFAULT_YES
),
this,
"PN may\$ gain 1 life.") :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),1));
}
}
}
]