mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Fix so phyrexian mana symbols display properly in generated card images
This commit is contained in:
@@ -56,11 +56,11 @@ public enum ManaCostShard implements Comparable<ManaCostShard> {
|
|||||||
COLORLESS(ManaAtom.COLORLESS, "1"),
|
COLORLESS(ManaAtom.COLORLESS, "1"),
|
||||||
|
|
||||||
/* Phyrexian */
|
/* Phyrexian */
|
||||||
PW(ManaAtom.WHITE | ManaAtom.OR_2_LIFE, "W/P", "PW"),
|
PW(ManaAtom.WHITE | ManaAtom.OR_2_LIFE, "P/W", "PW"),
|
||||||
PU(ManaAtom.BLUE | ManaAtom.OR_2_LIFE, "U/P", "PU"),
|
PU(ManaAtom.BLUE | ManaAtom.OR_2_LIFE, "P/U", "PU"),
|
||||||
PB(ManaAtom.BLACK | ManaAtom.OR_2_LIFE, "B/P", "PB"),
|
PB(ManaAtom.BLACK | ManaAtom.OR_2_LIFE, "P/B", "PB"),
|
||||||
PR(ManaAtom.RED | ManaAtom.OR_2_LIFE, "R/P", "PR"),
|
PR(ManaAtom.RED | ManaAtom.OR_2_LIFE, "P/R", "PR"),
|
||||||
PG(ManaAtom.GREEN | ManaAtom.OR_2_LIFE, "G/P", "PG"),
|
PG(ManaAtom.GREEN | ManaAtom.OR_2_LIFE, "P/G", "PG"),
|
||||||
|
|
||||||
X(ManaAtom.IS_X, "X");
|
X(ManaAtom.IS_X, "X");
|
||||||
|
|
||||||
|
|||||||
@@ -1187,11 +1187,11 @@ public class FSkin {
|
|||||||
addEncodingSymbol("2/B", FSkinProp.IMG_MANA_2B);
|
addEncodingSymbol("2/B", FSkinProp.IMG_MANA_2B);
|
||||||
addEncodingSymbol("2/R", FSkinProp.IMG_MANA_2R);
|
addEncodingSymbol("2/R", FSkinProp.IMG_MANA_2R);
|
||||||
addEncodingSymbol("2/G", FSkinProp.IMG_MANA_2G);
|
addEncodingSymbol("2/G", FSkinProp.IMG_MANA_2G);
|
||||||
addEncodingSymbol("W/P", FSkinProp.IMG_MANA_PHRYX_W);
|
addEncodingSymbol("P/W", FSkinProp.IMG_MANA_PHRYX_W);
|
||||||
addEncodingSymbol("U/P", FSkinProp.IMG_MANA_PHRYX_U);
|
addEncodingSymbol("P/U", FSkinProp.IMG_MANA_PHRYX_U);
|
||||||
addEncodingSymbol("B/P", FSkinProp.IMG_MANA_PHRYX_B);
|
addEncodingSymbol("P/B", FSkinProp.IMG_MANA_PHRYX_B);
|
||||||
addEncodingSymbol("R/P", FSkinProp.IMG_MANA_PHRYX_R);
|
addEncodingSymbol("P/R", FSkinProp.IMG_MANA_PHRYX_R);
|
||||||
addEncodingSymbol("G/P", FSkinProp.IMG_MANA_PHRYX_G);
|
addEncodingSymbol("P/G", FSkinProp.IMG_MANA_PHRYX_G);
|
||||||
for (int i = 0; i <= 20; i++) {
|
for (int i = 0; i <= 20; i++) {
|
||||||
addEncodingSymbol(String.valueOf(i), FSkinProp.valueOf("IMG_MANA_" + i));
|
addEncodingSymbol(String.valueOf(i), FSkinProp.valueOf("IMG_MANA_" + i));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ public class TextRenderer {
|
|||||||
symbolLookup.put("2/B", FSkinImage.MANA_2B);
|
symbolLookup.put("2/B", FSkinImage.MANA_2B);
|
||||||
symbolLookup.put("2/R", FSkinImage.MANA_2R);
|
symbolLookup.put("2/R", FSkinImage.MANA_2R);
|
||||||
symbolLookup.put("2/G", FSkinImage.MANA_2G);
|
symbolLookup.put("2/G", FSkinImage.MANA_2G);
|
||||||
symbolLookup.put("W/P", FSkinImage.MANA_PHRYX_W);
|
symbolLookup.put("P/W", FSkinImage.MANA_PHRYX_W);
|
||||||
symbolLookup.put("U/P", FSkinImage.MANA_PHRYX_U);
|
symbolLookup.put("P/U", FSkinImage.MANA_PHRYX_U);
|
||||||
symbolLookup.put("B/P", FSkinImage.MANA_PHRYX_B);
|
symbolLookup.put("P/B", FSkinImage.MANA_PHRYX_B);
|
||||||
symbolLookup.put("R/P", FSkinImage.MANA_PHRYX_R);
|
symbolLookup.put("P/R", FSkinImage.MANA_PHRYX_R);
|
||||||
symbolLookup.put("G/P", FSkinImage.MANA_PHRYX_G);
|
symbolLookup.put("P/G", FSkinImage.MANA_PHRYX_G);
|
||||||
for (int i = 0; i <= 20; i++) {
|
for (int i = 0; i <= 20; i++) {
|
||||||
symbolLookup.put(String.valueOf(i), FSkinImage.valueOf("MANA_" + i));
|
symbolLookup.put(String.valueOf(i), FSkinImage.valueOf("MANA_" + i));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Name:Rage Extractor
|
Name:Rage Extractor
|
||||||
ManaCost:4 PR
|
ManaCost:4 PR
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
T:Mode$ SpellCast | ValidCard$ Card.CostsPhyrexianMana | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever you cast a spell with P in its mana cost, CARDNAME deals damage equal to that spell's converted mana cost to target creature or player.
|
T:Mode$ SpellCast | ValidCard$ Card.CostsPhyrexianMana | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever you cast a spell with {P} in its mana cost, CARDNAME deals damage equal to that spell's converted mana cost to target creature or player.
|
||||||
SVar:TrigDealDamage:AB$DealDamage | Cost$ 0 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ X | References$ X
|
SVar:TrigDealDamage:AB$DealDamage | Cost$ 0 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ X | References$ X
|
||||||
SVar:X:TriggerCount$CastSACMC
|
SVar:X:TriggerCount$CastSACMC
|
||||||
SVar:BuffedBy:Card.CostsPhyrexianMana
|
SVar:BuffedBy:Card.CostsPhyrexianMana
|
||||||
|
|||||||
@@ -91,11 +91,11 @@ public class CardReaderExperiments {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//convert {2W} and {WP} to {2/W} and {W/P}, and ensure not {W/2} or {P/W}
|
//convert {2W} and {PW} to {2/W} and {P/W}, and ensure not {W/2} or {W/P}
|
||||||
for (int i = 0; i < lines.size(); i++) {
|
for (int i = 0; i < lines.size(); i++) {
|
||||||
String newLine = lines.get(i).replaceAll("\\{([WUBRG2])([WUBRGP])\\}", "\\{$1/$2\\}")
|
String newLine = lines.get(i).replaceAll("\\{([WUBRG2P])([WUBRG])\\}", "\\{$1/$2\\}")
|
||||||
.replaceAll("\\{([WUBRG])/2\\}", "\\{2/$1\\}")
|
.replaceAll("\\{([WUBRG])/2\\}", "\\{2/$1\\}")
|
||||||
.replaceAll("\\{P/([WUBRG])\\}", "\\{$1/P\\}");
|
.replaceAll("\\{([WUBRG])/P\\}", "\\{P/$1\\}");
|
||||||
if (!newLine.equals(lines.get(i))) {
|
if (!newLine.equals(lines.get(i))) {
|
||||||
updated = true;
|
updated = true;
|
||||||
lines.set(i, newLine);
|
lines.set(i, newLine);
|
||||||
@@ -116,7 +116,7 @@ public class CardReaderExperiments {
|
|||||||
if (s.isEmpty()) { continue; }
|
if (s.isEmpty()) { continue; }
|
||||||
try {
|
try {
|
||||||
String pattern = s.replaceAll("\\{([WUBRGSXYZ]|[0-9]+)\\}", "$1[ ]\\?")
|
String pattern = s.replaceAll("\\{([WUBRGSXYZ]|[0-9]+)\\}", "$1[ ]\\?")
|
||||||
.replaceAll("\\{([WUBRG2])/([WUBRGP])\\}", "$1$2[ ]\\?")
|
.replaceAll("\\{([WUBRG2P])/([WUBRG])\\}", "$1$2[ ]\\?")
|
||||||
.replaceAll("\\{C\\}", "Chaos");
|
.replaceAll("\\{C\\}", "Chaos");
|
||||||
if (pattern.length() != s.length()) {
|
if (pattern.length() != s.length()) {
|
||||||
pattern = "Description\\$(.*)" + pattern;
|
pattern = "Description\\$(.*)" + pattern;
|
||||||
|
|||||||
Reference in New Issue
Block a user