From d7b2d2208dbdaf239c302bef5016c9292f1e28c9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 14 Jul 2021 09:07:05 -0400 Subject: [PATCH] [AFC] Implemented Thorough Investigation --- .../mage/cards/t/ThoroughInvestigation.java | 40 +++++++++++++++++++ .../mage/sets/ForgottenRealmsCommander.java | 1 + .../SacrificePermanentTriggeredAbility.java | 4 +- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/t/ThoroughInvestigation.java diff --git a/Mage.Sets/src/mage/cards/t/ThoroughInvestigation.java b/Mage.Sets/src/mage/cards/t/ThoroughInvestigation.java new file mode 100644 index 00000000000..c1cbdd18371 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThoroughInvestigation.java @@ -0,0 +1,40 @@ +package mage.cards.t; + +import mage.abilities.common.AttacksWithCreaturesTriggeredAbility; +import mage.abilities.common.SacrificePermanentTriggeredAbility; +import mage.abilities.effects.keyword.InvestigateEffect; +import mage.abilities.effects.keyword.VentureIntoTheDungeonEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.FilterPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ThoroughInvestigation extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(SubType.CLUE, "a Clue"); + + public ThoroughInvestigation(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + + // Whenever you attack, investigate. + this.addAbility(new AttacksWithCreaturesTriggeredAbility(new InvestigateEffect(), 0)); + + // Whenever you sacrifice a Clue, venture into the dungeon. + this.addAbility(new SacrificePermanentTriggeredAbility(new VentureIntoTheDungeonEffect(), filter)); + } + + private ThoroughInvestigation(final ThoroughInvestigation card) { + super(card); + } + + @Override + public ThoroughInvestigation copy() { + return new ThoroughInvestigation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java b/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java index 8a32c3d0d09..33e22e7ec94 100644 --- a/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java +++ b/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java @@ -217,6 +217,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet { cards.add(new SetCardInfo("Terramorphic Expanse", 267, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class)); cards.add(new SetCardInfo("Terror of Mount Velus", 145, Rarity.RARE, mage.cards.t.TerrorOfMountVelus.class)); cards.add(new SetCardInfo("Theater of Horrors", 194, Rarity.RARE, mage.cards.t.TheaterOfHorrors.class)); + cards.add(new SetCardInfo("Thorough Investigation", 12, Rarity.RARE, mage.cards.t.ThoroughInvestigation.class)); cards.add(new SetCardInfo("Thriving Grove", 268, Rarity.COMMON, mage.cards.t.ThrivingGrove.class)); cards.add(new SetCardInfo("Thriving Heath", 269, Rarity.COMMON, mage.cards.t.ThrivingHeath.class)); cards.add(new SetCardInfo("Thriving Isle", 270, Rarity.COMMON, mage.cards.t.ThrivingIsle.class)); diff --git a/Mage/src/main/java/mage/abilities/common/SacrificePermanentTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/SacrificePermanentTriggeredAbility.java index 8c7077a37f3..f16b612cfc3 100644 --- a/Mage/src/main/java/mage/abilities/common/SacrificePermanentTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/SacrificePermanentTriggeredAbility.java @@ -43,8 +43,8 @@ public class SacrificePermanentTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getPlayerId().equals(this.getControllerId()) - && filter.match(game.getPermanentOrLKIBattlefield(event.getTargetId()), game); + return isControlledBy(event.getPlayerId()) + && filter.match(game.getPermanentOrLKIBattlefield(event.getTargetId()), getSourceId(), getControllerId(), game); } @Override