From 47dc1d8d6161e379a5e9a286b79add7ed0426a1d Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 24 Feb 2021 11:07:36 -0600 Subject: [PATCH] - T, V, U cards: A player now moves the card/permanent to a zone. --- Mage.Sets/src/mage/cards/t/TaintedPact.java | 38 +++++++++---------- Mage.Sets/src/mage/cards/u/Umbilicus.java | 10 ++--- .../cards/u/UneshCriosphinxSovereign.java | 9 ++++- Mage.Sets/src/mage/cards/v/VaporSnare.java | 9 +++-- 4 files changed, 36 insertions(+), 30 deletions(-) diff --git a/Mage.Sets/src/mage/cards/t/TaintedPact.java b/Mage.Sets/src/mage/cards/t/TaintedPact.java index fd4c38f0c4..5213e24603 100644 --- a/Mage.Sets/src/mage/cards/t/TaintedPact.java +++ b/Mage.Sets/src/mage/cards/t/TaintedPact.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.HashSet; @@ -17,13 +16,13 @@ import mage.players.Player; /** * - * @author cbt33, Ad Nauseum (North), Izzet Staticaster (LevelX2), Bane Alley Broker (LevelX2) + * @author cbt33, Ad Nauseum (North), Izzet Staticaster (LevelX2), Bane Alley + * Broker (LevelX2) */ public final class TaintedPact extends CardImpl { public TaintedPact(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}"); // Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first. this.getSpellAbility().addEffect(new TaintedPactEffect()); @@ -39,9 +38,9 @@ public final class TaintedPact extends CardImpl { } } -class TaintedPactEffect extends OneShotEffect{ - - public TaintedPactEffect() { +class TaintedPactEffect extends OneShotEffect { + + public TaintedPactEffect() { super(Outcome.DrawCard); this.staticText = "Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first"; } @@ -54,28 +53,29 @@ class TaintedPactEffect extends OneShotEffect{ public TaintedPactEffect copy() { return new TaintedPactEffect(this); } - + @Override - public boolean apply(Game game, Ability source) { - Card sourceCard = game.getCard(source.getSourceId()); - Player player = game.getPlayer(source.getControllerId()); - if (player == null || sourceCard == null) { + public boolean apply(Game game, Ability source) { + Card sourceCard = game.getCard(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null + || sourceCard == null) { return false; } Set names = new HashSet<>(); - while (player.canRespond() && player.getLibrary().hasCards()) { - Card card = player.getLibrary().getFromTop(game); + while (controller.canRespond() + && controller.getLibrary().hasCards()) { + Card card = controller.getLibrary().getFromTop(game); if (card != null) { - - card.moveToExile(null, null, source, game); + controller.moveCards(card, Zone.EXILED, source, game); // Checks if there was already exiled a card with the same name if (names.contains(card.getName())) { break; } names.add(card.getName()); - if (player.chooseUse(outcome, "Put " + card.getName() + " into your hand?", source, game)) { - //Adds the current card to hand if it is chosen. - card.moveToZone(Zone.HAND, source, game, true); + if (controller.chooseUse(outcome, "Put " + card.getName() + " into your hand?", source, game)) { + //Adds the current card to hand if it is chosen. + controller.moveCards(card, Zone.HAND, source, game); break; } } diff --git a/Mage.Sets/src/mage/cards/u/Umbilicus.java b/Mage.Sets/src/mage/cards/u/Umbilicus.java index ee4024bedf..e1a6e26fc7 100644 --- a/Mage.Sets/src/mage/cards/u/Umbilicus.java +++ b/Mage.Sets/src/mage/cards/u/Umbilicus.java @@ -1,4 +1,3 @@ - package mage.cards.u; import java.util.UUID; @@ -24,7 +23,7 @@ import mage.target.common.TargetControlledPermanent; public final class Umbilicus extends CardImpl { public Umbilicus(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); // At the beginning of each player's upkeep, that player returns a permanent they control to its owner's hand unless they pay 2 life. Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new BloodClockEffect(), TargetController.ANY, false, true); @@ -63,7 +62,8 @@ class BloodClockEffect extends OneShotEffect { if (player == null) { return false; } - if (player.getLife() > 2 && player.chooseUse(Outcome.Neutral, "Pay 2 life? If you don't, return a permanent you control to its owner's hand.", source, game)) { + if (player.getLife() > 2 + && player.chooseUse(Outcome.Neutral, "Pay 2 life? If you don't, return a permanent you control to its owner's hand.", source, game)) { player.loseLife(2, game, source, false); game.informPlayers(player.getLogName() + " pays 2 life. They will not return a permanent they control."); return true; @@ -73,10 +73,10 @@ class BloodClockEffect extends OneShotEffect { Permanent permanent = game.getPermanent(target.getFirstTarget()); if (permanent != null) { game.informPlayers(player.getLogName() + " returns " + permanent.getName() + " to hand."); - return permanent.moveToZone(Zone.HAND, source, game, false); + return player.moveCards(permanent, Zone.HAND, source, game); } } } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java b/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java index 2b60a7057a..50f04bb915 100644 --- a/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java +++ b/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java @@ -19,6 +19,7 @@ import mage.target.TargetCard; import mage.target.common.TargetOpponent; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import java.util.UUID; @@ -84,6 +85,8 @@ class UneshCriosphinxSovereignEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); + Set cardsToGraveyard = new LinkedHashSet<>(); + Set cardsToHand = new LinkedHashSet<>(); MageObject sourceObject = source.getSourceObject(game); if (controller == null || sourceObject == null) { return false; @@ -134,8 +137,9 @@ class UneshCriosphinxSovereignEffect extends OneShotEffect { if (i < pile1.size()) { sb.append(", "); } - card.moveToZone(pile1Zone, source, game, false); + cardsToGraveyard.add(card); } + controller.moveCards(cardsToGraveyard, pile1Zone, source, game); game.informPlayers(sb.toString()); sb = new StringBuilder("Pile 2, going to ").append(pile2Zone == Zone.HAND ? "Hand" : "Graveyard").append(':'); @@ -146,8 +150,9 @@ class UneshCriosphinxSovereignEffect extends OneShotEffect { if (i < pile2.size()) { sb.append(", "); } - card.moveToZone(pile2Zone, source, game, false); + cardsToHand.add(card); } + controller.moveCards(cardsToHand, pile2Zone, source, game); game.informPlayers(sb.toString()); } diff --git a/Mage.Sets/src/mage/cards/v/VaporSnare.java b/Mage.Sets/src/mage/cards/v/VaporSnare.java index 1f5aa7e7da..2fba8df657 100644 --- a/Mage.Sets/src/mage/cards/v/VaporSnare.java +++ b/Mage.Sets/src/mage/cards/v/VaporSnare.java @@ -76,16 +76,17 @@ class VaporSnareEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { boolean targetChosen = false; - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); TargetPermanent target = new TargetPermanent(1, 1, filter, false); - if (player != null && target.canChoose(source.getSourceId(), player.getId(), game)) { - player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + if (controller != null + && target.canChoose(source.getSourceId(), controller.getId(), game)) { + controller.choose(Outcome.Sacrifice, target, source.getSourceId(), game); Permanent permanent = game.getPermanent(target.getFirstTarget()); if ( permanent != null ) { targetChosen = true; - permanent.moveToZone(Zone.HAND, source, game, false); + controller.moveCards(permanent, Zone.HAND, source, game); } }