Card: fix faulty SpellDescriptions, skip BasicSpells

This commit is contained in:
Hans Mackowiak
2021-04-09 20:57:36 +02:00
parent 8e4d07163d
commit 36c7f1244d

View File

@@ -2290,8 +2290,6 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
} }
final List<String> addedManaStrings = Lists.newArrayList(); final List<String> addedManaStrings = Lists.newArrayList();
boolean primaryCost = true;
boolean isNonAura = !type.hasSubtype("Aura");
for (final SpellAbility sa : state.getSpellAbilities()) { for (final SpellAbility sa : state.getSpellAbilities()) {
// This code block is not shared by instants or sorceries. We don't need to check for permanence. // This code block is not shared by instants or sorceries. We don't need to check for permanence.
@@ -2299,15 +2297,13 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
continue; continue;
} }
// should not print Spelldescription for Morph // skip Basic Spells
if (sa.isCastFaceDown()) { if (sa.isSpell() && sa.isBasicSpell()) {
continue; continue;
} }
boolean isNonAuraPermanent = (sa instanceof SpellPermanent) && isNonAura; // should not print Spelldescription for Morph
if (isNonAuraPermanent && primaryCost) { if (sa.isCastFaceDown()) {
// For Alt costs, make sure to display the cost!
primaryCost = false;
continue; continue;
} }
@@ -2332,10 +2328,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
addedManaStrings.add(sAbility); addedManaStrings.add(sAbility);
} }
if (isNonAuraPermanent) { if (!sAbility.endsWith(state.getName() + "\r\n")) {
sb.insert(0, "\r\n");
sb.insert(0, sAbility);
} else if (!sAbility.endsWith(state.getName() + "\r\n")) {
sb.append(sAbility); sb.append(sAbility);
sb.append("\r\n"); sb.append("\r\n");
} }