From 8f4a920888a75e2cc65334d654ec99626eb0ad46 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 26 Jan 2024 21:26:53 -0500 Subject: [PATCH] [MKM] Implement Detective's Satchel --- .../src/mage/cards/d/DetectivesSatchel.java | 43 +++++++++++++++++++ .../src/mage/sets/MurdersAtKarlovManor.java | 1 + .../SacrificedArtifactThisTurnCondition.java | 5 +++ 3 files changed, 49 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DetectivesSatchel.java diff --git a/Mage.Sets/src/mage/cards/d/DetectivesSatchel.java b/Mage.Sets/src/mage/cards/d/DetectivesSatchel.java new file mode 100644 index 00000000000..12357dd83fc --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DetectivesSatchel.java @@ -0,0 +1,43 @@ +package mage.cards.d; + +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.SacrificedArtifactThisTurnCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.keyword.InvestigateEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.permanent.token.ThopterColorlessToken; +import mage.watchers.common.PermanentsSacrificedWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DetectivesSatchel extends CardImpl { + + public DetectivesSatchel(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}{U}{R}"); + + // When Detective's Satchel enters the battlefield, investigate twice. + this.addAbility(new EntersBattlefieldTriggeredAbility(new InvestigateEffect(2))); + + // {T}: Create a 1/1 colorless Thopter artifact creature token with flying. Activate only if you've sacrificed an artifact this turn. + this.addAbility(new ConditionalActivatedAbility( + new CreateTokenEffect(new ThopterColorlessToken()), new TapSourceCost(), + SacrificedArtifactThisTurnCondition.instance + ).addHint(SacrificedArtifactThisTurnCondition.getHint()), new PermanentsSacrificedWatcher()); + } + + private DetectivesSatchel(final DetectivesSatchel card) { + super(card); + } + + @Override + public DetectivesSatchel copy() { + return new DetectivesSatchel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java index 981d899bdb5..c723950fc5f 100644 --- a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java +++ b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java @@ -60,6 +60,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet { cards.add(new SetCardInfo("Deduce", 52, Rarity.COMMON, mage.cards.d.Deduce.class)); cards.add(new SetCardInfo("Defenestrated Phantom", 11, Rarity.COMMON, mage.cards.d.DefenestratedPhantom.class)); cards.add(new SetCardInfo("Demand Answers", 122, Rarity.COMMON, mage.cards.d.DemandAnswers.class)); + cards.add(new SetCardInfo("Detective's Satchel", 196, Rarity.UNCOMMON, mage.cards.d.DetectivesSatchel.class)); cards.add(new SetCardInfo("Dog Walker", 197, Rarity.COMMON, mage.cards.d.DogWalker.class)); cards.add(new SetCardInfo("Doppelgang", 198, Rarity.RARE, mage.cards.d.Doppelgang.class)); cards.add(new SetCardInfo("Drag the Canal", 199, Rarity.RARE, mage.cards.d.DragTheCanal.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/common/SacrificedArtifactThisTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SacrificedArtifactThisTurnCondition.java index efa9095b575..298c158eff4 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SacrificedArtifactThisTurnCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SacrificedArtifactThisTurnCondition.java @@ -27,4 +27,9 @@ public enum SacrificedArtifactThisTurnCondition implements Condition { .stream() .anyMatch(permanent -> permanent.isArtifact(game)); } + + @Override + public String toString() { + return "you've sacrificed an artifact this turn"; + } }