From 398e2e2527aef5cf4e8a30aa57d30cafaa9be288 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Mon, 8 Apr 2024 13:20:49 -0400 Subject: [PATCH] [PIP] Implement The Wise Mothman --- .../src/mage/cards/t/TheWiseMothman.java | 90 +++++++++++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 1 + 2 files changed, 91 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TheWiseMothman.java diff --git a/Mage.Sets/src/mage/cards/t/TheWiseMothman.java b/Mage.Sets/src/mage/cards/t/TheWiseMothman.java new file mode 100644 index 00000000000..1def6993fee --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheWiseMothman.java @@ -0,0 +1,90 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersPlayersEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.MilledCardsEvent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TheWiseMothman extends CardImpl { + + public TheWiseMothman(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.INSECT); + this.subtype.add(SubType.MUTANT); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever The Wise Mothman enters the battlefield or attacks, each player gets a rad counter. + this.addAbility(new EntersBattlefieldOrAttacksSourceTriggeredAbility( + new AddCountersPlayersEffect(CounterType.RAD.createInstance(), TargetController.EACH_PLAYER) + )); + + // Whenever one or more nonland cards are milled, put a +1/+1 counter on each of up to X target creatures, where X is the number of nonland cards milled this way. + this.addAbility(new TheWiseMothmanTriggeredAbility()); + } + + private TheWiseMothman(final TheWiseMothman card) { + super(card); + } + + @Override + public TheWiseMothman copy() { + return new TheWiseMothman(this); + } +} + +class TheWiseMothmanTriggeredAbility extends TriggeredAbilityImpl { + + TheWiseMothmanTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()) + .setText("put a +1/+1 counter on each of up to X target creatures, " + + "where X is the number of nonland cards milled this way")); + this.setTriggerPhrase("Whenever one or more nonland cards are milled, "); + } + + private TheWiseMothmanTriggeredAbility(final TheWiseMothmanTriggeredAbility ability) { + super(ability); + } + + @Override + public TheWiseMothmanTriggeredAbility copy() { + return new TheWiseMothmanTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.MILLED_CARDS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + int count = ((MilledCardsEvent) event).getCards().count(StaticFilters.FILTER_CARD_NON_LAND, game); + if (count < 1) { + return false; + } + this.getTargets().clear(); + this.getTargets().add(new TargetCreaturePermanent(0, count)); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 81006cb51c6..4c61ebac2c5 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -308,6 +308,7 @@ public final class Fallout extends ExpansionSet { cards.add(new SetCardInfo("Temple of Triumph", 312, Rarity.RARE, mage.cards.t.TempleOfTriumph.class)); cards.add(new SetCardInfo("Temple of the False God", 311, Rarity.UNCOMMON, mage.cards.t.TempleOfTheFalseGod.class)); cards.add(new SetCardInfo("Terramorphic Expanse", 313, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class)); + cards.add(new SetCardInfo("The Wise Mothman", 4, Rarity.MYTHIC, mage.cards.t.TheWiseMothman.class)); cards.add(new SetCardInfo("Thirst for Knowledge", 180, Rarity.UNCOMMON, mage.cards.t.ThirstForKnowledge.class)); cards.add(new SetCardInfo("Thought Vessel", 251, Rarity.COMMON, mage.cards.t.ThoughtVessel.class)); cards.add(new SetCardInfo("Tireless Tracker", 207, Rarity.RARE, mage.cards.t.TirelessTracker.class));