magarena/release/Magarena/scripts/Wall_of_Reverence.groovy

25 lines
1004 B
Groovy

[
new MagicAtEndOfTurnTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer eotPlayer) {
return permanent.isController(eotPlayer) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_CREATURE_YOU_CONTROL,
MagicPowerTargetPicker.getInstance(),
this,
"PN gains life equal to the power of target creature\$ he or she controls."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),creature.getPower()));
}
});
}
}
]