mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
generalize power, toughness, and cmc hasProperty variable counting (Thanks to slowe I believe).
This commit is contained in:
@@ -6635,29 +6635,26 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (property.startsWith("power") || // 8/10
|
} else if (property.startsWith("power") ||
|
||||||
property.startsWith("toughness") || property.startsWith("cmc")) {
|
property.startsWith("toughness") || property.startsWith("cmc")) {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
int z = 0;
|
String rhs = "";
|
||||||
|
|
||||||
if (property.startsWith("power")) {
|
if (property.startsWith("power")) {
|
||||||
z = 7;
|
rhs = property.substring(7);
|
||||||
y = getNetAttack();
|
y = getNetAttack();
|
||||||
} else if (property.startsWith("toughness")) {
|
} else if (property.startsWith("toughness")) {
|
||||||
z = 11;
|
rhs = property.substring(11);
|
||||||
y = getNetDefense();
|
y = getNetDefense();
|
||||||
} else if (property.startsWith("cmc")) {
|
} else if (property.startsWith("cmc")) {
|
||||||
z = 5;
|
rhs = property.substring(5);
|
||||||
y = getCMC();
|
y = getCMC();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
if (property.substring(z).equals("X")) {
|
x = Integer.parseInt(rhs);
|
||||||
x = CardFactoryUtil.xCount(source, source.getSVar("X"));
|
} catch (NumberFormatException e) {
|
||||||
} else if (property.substring(z).equals("Y")) {
|
x = CardFactoryUtil.xCount(source, source.getSVar(rhs));
|
||||||
x = CardFactoryUtil.xCount(source, source.getSVar("Y"));
|
|
||||||
} else {
|
|
||||||
x = Integer.parseInt(property.substring(z));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!AllZoneUtil.compare(y, property, x)) {
|
if (!AllZoneUtil.compare(y, property, x)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user