From e57aee7fcb1959850cf6ce1d6067926e3e279fa0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 20 Jun 2014 01:04:28 +0200 Subject: [PATCH] * Necropotence - Fixed that card name was shown as target for face down cards on stack or if player selects order of triggered effects. --- Mage.Common/src/mage/view/CardsView.java | 25 +++++++++++++------ .../src/mage/view/StackAbilityView.java | 2 +- .../src/mage/sets/iceage/Necropotence.java | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Mage.Common/src/mage/view/CardsView.java b/Mage.Common/src/mage/view/CardsView.java index a505a2e90f5..e9b772161b2 100644 --- a/Mage.Common/src/mage/view/CardsView.java +++ b/Mage.Common/src/mage/view/CardsView.java @@ -28,18 +28,27 @@ package mage.view; -import mage.constants.Zone; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.Effect; import mage.cards.Card; +import mage.constants.Zone; +import static mage.constants.Zone.ALL; +import static mage.constants.Zone.BATTLEFIELD; +import static mage.constants.Zone.COMMAND; +import static mage.constants.Zone.EXILED; +import static mage.constants.Zone.GRAVEYARD; +import static mage.constants.Zone.STACK; import mage.game.Game; import mage.game.GameState; import mage.game.permanent.Permanent; import mage.target.targetpointer.TargetPointer; -import java.util.*; - /** * * @author BetaSteward_at_googlemail.com @@ -81,11 +90,11 @@ public class CardsView extends LinkedHashMap { break; } if (sourceCard != null) { - AbilityView abilityView = new AbilityView(ability, sourceCard.getName(), new CardView(sourceCard)); + AbilityView abilityView = new AbilityView(ability, sourceCard.getLogName(), new CardView(sourceCard)); if (ability.getTargets().size() > 0) { abilityView.setTargets(ability.getTargets()); } else { - List abilityTargets = new ArrayList(); + List abilityTargets = new ArrayList<>(); for (Effect effect : ability.getEffects()) { TargetPointer targetPointer = effect.getTargetPointer(); if (targetPointer != null) { @@ -95,11 +104,11 @@ public class CardsView extends LinkedHashMap { } if (!abilityTargets.isEmpty()) { abilityView.overrideTargets(abilityTargets); - List names = new ArrayList(); + List names = new ArrayList<>(); for (UUID uuid : abilityTargets) { MageObject mageObject = game.getObject(uuid); if (mageObject != null) { - names.add(mageObject.getName()); + names.add(mageObject.getLogName()); } } if (!names.isEmpty()) { @@ -116,7 +125,7 @@ public class CardsView extends LinkedHashMap { for (Ability ability: abilities) { Card sourceCard = state.getPermanent(ability.getSourceId()); if (sourceCard != null) { - this.put(ability.getId(), new AbilityView(ability, sourceCard.getName(), new CardView(sourceCard))); + this.put(ability.getId(), new AbilityView(ability, sourceCard.getLogName(), new CardView(sourceCard))); } } } diff --git a/Mage.Common/src/mage/view/StackAbilityView.java b/Mage.Common/src/mage/view/StackAbilityView.java index deeacb9be92..0f7c4249b82 100644 --- a/Mage.Common/src/mage/view/StackAbilityView.java +++ b/Mage.Common/src/mage/view/StackAbilityView.java @@ -90,7 +90,7 @@ public class StackAbilityView extends CardView { for (UUID uuid : targetList) { MageObject mageObject = game.getObject(uuid); if (mageObject != null) { - names.add(mageObject.getName()); + names.add(mageObject.getLogName()); } } diff --git a/Mage.Sets/src/mage/sets/iceage/Necropotence.java b/Mage.Sets/src/mage/sets/iceage/Necropotence.java index 532eab1d043..73d1bd18830 100644 --- a/Mage.Sets/src/mage/sets/iceage/Necropotence.java +++ b/Mage.Sets/src/mage/sets/iceage/Necropotence.java @@ -139,6 +139,7 @@ class NecropotenceEffect extends OneShotEffect { card.setFaceDown(true); if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY)) { Effect returnToHandeffect = new ReturnToHandTargetEffect(); + returnToHandeffect.setText("put that face down card into your hand"); returnToHandeffect.setTargetPointer(new FixedTarget(card.getId())); DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(returnToHandeffect, TargetController.YOU); delayedAbility.setSourceId(source.getSourceId());