From 67baf777ce70c283141fc9a966114be362fe22ba Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 2 May 2025 10:04:53 -0400 Subject: [PATCH] [WHO] Implement Vislor Turlough --- .../src/mage/cards/v/VislorTurlough.java | 129 ++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 8 +- .../common/combat/GoadTargetEffect.java | 2 +- 3 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/v/VislorTurlough.java diff --git a/Mage.Sets/src/mage/cards/v/VislorTurlough.java b/Mage.Sets/src/mage/cards/v/VislorTurlough.java new file mode 100644 index 00000000000..169c3f520b1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VislorTurlough.java @@ -0,0 +1,129 @@ +package mage.cards.v; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.effects.common.combat.GoadTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.keyword.DoctorsCompanionAbility; +import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class VislorTurlough extends CardImpl { + + public VislorTurlough(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // Deal with the Black Guardian -- When Vislor Turlough enters the battlefield, you may have an opponent gain control of it. If you do, it's goaded for as long as they control it. + this.addAbility(new EntersBattlefieldTriggeredAbility(new VislorTurloughEffect(), true) + .withFlavorWord("Deal with the Black Guardian")); + + // At the beginning of your end step, draw a card, then you lose life equal to the number of cards in your hand. + Ability ability = new BeginningOfEndStepTriggeredAbility(new DrawCardSourceControllerEffect(1)); + ability.addEffect(new LoseLifeSourceControllerEffect(CardsInControllerHandCount.ANY) + .setText(", then you lose life equal to the number of cards in your hand")); + this.addAbility(ability); + + // Doctor's companion + this.addAbility(DoctorsCompanionAbility.getInstance()); + } + + private VislorTurlough(final VislorTurlough card) { + super(card); + } + + @Override + public VislorTurlough copy() { + return new VislorTurlough(this); + } +} + +class VislorTurloughEffect extends OneShotEffect { + + VislorTurloughEffect() { + super(Outcome.Benefit); + staticText = "have an opponent gain control of it. If you do, it's goaded for as long as they control it"; + } + + private VislorTurloughEffect(final VislorTurloughEffect effect) { + super(effect); + } + + @Override + public VislorTurloughEffect copy() { + return new VislorTurloughEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (player == null || permanent == null) { + return false; + } + TargetPlayer target = new TargetOpponent(0, 1, true); + player.choose(Outcome.GainControl, target, source, game); + Player opponent = game.getPlayer(target.getFirstTarget()); + if (opponent == null) { + return false; + } + game.addEffect(new GainControlTargetEffect( + Duration.Custom, true, opponent.getId() + ).setTargetPointer(new FixedTarget(permanent, game)), source); + game.addEffect(new VislorTurloughGoadEffect(opponent.getId(), permanent, game), source); + return true; + } +} + +class VislorTurloughGoadEffect extends GoadTargetEffect { + + private final UUID controllerId; + + VislorTurloughGoadEffect(UUID controllerId, Permanent permanent, Game game) { + super(Duration.Custom); + this.controllerId = controllerId; + this.setTargetPointer(new FixedTarget(permanent, game)); + } + + private VislorTurloughGoadEffect(final VislorTurloughGoadEffect effect) { + super(effect); + this.controllerId = effect.controllerId; + } + + @Override + public VislorTurloughGoadEffect copy() { + return new VislorTurloughGoadEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null && permanent.isControlledBy(controllerId)) { + return super.apply(game, source); + } + discard(); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index 39fe7ea0ece..c8c67607a79 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -1150,10 +1150,10 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("Vineglimmer Snarl", 329, Rarity.RARE, mage.cards.v.VineglimmerSnarl.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Vineglimmer Snarl", 532, Rarity.RARE, mage.cards.v.VineglimmerSnarl.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Vineglimmer Snarl", 920, Rarity.RARE, mage.cards.v.VineglimmerSnarl.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Vislor Turlough", 377, Rarity.RARE, mage.cards.v.VislorTurlough.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Vislor Turlough", 679, Rarity.RARE, mage.cards.v.VislorTurlough.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Vislor Turlough", 74, Rarity.RARE, mage.cards.v.VislorTurlough.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Vislor Turlough", 968, Rarity.RARE, mage.cards.v.VislorTurlough.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Vislor Turlough", 377, Rarity.RARE, mage.cards.v.VislorTurlough.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Vislor Turlough", 679, Rarity.RARE, mage.cards.v.VislorTurlough.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Vislor Turlough", 74, Rarity.RARE, mage.cards.v.VislorTurlough.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Vislor Turlough", 968, Rarity.RARE, mage.cards.v.VislorTurlough.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Vrestin, Menoptra Leader", 1042, Rarity.RARE, mage.cards.v.VrestinMenoptraLeader.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Vrestin, Menoptra Leader", 166, Rarity.RARE, mage.cards.v.VrestinMenoptraLeader.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Vrestin, Menoptra Leader", 451, Rarity.RARE, mage.cards.v.VrestinMenoptraLeader.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/GoadTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/GoadTargetEffect.java index dc944f0add3..4fe12b5667b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/GoadTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/GoadTargetEffect.java @@ -33,7 +33,7 @@ public class GoadTargetEffect extends ContinuousEffectImpl { super(duration, Layer.RulesEffects, SubLayer.NA, Outcome.Detriment); } - private GoadTargetEffect(final GoadTargetEffect effect) { + protected GoadTargetEffect(final GoadTargetEffect effect) { super(effect); }