From ecdc47ad68a2cbf34043f28ea126d35349f9ce21 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 7 Jun 2019 16:56:06 +0400 Subject: [PATCH] * Scale Up - fixed that creatures doesn't lose types after overload pay; --- Mage.Sets/src/mage/cards/s/ScaleUp.java | 2 +- .../common/continuous/BecomesCreatureAllEffect.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/s/ScaleUp.java b/Mage.Sets/src/mage/cards/s/ScaleUp.java index 1537722655c..969cb0de2a1 100644 --- a/Mage.Sets/src/mage/cards/s/ScaleUp.java +++ b/Mage.Sets/src/mage/cards/s/ScaleUp.java @@ -40,7 +40,7 @@ public final class ScaleUp extends CardImpl { this.addAbility(new OverloadAbility(this, new BecomesCreatureAllEffect( new CreatureToken(6, 4, "green Wurm with base power and toughness 6/4") .withColor("G").withSubType(SubType.WURM), - null, filter, Duration.EndOfTurn, true + null, filter, Duration.EndOfTurn, true, false, true ), new ManaCostsImpl("{4}{G}{G}"))); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java index 07892612d65..709fca771a7 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java @@ -22,19 +22,25 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { protected String theyAreStillType; private final FilterPermanent filter; private boolean loseColor = true; + private boolean loseTypes = false; protected boolean loseName = false; public BecomesCreatureAllEffect(Token token, String theyAreStillType, FilterPermanent filter, Duration duration, boolean loseColor) { - this(token, theyAreStillType, filter, duration, loseColor, false); + this(token, theyAreStillType, filter, duration, loseColor, false, false); } public BecomesCreatureAllEffect(Token token, String theyAreStillType, FilterPermanent filter, Duration duration, boolean loseColor, boolean loseName) { + this(token, theyAreStillType, filter, duration, loseColor, loseName, false); + } + + public BecomesCreatureAllEffect(Token token, String theyAreStillType, FilterPermanent filter, Duration duration, boolean loseColor, boolean loseName, boolean loseTypes) { super(duration, Outcome.BecomeCreature); this.token = token; this.theyAreStillType = theyAreStillType; this.filter = filter; this.loseColor = loseColor; this.loseName = loseName; + this.loseTypes = loseTypes; } public BecomesCreatureAllEffect(final BecomesCreatureAllEffect effect) { @@ -44,6 +50,7 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { this.filter = effect.filter.copy(); this.loseColor = effect.loseColor; this.loseName = effect.loseName; + this.loseTypes = effect.loseTypes; } @Override @@ -89,6 +96,10 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { permanent.getSubtype(game).retainAll(SubType.getLandTypes()); permanent.getSubtype(game).addAll(token.getSubtype(game)); } else { + if (loseTypes) { + permanent.getSubtype(game).retainAll(SubType.getLandTypes()); + } + for (SubType t : token.getSubtype(game)) { if (!permanent.hasSubtype(t, game)) { permanent.getSubtype(game).add(t);