From d519f1d775e8b1c0f81ce36b36574088e740ca2d Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Wed, 7 Jul 2021 10:01:36 -0500 Subject: [PATCH] [AFR] Implemented Ingenious Smith --- .../src/mage/cards/i/IngeniousSmith.java | 59 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + 2 files changed, 60 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/i/IngeniousSmith.java diff --git a/Mage.Sets/src/mage/cards/i/IngeniousSmith.java b/Mage.Sets/src/mage/cards/i/IngeniousSmith.java new file mode 100644 index 0000000000..8fd5859aad --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IngeniousSmith.java @@ -0,0 +1,59 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.filter.common.FilterArtifactPermanent; + +/** + * + * @author weirddan455 + */ +public final class IngeniousSmith extends CardImpl { + + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("one or more artifacts"); + + public IngeniousSmith(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ARTIFICER); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Ingenious Smith enters the battlefield, look at the top four cards of your library. + // You may reveal an artifact card from among them and put it into your hand. + // Put the rest on the bottom of your library in a random order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect( + StaticValue.get(4), false, StaticValue.get(1), StaticFilters.FILTER_CARD_ARTIFACT_AN, + Zone.LIBRARY, false, true, false, Zone.HAND, + true, false, false).setBackInRandomOrder(true) + )); + + // Whenever one or more artifacts enter the battlefield under your control, put a +1/+1 counter on Ingenious Smith. + // This ability triggers only once each turn. + this.addAbility(new EntersBattlefieldControlledTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter + ).setTriggersOnce(true)); + } + + private IngeniousSmith(final IngeniousSmith card) { + super(card); + } + + @Override + public IngeniousSmith copy() { + return new IngeniousSmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 8c2d683c70..b0f2ab90f1 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -124,6 +124,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Icingdeath, Frost Tyrant", 20, Rarity.MYTHIC, mage.cards.i.IcingdeathFrostTyrant.class)); cards.add(new SetCardInfo("Improvised Weaponry", 150, Rarity.COMMON, mage.cards.i.ImprovisedWeaponry.class)); cards.add(new SetCardInfo("Inferno of the Star Mounts", 151, Rarity.MYTHIC, mage.cards.i.InfernoOfTheStarMounts.class)); + cards.add(new SetCardInfo("Ingenious Smith", 21, Rarity.UNCOMMON, mage.cards.i.IngeniousSmith.class)); cards.add(new SetCardInfo("Inspiring Bard", 189, Rarity.COMMON, mage.cards.i.InspiringBard.class)); cards.add(new SetCardInfo("Intrepid Outlander", 191, Rarity.UNCOMMON, mage.cards.i.IntrepidOutlander.class)); cards.add(new SetCardInfo("Iron Golem", 247, Rarity.UNCOMMON, mage.cards.i.IronGolem.class));