Skip to content

Commit

Permalink
Fix Awakened Skyclave & Grond, The Gatebreaker
Browse files Browse the repository at this point in the history
  • Loading branch information
Cguy7777 committed Jan 14, 2025
1 parent 3d14755 commit 4c39d4f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/a/AwakenedSkyclave.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public AwakenedSkyclave(UUID ownerId, CardSetInfo setInfo) {
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -45,7 +50,8 @@ public void init(Ability source, Game game) {
@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)) || !duration.isOnlyValidIfNoZoneChange())) {
for (CardType cardType : addedCardTypes) {
permanent.addCardType(game, cardType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 4c39d4f

Please sign in to comment.