mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Mostly cosmetic changes to color code
This commit is contained in:
@@ -2,6 +2,7 @@ package forge.game.ability;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import forge.card.ColorSet;
|
||||
import forge.card.MagicColor;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaCostShard;
|
||||
@@ -1494,9 +1495,9 @@ public class AbilityUtils {
|
||||
String convertTo = params.get(key);
|
||||
byte convertByte = 0;
|
||||
if ("All".equals(convertTo)) {
|
||||
convertByte = MagicColor.ALL_COLORS;
|
||||
} else{
|
||||
for(String convertColor : convertTo.split(",")) {
|
||||
convertByte = ColorSet.ALL_COLORS.getColor();
|
||||
} else {
|
||||
for (final String convertColor : convertTo.split(",")) {
|
||||
convertByte |= MagicColor.fromName(convertColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ChangeTextEffect extends SpellAbilityEffect {
|
||||
final String[] changedColorWordsArray = sa.getParam("ChangeColorWord").split(" ");
|
||||
if (changedColorWordsArray[0].equals("Choose")) {
|
||||
originalColor = sa.getActivatingPlayer().getController().chooseColor(
|
||||
"Choose a color word to replace", sa, ColorSet.fromMask(MagicColor.ALL_COLORS));
|
||||
"Choose a color word to replace", sa, ColorSet.ALL_COLORS);
|
||||
changedColorWordOriginal = TextUtil.capitalize(MagicColor.toLongString(originalColor));
|
||||
} else {
|
||||
changedColorWordOriginal = changedColorWordsArray[0];
|
||||
@@ -43,7 +43,7 @@ public class ChangeTextEffect extends SpellAbilityEffect {
|
||||
if (changedColorWordsArray[1].equals("Choose")) {
|
||||
final ColorSet possibleNewColors;
|
||||
if (originalColor == 0) { // no original color (ie. any or absent)
|
||||
possibleNewColors = ColorSet.fromMask(MagicColor.ALL_COLORS);
|
||||
possibleNewColors = ColorSet.ALL_COLORS;
|
||||
} else { // may choose any except original color
|
||||
possibleNewColors = ColorSet.fromMask(originalColor).inverse();
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class ChangeTextEffect extends SpellAbilityEffect {
|
||||
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
||||
*/
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
protected String getStackDescription(final SpellAbility sa) {
|
||||
final String changedColorWordOriginal, changedColorWordNew;
|
||||
if (sa.hasParam("ChangeColorWord")) {
|
||||
final String[] changedColorWordsArray = sa.getParam("ChangeColorWord").split(" ");
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ManaEffect extends SpellAbilityEffect {
|
||||
for (int nChar = 0; nChar < colorsNeeded.length(); nChar++) {
|
||||
mask |= MagicColor.fromName(colorsNeeded.charAt(nChar));
|
||||
}
|
||||
colorMenu = ColorSet.fromMask(mask == 0 ? MagicColor.ALL_COLORS : mask);
|
||||
colorMenu = mask == 0 ? ColorSet.ALL_COLORS : ColorSet.fromMask(mask);
|
||||
byte val = act.getController().chooseColor("Select Mana to Produce", sa, colorMenu);
|
||||
if (0 == val) {
|
||||
throw new RuntimeException("ManaEffect::resolve() /*any mana*/ - " + act + " color mana choice is empty for " + card.getName());
|
||||
|
||||
@@ -417,7 +417,7 @@ public class ManaCostBeingPaid {
|
||||
|
||||
if (bill.isMonoColor()) {
|
||||
if (bill.isOr2Colorless()) {
|
||||
return (bill.getColorMask() & paymentColor & MagicColor.ALL_COLORS) != 0? 9 : 4;
|
||||
return !ColorSet.fromMask(bill.getColorMask() & paymentColor).isColorless() ? 9 : 4;
|
||||
}
|
||||
if (!bill.isPhyrexian()) {
|
||||
return 10;
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import forge.GameCommand;
|
||||
import forge.card.ColorSet;
|
||||
import forge.card.MagicColor;
|
||||
import forge.card.mana.ManaCostShard;
|
||||
import forge.game.GlobalRuleChange;
|
||||
@@ -368,7 +369,7 @@ public class ManaPool implements Iterable<Mana> {
|
||||
colorConversionMatrix[i] = identityMatrix[i];
|
||||
}
|
||||
for (int i = 0; i < colorRestrictionMatrix.length; i++) {
|
||||
colorRestrictionMatrix[i] = MagicColor.ALL_COLORS;
|
||||
colorRestrictionMatrix[i] = ColorSet.ALL_COLORS.getColor();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package forge.game.player;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import forge.card.MagicColor;
|
||||
import forge.card.ColorSet;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
|
||||
@@ -15,17 +15,17 @@ public class AchievementTracker {
|
||||
public int maxStormCount = 0;
|
||||
public int landsPlayed = 0;
|
||||
|
||||
public void onSpellAbilityPlayed(SpellAbility sa) {
|
||||
public void onSpellAbilityPlayed(final SpellAbility sa) {
|
||||
final Card card = sa.getHostCard();
|
||||
if (sa.getRestrictions().isPwAbility() && sa.hasParam("Ultimate")) {
|
||||
activatedUltimates.add(card.getName());
|
||||
}
|
||||
if (card.determineColor().getColor() == MagicColor.ALL_COLORS) {
|
||||
if (card.determineColor().equals(ColorSet.ALL_COLORS)) {
|
||||
challengesCompleted.add("Chromatic");
|
||||
}
|
||||
}
|
||||
|
||||
public void onSpellResolve(SpellAbility spell) {
|
||||
public void onSpellResolve(final SpellAbility spell) {
|
||||
final Card card = spell.getHostCard();
|
||||
if (card.hasKeyword("Epic")) {
|
||||
challengesCompleted.add("Epic");
|
||||
|
||||
@@ -619,14 +619,14 @@ public class AbilityManaPart implements java.io.Serializable {
|
||||
}
|
||||
if (manaReplace.startsWith("Any")) {
|
||||
// Replace any type and amount
|
||||
String replaced = manaReplace.split("->")[1];
|
||||
if (replaced.equals("Any")) {
|
||||
String replaced = manaReplace.split("->")[1];
|
||||
if (replaced.equals("Any")) {
|
||||
byte rs = MagicColor.GREEN;
|
||||
if (act != null) {
|
||||
rs = act.getController().chooseColor("Choose a color", sa, ColorSet.fromMask(MagicColor.ALL_COLORS));
|
||||
rs = act.getController().chooseColor("Choose a color", sa, ColorSet.ALL_COLORS);
|
||||
}
|
||||
replaced = MagicColor.toShortString(rs);
|
||||
}
|
||||
}
|
||||
return replaced;
|
||||
}
|
||||
final Pattern splitter = Pattern.compile("->");
|
||||
@@ -657,7 +657,7 @@ public class AbilityManaPart implements java.io.Serializable {
|
||||
while (replaced.contains("Any")) {
|
||||
byte rs = MagicColor.GREEN;
|
||||
if (act != null) {
|
||||
rs = act.getController().chooseColor("Choose a color", sa, ColorSet.fromMask(MagicColor.ALL_COLORS));
|
||||
rs = act.getController().chooseColor("Choose a color", sa, ColorSet.ALL_COLORS);
|
||||
}
|
||||
replaced = replaced.replaceFirst("Any", MagicColor.toShortString(rs));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user