diff --git a/Mage.Sets/src/mage/cards/g/GodPharaohsGift.java b/Mage.Sets/src/mage/cards/g/GodPharaohsGift.java index 279e6a8597..6f7c8d0ccc 100644 --- a/Mage.Sets/src/mage/cards/g/GodPharaohsGift.java +++ b/Mage.Sets/src/mage/cards/g/GodPharaohsGift.java @@ -111,6 +111,7 @@ class GodPharaohsGiftEffect extends OneShotEffect { && cardChosen.moveToExile(exileId, sourceObject.getIdName(), source.getSourceId(), game)) { EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(cardChosen); + token.removePTCDA(); token.getPower().modifyBaseValue(4); token.getToughness().modifyBaseValue(4); token.getColor(game).setColor(ObjectColor.BLACK); diff --git a/Mage.Sets/src/mage/cards/h/HourOfEternity.java b/Mage.Sets/src/mage/cards/h/HourOfEternity.java index 12c92247f2..813a8b3293 100644 --- a/Mage.Sets/src/mage/cards/h/HourOfEternity.java +++ b/Mage.Sets/src/mage/cards/h/HourOfEternity.java @@ -103,6 +103,7 @@ class HourOfEternityEffect extends OneShotEffect { if (game.getState().getZone(card.getId()) == Zone.EXILED) { EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(card); + token.removePTCDA(); token.getPower().modifyBaseValue(4); token.getToughness().modifyBaseValue(4); token.getColor(game).setColor(ObjectColor.BLACK); diff --git a/Mage.Sets/src/mage/cards/q/QuicksilverGargantuan.java b/Mage.Sets/src/mage/cards/q/QuicksilverGargantuan.java index 254507f8c9..df33757c0f 100644 --- a/Mage.Sets/src/mage/cards/q/QuicksilverGargantuan.java +++ b/Mage.Sets/src/mage/cards/q/QuicksilverGargantuan.java @@ -72,6 +72,7 @@ class QuicksilverGargantuanApplyToPermanent extends ApplyToPermanent { @Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { + permanent.removePTCDA(); permanent.getPower().modifyBaseValue(7); permanent.getToughness().modifyBaseValue(7); return true; @@ -79,6 +80,7 @@ class QuicksilverGargantuanApplyToPermanent extends ApplyToPermanent { @Override public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) { + mageObject.removePTCDA(); mageObject.getPower().modifyBaseValue(7); mageObject.getToughness().modifyBaseValue(7); return true; diff --git a/Mage.Sets/src/mage/cards/t/Tarmogoyf.java b/Mage.Sets/src/mage/cards/t/Tarmogoyf.java index 9d6bbd78ec..3292df697a 100644 --- a/Mage.Sets/src/mage/cards/t/Tarmogoyf.java +++ b/Mage.Sets/src/mage/cards/t/Tarmogoyf.java @@ -73,7 +73,7 @@ public class Tarmogoyf extends CardImpl { class TarmogoyfEffect extends ContinuousEffectImpl { public TarmogoyfEffect() { - super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature); staticText = "{this}'s power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1"; } diff --git a/Mage/src/main/java/mage/MageObject.java b/Mage/src/main/java/mage/MageObject.java index 131dbe8efa..9982250353 100644 --- a/Mage/src/main/java/mage/MageObject.java +++ b/Mage/src/main/java/mage/MageObject.java @@ -17,8 +17,11 @@ import mage.util.SubTypeList; import java.io.Serializable; import java.util.EnumSet; +import java.util.Iterator; import java.util.List; import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; public interface MageObject extends MageItem, Serializable { @@ -198,6 +201,8 @@ public interface MageObject extends MageItem, Serializable { TextPart addTextPart(TextPart textPart); + public void removePTCDA(); + default void changeSubType(SubType fromSubType, SubType toSubType) { } diff --git a/Mage/src/main/java/mage/MageObjectImpl.java b/Mage/src/main/java/mage/MageObjectImpl.java index 30c93e6fb0..44f5f42feb 100644 --- a/Mage/src/main/java/mage/MageObjectImpl.java +++ b/Mage/src/main/java/mage/MageObjectImpl.java @@ -29,6 +29,7 @@ package mage; import java.util.ArrayList; import java.util.EnumSet; +import java.util.Iterator; import java.util.List; import java.util.UUID; import mage.abilities.Abilities; @@ -38,12 +39,15 @@ import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; import mage.abilities.keyword.ChangelingAbility; import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.abilities.text.TextPart; import mage.abilities.text.TextPartSubType; import mage.cards.FrameStyle; import mage.constants.CardType; +import mage.constants.SubLayer; import mage.constants.SubType; import mage.constants.SubTypeSet; import mage.constants.SuperType; @@ -338,4 +342,15 @@ public abstract class MageObjectImpl implements MageObject { } } + public void removePTCDA() { + for (Iterator iter = this.getAbilities().iterator(); iter.hasNext();) { + Ability ability = iter.next(); + for (Effect effect : ability.getEffects()) { + if (effect instanceof ContinuousEffect && ((ContinuousEffect) effect).getSublayer() == SubLayer.CharacteristicDefining_7a) { + iter.remove(); + break; + } + } + } + } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java index 746ca3f4ef..56c2b43515 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenCopyTargetEffect.java @@ -233,9 +233,11 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect { token.addAbility(FlyingAbility.getInstance()); } if (tokenPower != Integer.MIN_VALUE) { + token.removePTCDA(); token.getPower().modifyBaseValue(tokenPower); } if (tokenToughness != Integer.MIN_VALUE) { + token.removePTCDA(); token.getToughness().modifyBaseValue(tokenToughness); } if (additionalSubType != null && !token.hasSubtype(additionalSubType, game)) { diff --git a/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java b/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java index e7ae5d52af..dd46c9d9d7 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EternalizeAbility.java @@ -119,6 +119,7 @@ class EternalizeEffect extends OneShotEffect { token.getSubtype(game).add(0, SubType.ZOMBIE); } token.getManaCost().clear(); + token.removePTCDA(); token.getPower().modifyBaseValue(4); token.getToughness().modifyBaseValue(4); game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ETERNALIZED_CREATURE, token.getId(), source.getSourceId(), controller.getId())); diff --git a/Mage/src/main/java/mage/game/permanent/token/Token.java b/Mage/src/main/java/mage/game/permanent/token/Token.java index 55f23dacdd..57aced4814 100644 --- a/Mage/src/main/java/mage/game/permanent/token/Token.java +++ b/Mage/src/main/java/mage/game/permanent/token/Token.java @@ -310,8 +310,4 @@ public class Token extends MageObjectImpl { this.setExpansionSetCodeForImage(setCode); return true; } - - - - }