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
This commit is contained in:
chesse20 2023-05-02 16:59:17 -07:00 committed by GitHub
parent 171f0a238b
commit e8892badf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

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

View file

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