From 4db79ae3c19ab64d01b1f19ccda908c5686eeaa6 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 26 Jan 2021 17:05:32 -0500 Subject: [PATCH] [MIR] fixed Jungle Wurm calculating incorrectly (fixes #7449) --- Mage.Sets/src/mage/cards/j/JungleWurm.java | 24 +++++++++---------- .../common/BlockedCreatureCount.java | 7 +++--- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Mage.Sets/src/mage/cards/j/JungleWurm.java b/Mage.Sets/src/mage/cards/j/JungleWurm.java index 5d885826e7..d38b80f589 100644 --- a/Mage.Sets/src/mage/cards/j/JungleWurm.java +++ b/Mage.Sets/src/mage/cards/j/JungleWurm.java @@ -1,41 +1,41 @@ - package mage.cards.j; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.BecomesBlockedSourceTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.MultipliedValue; import mage.abilities.dynamicvalue.common.BlockedCreatureCount; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; + +import java.util.UUID; /** - * * @author LoneFox */ public final class JungleWurm extends CardImpl { + private static final DynamicValue xValue = new MultipliedValue( + new BlockedCreatureCount("", true), -1 + ); + public JungleWurm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.subtype.add(SubType.WURM); this.power = new MageInt(5); this.toughness = new MageInt(5); // Whenever Jungle Wurm becomes blocked, it gets -1/-1 until end of turn for each creature blocking it beyond the first. - BlockedCreatureCount blockedCreatureCount = new BlockedCreatureCount("each creature blocking it beyond the first", true); - DynamicValue value = new MultipliedValue(blockedCreatureCount, -1); - Effect effect = new BoostSourceEffect(value, value, Duration.EndOfTurn, true); - effect.setText("it gets -1/-1 until end of turn for each creature blocking it beyond the first"); - this.addAbility(new BecomesBlockedSourceTriggeredAbility(effect, false)); + this.addAbility(new BecomesBlockedSourceTriggeredAbility(new BoostSourceEffect( + xValue, xValue, Duration.EndOfTurn, true + ).setText("it gets -1/-1 until end of turn for each creature blocking it beyond the first"), false)); } - public JungleWurm(final JungleWurm card) { + private JungleWurm(final JungleWurm card) { super(card); } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/BlockedCreatureCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/BlockedCreatureCount.java index 767af9da3b..297ce55d7b 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/BlockedCreatureCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/BlockedCreatureCount.java @@ -8,13 +8,12 @@ import mage.game.Game; import mage.game.combat.CombatGroup; /** - * * @author Markedagain */ public class BlockedCreatureCount implements DynamicValue { - private String message; - boolean beyondTheFirst; + private final String message; + private final boolean beyondTheFirst; public BlockedCreatureCount() { this("each creature blocking it"); @@ -26,7 +25,7 @@ public class BlockedCreatureCount implements DynamicValue { public BlockedCreatureCount(String message, boolean beyondTheFirst) { this.message = message; - //this.beyondTheFirst = beyondTheFirst; this was never set in the original, so not setting here just in case ?? + this.beyondTheFirst = beyondTheFirst; } public BlockedCreatureCount(final BlockedCreatureCount dynamicValue) {