Awakened Skyclave & Grond, The Gatebreaker - fixed that it doesn’t give a land type (#13229)

This commit is contained in:
Cameron Merkel 2025-01-15 08:32:00 -06:00 committed by GitHub
parent b58fbbdd84
commit 5d4112c45d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 2 deletions

View file

@ -35,7 +35,7 @@ public final class AwakenedSkyclave extends CardImpl {
this.addAbility(HasteAbility.getInstance()); this.addAbility(HasteAbility.getInstance());
// As long as Awakened Skyclave is on the battlefield, it's a land in addition to its other types. // 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"))); .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. // {T}: Add one mana of any color.

View file

@ -21,12 +21,17 @@ public class AddCardTypeSourceEffect extends ContinuousEffectImpl {
public AddCardTypeSourceEffect(Duration duration, CardType... addedCardType) { public AddCardTypeSourceEffect(Duration duration, CardType... addedCardType) {
super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); 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) { for (CardType cardType : addedCardType) {
this.addedCardTypes.add(cardType); this.addedCardTypes.add(cardType);
if (cardType == CardType.ENCHANTMENT) { if (cardType == CardType.ENCHANTMENT) {
dependencyTypes.add(DependencyType.EnchantmentAddingRemoving); dependencyTypes.add(DependencyType.EnchantmentAddingRemoving);
} else if (cardType == CardType.ARTIFACT) { } else if (cardType == CardType.ARTIFACT) {
dependencyTypes.add(DependencyType.ArtifactAddingRemoving); dependencyTypes.add(DependencyType.ArtifactAddingRemoving);
} else if (cardType == CardType.LAND) {
dependencyTypes.add(DependencyType.BecomeNonbasicLand);
} }
} }
} }
@ -45,7 +50,10 @@ public class AddCardTypeSourceEffect extends ContinuousEffectImpl {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId()); 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) { for (CardType cardType : addedCardTypes) {
permanent.addCardType(game, cardType); permanent.addCardType(game, cardType);
} }

View file

@ -21,12 +21,17 @@ public class AddCardTypeTargetEffect extends ContinuousEffectImpl {
public AddCardTypeTargetEffect(Duration duration, CardType... addedCardType) { public AddCardTypeTargetEffect(Duration duration, CardType... addedCardType) {
super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); 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) { for (CardType cardType : addedCardType) {
this.addedCardTypes.add(cardType); this.addedCardTypes.add(cardType);
if (cardType == CardType.ENCHANTMENT) { if (cardType == CardType.ENCHANTMENT) {
dependencyTypes.add(DependencyType.EnchantmentAddingRemoving); dependencyTypes.add(DependencyType.EnchantmentAddingRemoving);
} else if (cardType == CardType.ARTIFACT) { } else if (cardType == CardType.ARTIFACT) {
dependencyTypes.add(DependencyType.ArtifactAddingRemoving); dependencyTypes.add(DependencyType.ArtifactAddingRemoving);
} else if (cardType == CardType.LAND) {
dependencyTypes.add(DependencyType.BecomeNonbasicLand);
} }
} }