From e8892badf1a4a643029bbf5c78ad7b86ae3bc2dd Mon Sep 17 00:00:00 2001 From: chesse20 Date: Tue, 2 May 2023 16:59:17 -0700 Subject: [PATCH] Fix perpetual use toughness as power of Walking bulwark (#10138) * attempted fix * super constructors work like this? * better use of super and java * try this again * fix un-needed code * remove commented code * missed some * Simplify Constructors --- Mage.Sets/src/mage/cards/w/WalkingBulwark.java | 2 +- .../ruleModifying/CombatDamageByToughnessEffect.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/w/WalkingBulwark.java b/Mage.Sets/src/mage/cards/w/WalkingBulwark.java index 97f57b8b861..1b8c612d4fc 100644 --- a/Mage.Sets/src/mage/cards/w/WalkingBulwark.java +++ b/Mage.Sets/src/mage/cards/w/WalkingBulwark.java @@ -92,7 +92,7 @@ class WalkingBulwarkEffect extends OneShotEffect { game.addEffect(new CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration.EndOfTurn), source); FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new MageObjectReferencePredicate(permanent, game)); - game.addEffect(new CombatDamageByToughnessEffect(filter, false), source); + game.addEffect(new CombatDamageByToughnessEffect(filter, false, Duration.EndOfTurn), source); return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CombatDamageByToughnessEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CombatDamageByToughnessEffect.java index 55f3369ef1f..711ebf51f09 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CombatDamageByToughnessEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CombatDamageByToughnessEffect.java @@ -20,11 +20,17 @@ public class CombatDamageByToughnessEffect extends ContinuousEffectImpl { private final FilterCreaturePermanent filter; private final boolean onlyControlled; + public CombatDamageByToughnessEffect(FilterCreaturePermanent filter, boolean onlyControlled) { - super(Duration.WhileOnBattlefield, Layer.RulesEffects, SubLayer.NA, Outcome.Detriment); + this(filter, onlyControlled, Duration.WhileOnBattlefield); + } + + public CombatDamageByToughnessEffect(FilterCreaturePermanent filter, boolean onlyControlled, Duration duration) { + super(duration, Layer.RulesEffects, SubLayer.NA, Outcome.Detriment); this.filter = filter; this.onlyControlled = onlyControlled; } + private CombatDamageByToughnessEffect(final CombatDamageByToughnessEffect effect) { super(effect); @@ -39,7 +45,6 @@ public class CombatDamageByToughnessEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - // Change the rule FilterCreaturePermanent filterPermanent; if (onlyControlled) { filterPermanent = filter.copy();