add in the 'as long as' in Elderscale Wurms's second ability

master
melvin 2014-01-16 16:52:50 +08:00
parent 06b59b041d
commit 784b1c1586
1 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,15 @@
def trigger = 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.getLife() < 7) {
player.setLife(7);
}
return MagicEvent.NONE;
}
}
[ [
new MagicWhenComesIntoPlayTrigger() { new MagicWhenComesIntoPlayTrigger() {
@Override @Override
@ -19,15 +31,12 @@
} }
} }
}, },
new MagicWhenDamageIsDealtTrigger() { new MagicStatic(MagicLayer.Ability) {
@Override @Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) { public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
final MagicPlayer player = permanent.getController(); if (permanent.getController().getLife() >= 7) {
final MagicTarget target = damage.getTarget(); permanent.addAbility(trigger);
if (player == target && player.getLife() < 7) {
player.setLife(7);
} }
return MagicEvent.NONE;
} }
} }
] ]