From 0aabd1699ff3294e9c9de6c5ea7cd5523a724401 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 23 Mar 2025 19:20:58 -0400 Subject: [PATCH] [TDM] Implement Abzan Monument --- Mage.Sets/src/mage/cards/a/AbzanMonument.java | 101 ++++++++++++++++++ .../src/mage/sets/TarkirDragonstorm.java | 1 + 2 files changed, 102 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AbzanMonument.java diff --git a/Mage.Sets/src/mage/cards/a/AbzanMonument.java b/Mage.Sets/src/mage/cards/a/AbzanMonument.java new file mode 100644 index 00000000000..fc1899a2030 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AbzanMonument.java @@ -0,0 +1,101 @@ +package mage.cards.a; + +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.GreatestToughnessAmongControlledCreaturesValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.hint.Hint; +import mage.abilities.hint.ValueHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.game.permanent.token.SpiritXXToken; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AbzanMonument extends CardImpl { + + private static final FilterCard filter = new FilterCard("a basic Plains, Swamp, or Forest card"); + + static { + filter.add(SuperType.BASIC.getPredicate()); + filter.add(Predicates.or( + SubType.PLAINS.getPredicate(), + SubType.SWAMP.getPredicate(), + SubType.FOREST.getPredicate() + )); + } + + private static final Hint hint = new ValueHint( + "Greatest toughness among creatures you control", + GreatestToughnessAmongControlledCreaturesValue.instance + ); + + public AbzanMonument(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + // When this artifact enters, search your library for a basic Plains, Swamp, or Forest card, reveal it, put it into your hand, then shuffle. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true) + )); + + // {1}{W}{B}{G}, {T}, Sacrifice this artifact: Create an X/X white Spirit creature token, where X is the greatest toughness among creatures you control. Activate only as a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility( + new AbzanMonumentEffect(), new ManaCostsImpl<>("{1}{W}{B}{G}") + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability.addHint(hint)); + } + + private AbzanMonument(final AbzanMonument card) { + super(card); + } + + @Override + public AbzanMonument copy() { + return new AbzanMonument(this); + } +} + +class AbzanMonumentEffect extends OneShotEffect { + + AbzanMonumentEffect() { + super(Outcome.Benefit); + staticText = "create an X/X white Spirit creature token, " + + "where X is the greatest toughness among creatures you control"; + } + + private AbzanMonumentEffect(final AbzanMonumentEffect effect) { + super(effect); + } + + @Override + public AbzanMonumentEffect copy() { + return new AbzanMonumentEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return new SpiritXXToken( + GreatestToughnessAmongControlledCreaturesValue + .instance + .calculate(game, source, this) + ).putOntoBattlefield(1, game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java index 72403fe6f94..073e025fd97 100644 --- a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java +++ b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java @@ -21,6 +21,7 @@ public final class TarkirDragonstorm extends ExpansionSet { this.hasBasicLands = true; cards.add(new SetCardInfo("Abzan Devotee", 68, Rarity.COMMON, mage.cards.a.AbzanDevotee.class)); + cards.add(new SetCardInfo("Abzan Monument", 238, Rarity.UNCOMMON, mage.cards.a.AbzanMonument.class)); cards.add(new SetCardInfo("Aegis Sculptor", 35, Rarity.UNCOMMON, mage.cards.a.AegisSculptor.class)); cards.add(new SetCardInfo("Agent of Kotis", 36, Rarity.COMMON, mage.cards.a.AgentOfKotis.class)); cards.add(new SetCardInfo("Alesha's Legacy", 72, Rarity.COMMON, mage.cards.a.AleshasLegacy.class));