From 4bb00131e03fb0a74d4d7acc14f72ffbc3b8fe70 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 6 Sep 2024 13:50:56 -0400 Subject: [PATCH] [DSK] Implement Victor, Valgavoth's Senechal --- .../cards/v/VictorValgavothsSeneschal.java | 94 +++++++++++++++++++ .../src/mage/sets/DuskmournHouseOfHorror.java | 1 + 2 files changed, 95 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/VictorValgavothsSeneschal.java diff --git a/Mage.Sets/src/mage/cards/v/VictorValgavothsSeneschal.java b/Mage.Sets/src/mage/cards/v/VictorValgavothsSeneschal.java new file mode 100644 index 00000000000..5217fc9b55e --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VictorValgavothsSeneschal.java @@ -0,0 +1,94 @@ +package mage.cards.v; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.abilityword.EerieAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.IfAbilityHasResolvedXTimesEffect; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.abilities.effects.keyword.SurveilEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInGraveyard; +import mage.watchers.common.AbilityResolvedWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class VictorValgavothsSeneschal extends CardImpl { + + public VictorValgavothsSeneschal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WARLOCK); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Eerie -- Whenever an enchantment you control enters and whenever you fully unlock a Room, surveil 2 if this is the first time this ability has resolved this turn. If it's the second time, each opponent discards a card. If it's the third time, put a creature card from a graveyard onto the battlefield under your control. + Ability ability = new EerieAbility( + new IfAbilityHasResolvedXTimesEffect(1, new SurveilEffect(2)) + .setText("surveil 2 if this is the first time this ability has resolved this turn") + ); + ability.addEffect(new IfAbilityHasResolvedXTimesEffect( + 2, new DiscardEachPlayerEffect(TargetController.OPPONENT) + ).setText("If it's the second time, each opponent discards a card")); + ability.addEffect(new VictorValgavothsSeneschalEffect()); + this.addAbility(ability, new AbilityResolvedWatcher()); + } + + private VictorValgavothsSeneschal(final VictorValgavothsSeneschal card) { + super(card); + } + + @Override + public VictorValgavothsSeneschal copy() { + return new VictorValgavothsSeneschal(this); + } +} + +class VictorValgavothsSeneschalEffect extends OneShotEffect { + + VictorValgavothsSeneschalEffect() { + super(Outcome.Benefit); + staticText = "If it's the third time, put a creature card " + + "from a graveyard onto the battlefield under your control"; + } + + private VictorValgavothsSeneschalEffect(final VictorValgavothsSeneschalEffect effect) { + super(effect); + } + + @Override + public VictorValgavothsSeneschalEffect copy() { + return new VictorValgavothsSeneschalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + if (AbilityResolvedWatcher.getResolutionCount(game, source) != 3) { + return false; + } + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetCard target = new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE); + target.withNotTarget(true); + if (!target.canChoose(source.getControllerId(), source, game)) { + return false; + } + player.choose(outcome, target, source, game); + Card card = game.getCard(target.getFirstTarget()); + return card != null && player.moveCards(card, Zone.BATTLEFIELD, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java index d6ad7673c76..e9b978eb875 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java @@ -112,6 +112,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet { cards.add(new SetCardInfo("Valgavoth's Lair", 271, Rarity.RARE, mage.cards.v.ValgavothsLair.class)); cards.add(new SetCardInfo("Veteran Survivor", 40, Rarity.UNCOMMON, mage.cards.v.VeteranSurvivor.class)); cards.add(new SetCardInfo("Vicious Clown", 163, Rarity.COMMON, mage.cards.v.ViciousClown.class)); + cards.add(new SetCardInfo("Victor, Valgavoth's Seneschal", 238, Rarity.RARE, mage.cards.v.VictorValgavothsSeneschal.class)); cards.add(new SetCardInfo("Winter, Misanthropic Guide", 240, Rarity.RARE, mage.cards.w.WinterMisanthropicGuide.class)); cards.add(new SetCardInfo("Zimone, All-Questioning", 241, Rarity.RARE, mage.cards.z.ZimoneAllQuestioning.class));