[MIR] fixed Jungle Wurm calculating incorrectly (fixes #7449)

This commit is contained in:
Evan Kranzler 2021-01-26 17:05:32 -05:00
parent 3d8d85fbbd
commit 4db79ae3c1
2 changed files with 15 additions and 16 deletions

View file

@ -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);
}

View file

@ -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) {