magarena/release/Magarena/scripts/Revered_Unicorn.groovy

23 lines
803 B
Groovy

[
new MagicWhenLeavesPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicRemoveFromPlayAction act) {
return act.isPermanent(permanent) ?
new MagicEvent(
permanent,
this,
"PN gains life equal to the number of age counters on SN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final int amount = event.getPermanent().getCounters(MagicCounterType.Charge);
game.doAction(new MagicChangeLifeAction(
event.getPlayer(),
amount
));
}
}
]