From 911a221a1bdd055e55bf8573294c82e4f85b78b6 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Tue, 2 Apr 2024 15:23:48 -0400 Subject: [PATCH] [OTJ] Implement Patient Naturalist --- .../src/mage/cards/p/PatientNaturalist.java | 44 +++++++++++++++++++ .../mage/sets/OutlawsOfThunderJunction.java | 1 + .../common/MillThenPutInHandEffect.java | 29 +++++++----- 3 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/p/PatientNaturalist.java diff --git a/Mage.Sets/src/mage/cards/p/PatientNaturalist.java b/Mage.Sets/src/mage/cards/p/PatientNaturalist.java new file mode 100644 index 00000000000..4e16c83d43a --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PatientNaturalist.java @@ -0,0 +1,44 @@ +package mage.cards.p; + +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.MillThenPutInHandEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.StaticFilters; +import mage.game.permanent.token.TreasureToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PatientNaturalist extends CardImpl { + + public PatientNaturalist(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SCOUT); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // When Patient Naturalist enters the battlefield, mill three cards. Put a land card from among the milled cards into your hand. If you can't, create a Treasure token. + this.addAbility(new EntersBattlefieldTriggeredAbility(new MillThenPutInHandEffect( + 3, StaticFilters.FILTER_CARD_LAND_A, + new CreateTokenEffect(new TreasureToken()), false + ))); + } + + private PatientNaturalist(final PatientNaturalist card) { + super(card); + } + + @Override + public PatientNaturalist copy() { + return new PatientNaturalist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java index 6e4be3b58c3..2f61bd53c7e 100644 --- a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java +++ b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java @@ -186,6 +186,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet { cards.add(new SetCardInfo("Outlaw Stitcher", 59, Rarity.UNCOMMON, mage.cards.o.OutlawStitcher.class)); cards.add(new SetCardInfo("Outlaws' Fury", 136, Rarity.COMMON, mage.cards.o.OutlawsFury.class)); cards.add(new SetCardInfo("Overzealous Muscle", 97, Rarity.COMMON, mage.cards.o.OverzealousMuscle.class)); + cards.add(new SetCardInfo("Patient Naturalist", 174, Rarity.COMMON, mage.cards.p.PatientNaturalist.class)); cards.add(new SetCardInfo("Peerless Ropemaster", 60, Rarity.COMMON, mage.cards.p.PeerlessRopemaster.class)); cards.add(new SetCardInfo("Phantom Interference", 61, Rarity.COMMON, mage.cards.p.PhantomInterference.class)); cards.add(new SetCardInfo("Pillage the Bog", 224, Rarity.RARE, mage.cards.p.PillageTheBog.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/MillThenPutInHandEffect.java b/Mage/src/main/java/mage/abilities/effects/common/MillThenPutInHandEffect.java index ad8baabac05..7987db6360a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/MillThenPutInHandEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/MillThenPutInHandEffect.java @@ -35,8 +35,8 @@ public class MillThenPutInHandEffect extends OneShotEffect { } /** - * @param amount number of cards to mill - * @param filter select a card matching this filter from among the milled cards to put in hand + * @param amount number of cards to mill + * @param filter select a card matching this filter from among the milled cards to put in hand * @param optional whether the selection is optional (true) or mandatory (false) */ public MillThenPutInHandEffect(int amount, FilterCard filter, boolean optional) { @@ -44,8 +44,8 @@ public class MillThenPutInHandEffect extends OneShotEffect { } /** - * @param amount number of cards to mill - * @param filter optionally select a card matching this filter from among the milled cards to put in hand + * @param amount number of cards to mill + * @param filter optionally select a card matching this filter from among the milled cards to put in hand * @param otherwiseEffect applied if no card put into hand */ public MillThenPutInHandEffect(int amount, FilterCard filter, Effect otherwiseEffect) { @@ -53,7 +53,7 @@ public class MillThenPutInHandEffect extends OneShotEffect { this.textFromAmong = "the cards milled this way"; } - protected MillThenPutInHandEffect(int amount, FilterCard filter, Effect otherwiseEffect, boolean optional) { + public MillThenPutInHandEffect(int amount, FilterCard filter, Effect otherwiseEffect, boolean optional) { super(Outcome.Benefit); this.amount = amount; this.filter = filter; @@ -115,12 +115,21 @@ public class MillThenPutInHandEffect extends OneShotEffect { if (staticText != null && !staticText.isEmpty()) { return staticText; } - String text = "mill " + CardUtil.numberToText(amount) + " cards. "; - text += optional ? "You may " : "Then "; - text += "put " + filter.getMessage() + " from among " + textFromAmong + " into your hand"; + StringBuilder sb = new StringBuilder("mill "); + sb.append(CardUtil.numberToText(amount)); + sb.append(" cards. "); + sb.append(optional ? "You may " : "Then "); + sb.append("put "); + sb.append(filter.getMessage()); + sb.append(" from among "); + sb.append(textFromAmong); + sb.append(" into your hand"); if (otherwiseEffect != null) { - text += ". If you don't, " + otherwiseEffect.getText(mode); + sb.append(". If you "); + sb.append(optional ? "don't" : "can't"); + sb.append(", "); + sb.append(otherwiseEffect.getText(mode)); } - return text; + return sb.toString(); } }