magarena/release/Magarena/scripts/Tamanoa.groovy

22 lines
812 B
Groovy
Raw Normal View History

2013-05-12 03:52:02 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final int amount = damage.getDealtAmount();
final MagicSource source = damage.getSource();
return (!source.isCreature() && permanent.isFriend(source)) ?
new MagicEvent(
permanent,
amount,
this,
"PN gains " + amount + " life.")
:
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),event.getRefInt()));
}
}
]