From 42b2c91809f1a2d89452f5d1f0cda470df15a824 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 1 May 2025 17:47:40 -0400 Subject: [PATCH] [WHO] Implemented Hunted by The Family --- .../src/mage/cards/h/HuntedByTheFamily.java | 122 ++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 8 +- 2 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/h/HuntedByTheFamily.java diff --git a/Mage.Sets/src/mage/cards/h/HuntedByTheFamily.java b/Mage.Sets/src/mage/cards/h/HuntedByTheFamily.java new file mode 100644 index 00000000000..6ba78ccc7e6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HuntedByTheFamily.java @@ -0,0 +1,122 @@ +package mage.cards.h; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.choices.FaceVillainousChoice; +import mage.choices.VillainousChoice; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.custom.CreatureToken; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class HuntedByTheFamily extends CardImpl { + + public HuntedByTheFamily(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{U}{U}"); + + // Choose up to four target creatures you don't control. For each of them, that creature's controller faces a villainous choice -- That creature becomes a 1/1 white Human creature and loses all abilities, or you create a token that's a copy of it. + this.getSpellAbility().addEffect(new HuntedByTheFamilyEffect()); + this.getSpellAbility().addTarget(new TargetPermanent( + 0, 4, StaticFilters.FILTER_CREATURES_YOU_DONT_CONTROL + )); + } + + private HuntedByTheFamily(final HuntedByTheFamily card) { + super(card); + } + + @Override + public HuntedByTheFamily copy() { + return new HuntedByTheFamily(this); + } +} + +class HuntedByTheFamilyEffect extends OneShotEffect { + + HuntedByTheFamilyEffect() { + super(Outcome.Benefit); + staticText = "choose up to four target creatures you don't control. " + + "For each of them, that creature's controller faces a villainous choice — " + + "That creature becomes a 1/1 white Human creature and loses all abilities, " + + "or you create a token that's a copy of it"; + } + + private HuntedByTheFamilyEffect(final HuntedByTheFamilyEffect effect) { + super(effect); + } + + @Override + public HuntedByTheFamilyEffect copy() { + return new HuntedByTheFamilyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID targetId : getTargetPointer().getTargets(game, source)) { + Permanent permanent = game.getPermanent(targetId); + Player player = game.getPlayer(game.getControllerId(targetId)); + if (permanent == null || player == null) { + continue; + } + FaceVillainousChoice choice = new FaceVillainousChoice( + Outcome.DestroyPermanent, + new HuntedByTheFamilyFirstChoice(permanent), + new HuntedByTheFamilySecondChoice(permanent) + ); + choice.faceChoice(player, game, source); + } + return true; + } +} + +class HuntedByTheFamilyFirstChoice extends VillainousChoice { + + private final Permanent permanent; + + HuntedByTheFamilyFirstChoice(Permanent permanent) { + super("", permanent.getIdName() + " becomes a 1/1 white Human and loses all abilities"); + this.permanent = permanent; + } + + @Override + public boolean doChoice(Player player, Game game, Ability source) { + game.addEffect(new BecomesCreatureTargetEffect( + new CreatureToken(1, 1) + .withSubType(SubType.HUMAN) + .withColor("W"), + true, false, Duration.Custom + ).setTargetPointer(new FixedTarget(permanent, game)), source); + return true; + } +} + +class HuntedByTheFamilySecondChoice extends VillainousChoice { + + private final Permanent permanent; + + HuntedByTheFamilySecondChoice(Permanent permanent) { + super("", "{controller} creates a token that's a copy of " + permanent.getIdName()); + this.permanent = permanent; + } + + @Override + public boolean doChoice(Player player, Game game, Ability source) { + return new CreateTokenCopyTargetEffect().setSavedPermanent(permanent).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index ba42066ce2b..26888bae0be 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -437,10 +437,10 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("Horizon Canopy", 878, Rarity.RARE, mage.cards.h.HorizonCanopy.class, NON_FULL_USE_VARIOUS)); //cards.add(new SetCardInfo("Hotel of Fears", 584, Rarity.COMMON, mage.cards.h.HotelOfFears.class)); //cards.add(new SetCardInfo("Human-Time Lord Meta-Crisis", 585, Rarity.COMMON, mage.cards.h.HumanTimeLordMetaCrisis.class)); - //cards.add(new SetCardInfo("Hunted by The Family", 361, Rarity.RARE, mage.cards.h.HuntedByTheFamily.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Hunted by The Family", 46, Rarity.RARE, mage.cards.h.HuntedByTheFamily.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Hunted by The Family", 651, Rarity.RARE, mage.cards.h.HuntedByTheFamily.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Hunted by The Family", 952, Rarity.RARE, mage.cards.h.HuntedByTheFamily.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Hunted by The Family", 361, Rarity.RARE, mage.cards.h.HuntedByTheFamily.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Hunted by The Family", 46, Rarity.RARE, mage.cards.h.HuntedByTheFamily.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Hunted by The Family", 651, Rarity.RARE, mage.cards.h.HuntedByTheFamily.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Hunted by The Family", 952, Rarity.RARE, mage.cards.h.HuntedByTheFamily.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Ian Chesterton", 22, Rarity.RARE, mage.cards.i.IanChesterton.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Ian Chesterton", 341, Rarity.RARE, mage.cards.i.IanChesterton.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Ian Chesterton", 627, Rarity.RARE, mage.cards.i.IanChesterton.class, NON_FULL_USE_VARIOUS));