From 5d4112c45d62d02c86cc0facdf3abfa1e80e285a Mon Sep 17 00:00:00 2001 From: Cameron Merkel <44722506+Cguy7777@users.noreply.github.com> Date: Wed, 15 Jan 2025 08:32:00 -0600 Subject: [PATCH] =?UTF-8?q?Awakened=20Skyclave=20&=20Grond,=20The=20Gatebr?= =?UTF-8?q?eaker=20-=20fixed=20that=20it=20doesn=E2=80=99t=20give=20a=20la?= =?UTF-8?q?nd=20type=20(#13229)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mage.Sets/src/mage/cards/a/AwakenedSkyclave.java | 2 +- .../common/continuous/AddCardTypeSourceEffect.java | 10 +++++++++- .../common/continuous/AddCardTypeTargetEffect.java | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AwakenedSkyclave.java b/Mage.Sets/src/mage/cards/a/AwakenedSkyclave.java index b104abbe8bd..48e9a24dee8 100644 --- a/Mage.Sets/src/mage/cards/a/AwakenedSkyclave.java +++ b/Mage.Sets/src/mage/cards/a/AwakenedSkyclave.java @@ -35,7 +35,7 @@ public final class AwakenedSkyclave extends CardImpl { this.addAbility(HasteAbility.getInstance()); // As long as Awakened Skyclave is on the battlefield, it's a land in addition to its other types. - this.addAbility(new SimpleStaticAbility(new AddCardTypeSourceEffect(Duration.WhileOnBattlefield) + this.addAbility(new SimpleStaticAbility(new AddCardTypeSourceEffect(Duration.WhileOnBattlefield, CardType.LAND) .setText("as long as {this} is on the battlefield, it's a land in addition to its other types"))); // {T}: Add one mana of any color. diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java index cde16f3fa3c..5d3f0b1bea0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java @@ -21,12 +21,17 @@ public class AddCardTypeSourceEffect extends ContinuousEffectImpl { public AddCardTypeSourceEffect(Duration duration, CardType... addedCardType) { super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); + if (addedCardType.length == 0) { + throw new IllegalArgumentException("AddCardTypeSourceEffect should be called with at least one card type."); + } for (CardType cardType : addedCardType) { this.addedCardTypes.add(cardType); if (cardType == CardType.ENCHANTMENT) { dependencyTypes.add(DependencyType.EnchantmentAddingRemoving); } else if (cardType == CardType.ARTIFACT) { dependencyTypes.add(DependencyType.ArtifactAddingRemoving); + } else if (cardType == CardType.LAND) { + dependencyTypes.add(DependencyType.BecomeNonbasicLand); } } } @@ -45,7 +50,10 @@ public class AddCardTypeSourceEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && affectedObjectList.contains(new MageObjectReference(permanent, game))) { + if (permanent != null + && (affectedObjectList.contains(new MageObjectReference(permanent, game)) + // Workaround to support abilities like "As long as __, this permanent is a __ in addition to its other types." + || !duration.isOnlyValidIfNoZoneChange())) { for (CardType cardType : addedCardTypes) { permanent.addCardType(game, cardType); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java index 7cda13f3c0e..188465afe27 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java @@ -21,12 +21,17 @@ public class AddCardTypeTargetEffect extends ContinuousEffectImpl { public AddCardTypeTargetEffect(Duration duration, CardType... addedCardType) { super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); + if (addedCardType.length == 0) { + throw new IllegalArgumentException("AddCardTypeTargetEffect should be called with at least one card type."); + } for (CardType cardType : addedCardType) { this.addedCardTypes.add(cardType); if (cardType == CardType.ENCHANTMENT) { dependencyTypes.add(DependencyType.EnchantmentAddingRemoving); } else if (cardType == CardType.ARTIFACT) { dependencyTypes.add(DependencyType.ArtifactAddingRemoving); + } else if (cardType == CardType.LAND) { + dependencyTypes.add(DependencyType.BecomeNonbasicLand); } }