diff --git a/Mage.Sets/src/mage/sets/returntoravnica/CryptbornHorror.java b/Mage.Sets/src/mage/sets/returntoravnica/CryptbornHorror.java index 052a61d3e71..f1e958effbc 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/CryptbornHorror.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/CryptbornHorror.java @@ -28,9 +28,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; @@ -38,7 +35,9 @@ import mage.abilities.dynamicvalue.common.OpponentsLostLifeCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; @@ -64,7 +63,7 @@ public class CryptbornHorror extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Cryptborn Horror enters the battlefield with X +1/+1 counters on it, where X is the total life lost by your opponents this turn. - this.addAbility(new EntersBattlefieldAbility(new CryptbornHorrorEffect(),rule)); + this.addAbility(new EntersBattlefieldAbility(new CryptbornHorrorEffect(), rule)); } public CryptbornHorror(final CryptbornHorror card) { @@ -76,7 +75,9 @@ public class CryptbornHorror extends CardImpl { return new CryptbornHorror(this); } } + class CryptbornHorrorEffect extends OneShotEffect { + CryptbornHorrorEffect() { super(Outcome.BoostCreature); } @@ -87,16 +88,13 @@ class CryptbornHorrorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (permanent != null) { - OpponentsLostLifeCount dynamicValue = new OpponentsLostLifeCount(); - if (dynamicValue != null) { - int oll = dynamicValue.calculate(game, source, this); - if (oll > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(oll), game); - } - return true; + int oll = new OpponentsLostLifeCount().calculate(game, source, this); + if (oll > 0) { + permanent.addCounters(CounterType.P1P1.createInstance(oll), game); } + return true; } return false; } @@ -105,4 +103,4 @@ class CryptbornHorrorEffect extends OneShotEffect { public CryptbornHorrorEffect copy() { return new CryptbornHorrorEffect(this); } -} +} diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsLostLifeCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsLostLifeCount.java index 2603e6b02ca..927106f1997 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsLostLifeCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsLostLifeCount.java @@ -49,8 +49,8 @@ public class OpponentsLostLifeCount implements DynamicValue { PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher"); if (watcher != null) { int amountLifeLost = 0; - for (UUID opponent : game.getOpponents(controllerId)) { - amountLifeLost += watcher.getLiveLost(opponent); + for (UUID opponentId : game.getOpponents(controllerId)) { + amountLifeLost += watcher.getLiveLost(opponentId); } return amountLifeLost; } diff --git a/Mage/src/main/java/mage/watchers/common/PlayerLostLifeWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerLostLifeWatcher.java index 26b16292c40..e3d05d85364 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerLostLifeWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerLostLifeWatcher.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.watchers.common; import java.util.HashMap; @@ -37,11 +36,9 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.watchers.Watcher; - - -/** +/* * Counts amount of life lost current or last turn by players. - * + * This watcher is always added in gameImpl.init * * @author LevelX2 */