From 033ad94b8b4ec8869f6f31c5b5db981e6a298b92 Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Thu, 13 Feb 2020 09:34:56 -0600 Subject: [PATCH] - Fixed Disciple of Phenax and Ghastlord of Fugue. --- Mage.Sets/src/mage/cards/d/DiscipleOfPhenax.java | 10 ++++++---- Mage.Sets/src/mage/cards/g/GhastlordOfFugue.java | 15 ++++++++------- .../discard/DiscardCardYouChooseTargetEffect.java | 14 ++++++++------ 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DiscipleOfPhenax.java b/Mage.Sets/src/mage/cards/d/DiscipleOfPhenax.java index 7ac0707d67..57d0d567fa 100644 --- a/Mage.Sets/src/mage/cards/d/DiscipleOfPhenax.java +++ b/Mage.Sets/src/mage/cards/d/DiscipleOfPhenax.java @@ -15,7 +15,6 @@ import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; import mage.target.TargetPlayer; -import mage.target.common.TargetCardInHand; import java.util.List; import java.util.UUID; @@ -56,7 +55,9 @@ class DiscipleOfPhenaxEffect extends OneShotEffect { DiscipleOfPhenaxEffect() { super(Outcome.Discard); - staticText = "target player reveals a number of cards from their hand equal to your devotion to black. You choose one of them. That player discards that card"; + staticText = "target player reveals a number of cards from their hand " + + "equal to your devotion to black. You choose one of " + + "them. That player discards that card"; } private DiscipleOfPhenaxEffect(final DiscipleOfPhenaxEffect effect) { @@ -79,9 +80,10 @@ class DiscipleOfPhenaxEffect extends OneShotEffect { int amount = Math.min(targetPlayer.getHand().size(), devotion); if (targetPlayer.getHand().size() > amount) { FilterCard filter = new FilterCard("card in target player's hand"); - TargetCardInHand chosenCards = new TargetCardInHand(amount, amount, filter); + TargetCard chosenCards = new TargetCard(amount, amount, Zone.HAND, filter); chosenCards.setNotTarget(true); - if (chosenCards.canChoose(targetPlayer.getId(), game) && targetPlayer.choose(Outcome.Discard, targetPlayer.getHand(), chosenCards, game)) { + if (chosenCards.canChoose(targetPlayer.getId(), game) + && targetPlayer.choose(Outcome.Discard, targetPlayer.getHand(), chosenCards, game)) { if (!chosenCards.getTargets().isEmpty()) { List targets = chosenCards.getTargets(); for (UUID targetid : targets) { diff --git a/Mage.Sets/src/mage/cards/g/GhastlordOfFugue.java b/Mage.Sets/src/mage/cards/g/GhastlordOfFugue.java index 4f07d3c6b6..bc89e9194c 100644 --- a/Mage.Sets/src/mage/cards/g/GhastlordOfFugue.java +++ b/Mage.Sets/src/mage/cards/g/GhastlordOfFugue.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -20,7 +19,7 @@ import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; -import mage.target.common.TargetCardInHand; +import mage.target.TargetCard; /** * @@ -29,7 +28,7 @@ import mage.target.common.TargetCardInHand; public final class GhastlordOfFugue extends CardImpl { public GhastlordOfFugue(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U/B}{U/B}{U/B}{U/B}{U/B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U/B}{U/B}{U/B}{U/B}{U/B}"); this.subtype.add(SubType.SPIRIT); this.subtype.add(SubType.AVATAR); @@ -37,9 +36,11 @@ public final class GhastlordOfFugue extends CardImpl { this.toughness = new MageInt(4); // Ghastlord of Fugue can't be blocked. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedSourceEffect(Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new CantBeBlockedSourceEffect(Duration.WhileOnBattlefield))); - // Whenever Ghastlord of Fugue deals combat damage to a player, that player reveals their hand. You choose a card from it. That player exiles that card. + // Whenever Ghastlord of Fugue deals combat damage to a player, + // that player reveals their hand. You choose a card from it. That player exiles that card. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new GhastlordOfFugueEffect(), false, true)); } @@ -78,10 +79,10 @@ class GhastlordOfFugueEffect extends OneShotEffect { targetPlayer.revealCards(sourceObject.getName(), targetPlayer.getHand(), game); // You choose a card from it - TargetCardInHand target = new TargetCardInHand(new FilterCard()); + TargetCard target = new TargetCard(Zone.HAND, new FilterCard()); target.setNotTarget(true); Card chosenCard = null; - if (controller.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) { + if (controller.chooseTarget(Outcome.Benefit, targetPlayer.getHand(), target, source, game)) { chosenCard = game.getCard(target.getFirstTarget()); } if (chosenCard != null) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java index 5e2d1d1193..d48b78dc8e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java @@ -15,9 +15,7 @@ import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; -import mage.target.common.TargetCardInHand; import mage.util.CardUtil; - import java.util.List; import java.util.UUID; @@ -74,7 +72,8 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect { this(StaticValue.get(1), filter, targetController); } - public DiscardCardYouChooseTargetEffect(DynamicValue numberCardsToDiscard, FilterCard filter, TargetController targetController) { + public DiscardCardYouChooseTargetEffect(DynamicValue numberCardsToDiscard, + FilterCard filter, TargetController targetController) { super(Outcome.Discard); this.targetController = targetController; this.filter = filter; @@ -112,9 +111,11 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect { Cards revealedCards = new CardsImpl(); numberToReveal = Math.min(player.getHand().size(), numberToReveal); if (player.getHand().size() > numberToReveal) { - TargetCardInHand chosenCards = new TargetCardInHand(numberToReveal, numberToReveal, new FilterCard("card in " + player.getName() + "'s hand")); + TargetCard chosenCards = new TargetCard(numberToReveal, numberToReveal, + Zone.HAND, new FilterCard("card in " + player.getName() + "'s hand")); chosenCards.setNotTarget(true); - if (chosenCards.canChoose(player.getId(), game) && player.chooseTarget(Outcome.Discard, player.getHand(), chosenCards, source, game)) { + if (chosenCards.canChoose(player.getId(), game) + && player.chooseTarget(Outcome.Discard, player.getHand(), chosenCards, source, game)) { if (!chosenCards.getTargets().isEmpty()) { List targets = chosenCards.getTargets(); for (UUID targetid : targets) { @@ -130,7 +131,8 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect { } Card sourceCard = game.getCard(source.getSourceId()); - player.revealCards(sourceCard != null ? sourceCard.getIdName() + " (" + sourceCard.getZoneChangeCounter(game) + ')' : "Discard", revealedCards, game); + player.revealCards(sourceCard != null ? sourceCard.getIdName() + " (" + + sourceCard.getZoneChangeCounter(game) + ')' : "Discard", revealedCards, game); boolean result = true; int filteredCardsCount = revealedCards.count(filter, source.getSourceId(), source.getControllerId(), game);