mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Card: fixed description output of Morph, MegaMorph, Madness and Emerge
This commit is contained in:
@@ -46,6 +46,7 @@ import forge.game.replacement.ReplaceMoved;
|
|||||||
import forge.game.replacement.ReplacementEffect;
|
import forge.game.replacement.ReplacementEffect;
|
||||||
import forge.game.replacement.ReplacementResult;
|
import forge.game.replacement.ReplacementResult;
|
||||||
import forge.game.spellability.OptionalCost;
|
import forge.game.spellability.OptionalCost;
|
||||||
|
import forge.game.spellability.Spell;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.spellability.SpellPermanent;
|
import forge.game.spellability.SpellPermanent;
|
||||||
import forge.game.spellability.TargetRestrictions;
|
import forge.game.spellability.TargetRestrictions;
|
||||||
@@ -1339,23 +1340,11 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
} else {
|
} else {
|
||||||
sbLong.append(parts[0]).append(" ").append(ManaCostParser.parse(parts[1])).append("\r\n");
|
sbLong.append(parts[0]).append(" ").append(ManaCostParser.parse(parts[1])).append("\r\n");
|
||||||
}
|
}
|
||||||
} else if (keyword.startsWith("Morph")) {
|
} else if (keyword.startsWith("Morph") || keyword.startsWith("Megamorph")) {
|
||||||
sbLong.append("Morph");
|
String[] k = keyword.split(":");
|
||||||
|
sbLong.append(k[0]);
|
||||||
if (keyword.contains(":")) {
|
if (keyword.contains(":")) {
|
||||||
final Cost mCost = new Cost(keyword.substring(6), true);
|
final Cost mCost = new Cost(k[1], true);
|
||||||
if (!mCost.isOnlyManaCost()) {
|
|
||||||
sbLong.append(" -");
|
|
||||||
}
|
|
||||||
sbLong.append(" ").append(mCost.toString()).delete(sbLong.length() - 2, sbLong.length());
|
|
||||||
if (!mCost.isOnlyManaCost()) {
|
|
||||||
sbLong.append(".");
|
|
||||||
}
|
|
||||||
sbLong.append("\r\n");
|
|
||||||
}
|
|
||||||
} else if (keyword.startsWith("Megamorph")) {
|
|
||||||
sbLong.append("Megamorph");
|
|
||||||
if (keyword.contains(":")) {
|
|
||||||
final Cost mCost = new Cost(keyword.substring(10), true);
|
|
||||||
if (!mCost.isOnlyManaCost()) {
|
if (!mCost.isOnlyManaCost()) {
|
||||||
sbLong.append(" -");
|
sbLong.append(" -");
|
||||||
}
|
}
|
||||||
@@ -1363,8 +1352,14 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
if (!mCost.isOnlyManaCost()) {
|
if (!mCost.isOnlyManaCost()) {
|
||||||
sbLong.append(".");
|
sbLong.append(".");
|
||||||
}
|
}
|
||||||
|
sbLong.append(" (" + Keyword.getInstance(keyword).getReminderText() + ")");
|
||||||
sbLong.append("\r\n");
|
sbLong.append("\r\n");
|
||||||
}
|
}
|
||||||
|
} else if (keyword.startsWith("Emerge")) {
|
||||||
|
final String[] k = keyword.split(" ", 2);
|
||||||
|
sbLong.append(k[0]).append(" ").append(ManaCostParser.parse(k[1]));
|
||||||
|
sbLong.append(" (" + Keyword.getInstance(keyword).getReminderText() + ")");
|
||||||
|
sbLong.append("\r\n");
|
||||||
} else if (keyword.startsWith("Echo")) {
|
} else if (keyword.startsWith("Echo")) {
|
||||||
sbLong.append("Echo ");
|
sbLong.append("Echo ");
|
||||||
final String[] upkeepCostParams = keyword.split(":");
|
final String[] upkeepCostParams = keyword.split(":");
|
||||||
@@ -1677,6 +1672,11 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// should not print Spelldescription for Morph
|
||||||
|
if (sa instanceof Spell && ((Spell)sa).isCastFaceDown()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
boolean isNonAuraPermanent = (sa instanceof SpellPermanent) && isNonAura;
|
boolean isNonAuraPermanent = (sa instanceof SpellPermanent) && isNonAura;
|
||||||
if (isNonAuraPermanent && primaryCost) {
|
if (isNonAuraPermanent && primaryCost) {
|
||||||
// For Alt costs, make sure to display the cost!
|
// For Alt costs, make sure to display the cost!
|
||||||
@@ -1757,7 +1757,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|
|
||||||
// Replacement effects
|
// Replacement effects
|
||||||
for (final ReplacementEffect replacementEffect : state.getReplacementEffects()) {
|
for (final ReplacementEffect replacementEffect : state.getReplacementEffects()) {
|
||||||
sb.append(replacementEffect.toString()).append("\r\n");
|
if (!replacementEffect.isSecondary()) {
|
||||||
|
sb.append(replacementEffect.toString()).append("\r\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// static abilities
|
// static abilities
|
||||||
@@ -1775,7 +1777,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|| (keyword.startsWith("Dredge") && !sb.toString().contains("Dredge"))
|
|| (keyword.startsWith("Dredge") && !sb.toString().contains("Dredge"))
|
||||||
|| (keyword.startsWith("CARDNAME is ") && !sb.toString().contains("CARDNAME is "))) {
|
|| (keyword.startsWith("CARDNAME is ") && !sb.toString().contains("CARDNAME is "))) {
|
||||||
sb.append(keyword.replace(":", " ")).append("\r\n");
|
sb.append(keyword.replace(":", " ")).append("\r\n");
|
||||||
} else if ((keyword.startsWith("Madness") && !sb.toString().contains("Madness"))
|
} else if (keyword.startsWith("Madness")
|
||||||
|| (keyword.startsWith("Recover") && !sb.toString().contains("Recover"))
|
|| (keyword.startsWith("Recover") && !sb.toString().contains("Recover"))
|
||||||
|| (keyword.startsWith("Miracle") && !sb.toString().contains("Miracle"))) {
|
|| (keyword.startsWith("Miracle") && !sb.toString().contains("Miracle"))) {
|
||||||
String[] parts = keyword.split(":");
|
String[] parts = keyword.split(":");
|
||||||
@@ -1802,11 +1804,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sb.append("\r\n");
|
sb.append("\r\n");
|
||||||
} else if (keyword.startsWith("Emerge")) {
|
|
||||||
final Cost cost = new Cost(keyword.substring(7), false);
|
|
||||||
sb.append("Emerge ").append(cost.toSimpleString());
|
|
||||||
sb.append(" (You may cast this spell by sacrificing a creature and paying the emerge cost reduced by that creature's converted mana cost.)");
|
|
||||||
sb.append("\r\n");
|
|
||||||
} else if (keyword.startsWith("Splice")) {
|
} else if (keyword.startsWith("Splice")) {
|
||||||
final Cost cost = new Cost(keyword.substring(19), false);
|
final Cost cost = new Cost(keyword.substring(19), false);
|
||||||
sb.append("Splice onto Arcane ").append(cost.toSimpleString()).append("\r\n");
|
sb.append("Splice onto Arcane ").append(cost.toSimpleString()).append("\r\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user