Fix game log revealing opponent's morphed creatures in messages.

This commit is contained in:
Myrd
2014-12-01 06:09:54 +00:00
parent b3a2ca8291
commit 319cd97d83
4 changed files with 9 additions and 24 deletions

View File

@@ -27,12 +27,7 @@ public class DestroyEffect extends SpellAbilityEffect {
final Iterator<Card> it = tgtCards.iterator();
while (it.hasNext()) {
final Card tgtC = it.next();
if (tgtC.isFaceDown()) {
sb.append("Morph ").append("(").append(tgtC.getId()).append(")");
} else {
sb.append(tgtC);
}
sb.append(it.next());
if (it.hasNext()) {
sb.append(", ");

View File

@@ -26,12 +26,7 @@ public class SetStateEffect extends SpellAbilityEffect {
final Iterator<Card> it = tgtCards.iterator();
while (it.hasNext()) {
final Card tgtC = it.next();
if (tgtC.isFaceDown()) {
sb.append("Morph ").append("(").append(tgtC.getId()).append(")");
} else {
sb.append(tgtC);
}
sb.append(it.next());
if (it.hasNext()) {
sb.append(", ");

View File

@@ -3120,10 +3120,13 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
/** {@inheritDoc} */
@Override
public final String toString() {
String name = getName();
String name = "Morph";
if (!isFaceDown()) {
name = getName();
if (StringUtils.isEmpty(name) && paperCard != null) {
name = paperCard.getName(); //make it possible to see likely card name before it's set
}
}
return name + " (" + id + ")";
}

View File

@@ -935,15 +935,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
resetTargets();
targetChosen.add(card);
final String desc;
if (!card.isFaceDown()) {
desc = getHostCard().getName() + " - targeting " + card;
}
else {
desc = getHostCard().getName() + " - targeting Morph(" + card.getId() + ")";
}
setStackDescription(desc);
setStackDescription(getHostCard().getName() + " - targeting " + card);
}
/**