mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
- Fixed Disciple of Phenax and Ghastlord of Fugue.
This commit is contained in:
parent
ca52e0bf38
commit
033ad94b8b
3 changed files with 22 additions and 17 deletions
|
@ -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<UUID> targets = chosenCards.getTargets();
|
||||
for (UUID targetid : targets) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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<UUID> 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);
|
||||
|
|
Loading…
Reference in a new issue