magarena/release/Magarena/scripts/Angelic_Chorus.groovy

26 lines
983 B
Groovy
Raw Normal View History

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