diff --git a/Mage/src/mage/abilities/dynamicvalue/common/DomainValue.java b/Mage/src/mage/abilities/dynamicvalue/common/DomainValue.java index a34880ae31..81c8ac4e6f 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/DomainValue.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/DomainValue.java @@ -58,6 +58,9 @@ public class DomainValue implements DynamicValue { return amount.toString(); } + public Integer getAmount() { + return amount; + } @Override public String getMessage() { diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java index 6823ffa707..08197770e8 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java @@ -34,6 +34,8 @@ import mage.Constants.SubLayer; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.DomainValue; +import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffectImpl; import mage.game.Game; @@ -64,7 +66,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl { * @param lockedIn if true, power and toughness will be calculated only once, when the ability resolves */ public BoostTargetEffect(DynamicValue power, DynamicValue toughness, Duration duration, boolean lockedIn) { - super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, isCanKill(toughness) ? Outcome.UnboostCreature : Outcome.BoostCreature); this.power = power; this.toughness = toughness; this.lockedIn = lockedIn; @@ -77,6 +79,20 @@ public class BoostTargetEffect extends ContinuousEffectImpl { this.lockedIn = effect.lockedIn; } + private static boolean isCanKill(DynamicValue toughness) { + if (toughness instanceof StaticValue) { + return toughness.calculate(null, null) < 0; + } + if (toughness instanceof SignInversionDynamicValue) { + // count this class as used for "-{something_positive}" + return true; + } + if (toughness instanceof DomainValue) { + return ((DomainValue)toughness).getAmount() < 0; + } + return false; + } + @Override public BoostTargetEffect copy() { return new BoostTargetEffect(this);