magarena/release/Magarena/scripts/Angelic_Chorus.groovy

24 lines
925 B
Groovy
Raw Normal View History

2013-04-12 19:58:51 -07:00
[
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent.isCreature() &&
otherPermanent.isFriend(permanent)) ?
new MagicEvent(
permanent,
otherPermanent,
this,
"PN gains life equal to the toughness of RN."
) :
MagicEvent.NONE;
}
@Override
2013-06-15 07:01:56 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:58:51 -07:00
// get toughness here so counters on the creature are considered
final int toughness = (event.getRefPermanent()).getToughness();
game.doAction(new MagicChangeLifeAction(event.getPlayer(),toughness));
}
}
]