mirror of
https://github.com/correl/mage.git
synced 2025-04-13 17:00:09 -09:00
* Necropotence - Fixed that card name was shown as target for face down cards on stack or if player selects order of triggered effects.
This commit is contained in:
parent
c08d266fce
commit
e57aee7fcb
3 changed files with 19 additions and 9 deletions
Mage.Common/src/mage/view
Mage.Sets/src/mage/sets/iceage
|
@ -28,18 +28,27 @@
|
||||||
|
|
||||||
package mage.view;
|
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.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.cards.Card;
|
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.Game;
|
||||||
import mage.game.GameState;
|
import mage.game.GameState;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.targetpointer.TargetPointer;
|
import mage.target.targetpointer.TargetPointer;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
@ -81,11 +90,11 @@ public class CardsView extends LinkedHashMap<UUID, CardView> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (sourceCard != null) {
|
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) {
|
if (ability.getTargets().size() > 0) {
|
||||||
abilityView.setTargets(ability.getTargets());
|
abilityView.setTargets(ability.getTargets());
|
||||||
} else {
|
} else {
|
||||||
List<UUID> abilityTargets = new ArrayList<UUID>();
|
List<UUID> abilityTargets = new ArrayList<>();
|
||||||
for (Effect effect : ability.getEffects()) {
|
for (Effect effect : ability.getEffects()) {
|
||||||
TargetPointer targetPointer = effect.getTargetPointer();
|
TargetPointer targetPointer = effect.getTargetPointer();
|
||||||
if (targetPointer != null) {
|
if (targetPointer != null) {
|
||||||
|
@ -95,11 +104,11 @@ public class CardsView extends LinkedHashMap<UUID, CardView> {
|
||||||
}
|
}
|
||||||
if (!abilityTargets.isEmpty()) {
|
if (!abilityTargets.isEmpty()) {
|
||||||
abilityView.overrideTargets(abilityTargets);
|
abilityView.overrideTargets(abilityTargets);
|
||||||
List<String> names = new ArrayList<String>();
|
List<String> names = new ArrayList<>();
|
||||||
for (UUID uuid : abilityTargets) {
|
for (UUID uuid : abilityTargets) {
|
||||||
MageObject mageObject = game.getObject(uuid);
|
MageObject mageObject = game.getObject(uuid);
|
||||||
if (mageObject != null) {
|
if (mageObject != null) {
|
||||||
names.add(mageObject.getName());
|
names.add(mageObject.getLogName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!names.isEmpty()) {
|
if (!names.isEmpty()) {
|
||||||
|
@ -116,7 +125,7 @@ public class CardsView extends LinkedHashMap<UUID, CardView> {
|
||||||
for (Ability ability: abilities) {
|
for (Ability ability: abilities) {
|
||||||
Card sourceCard = state.getPermanent(ability.getSourceId());
|
Card sourceCard = state.getPermanent(ability.getSourceId());
|
||||||
if (sourceCard != null) {
|
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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class StackAbilityView extends CardView {
|
||||||
for (UUID uuid : targetList) {
|
for (UUID uuid : targetList) {
|
||||||
MageObject mageObject = game.getObject(uuid);
|
MageObject mageObject = game.getObject(uuid);
|
||||||
if (mageObject != null) {
|
if (mageObject != null) {
|
||||||
names.add(mageObject.getName());
|
names.add(mageObject.getLogName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,7 @@ class NecropotenceEffect extends OneShotEffect {
|
||||||
card.setFaceDown(true);
|
card.setFaceDown(true);
|
||||||
if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY)) {
|
if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY)) {
|
||||||
Effect returnToHandeffect = new ReturnToHandTargetEffect();
|
Effect returnToHandeffect = new ReturnToHandTargetEffect();
|
||||||
|
returnToHandeffect.setText("put that face down card into your hand");
|
||||||
returnToHandeffect.setTargetPointer(new FixedTarget(card.getId()));
|
returnToHandeffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||||
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(returnToHandeffect, TargetController.YOU);
|
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(returnToHandeffect, TargetController.YOU);
|
||||||
delayedAbility.setSourceId(source.getSourceId());
|
delayedAbility.setSourceId(source.getSourceId());
|
||||||
|
|
Loading…
Add table
Reference in a new issue