magarena/release/Magarena/scripts/Archon_of_Redemption.groovy

38 lines
1.5 KiB
Groovy

[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
this,
"PN gains life equal to SN's power."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),event.getPermanent().getPower()));
}
},
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent!=permanent &&
otherPermanent.isCreature() &&
otherPermanent.hasAbility(MagicAbility.Flying) &&
otherPermanent.isFriend(permanent)) ?
new MagicEvent(
permanent,
otherPermanent,
this,
"PN gains life equal to the power of "+otherPermanent+'.'
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent=event.getRefPermanent();
game.doAction(new MagicChangeLifeAction(event.getPlayer(),permanent.getPower()));
}
}
]