magarena/release/Magarena/scripts/Worship.groovy

14 lines
531 B
Groovy
Raw Normal View History

2013-03-14 06:34:15 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicPlayer player = permanent.getController();
final MagicTarget target = damage.getTarget();
if (player == target && player.getNrOfPermanentsWithType(MagicType.Creature) > 0 && player.getLife() < 1) {
player.setLife(1);
}
return MagicEvent.NONE;
}
}
]