- Synchronize nomenclature of Generic Cost

- Add new Colorless Cost
- Start displaying of colorless mana with new symbol (with backwards compatibility for existing scripts that produce "{1}" instead of "{C}")
This commit is contained in:
Sol
2015-12-29 16:37:22 +00:00
parent 3cc5f6495b
commit ff73eb78eb
31 changed files with 129 additions and 134 deletions

View File

@@ -1297,9 +1297,9 @@ public class AiController {
return null; return null;
} }
public CardCollection chooseCardsToDelve(int colorlessCost, CardCollection grave) { public CardCollection chooseCardsToDelve(int genericCost, CardCollection grave) {
CardCollection toExile = new CardCollection(); CardCollection toExile = new CardCollection();
int numToExile = Math.min(grave.size(), colorlessCost); int numToExile = Math.min(grave.size(), genericCost);
for (int i = 0; i < numToExile; i++) { for (int i = 0; i < numToExile; i++) {
Card chosen = null; Card chosen = null;

View File

@@ -348,7 +348,7 @@ public class ComputerUtilMana {
Collection<SpellAbility> saList = null; Collection<SpellAbility> saList = null;
if (hasConverge && if (hasConverge &&
(toPay == ManaCostShard.COLORLESS || toPay == ManaCostShard.X)) { (toPay == ManaCostShard.GENERIC || toPay == ManaCostShard.X)) {
final int unpaidColors = cost.getUnpaidColors() + cost.getColorsPaid() ^ ManaCostShard.COLORS_SUPERPOSITION; final int unpaidColors = cost.getUnpaidColors() + cost.getColorsPaid() ^ ManaCostShard.COLORS_SUPERPOSITION;
for (final byte b : ColorSet.fromMask(unpaidColors)) { // try and pay other colors for converge for (final byte b : ColorSet.fromMask(unpaidColors)) { // try and pay other colors for converge
final ManaCostShard shard = ManaCostShard.valueOf(b); final ManaCostShard shard = ManaCostShard.valueOf(b);
@@ -358,7 +358,7 @@ public class ComputerUtilMana {
break; break;
} }
} }
if (saList == null || saList.isEmpty()) { // failed to converge, revert to paying colorless if (saList == null || saList.isEmpty()) { // failed to converge, revert to paying generic
saList = sourcesForShards.get(toPay); saList = sourcesForShards.get(toPay);
hasConverge = false; hasConverge = false;
} }
@@ -666,7 +666,7 @@ public class ComputerUtilMana {
} }
else if (m.isAnyMana()) { else if (m.isAnyMana()) {
byte colorChoice = 0; byte colorChoice = 0;
if (toPay.isOr2Colorless()) if (toPay.isOr2Generic())
colorChoice = toPay.getColorMask(); colorChoice = toPay.getColorMask();
else { else {
for (byte c : MagicColor.WUBRG) { for (byte c : MagicColor.WUBRG) {
@@ -775,7 +775,7 @@ public class ComputerUtilMana {
// * Pay 2/C with matching colors // * Pay 2/C with matching colors
// * pay hybrids // * pay hybrids
// * pay phyrexian, keep mana for colorless // * pay phyrexian, keep mana for colorless
// * pay colorless // * pay generic
return cost.getShardToPayByPriority(cost.getDistinctShards(), ColorSet.ALL_COLORS.getColor()); return cost.getShardToPayByPriority(cost.getDistinctShards(), ColorSet.ALL_COLORS.getColor());
} }
@@ -786,10 +786,10 @@ public class ComputerUtilMana {
byte mask = MagicColor.fromName(manaPart); byte mask = MagicColor.fromName(manaPart);
// make mana mandatory for AI // make mana mandatory for AI
if (!cost.needsColor(mask, ai.getManaPool()) && cost.getColorlessManaAmount() > 0) { if (!cost.needsColor(mask, ai.getManaPool()) && cost.getGenericManaAmount() > 0) {
ManaCostShard shard = ManaCostShard.valueOf(mask); ManaCostShard shard = ManaCostShard.valueOf(mask);
cost.increaseShard(shard, 1); cost.increaseShard(shard, 1);
cost.decreaseColorlessMana(1); cost.decreaseGenericMana(1);
} }
} }
} }
@@ -909,8 +909,8 @@ public class ComputerUtilMana {
final ManaCostBeingPaid cost) { final ManaCostBeingPaid cost) {
ListMultimap<ManaCostShard, SpellAbility> res = ArrayListMultimap.create(); ListMultimap<ManaCostShard, SpellAbility> res = ArrayListMultimap.create();
if (cost.getColorlessManaAmount() > 0 && manaAbilityMap.containsKey(ManaAtom.COLORLESS)) { if (cost.getGenericManaAmount() > 0 && manaAbilityMap.containsKey(ManaAtom.GENERIC)) {
res.putAll(ManaCostShard.COLORLESS, manaAbilityMap.get(ManaAtom.COLORLESS)); res.putAll(ManaCostShard.GENERIC, manaAbilityMap.get(ManaAtom.GENERIC));
} }
// loop over cost parts // loop over cost parts
@@ -923,16 +923,16 @@ public class ComputerUtilMana {
continue; continue;
} }
if (shard.isOr2Colorless()) { if (shard.isOr2Generic()) {
Integer colorKey = (int) shard.getColorMask(); Integer colorKey = (int) shard.getColorMask();
if (manaAbilityMap.containsKey(colorKey)) if (manaAbilityMap.containsKey(colorKey))
res.putAll(shard, manaAbilityMap.get(colorKey)); res.putAll(shard, manaAbilityMap.get(colorKey));
if (manaAbilityMap.containsKey(ManaAtom.COLORLESS)) if (manaAbilityMap.containsKey(ManaAtom.GENERIC))
res.putAll(shard, manaAbilityMap.get(ManaAtom.COLORLESS)); res.putAll(shard, manaAbilityMap.get(ManaAtom.GENERIC));
continue; continue;
} }
if (shard == ManaCostShard.COLORLESS) { if (shard == ManaCostShard.GENERIC) {
continue; continue;
} }
@@ -1176,7 +1176,7 @@ public class ComputerUtilMana {
} }
} }
manaMap.get(ManaAtom.COLORLESS).add(manaMap.get(ManaAtom.COLORLESS).size(), m); // add to colorless source list manaMap.get(ManaAtom.GENERIC).add(manaMap.get(ManaAtom.GENERIC).size(), m); // add to generic source list
AbilityManaPart mp = m.getManaPart(); AbilityManaPart mp = m.getManaPart();
// setup produce mana replacement effects // setup produce mana replacement effects
@@ -1314,7 +1314,7 @@ public class ComputerUtilMana {
convoked = null; convoked = null;
} }
for (int i = 0; i < list.size() && i < cost.getGenericCost(); i++) { for (int i = 0; i < list.size() && i < cost.getGenericCost(); i++) {
convoke.put(list.get(i), ManaCostShard.COLORLESS); convoke.put(list.get(i), ManaCostShard.GENERIC);
} }
return convoke; return convoke;
} }

View File

@@ -320,8 +320,8 @@ public class PlayerControllerAi extends PlayerController {
} }
@Override @Override
public CardCollectionView chooseCardsToDelve(int colorlessCost, CardCollection grave) { public CardCollectionView chooseCardsToDelve(int genericAmount, CardCollection grave) {
return getAi().chooseCardsToDelve(colorlessCost, grave); return getAi().chooseCardsToDelve(genericAmount, grave);
} }
@Override @Override

View File

@@ -427,19 +427,19 @@ public final class CardRules implements ICardCharacteristics {
*/ */
private static class ManaCostParser implements IParserManaCost { private static class ManaCostParser implements IParserManaCost {
private final StringTokenizer st; private final StringTokenizer st;
private int colorlessCost; private int genericCost;
public ManaCostParser(final String cost) { public ManaCostParser(final String cost) {
st = new StringTokenizer(cost, " "); st = new StringTokenizer(cost, " ");
this.colorlessCost = 0; this.genericCost = 0;
} }
@Override @Override
public final int getTotalColorlessCost() { public final int getTotalGenericCost() {
if (this.hasNext()) { if (this.hasNext()) {
throw new RuntimeException("Colorless cost should be obtained after iteration is complete"); throw new RuntimeException("Generic cost should be obtained after iteration is complete");
} }
return this.colorlessCost; return this.genericCost;
} }
/* /*
@@ -463,7 +463,7 @@ public final class CardRules implements ICardCharacteristics {
// System.out.println(unparsed); // System.out.println(unparsed);
try { try {
int iVal = Integer.parseInt(unparsed); int iVal = Integer.parseInt(unparsed);
this.colorlessCost += iVal; this.genericCost += iVal;
return null; return null;
} }
catch (NumberFormatException nex) { } catch (NumberFormatException nex) { }

View File

@@ -394,7 +394,7 @@ public final class CardRulesPredicates {
public static class LeafNumber implements Predicate<CardRules> { public static class LeafNumber implements Predicate<CardRules> {
public enum CardField { public enum CardField {
CMC, COLORLESS_COST, POWER, TOUGHNESS CMC, GENERIC_COST, POWER, TOUGHNESS
} }
private final LeafNumber.CardField field; private final LeafNumber.CardField field;
@@ -413,7 +413,7 @@ public final class CardRulesPredicates {
switch (this.field) { switch (this.field) {
case CMC: case CMC:
return this.op(card.getManaCost().getCMC(), this.operand); return this.op(card.getManaCost().getCMC(), this.operand);
case COLORLESS_COST: case GENERIC_COST:
return this.op(card.getManaCost().getGenericCost(), this.operand); return this.op(card.getManaCost().getGenericCost(), this.operand);
case POWER: case POWER:
value = card.getIntPower(); value = card.getIntPower();

View File

@@ -7,11 +7,5 @@ import java.util.Iterator;
* The Interface ManaParser. * The Interface ManaParser.
*/ */
public interface IParserManaCost extends Iterator<ManaCostShard> { public interface IParserManaCost extends Iterator<ManaCostShard> {
int getTotalGenericCost();
/**
* Gets the total colorless cost.
*
* @return the total colorless cost
*/
int getTotalColorlessCost();
} }

View File

@@ -4,7 +4,7 @@ import forge.card.MagicColor;
/** A bitmask to represent any mana symbol as an integer. */ /** A bitmask to represent any mana symbol as an integer. */
public abstract class ManaAtom { public abstract class ManaAtom {
public static final int COLORLESS = 1 << 6; public static final int GENERIC = 1 << 6;
/** The Constant WHITE. */ /** The Constant WHITE. */
public static final int WHITE = MagicColor.WHITE; public static final int WHITE = MagicColor.WHITE;
@@ -24,12 +24,14 @@ public abstract class ManaAtom {
/** The Constant IS_X. */ /** The Constant IS_X. */
public static final int IS_X = 1 << 8; public static final int IS_X = 1 << 8;
/** The Constant OR_2_COLORLESS. */ /** The Constant OR_2_GENERIC. */
public static final int OR_2_COLORLESS = 1 << 9; public static final int OR_2_GENERIC = 1 << 9;
/** The Constant OR_2_LIFE. */ /** The Constant OR_2_LIFE. */
public static final int OR_2_LIFE = 1 << 10; public static final int OR_2_LIFE = 1 << 10;
/** The Constant IS_SNOW. */ /** The Constant IS_SNOW. */
public static final int IS_SNOW = 1 << 11; public static final int IS_SNOW = 1 << 11;
public static final int COLORLESS = 1 << 12;
} }

View File

@@ -48,7 +48,6 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
private Float compareWeight = null; private Float compareWeight = null;
/** The Constant empty. */
public static final ManaCost NO_COST = new ManaCost(-1); public static final ManaCost NO_COST = new ManaCost(-1);
public static final ManaCost ZERO = new ManaCost(0); public static final ManaCost ZERO = new ManaCost(0);
public static final ManaCost ONE = new ManaCost(1); public static final ManaCost ONE = new ManaCost(1);
@@ -56,15 +55,15 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
public static final ManaCost THREE = new ManaCost(3); public static final ManaCost THREE = new ManaCost(3);
public static final ManaCost FOUR = new ManaCost(4); public static final ManaCost FOUR = new ManaCost(4);
public static ManaCost get(int cntColorless) { public static ManaCost get(int cntGeneric) {
switch (cntColorless) { switch (cntGeneric) {
case 0: return ZERO; case 0: return ZERO;
case 1: return ONE; case 1: return ONE;
case 2: return TWO; case 2: return TWO;
case 3: return THREE; case 3: return THREE;
case 4: return FOUR; case 4: return FOUR;
} }
return cntColorless > 0 ? new ManaCost(cntColorless) : NO_COST; return cntGeneric > 0 ? new ManaCost(cntGeneric) : NO_COST;
} }
// pass mana cost parser here // pass mana cost parser here
@@ -91,11 +90,11 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
this.hasNoCost = false; this.hasNoCost = false;
while (parser.hasNext()) { while (parser.hasNext()) {
final ManaCostShard shard = parser.next(); final ManaCostShard shard = parser.next();
if (shard != null && shard != ManaCostShard.COLORLESS) { if (shard != null && shard != ManaCostShard.GENERIC) {
shardsTemp.add(shard); shardsTemp.add(shard);
} // null is OK - that was generic mana } // null is OK - that was generic mana
} }
this.genericCost = parser.getTotalColorlessCost(); // collect generic mana this.genericCost = parser.getTotalGenericCost(); // collect generic mana
// here // here
sealClass(shardsTemp); sealClass(shardsTemp);
} }
@@ -149,7 +148,7 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
} }
public int getShardCount(ManaCostShard which) { public int getShardCount(ManaCostShard which) {
if (which == ManaCostShard.COLORLESS) { if (which == ManaCostShard.GENERIC) {
return genericCost; return genericCost;
} }

View File

@@ -9,7 +9,7 @@ import org.apache.commons.lang3.StringUtils;
public class ManaCostParser implements IParserManaCost { public class ManaCostParser implements IParserManaCost {
private final String[] cost; private final String[] cost;
private int nextToken; private int nextToken;
private int colorlessCost; private int genericCost;
/** /**
* Parse the given cost and output formatted cost string * Parse the given cost and output formatted cost string
@@ -32,20 +32,20 @@ public class ManaCostParser implements IParserManaCost {
this.cost = cost.split(" "); this.cost = cost.split(" ");
// System.out.println(cost); // System.out.println(cost);
this.nextToken = 0; this.nextToken = 0;
this.colorlessCost = 0; this.genericCost = 0;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see forge.card.CardManaCost.ManaParser#getTotalColorlessCost() * @see forge.card.CardManaCost.ManaParser#getTotalGenericCost()
*/ */
@Override @Override
public final int getTotalColorlessCost() { public final int getTotalGenericCost() {
if (this.hasNext()) { if (this.hasNext()) {
throw new RuntimeException("Colorless cost should be obtained after iteration is complete"); throw new RuntimeException("Generic cost should be obtained after iteration is complete");
} }
return this.colorlessCost; return this.genericCost;
} }
/* /*
@@ -68,7 +68,7 @@ public class ManaCostParser implements IParserManaCost {
final String unparsed = this.cost[this.nextToken++]; final String unparsed = this.cost[this.nextToken++];
// System.out.println(unparsed); // System.out.println(unparsed);
if (StringUtils.isNumeric(unparsed)) { if (StringUtils.isNumeric(unparsed)) {
this.colorlessCost += Integer.parseInt(unparsed); this.genericCost += Integer.parseInt(unparsed);
return null; return null;
} }

View File

@@ -45,15 +45,16 @@ public enum ManaCostShard {
GU(ManaAtom.GREEN | ManaAtom.BLUE, "G/U", "GU"), GU(ManaAtom.GREEN | ManaAtom.BLUE, "G/U", "GU"),
/* Or 2 colorless */ /* Or 2 colorless */
W2(ManaAtom.WHITE | ManaAtom.OR_2_COLORLESS, "2/W", "2W"), W2(ManaAtom.WHITE | ManaAtom.OR_2_GENERIC, "2/W", "2W"),
U2(ManaAtom.BLUE | ManaAtom.OR_2_COLORLESS, "2/U", "2U"), U2(ManaAtom.BLUE | ManaAtom.OR_2_GENERIC, "2/U", "2U"),
B2(ManaAtom.BLACK | ManaAtom.OR_2_COLORLESS, "2/B", "2B"), B2(ManaAtom.BLACK | ManaAtom.OR_2_GENERIC, "2/B", "2B"),
R2(ManaAtom.RED | ManaAtom.OR_2_COLORLESS, "2/R", "2R"), R2(ManaAtom.RED | ManaAtom.OR_2_GENERIC, "2/R", "2R"),
G2(ManaAtom.GREEN | ManaAtom.OR_2_COLORLESS, "2/G", "2G"), G2(ManaAtom.GREEN | ManaAtom.OR_2_GENERIC, "2/G", "2G"),
// Snow and colorless // Snow and colorless
S(ManaAtom.IS_SNOW, "S"), S(ManaAtom.IS_SNOW, "S"),
COLORLESS(ManaAtom.COLORLESS, "1"), GENERIC(ManaAtom.GENERIC, "1"),
COLORLESS(ManaAtom.COLORLESS, "C"),
/* Phyrexian */ /* Phyrexian */
PW(ManaAtom.WHITE | ManaAtom.OR_2_LIFE, "P/W", "PW"), PW(ManaAtom.WHITE | ManaAtom.OR_2_LIFE, "P/W", "PW"),
@@ -112,7 +113,7 @@ public enum ManaCostShard {
if (0 != (this.shard & ManaAtom.IS_X)) { if (0 != (this.shard & ManaAtom.IS_X)) {
return 0; return 0;
} }
if (0 != (this.shard & ManaAtom.OR_2_COLORLESS)) { if (0 != (this.shard & ManaAtom.OR_2_GENERIC)) {
return 2; return 2;
} }
return 1; return 1;
@@ -130,7 +131,7 @@ public enum ManaCostShard {
if (0 != (this.shard & ManaAtom.IS_X)) { if (0 != (this.shard & ManaAtom.IS_X)) {
return 0.0001f; return 0.0001f;
} }
float cost = 0 != (this.shard & ManaAtom.OR_2_COLORLESS) ? 2 : 1; float cost = 0 != (this.shard & ManaAtom.OR_2_GENERIC) ? 2 : 1;
// yes, these numbers are magic, slightly-magic // yes, these numbers are magic, slightly-magic
if (0 != (this.shard & ManaAtom.WHITE)) { if (0 != (this.shard & ManaAtom.WHITE)) {
cost += 0.0005f; cost += 0.0005f;
@@ -170,7 +171,7 @@ public enum ManaCostShard {
* @return the card mana cost shard * @return the card mana cost shard
*/ */
public static ManaCostShard valueOf(final int atoms) { public static ManaCostShard valueOf(final int atoms) {
if ( atoms == 0 ) return ManaCostShard.COLORLESS; if ( atoms == 0 ) return ManaCostShard.GENERIC;
for (final ManaCostShard element : ManaCostShard.values()) { for (final ManaCostShard element : ManaCostShard.values()) {
if (element.shard == atoms) { if (element.shard == atoms) {
return element; return element;
@@ -194,17 +195,18 @@ public enum ManaCostShard {
case 'P': atoms |= ManaAtom.OR_2_LIFE; break; case 'P': atoms |= ManaAtom.OR_2_LIFE; break;
case 'S': atoms |= ManaAtom.IS_SNOW; break; case 'S': atoms |= ManaAtom.IS_SNOW; break;
case 'X': atoms |= ManaAtom.IS_X; break; case 'X': atoms |= ManaAtom.IS_X; break;
case '2': atoms |= ManaAtom.OR_2_COLORLESS; break; case 'C': atoms |= ManaAtom.COLORLESS; break;
case '2': atoms |= ManaAtom.OR_2_GENERIC; break;
default: default:
if (c <= '9' && c >= '0') { if (c <= '9' && c >= '0') {
atoms |= ManaAtom.COLORLESS; atoms |= ManaAtom.GENERIC;
} }
break; break;
} }
} }
// for cases when unparsed equals '2' or unparsed is like '12' or '20' // for cases when unparsed equals '2' or unparsed is like '12' or '20'
if (atoms == ManaAtom.OR_2_COLORLESS || atoms == (ManaAtom.OR_2_COLORLESS | ManaAtom.COLORLESS)) { if (atoms == ManaAtom.OR_2_GENERIC || atoms == (ManaAtom.OR_2_GENERIC | ManaAtom.GENERIC)) {
atoms = ManaAtom.COLORLESS; atoms = ManaAtom.GENERIC;
} }
return ManaCostShard.valueOf(atoms); return ManaCostShard.valueOf(atoms);
} }
@@ -282,11 +284,11 @@ public enum ManaCostShard {
return BinaryUtil.bitCount(this.shard & COLORS_SUPERPOSITION) == 1; return BinaryUtil.bitCount(this.shard & COLORS_SUPERPOSITION) == 1;
} }
public boolean isOr2Colorless() { public boolean isOr2Generic() {
return (this.shard & ManaAtom.OR_2_COLORLESS) != 0; return (this.shard & ManaAtom.OR_2_GENERIC) != 0;
} }
public boolean canBePaidWithManaOfColor(byte colorCode) { public boolean canBePaidWithManaOfColor(byte colorCode) {
return this.isOr2Colorless() || (COLORS_SUPERPOSITION & this.shard) == 0 || (colorCode & this.shard) > 0; return this.isOr2Generic() || (COLORS_SUPERPOSITION & this.shard) == 0 || (colorCode & this.shard) > 0;
} }
} }

View File

@@ -255,7 +255,7 @@ public final class GameActionUtil {
final SpellAbility newSA = sa.copy(); final SpellAbility newSA = sa.copy();
newSA.setBasicSpell(false); newSA.setBasicSpell(false);
ManaCostBeingPaid newCost = new ManaCostBeingPaid(source.getManaCost()); ManaCostBeingPaid newCost = new ManaCostBeingPaid(source.getManaCost());
newCost.increaseColorlessMana(2); newCost.increaseGenericMana(2);
final Cost actualcost = new Cost(newCost.toManaCost(), false); final Cost actualcost = new Cost(newCost.toManaCost(), false);
newSA.setPayCosts(actualcost); newSA.setPayCosts(actualcost);
SpellAbilityRestriction sar = new SpellAbilityRestriction(); SpellAbilityRestriction sar = new SpellAbilityRestriction();

View File

@@ -1285,7 +1285,7 @@ public class AbilityUtils {
int xPaid = triggeredCard.getXManaCostPaid() * xCount; int xPaid = triggeredCard.getXManaCostPaid() * xCount;
ManaCostBeingPaid toPay = new ManaCostBeingPaid(triggeredCard.getManaCost()); ManaCostBeingPaid toPay = new ManaCostBeingPaid(triggeredCard.getManaCost());
toPay.decreaseShard(ManaCostShard.X, xCount); toPay.decreaseShard(ManaCostShard.X, xCount);
toPay.increaseColorlessMana(xPaid); toPay.increaseGenericMana(xPaid);
cost = new Cost(toPay.toManaCost(), true); cost = new Cost(toPay.toManaCost(), true);
} }
} }
@@ -1305,7 +1305,7 @@ public class AbilityUtils {
return; return;
} }
ManaCostBeingPaid newCost = new ManaCostBeingPaid(rememberedCard.getManaCost()); ManaCostBeingPaid newCost = new ManaCostBeingPaid(rememberedCard.getManaCost());
newCost.decreaseColorlessMana(2); newCost.decreaseGenericMana(2);
cost = new Cost(newCost.toManaCost(), true); cost = new Cost(newCost.toManaCost(), true);
} }
else if (!StringUtils.isBlank(sa.getSVar(unlessCost)) || !StringUtils.isBlank(source.getSVar(unlessCost))) { else if (!StringUtils.isBlank(sa.getSVar(unlessCost)) || !StringUtils.isBlank(source.getSVar(unlessCost))) {

View File

@@ -438,7 +438,7 @@ public class CardFactoryUtil {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
if (Character.isDigit(tokenized[0].charAt(0))) { if (Character.isDigit(tokenized[0].charAt(0))) {
// cost starts with "colorless" number cost // cost starts with "generic" number cost
int cost = Integer.parseInt(tokenized[0]); int cost = Integer.parseInt(tokenized[0]);
cost = multiplier * cost; cost = multiplier * cost;
tokenized[0] = "" + cost; tokenized[0] = "" + cost;

View File

@@ -407,7 +407,8 @@ public final class CardUtil {
colors.add(col); colors.add(col);
} }
} }
if (maxChoices == 6 && producedColors.contains("1")) { // TODO Sol Remove production of "1" Generic Mana
if (maxChoices == 6 && (producedColors.contains("1") || producedColors.contains("C"))) {
colors.add(MagicColor.Constant.COLORLESS); colors.add(MagicColor.Constant.COLORLESS);
} }
} else if (reflectProperty.equals("Produce")) { } else if (reflectProperty.equals("Produce")) {
@@ -461,7 +462,8 @@ public final class CardUtil {
} }
} }
if (maxChoices == 6 && ab.canProduce("1")) { // TODO Sol Remove production of "1" Generic Mana
if (maxChoices == 6 && (ab.canProduce("1") || ab.canProduce("C"))) {
colors.add(MagicColor.Constant.COLORLESS); colors.add(MagicColor.Constant.COLORLESS);
} }

View File

@@ -114,13 +114,14 @@ public class Cost {
return manapart == null ? ManaCost.ZERO : manapart.getManaToPay(); return manapart == null ? ManaCost.ZERO : manapart.getManaToPay();
} }
private Cost(int colorlessmana) { private Cost(int genericMana) {
costParts.add(new CostPartMana(ManaCost.get(colorlessmana), null)); costParts.add(new CostPartMana(ManaCost.get(genericMana), null));
} }
// Parsing Strings // Parsing Strings
public Cost(ManaCost cost, final boolean bAbility) { public Cost(ManaCost cost, final boolean bAbility) {
this.isAbility = bAbility;
costParts.add(new CostPartMana(cost, null)); costParts.add(new CostPartMana(cost, null));
} }

View File

@@ -94,9 +94,9 @@ public class ManaCostAdjustment {
sa.getHostCard().clearDelved(); sa.getHostCard().clearDelved();
final Player pc = sa.getActivatingPlayer(); final Player pc = sa.getActivatingPlayer();
final CardCollection mutableGrave = new CardCollection(pc.getCardsIn(ZoneType.Graveyard)); final CardCollection mutableGrave = new CardCollection(pc.getCardsIn(ZoneType.Graveyard));
final CardCollectionView toExile = pc.getController().chooseCardsToDelve(cost.getUnpaidShards(ManaCostShard.COLORLESS), mutableGrave); final CardCollectionView toExile = pc.getController().chooseCardsToDelve(cost.getUnpaidShards(ManaCostShard.GENERIC), mutableGrave);
for (final Card c : toExile) { for (final Card c : toExile) {
cost.decreaseColorlessMana(1); cost.decreaseGenericMana(1);
if (cardsToDelveOut != null) { if (cardsToDelveOut != null) {
cardsToDelveOut.add(c); cardsToDelveOut.add(c);
} else if (!test) { } else if (!test) {
@@ -328,15 +328,15 @@ public class ManaCostAdjustment {
} }
if (!params.containsKey("Color")) { if (!params.containsKey("Color")) {
manaCost.increaseColorlessMana(value); manaCost.increaseGenericMana(value);
if (manaCost.toString().equals("{0}") && params.containsKey("MinMana")) { if (manaCost.toString().equals("{0}") && params.containsKey("MinMana")) {
manaCost.increaseColorlessMana(Integer.valueOf(params.get("MinMana"))); manaCost.increaseGenericMana(Integer.valueOf(params.get("MinMana")));
} }
} else { } else {
final String color = params.get("Color"); final String color = params.get("Color");
for (final String cost : color.split(" ")) { for (final String cost : color.split(" ")) {
if (StringUtils.isNumeric(cost)) { if (StringUtils.isNumeric(cost)) {
manaCost.increaseColorlessMana(Integer.parseInt(cost) * value); manaCost.increaseGenericMana(Integer.parseInt(cost) * value);
} else { } else {
manaCost.increaseShard(ManaCostShard.parseNonGeneric(cost), value); manaCost.increaseShard(ManaCostShard.parseNonGeneric(cost), value);
} }
@@ -463,13 +463,13 @@ public class ManaCostAdjustment {
final int maxReduction = Math.max(0, manaCost.getConvertedManaCost() - minMana); final int maxReduction = Math.max(0, manaCost.getConvertedManaCost() - minMana);
if (maxReduction > 0) { if (maxReduction > 0) {
manaCost.decreaseColorlessMana(Math.min(value, maxReduction)); manaCost.decreaseGenericMana(Math.min(value, maxReduction));
} }
} else { } else {
final String color = params.get("Color"); final String color = params.get("Color");
for (final String cost : color.split(" ")) { for (final String cost : color.split(" ")) {
if (StringUtils.isNumeric(cost)) { if (StringUtils.isNumeric(cost)) {
manaCost.decreaseColorlessMana(Integer.parseInt(cost) * value); manaCost.decreaseGenericMana(Integer.parseInt(cost) * value);
} else { } else {
manaCost.decreaseShard(ManaCostShard.parseNonGeneric(cost), value); manaCost.decreaseShard(ManaCostShard.parseNonGeneric(cost), value);
} }

View File

@@ -80,16 +80,16 @@ public class ManaCostBeingPaid {
if (!mch.hasNext()) { return false; } if (!mch.hasNext()) { return false; }
nextShard = mch.next(); nextShard = mch.next();
if (nextShard == ManaCostShard.COLORLESS) { if (nextShard == ManaCostShard.GENERIC) {
return this.hasNext(); // skip colorless return this.hasNext(); // skip generic
} }
remainingShards = unpaidShards.get(nextShard).totalCount; remainingShards = unpaidShards.get(nextShard).totalCount;
return true; return true;
} }
@Override @Override
public int getTotalColorlessCost() { public int getTotalGenericCost() {
ShardCount c = unpaidShards.get(ManaCostShard.COLORLESS); ShardCount c = unpaidShards.get(ManaCostShard.GENERIC);
return c == null ? 0 : c.totalCount; return c == null ? 0 : c.totalCount;
} }
} }
@@ -107,7 +107,7 @@ public class ManaCostBeingPaid {
} }
// holds Mana_Part objects // holds Mana_Part objects
// ManaPartColor is stored before ManaPartColorless // ManaPartColor is stored before ManaPartGeneric
private final Map<ManaCostShard, ShardCount> unpaidShards = new HashMap<ManaCostShard, ShardCount>(); private final Map<ManaCostShard, ShardCount> unpaidShards = new HashMap<ManaCostShard, ShardCount>();
private Map<String, Integer> xManaCostPaidByColor; private Map<String, Integer> xManaCostPaidByColor;
private final String sourceRestriction; private final String sourceRestriction;
@@ -145,7 +145,7 @@ public class ManaCostBeingPaid {
increaseShard(shard, 1, false); increaseShard(shard, 1, false);
} }
} }
increaseColorlessMana(manaCost.getGenericCost()); increaseGenericMana(manaCost.getGenericCost());
} }
public Map<String, Integer> getXManaCostPaidByColor() { public Map<String, Integer> getXManaCostPaidByColor() {
@@ -190,10 +190,10 @@ public class ManaCostBeingPaid {
// Easier for split costs // Easier for split costs
public final boolean needsColor(final byte colorMask, final ManaPool pool) { public final boolean needsColor(final byte colorMask, final ManaPool pool) {
for (ManaCostShard shard : unpaidShards.keySet()) { for (ManaCostShard shard : unpaidShards.keySet()) {
if (shard == ManaCostShard.COLORLESS) { if (shard == ManaCostShard.GENERIC) {
continue; continue;
} }
if (shard.isOr2Colorless()) { if (shard.isOr2Generic()) {
if ((shard.getColorMask() & colorMask) != 0) { if ((shard.getColorMask() & colorMask) != 0) {
return true; return true;
} }
@@ -234,7 +234,7 @@ public class ManaCostBeingPaid {
ManaCostShard shard; ManaCostShard shard;
if (StringUtils.isEmpty(xColor)) { if (StringUtils.isEmpty(xColor)) {
shard = ManaCostShard.COLORLESS; shard = ManaCostShard.GENERIC;
} }
else { else {
shard = ManaCostShard.valueOf(MagicColor.fromName(xColor)); shard = ManaCostShard.valueOf(MagicColor.fromName(xColor));
@@ -242,8 +242,8 @@ public class ManaCostBeingPaid {
increaseShard(shard, xCost, true); increaseShard(shard, xCost, true);
} }
public final void increaseColorlessMana(final int toAdd) { public final void increaseGenericMana(final int toAdd) {
increaseShard(ManaCostShard.COLORLESS, toAdd, false); increaseShard(ManaCostShard.GENERIC, toAdd, false);
} }
public final void increaseShard(final ManaCostShard shard, final int toAdd) { public final void increaseShard(final ManaCostShard shard, final int toAdd) {
increaseShard(shard, toAdd, false); increaseShard(shard, toAdd, false);
@@ -262,8 +262,8 @@ public class ManaCostBeingPaid {
sc.totalCount += toAdd; sc.totalCount += toAdd;
} }
public final void decreaseColorlessMana(final int manaToSubtract) { public final void decreaseGenericMana(final int manaToSubtract) {
decreaseShard(ManaCostShard.COLORLESS, manaToSubtract); decreaseShard(ManaCostShard.GENERIC, manaToSubtract);
} }
public final void decreaseShard(final ManaCostShard shard, final int manaToSubtract) { public final void decreaseShard(final ManaCostShard shard, final int manaToSubtract) {
@@ -289,8 +289,8 @@ public class ManaCostBeingPaid {
} }
} }
public final int getColorlessManaAmount() { public final int getGenericManaAmount() {
ShardCount sc = unpaidShards.get(ManaCostShard.COLORLESS); ShardCount sc = unpaidShards.get(ManaCostShard.GENERIC);
if (sc != null) { if (sc != null) {
return sc.totalCount; return sc.totalCount;
} }
@@ -402,8 +402,8 @@ public class ManaCostBeingPaid {
} }
decreaseShard(chosenShard, 1); decreaseShard(chosenShard, 1);
if (chosenShard.isOr2Colorless() && ( 0 == (chosenShard.getColorMask() & possibleUses) )) { if (chosenShard.isOr2Generic() && ( 0 == (chosenShard.getColorMask() & possibleUses) )) {
this.increaseColorlessMana(1); this.increaseGenericMana(1);
} }
this.sunburstMap |= colorMask; this.sunburstMap |= colorMask;
@@ -411,12 +411,12 @@ public class ManaCostBeingPaid {
} }
private static int getPayPriority(final ManaCostShard bill, final byte paymentColor) { private static int getPayPriority(final ManaCostShard bill, final byte paymentColor) {
if (bill == ManaCostShard.COLORLESS) { if (bill == ManaCostShard.GENERIC) {
return 0; return 0;
} }
if (bill.isMonoColor()) { if (bill.isMonoColor()) {
if (bill.isOr2Colorless()) { if (bill.isOr2Generic()) {
return !ColorSet.fromMask(bill.getColorMask() & paymentColor).isColorless() ? 9 : 4; return !ColorSet.fromMask(bill.getColorMask() & paymentColor).isColorless() ? 9 : 4;
} }
if (!bill.isPhyrexian()) { if (!bill.isPhyrexian()) {
@@ -445,7 +445,7 @@ public class ManaCostBeingPaid {
increaseShard(shard, 1, false); increaseShard(shard, 1, false);
} }
} }
increaseColorlessMana(extra.getGenericCost()); increaseGenericMana(extra.getGenericCost());
} }
public final void subtractManaCost(final ManaCost subThisManaCost) { public final void subtractManaCost(final ManaCost subThisManaCost) {
@@ -457,10 +457,10 @@ public class ManaCostBeingPaid {
decreaseShard(shard, 1); decreaseShard(shard, 1);
} }
else { else {
decreaseColorlessMana(1); decreaseGenericMana(1);
} }
} }
decreaseColorlessMana(subThisManaCost.getGenericCost()); decreaseGenericMana(subThisManaCost.getGenericCost());
} }
/** /**
@@ -480,12 +480,12 @@ public class ManaCostBeingPaid {
} }
} }
int nGeneric = getColorlessManaAmount(); int nGeneric = getGenericManaAmount();
if (nGeneric > 0) { if (nGeneric > 0) {
if (nGeneric <= 20) { if (nGeneric <= 20) {
sb.append("{" + nGeneric + "}"); sb.append("{" + nGeneric + "}");
} }
else { //if no mana symbol exists for colorless amount, use combination of symbols for each digit else { //if no mana symbol exists for generic amount, use combination of symbols for each digit
String genericStr = String.valueOf(nGeneric); String genericStr = String.valueOf(nGeneric);
for (int i = 0; i < genericStr.length(); i++) { for (int i = 0; i < genericStr.length(); i++) {
sb.append("{" + genericStr.charAt(i) + "}"); sb.append("{" + genericStr.charAt(i) + "}");
@@ -497,7 +497,7 @@ public class ManaCostBeingPaid {
List<ManaCostShard> shards = new ArrayList<ManaCostShard>(unpaidShards.keySet()); List<ManaCostShard> shards = new ArrayList<ManaCostShard>(unpaidShards.keySet());
Collections.sort(shards); Collections.sort(shards);
for (ManaCostShard shard : shards) { for (ManaCostShard shard : shards) {
if (shard == ManaCostShard.COLORLESS) { if (shard == ManaCostShard.GENERIC) {
continue; continue;
} }
@@ -554,15 +554,8 @@ public class ManaCostBeingPaid {
return result; return result;
} }
/** public final void removeGenericMana() {
* <p> unpaidShards.remove(ManaCostShard.GENERIC);
* removeColorlessMana.
* </p>
*
* @since 1.0.15
*/
public final void removeColorlessMana() {
unpaidShards.remove(ManaCostShard.COLORLESS);
} }
public String getSourceRestriction() { public String getSourceRestriction() {

View File

@@ -152,7 +152,7 @@ public abstract class PlayerController {
public abstract CardCollectionView chooseCardsToDiscardFrom(Player playerDiscard, SpellAbility sa, CardCollection validCards, int min, int max); public abstract CardCollectionView chooseCardsToDiscardFrom(Player playerDiscard, SpellAbility sa, CardCollection validCards, int min, int max);
public abstract void playMiracle(SpellAbility miracle, Card card); public abstract void playMiracle(SpellAbility miracle, Card card);
public abstract CardCollectionView chooseCardsToDelve(int colorLessAmount, CardCollection grave); public abstract CardCollectionView chooseCardsToDelve(int genericAmount, CardCollection grave);
public abstract CardCollectionView chooseCardsToRevealFromHand(int min, int max, CardCollectionView valid); public abstract CardCollectionView chooseCardsToRevealFromHand(int min, int max, CardCollectionView valid);
public abstract CardCollectionView chooseCardsToDiscardUnlessType(int min, CardCollectionView hand, String param, SpellAbility sa); public abstract CardCollectionView chooseCardsToDiscardUnlessType(int min, CardCollectionView hand, String param, SpellAbility sa);
public abstract List<SpellAbility> chooseSaToActivateFromOpeningHand(List<SpellAbility> usableFromOpeningHand); public abstract List<SpellAbility> chooseSaToActivateFromOpeningHand(List<SpellAbility> usableFromOpeningHand);

View File

@@ -521,6 +521,7 @@ public final class StaticAbilityContinuous {
sb.append(generic); sb.append(generic);
} }
for (ManaCostShard s : affectedCard.getManaCost()) { for (ManaCostShard s : affectedCard.getManaCost()) {
// TODO Sol Investigate, this loop feels wrong
ColorSet cs = ColorSet.fromMask(s.getColorMask()); ColorSet cs = ColorSet.fromMask(s.getColorMask());
if(cs.isColorless()) continue; if(cs.isColorless()) continue;
sb.append(' '); sb.append(' ');

View File

@@ -56,7 +56,7 @@ public class ColorSetRenderer extends ItemCellRenderer {
final int offsetIfNoSpace = cntGlyphs > 1 ? (cellWidth - padding0 - elemtWidth) / (cntGlyphs - 1) : elemtWidth + elemtGap; final int offsetIfNoSpace = cntGlyphs > 1 ? (cellWidth - padding0 - elemtWidth) / (cntGlyphs - 1) : elemtWidth + elemtGap;
final int dx = Math.min(elemtWidth + elemtGap, offsetIfNoSpace); final int dx = Math.min(elemtWidth + elemtGap, offsetIfNoSpace);
// Display colorless mana before colored mana // Display generic mana before colored mana
if (cntGlyphs == 0) { if (cntGlyphs == 0) {
CardFaceSymbols.drawSymbol(ManaCostShard.X.getImageKey(), g, x, y); CardFaceSymbols.drawSymbol(ManaCostShard.X.getImageKey(), g, x, y);
x += dx; x += dx;

View File

@@ -116,7 +116,7 @@ public class ManaCostRenderer extends ItemCellRenderer {
} }
} }
// Display colorless mana before colored mana // Display generic mana before colored mana
if (hasGeneric) { if (hasGeneric) {
final String sGeneric = Integer.toString(genericManaCost); final String sGeneric = Integer.toString(genericManaCost);
CardFaceSymbols.drawSymbol(sGeneric, g, x, y); CardFaceSymbols.drawSymbol(sGeneric, g, x, y);

View File

@@ -55,6 +55,7 @@ public class CardFaceSymbols {
MANA_IMAGES.put("X", FSkin.getImage(FSkinProp.IMG_MANA_X, manaImageSize, manaImageSize)); MANA_IMAGES.put("X", FSkin.getImage(FSkinProp.IMG_MANA_X, manaImageSize, manaImageSize));
MANA_IMAGES.put("Y", FSkin.getImage(FSkinProp.IMG_MANA_Y, manaImageSize, manaImageSize)); MANA_IMAGES.put("Y", FSkin.getImage(FSkinProp.IMG_MANA_Y, manaImageSize, manaImageSize));
MANA_IMAGES.put("Z", FSkin.getImage(FSkinProp.IMG_MANA_Z, manaImageSize, manaImageSize)); MANA_IMAGES.put("Z", FSkin.getImage(FSkinProp.IMG_MANA_Z, manaImageSize, manaImageSize));
MANA_IMAGES.put("C", FSkin.getImage(FSkinProp.IMG_MANA_COLORLESS, manaImageSize, manaImageSize));
MANA_IMAGES.put("B", FSkin.getImage(FSkinProp.IMG_MANA_B, manaImageSize, manaImageSize)); MANA_IMAGES.put("B", FSkin.getImage(FSkinProp.IMG_MANA_B, manaImageSize, manaImageSize));
MANA_IMAGES.put("BG", FSkin.getImage(FSkinProp.IMG_MANA_HYBRID_BG, manaImageSize, manaImageSize)); MANA_IMAGES.put("BG", FSkin.getImage(FSkinProp.IMG_MANA_HYBRID_BG, manaImageSize, manaImageSize));

View File

@@ -62,7 +62,7 @@ public class RunTest {
this.check("24", !manaCost.isPaid()); this.check("24", !manaCost.isPaid());
manaCost.payMana(MagicColor.Constant.BLUE); manaCost.payMana(MagicColor.Constant.BLUE);
this.check("25", !manaCost.isPaid()); this.check("25", !manaCost.isPaid());
manaCost.payMana(MagicColor.Constant.COLORLESS); manaCost.payMana(MagicColor.Constant.GENERIC);
this.check("26", !manaCost.isPaid()); this.check("26", !manaCost.isPaid());
manaCost.payMana(MagicColor.Constant.GREEN); manaCost.payMana(MagicColor.Constant.GREEN);
this.check("27", !manaCost.isPaid()); this.check("27", !manaCost.isPaid());

View File

@@ -273,7 +273,7 @@ public class PlayerControllerForTests extends PlayerController {
} }
@Override @Override
public CardCollectionView chooseCardsToDelve(int colorLessAmount, CardCollection grave) { public CardCollectionView chooseCardsToDelve(int genericAmount, CardCollection grave) {
return CardCollection.EMPTY; return CardCollection.EMPTY;
} }

View File

@@ -21,12 +21,12 @@ public class CardColorlessCostFilter extends ValueRangeFilter<PaperCard> {
@Override @Override
protected String getCaption() { protected String getCaption() {
return "Colorless Cost"; return "Generic Cost";
} }
@Override @Override
protected Predicate<PaperCard> buildPredicate() { protected Predicate<PaperCard> buildPredicate() {
Predicate<CardRules> predicate = getCardRulesFieldPredicate(CardRulesPredicates.LeafNumber.CardField.COLORLESS_COST); Predicate<CardRules> predicate = getCardRulesFieldPredicate(CardRulesPredicates.LeafNumber.CardField.GENERIC_COST);
if (predicate == null) { if (predicate == null) {
return Predicates.alwaysTrue(); return Predicates.alwaysTrue();
} }

View File

@@ -82,7 +82,7 @@ public enum FSkinProp {
IMG_MANA_PHRYX_B (new int[] {320, 360, 40, 40}, PropType.IMAGE), IMG_MANA_PHRYX_B (new int[] {320, 360, 40, 40}, PropType.IMAGE),
IMG_MANA_SNOW (new int[] {320, 160, 40, 40}, PropType.IMAGE), IMG_MANA_SNOW (new int[] {320, 160, 40, 40}, PropType.IMAGE),
//colorless mana images //generic mana images
IMG_MANA_0 (new int[] {640, 200, 20, 20}, PropType.IMAGE), IMG_MANA_0 (new int[] {640, 200, 20, 20}, PropType.IMAGE),
IMG_MANA_1 (new int[] {660, 200, 20, 20}, PropType.IMAGE), IMG_MANA_1 (new int[] {660, 200, 20, 20}, PropType.IMAGE),
IMG_MANA_2 (new int[] {640, 220, 20, 20}, PropType.IMAGE), IMG_MANA_2 (new int[] {640, 220, 20, 20}, PropType.IMAGE),

View File

@@ -169,7 +169,7 @@ public class CardDetailUtil {
if (curColors.hasGreen()) { strCurColors += "{G}"; } if (curColors.hasGreen()) { strCurColors += "{G}"; }
if (strCurColors.isEmpty()) { if (strCurColors.isEmpty()) {
strCurColors = "{X} (colorless)"; strCurColors = "{C}";
} }
return strCurColors; return strCurColors;

View File

@@ -168,7 +168,7 @@ public class DeckProxy implements InventoryItem {
else { else {
for (final ManaCostShard shard : rules.getManaCost()) { for (final ManaCostShard shard : rules.getManaCost()) {
//track phyrexian and hybrid costs separately as they won't always affect color //track phyrexian and hybrid costs separately as they won't always affect color
if (shard.isPhyrexian() || shard.isOr2Colorless() || !shard.isMonoColor()) { if (shard.isPhyrexian() || shard.isOr2Generic() || !shard.isMonoColor()) {
if (nonReqColors == null) { if (nonReqColors == null) {
nonReqColors = new HashSet<Byte>(); nonReqColors = new HashSet<Byte>();
} }

View File

@@ -129,8 +129,8 @@ public abstract class InputPayMana extends InputSyncronizedBase {
colorCanUse |= color; colorCanUse |= color;
} }
} }
if (manaCost.isAnyPartPayableWith((byte) ManaAtom.COLORLESS, player.getManaPool())) { if (manaCost.isAnyPartPayableWith((byte) ManaAtom.GENERIC, player.getManaPool())) {
colorCanUse |= ManaAtom.COLORLESS; colorCanUse |= ManaAtom.GENERIC;
} }
if (colorCanUse == 0) { // no mana cost or something if (colorCanUse == 0) { // no mana cost or something
return abilities; return abilities;
@@ -183,8 +183,8 @@ public abstract class InputPayMana extends InputSyncronizedBase {
if (manaCost.isAnyPartPayableWith(color, player.getManaPool())) { colorCanUse |= color; } if (manaCost.isAnyPartPayableWith(color, player.getManaPool())) { colorCanUse |= color; }
if (manaCost.needsColor(color, player.getManaPool())) { colorNeeded |= color; } if (manaCost.needsColor(color, player.getManaPool())) { colorNeeded |= color; }
} }
if (manaCost.isAnyPartPayableWith((byte) ManaAtom.COLORLESS, player.getManaPool())) { if (manaCost.isAnyPartPayableWith((byte) ManaAtom.GENERIC, player.getManaPool())) {
colorCanUse |= ManaAtom.COLORLESS; colorCanUse |= ManaAtom.GENERIC;
} }
if (colorCanUse == 0) { // no mana cost or something if (colorCanUse == 0) { // no mana cost or something
@@ -293,7 +293,7 @@ public abstract class InputPayMana extends InputSyncronizedBase {
} }
private static boolean abilityProducesManaColor(final SpellAbility am, AbilityManaPart m, final byte neededColor) { private static boolean abilityProducesManaColor(final SpellAbility am, AbilityManaPart m, final byte neededColor) {
if (0 != (neededColor & ManaAtom.COLORLESS)) { if (0 != (neededColor & ManaAtom.GENERIC)) {
return true; return true;
} }

View File

@@ -60,7 +60,7 @@ public final class InputSelectCardsForConvoke extends InputSelectManyBase<Card>
colors = ColorSet.fromMask(colors.getColor() & remainingCost.getUnpaidColors()); colors = ColorSet.fromMask(colors.getColor() & remainingCost.getUnpaidColors());
} }
if (!colors.isMulticolor()) { if (!colors.isMulticolor()) {
// Since the convoke mana logic can use colored mana as colorless if needed, // Since the convoke mana logic can use colored mana as generic if needed,
// there is no need to prompt the user when convoking with a mono-color creature. // there is no need to prompt the user when convoking with a mono-color creature.
chosenColor = colors.getColor(); chosenColor = colors.getColor();
} }

View File

@@ -701,8 +701,8 @@ public class PlayerControllerHuman
} }
@Override @Override
public CardCollectionView chooseCardsToDelve(final int colorLessAmount, final CardCollection grave) { public CardCollectionView chooseCardsToDelve(final int genericAmount, final CardCollection grave) {
final int cardsInGrave = Math.min(colorLessAmount, grave.size()); final int cardsInGrave = Math.min(genericAmount, grave.size());
if (cardsInGrave == 0) { if (cardsInGrave == 0) {
return CardCollection.EMPTY; return CardCollection.EMPTY;
} }
@@ -1437,7 +1437,7 @@ public class PlayerControllerHuman
} else { } else {
FThreads.invokeInEdtNowOrLater(new Runnable() { FThreads.invokeInEdtNowOrLater(new Runnable() {
@Override public final void run() { @Override public final void run() {
getGui().message("Cannot pass priority at this time."); //getGui().message("Cannot pass priority at this time.");
} }
}); });
} }