[TLA] Implement Toph, the First Metalbender

This commit is contained in:
theelk801 2025-08-12 20:39:22 -04:00
parent a00010a582
commit 7a241a6f1e
3 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,87 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.keyword.EarthbendTargetEffect;
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class TophTheFirstMetalbender extends CardImpl {
public TophTheFirstMetalbender(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{W}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WARRIOR);
this.subtype.add(SubType.ALLY);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Nontoken artifacts you control are lands in addition to their other types.
this.addAbility(new SimpleStaticAbility(new TophTheFirstMetalbenderEffect()));
// At the beginning of your end step, earthbend 2.
Ability ability = new BeginningOfEndStepTriggeredAbility(new EarthbendTargetEffect(2));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND));
this.addAbility(ability);
}
private TophTheFirstMetalbender(final TophTheFirstMetalbender card) {
super(card);
}
@Override
public TophTheFirstMetalbender copy() {
return new TophTheFirstMetalbender(this);
}
}
class TophTheFirstMetalbenderEffect extends ContinuousEffectImpl {
private static final FilterPermanent filter = new FilterControlledArtifactPermanent();
static {
filter.add(TokenPredicate.FALSE);
}
TophTheFirstMetalbenderEffect() {
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);
staticText = "nontoken artifacts you control are lands in addition to their other types";
}
private TophTheFirstMetalbenderEffect(final TophTheFirstMetalbenderEffect effect) {
super(effect);
}
@Override
public TophTheFirstMetalbenderEffect copy() {
return new TophTheFirstMetalbenderEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(
filter, source.getControllerId(), source, game
)) {
permanent.addCardType(game, CardType.LAND);
}
return true;
}
}

View file

@ -46,6 +46,9 @@ public final class AvatarTheLastAirbender extends ExpansionSet {
cards.add(new SetCardInfo("Sokka, Bold Boomeranger", 383, Rarity.RARE, mage.cards.s.SokkaBoldBoomeranger.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Southern Air Temple", 36, Rarity.UNCOMMON, mage.cards.s.SouthernAirTemple.class));
cards.add(new SetCardInfo("Swamp", 289, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Toph, the First Metalbender", 247, Rarity.RARE, mage.cards.t.TophTheFirstMetalbender.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Toph, the First Metalbender", 353, Rarity.RARE, mage.cards.t.TophTheFirstMetalbender.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Toph, the First Metalbender", 362, Rarity.RARE, mage.cards.t.TophTheFirstMetalbender.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Yue, the Moon Spirit", 338, Rarity.RARE, mage.cards.y.YueTheMoonSpirit.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Yue, the Moon Spirit", 83, Rarity.RARE, mage.cards.y.YueTheMoonSpirit.class, NON_FULL_USE_VARIOUS));

View file

@ -11,6 +11,7 @@ import mage.abilities.keyword.HasteAbility;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
@ -52,6 +53,7 @@ public class EarthbendTargetEffect extends OneShotEffect {
.withAbility(HasteAbility.getInstance()),
false, true, Duration.Custom
), source);
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game);
game.addDelayedTriggeredAbility(new EarthbendingDelayedTriggeredAbility(permanent, game), source);
game.fireEvent(GameEvent.getEvent(
GameEvent.EventType.EARTHBENDED, permanent.getId(),