diff --git a/Mage.Sets/src/mage/sets/newphyrexia/IchorExplosion.java b/Mage.Sets/src/mage/sets/newphyrexia/IchorExplosion.java index 59ffffe2ba0..d975b164f75 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/IchorExplosion.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/IchorExplosion.java @@ -28,16 +28,17 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.abilities.Ability; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -57,7 +58,8 @@ public class IchorExplosion extends CardImpl { // As an additional cost to cast Ichor Explosion, sacrifice a creature. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); // All creatures get -X/-X until end of turn, where X is the sacrificed creature's power. - this.getSpellAbility().addEffect(new BoostAllEffect(new IchorExplosionDynamicValue(), new IchorExplosionDynamicValue(), Constants.Duration.EndOfTurn)); + DynamicValue xValue = new IchorExplosionDynamicValue(); + this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, new FilterCreaturePermanent(), false, null, true)); } @@ -78,7 +80,7 @@ class IchorExplosionDynamicValue implements DynamicValue { if (sourceCard != null) { for (Object cost: sourceAbility.getCosts()) { if (cost instanceof SacrificeTargetCost) { - Permanent p = (Permanent) game.getLastKnownInformation(((SacrificeTargetCost) cost).getPermanents().get(0).getId(), Constants.Zone.BATTLEFIELD); + Permanent p = (Permanent) game.getLastKnownInformation(((SacrificeTargetCost) cost).getPermanents().get(0).getId(), Zone.BATTLEFIELD); return -1 * p.getPower().getValue(); } } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostAllEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostAllEffect.java index f5da2eccdf5..a636e5afc37 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostAllEffect.java @@ -50,6 +50,7 @@ public class BoostAllEffect extends ContinuousEffectImpl { protected DynamicValue toughness; protected boolean excludeSource; protected FilterCreaturePermanent filter; + protected boolean lockedInPT; public BoostAllEffect(int power, int toughness, Duration duration) { this(power, toughness, duration, new FilterCreaturePermanent(), false); @@ -68,21 +69,26 @@ public class BoostAllEffect extends ContinuousEffectImpl { } public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource) { - super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, isCanKill(toughness) ? Outcome.UnboostCreature : Outcome.BoostCreature); - this.power = power; - this.toughness = toughness; - this.filter = filter; - this.excludeSource = excludeSource; - setText(); + this(power, toughness, duration, filter, excludeSource, null); } - + public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource, String rule) { + this(power, toughness, duration, filter, excludeSource, null, false); + } + + public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource, String rule, boolean lockedInPT) { super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, isCanKill(toughness) ? Outcome.UnboostCreature : Outcome.BoostCreature); this.power = power; this.toughness = toughness; this.filter = filter; this.excludeSource = excludeSource; - this.staticText = rule; + + this.lockedInPT = lockedInPT; + if (rule == null) { + setText(); + } else { + this.staticText = rule; + } } public BoostAllEffect(final BoostAllEffect effect) { @@ -91,7 +97,7 @@ public class BoostAllEffect extends ContinuousEffectImpl { this.toughness = effect.toughness; this.filter = effect.filter.copy(); this.excludeSource = effect.excludeSource; - this.staticText = effect.staticText; + this.lockedInPT = effect.lockedInPT; } @Override @@ -109,6 +115,10 @@ public class BoostAllEffect extends ContinuousEffectImpl { } } } + if (lockedInPT) { + power = new StaticValue(power.calculate(game, source)); + toughness = new StaticValue(toughness.calculate(game, source)); + } } @Override