magarena/release/Magarena/scripts/Angelic_Chorus.groovy

24 lines
916 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) {
2013-06-23 18:29:26 -07:00
return (otherPermanent.isCreature() &&
2013-04-12 19:58:51 -07:00
otherPermanent.isFriend(permanent)) ?
new MagicEvent(
permanent,
otherPermanent,
this,
"PN gains life equal to the toughness of RN."
) :
MagicEvent.NONE;
}
2013-06-23 18:29:26 -07:00
2013-04-12 19:58:51 -07:00
@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));
}
}
]