magarena/release/Magarena/scripts/Shattered_Angel.groovy

26 lines
914 B
Groovy

[
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent played) {
return (played.isEnemy(permanent) && played.isLand()) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.GAIN_LIFE,
3,
MagicSimpleMayChoice.DEFAULT_YES
),
this,
"PN may\$ gain 3 life."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),3));
}
}
}
]