mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
- Fixing Colorless costs so they can't be paid by Colored mana for Humans (This may prevent AI from paying Colorless costs)
This commit is contained in:
@@ -9,12 +9,13 @@ import com.google.common.collect.ImmutableMap;
|
||||
*/
|
||||
public final class MagicColor {
|
||||
|
||||
public static final byte COLORLESS = 0;
|
||||
// Colorless value synchronized with value in ManaAtom
|
||||
public static final byte WHITE = 1 << 0;
|
||||
public static final byte BLUE = 1 << 1;
|
||||
public static final byte BLACK = 1 << 2;
|
||||
public static final byte RED = 1 << 3;
|
||||
public static final byte GREEN = 1 << 4;
|
||||
public static final byte COLORLESS = 1 << 5;
|
||||
|
||||
public static final int NUMBER_OR_COLORS = 5;
|
||||
|
||||
@@ -82,7 +83,7 @@ public final class MagicColor {
|
||||
case BLACK: return "B";
|
||||
case RED: return "R";
|
||||
case GREEN: return "G";
|
||||
default: return "1";
|
||||
default: return "C";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import forge.card.MagicColor;
|
||||
|
||||
/** A bitmask to represent any mana symbol as an integer. */
|
||||
public abstract class ManaAtom {
|
||||
public static final int GENERIC = 1 << 6;
|
||||
|
||||
/** The Constant WHITE. */
|
||||
public static final int WHITE = MagicColor.WHITE;
|
||||
|
||||
@@ -21,6 +19,9 @@ public abstract class ManaAtom {
|
||||
/** The Constant GREEN. */
|
||||
public static final int GREEN = MagicColor.GREEN;
|
||||
|
||||
public static final int COLORLESS = MagicColor.COLORLESS;
|
||||
public static final int GENERIC = 1 << 6;
|
||||
|
||||
/** The Constant IS_X. */
|
||||
public static final int IS_X = 1 << 8;
|
||||
|
||||
@@ -32,6 +33,4 @@ public abstract class ManaAtom {
|
||||
|
||||
/** The Constant IS_SNOW. */
|
||||
public static final int IS_SNOW = 1 << 11;
|
||||
|
||||
public static final int COLORLESS = 1 << 12;
|
||||
}
|
||||
@@ -289,6 +289,7 @@ public enum ManaCostShard {
|
||||
}
|
||||
|
||||
public boolean canBePaidWithManaOfColor(byte colorCode) {
|
||||
return this.isOr2Generic() || (COLORS_SUPERPOSITION & this.shard) == 0 || (colorCode & this.shard) > 0;
|
||||
return this.isOr2Generic() || ((COLORS_SUPERPOSITION | ManaAtom.COLORLESS) & this.shard) == 0 ||
|
||||
(colorCode & this.shard) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user