From ebf82309fcc5e73ffbffe4dbdf1f3627e0f9f7e2 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 20 Nov 2025 12:57:39 -0500 Subject: [PATCH] [TLE] Implement Swampbenders --- Mage.Sets/src/mage/cards/s/Swampbenders.java | 90 +++++++++++++++++++ .../sets/AvatarTheLastAirbenderEternal.java | 1 + 2 files changed, 91 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/Swampbenders.java diff --git a/Mage.Sets/src/mage/cards/s/Swampbenders.java b/Mage.Sets/src/mage/cards/s/Swampbenders.java new file mode 100644 index 00000000000..f7df97e858a --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/Swampbenders.java @@ -0,0 +1,90 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Swampbenders extends CardImpl { + + private static final DynamicValue xValue = new PermanentsOnBattlefieldCount( + new FilterPermanent(SubType.SWAMP, "Swamps on the battlefield") + ); + + public Swampbenders(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.DRUID); + this.subtype.add(SubType.ALLY); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Swampbenders's power and toughness are each equal to the number of Swamps on the battlefield. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue))); + + // Lands you control are Swamps in addition to their other types. + this.addAbility(new SimpleStaticAbility(new SwampbendersEffect())); + } + + private Swampbenders(final Swampbenders card) { + super(card); + } + + @Override + public Swampbenders copy() { + return new Swampbenders(this); + } +} + +class SwampbendersEffect extends ContinuousEffectImpl { + + SwampbendersEffect() { + super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.AIDontUseIt); + staticText = "lands you control are Swamps in addition to their other types."; + this.dependendToTypes.add(DependencyType.BecomeNonbasicLand); + this.dependencyTypes.add(DependencyType.BecomeSwamp); + } + + private SwampbendersEffect(final SwampbendersEffect effect) { + super(effect); + } + + @Override + public SwampbendersEffect copy() { + return new SwampbendersEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Ability ability = new BlackManaAbility(); + for (Permanent land : game.getBattlefield().getActivePermanents( + StaticFilters.FILTER_LAND, source.getControllerId(), game + )) { + // 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects + // So the ability removing has to be done before Layer 6 + // Lands have their mana ability intrinsically, so that is added in layer 4 + land.addSubType(game, SubType.SWAMP); + if (!land.getAbilities().containsRule(ability)) { + land.addAbility(ability, source.getSourceId(), game); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java b/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java index 63b728a7f6d..423f7ff4698 100644 --- a/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java +++ b/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java @@ -267,6 +267,7 @@ public final class AvatarTheLastAirbenderEternal extends ExpansionSet { cards.add(new SetCardInfo("Sunbaked Canyon", 58, Rarity.MYTHIC, mage.cards.s.SunbakedCanyon.class)); cards.add(new SetCardInfo("Sundial of the Infinite", 55, Rarity.MYTHIC, mage.cards.s.SundialOfTheInfinite.class)); cards.add(new SetCardInfo("Suspicious Bookcase", 170, Rarity.UNCOMMON, mage.cards.s.SuspiciousBookcase.class)); + cards.add(new SetCardInfo("Swampbenders", 65, Rarity.RARE, mage.cards.s.Swampbenders.class)); cards.add(new SetCardInfo("Swiftfoot Boots", 317, Rarity.RARE, mage.cards.s.SwiftfootBoots.class)); cards.add(new SetCardInfo("Tarnished Citadel", 59, Rarity.MYTHIC, mage.cards.t.TarnishedCitadel.class)); cards.add(new SetCardInfo("Taunting Challenge", 46, Rarity.MYTHIC, mage.cards.t.TauntingChallenge.class));