mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
* Added to all toUpperCase/toLowerCase calls the Locale.ENGLISH to prevent problems with some languages (e.g. Turkish). Removed some unused import statements. (#4634).
This commit is contained in:
parent
03ebdc17d8
commit
b073ce1c42
147 changed files with 1419 additions and 1496 deletions
|
|
@ -1217,7 +1217,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
|||
String searchStr = "";
|
||||
if (searchByTextField.getText().length() >= 3) {
|
||||
useText = true;
|
||||
searchStr = searchByTextField.getText().toLowerCase();
|
||||
searchStr = searchByTextField.getText().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
for (CardType cardType : selectByTypeButtons.keySet()) {
|
||||
|
|
@ -1267,20 +1267,20 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
|||
boolean s = card.isSelected();
|
||||
// Name
|
||||
if (!s) {
|
||||
s |= card.getName().toLowerCase().contains(searchStr);
|
||||
s |= card.getName().toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||
}
|
||||
// Sub & Super Types
|
||||
if (!s) {
|
||||
for (SuperType str : card.getSuperTypes()) {
|
||||
s |= str.toString().toLowerCase().contains(searchStr);
|
||||
s |= str.toString().toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||
}
|
||||
for (SubType str : card.getSubTypes()) {
|
||||
s |= str.toString().toLowerCase().contains(searchStr);
|
||||
s |= str.toString().toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||
}
|
||||
}
|
||||
// Rarity
|
||||
if (!s) {
|
||||
s |= card.getRarity().toString().toLowerCase().contains(searchStr);
|
||||
s |= card.getRarity().toString().toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||
}
|
||||
// Type line
|
||||
if (!s) {
|
||||
|
|
@ -1288,7 +1288,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
|||
for (CardType type : card.getCardTypes()) {
|
||||
t += ' ' + type.toString();
|
||||
}
|
||||
s |= t.toLowerCase().contains(searchStr);
|
||||
s |= t.toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||
}
|
||||
// Casting cost
|
||||
if (!s) {
|
||||
|
|
@ -1296,12 +1296,12 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
|||
for (String m : card.getManaCost()) {
|
||||
mc += m;
|
||||
}
|
||||
s |= mc.toLowerCase().contains(searchStr);
|
||||
s |= mc.toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||
}
|
||||
// Rules
|
||||
if (!s) {
|
||||
for (String str : card.getRules()) {
|
||||
s |= str.toLowerCase().contains(searchStr);
|
||||
s |= str.toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||
}
|
||||
}
|
||||
card.setSelected(s);
|
||||
|
|
@ -1348,21 +1348,21 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
|||
}
|
||||
// Sub & Super Types
|
||||
for (SuperType type : card.getSuperTypes()) {
|
||||
t += ' ' + type.toString().toLowerCase();
|
||||
t += ' ' + type.toString().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
for (SubType str : card.getSubTypes()) {
|
||||
t += " " + str.toString().toLowerCase();
|
||||
t += " " + str.toString().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
for (String qty : qtys.keySet()) {
|
||||
int value = qtys.get(qty);
|
||||
if (t.toLowerCase().contains(qty)) {
|
||||
if (t.toLowerCase(Locale.ENGLISH).contains(qty)) {
|
||||
qtys.put(qty, ++value);
|
||||
}
|
||||
|
||||
// Rules
|
||||
for (String str : card.getRules()) {
|
||||
if (str.toLowerCase().contains(qty)) {
|
||||
if (str.toLowerCase(Locale.ENGLISH).contains(qty)) {
|
||||
qtys.put(qty, ++value);
|
||||
}
|
||||
}
|
||||
|
|
@ -1380,10 +1380,10 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
|||
}
|
||||
mc = mc.replaceAll("\\{([WUBRG]).([WUBRG])\\}", "{$1}{$2}");
|
||||
mc = mc.replaceAll("\\{", "#");
|
||||
mc = mc.toLowerCase();
|
||||
mc = mc.toLowerCase(Locale.ENGLISH);
|
||||
for (String pip : pips.keySet()) {
|
||||
int value = pips.get(pip);
|
||||
while (mc.toLowerCase().contains(pip)) {
|
||||
while (mc.toLowerCase(Locale.ENGLISH).contains(pip)) {
|
||||
pips.put(pip, ++value);
|
||||
mc = mc.replaceFirst(pip, "");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import java.awt.Font;
|
|||
import java.awt.event.KeyEvent;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
|
@ -204,7 +205,7 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
|||
}
|
||||
message = '.' + message + '.';
|
||||
|
||||
message = message.toLowerCase();
|
||||
message = message.toLowerCase(Locale.ENGLISH);
|
||||
message = message.replaceAll("[a@]([s5][s5]+)", "axyx");
|
||||
message = message.replaceAll("b.([t\\+][t\\+]+)", "buxyx");
|
||||
message = message.replaceAll("(.)(\\1{1,})", "$1");
|
||||
|
|
@ -280,11 +281,11 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
|||
}
|
||||
if (messageType == MessageType.WHISPER_FROM) {
|
||||
if (username.equalsIgnoreCase(SessionHandler.getUserName())) {
|
||||
if (message.toLowerCase().startsWith("profanity 0")) {
|
||||
if (message.toLowerCase(Locale.ENGLISH).startsWith("profanity 0")) {
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "0");
|
||||
} else if (message.toLowerCase().startsWith("profanity 1")) {
|
||||
} else if (message.toLowerCase(Locale.ENGLISH).startsWith("profanity 1")) {
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "1");
|
||||
} else if (message.toLowerCase().startsWith("profanity 2")) {
|
||||
} else if (message.toLowerCase(Locale.ENGLISH).startsWith("profanity 2")) {
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "2");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
return choice;
|
||||
}
|
||||
choice = Jsoup.parse(choice).text(); // decode HTML entities and strip tags
|
||||
return choice.substring(0, 1).toUpperCase() + choice.substring(1);
|
||||
return choice.substring(0, 1).toUpperCase(Locale.ENGLISH) + choice.substring(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ package mage.client.deck.generator;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -86,7 +87,7 @@ public final class DeckGenerator {
|
|||
|
||||
String selectedColors = genDialog.getSelectedColors();
|
||||
List<ColoredManaSymbol> allowedColors = new ArrayList<>();
|
||||
selectedColors = selectedColors != null ? selectedColors.toUpperCase() : getRandomColors("X");
|
||||
selectedColors = selectedColors != null ? selectedColors.toUpperCase(Locale.ENGLISH) : getRandomColors("X");
|
||||
String format = genDialog.getSelectedFormat();
|
||||
|
||||
List<String> setsToUse = ConstructedFormats.getSetsByFormat(format);
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.client.deck.generator;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author Simown
|
||||
|
|
@ -74,23 +74,24 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
|||
|
||||
}
|
||||
|
||||
private static class AdjustingSliderGroup
|
||||
{
|
||||
private static class AdjustingSliderGroup {
|
||||
|
||||
private final ArrayList<JStorageSlider> storageSliders;
|
||||
private int sliderIndex = 0;
|
||||
|
||||
AdjustingSliderGroup(JStorageSlider... sliders)
|
||||
{
|
||||
AdjustingSliderGroup(JStorageSlider... sliders) {
|
||||
storageSliders = new ArrayList<>();
|
||||
for (JStorageSlider slider : sliders) {
|
||||
storageSliders.add(slider);
|
||||
slider.addChangeListener(e -> fireSliderChangedEvent((JStorageSlider) e.getSource()));
|
||||
}
|
||||
}
|
||||
|
||||
public void fireSliderChangedEvent(JStorageSlider source) {
|
||||
// We don't want to do anything if the value isn't changing
|
||||
if(!source.getValueIsAdjusting())
|
||||
if (!source.getValueIsAdjusting()) {
|
||||
return;
|
||||
}
|
||||
// Update the slider depending on how much it's changed relative to its previous position
|
||||
int change = (source.getValue() - source.getPreviousValue());
|
||||
updateSliderPosition(change, source);
|
||||
|
|
@ -156,7 +157,7 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
|||
textLabels.add(titleLabel);
|
||||
sliderPanel.add(titleLabel, BorderLayout.WEST);
|
||||
// Slider
|
||||
slider.setToolTipText("Percentage of " + label.trim().toLowerCase() + " in the generated deck.");
|
||||
slider.setToolTipText("Percentage of " + label.trim().toLowerCase(Locale.ENGLISH) + " in the generated deck.");
|
||||
sliderPanel.add(slider, BorderLayout.CENTER);
|
||||
// Percentage
|
||||
JLabel percentageLabel = createChangingPercentageLabel(slider);
|
||||
|
|
@ -227,7 +228,4 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
|||
landSlider.previousValue = percentage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1125,7 +1125,7 @@ class DeckFilter extends FileFilter {
|
|||
int i = s.lastIndexOf('.');
|
||||
|
||||
if (i > 0 && i < s.length() - 1) {
|
||||
ext = s.substring(i + 1).toLowerCase();
|
||||
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
return (ext == null) ? false : ext.equals("dck");
|
||||
}
|
||||
|
|
@ -1149,10 +1149,10 @@ class ImportFilter extends FileFilter {
|
|||
int i = s.lastIndexOf('.');
|
||||
|
||||
if (i > 0 && i < s.length() - 1) {
|
||||
ext = s.substring(i + 1).toLowerCase();
|
||||
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
if (ext != null) {
|
||||
if (ext.toLowerCase().equals("dec") || ext.toLowerCase().equals("mwdeck") || ext.toLowerCase().equals("txt") || ext.toLowerCase().equals("dek")) {
|
||||
if (ext.toLowerCase(Locale.ENGLISH).equals("dec") || ext.toLowerCase(Locale.ENGLISH).equals("mwdeck") || ext.toLowerCase(Locale.ENGLISH).equals("txt") || ext.toLowerCase(Locale.ENGLISH).equals("dek")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
|
|
@ -500,10 +501,10 @@ public class MageBook extends JComponent {
|
|||
className = className.replaceAll("[^a-zA-Z0-9]", "");
|
||||
className = "mage.game.permanent.token." + className + "Token";
|
||||
if (token.getTokenClassName() != null && token.getTokenClassName().length() > 0) {
|
||||
if (token.getTokenClassName().toLowerCase().matches(".*token.*")) {
|
||||
if (token.getTokenClassName().toLowerCase(Locale.ENGLISH).matches(".*token.*")) {
|
||||
className = token.getTokenClassName();
|
||||
className = "mage.game.permanent.token." + className;
|
||||
} else if (token.getTokenClassName().toLowerCase().matches(".*emblem.*")) {
|
||||
} else if (token.getTokenClassName().toLowerCase(Locale.ENGLISH).matches(".*emblem.*")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -541,7 +542,7 @@ public class MageBook extends JComponent {
|
|||
try {
|
||||
String className = emblem.getName();
|
||||
if (emblem.getTokenClassName() != null && emblem.getTokenClassName().length() > 0) {
|
||||
if (emblem.getTokenClassName().toLowerCase().matches(".*emblem.*")) {
|
||||
if (emblem.getTokenClassName().toLowerCase(Locale.ENGLISH).matches(".*emblem.*")) {
|
||||
className = emblem.getTokenClassName();
|
||||
className = "mage.game.command.emblems." + className;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ import mage.view.CardsView;
|
|||
import org.apache.log4j.Logger;
|
||||
import org.jdesktop.swingx.JXPanel;
|
||||
import org.mage.card.arcane.ManaSymbols;
|
||||
import org.mage.card.arcane.UI;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ import java.awt.Dimension;
|
|||
import java.awt.Point;
|
||||
import java.beans.PropertyVetoException;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import javax.swing.ImageIcon;
|
||||
|
|
|
|||
|
|
@ -51,11 +51,9 @@ import java.net.URL;
|
|||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
|
@ -723,14 +721,14 @@ public class ConnectDialog extends MageDialog {
|
|||
|
||||
}//GEN-LAST:event_btnFind2findPublicServerActionPerformed
|
||||
|
||||
private void connectXmageus(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_connecXmageusW
|
||||
private void connectXmageus(java.awt.event.ActionEvent evt) {
|
||||
String serverAddress = "xmage.us";
|
||||
this.txtServer.setText(serverAddress);
|
||||
this.txtPort.setText("17171");
|
||||
// Update userName and password according to the chosen server.
|
||||
this.txtUserName.setText(MagePreferences.getUserName(serverAddress));
|
||||
this.txtPassword.setText(MagePreferences.getPassword(serverAddress));
|
||||
}//GEN-LAST:event_connectXmageus
|
||||
}
|
||||
|
||||
private void btnFlagSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFlagSearchActionPerformed
|
||||
doFastFlagSearch();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.1" encoding="UTF-8" ?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<Properties>
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
|
|
|
|||
|
|
@ -25,14 +25,13 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.client.dialog;
|
||||
|
||||
import java.util.Locale;
|
||||
import javax.swing.*;
|
||||
import mage.client.SessionHandler;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* Feedback dialog.
|
||||
*
|
||||
|
|
@ -47,17 +46,19 @@ public class FeedbackDialog extends javax.swing.JDialog {
|
|||
"Thank you or \"Devs, you are so cool!\"",
|
||||
"Question or \"I'm so curious about\""};
|
||||
|
||||
/** Creates new form PreferencesDialog */
|
||||
/**
|
||||
* Creates new form PreferencesDialog
|
||||
*/
|
||||
public FeedbackDialog(java.awt.Frame parent, boolean modal) {
|
||||
super(parent, modal);
|
||||
initComponents();
|
||||
cbFeedbackType.setModel(new DefaultComboBoxModel(feedbackTypes));
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
* initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is
|
||||
* always regenerated by the Form Editor.
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
|
|
@ -259,16 +260,16 @@ public class FeedbackDialog extends javax.swing.JDialog {
|
|||
if (type == null || type.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
if (type.toLowerCase().startsWith("bug")) {
|
||||
if (type.toLowerCase(Locale.ENGLISH).startsWith("bug")) {
|
||||
return "bug";
|
||||
}
|
||||
if (type.toLowerCase().startsWith("feature")) {
|
||||
if (type.toLowerCase(Locale.ENGLISH).startsWith("feature")) {
|
||||
return "feature";
|
||||
}
|
||||
if (type.toLowerCase().startsWith("thank")) {
|
||||
if (type.toLowerCase(Locale.ENGLISH).startsWith("thank")) {
|
||||
return "thank";
|
||||
}
|
||||
if (type.toLowerCase().startsWith("question")) {
|
||||
if (type.toLowerCase(Locale.ENGLISH).startsWith("question")) {
|
||||
return "question";
|
||||
}
|
||||
return "";
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
|
|
@ -1264,7 +1265,7 @@ class DeckFilter extends FileFilter {
|
|||
int i = s.lastIndexOf('.');
|
||||
|
||||
if (i > 0 && i < s.length() - 1) {
|
||||
ext = s.substring(i + 1).toLowerCase();
|
||||
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
return (ext == null) ? false : ext.equals("dck");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,11 +210,11 @@ public class PickChoiceDialog extends MageDialog {
|
|||
// load data to datamodel after filter or on startup
|
||||
String filter = choice.getSearchText();
|
||||
if (filter == null){ filter = ""; }
|
||||
filter = filter.toLowerCase();
|
||||
filter = filter.toLowerCase(Locale.ENGLISH);
|
||||
|
||||
this.dataModel.clear();
|
||||
for(KeyValueItem item: this.allItems){
|
||||
if(!choice.isSearchEnabled() || item.Value.toLowerCase().contains(filter)){
|
||||
if(!choice.isSearchEnabled() || item.Value.toLowerCase(Locale.ENGLISH).contains(filter)){
|
||||
this.dataModel.addElement(item);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@
|
|||
package mage.client.dialog;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import javax.swing.*;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import java.io.File;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.prefs.BackingStoreException;
|
||||
import java.util.prefs.Preferences;
|
||||
|
|
@ -3492,7 +3493,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
|
||||
private static void loadProxySettings(Preferences prefs) {
|
||||
dialog.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get(KEY_PROXY_TYPE, "NONE").toUpperCase()));
|
||||
dialog.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get(KEY_PROXY_TYPE, "NONE").toUpperCase(Locale.ENGLISH)));
|
||||
|
||||
load(prefs, dialog.txtProxyServer, KEY_PROXY_ADDRESS, Config.serverName);
|
||||
load(prefs, dialog.txtProxyPort, KEY_PROXY_PORT, Integer.toString(Config.port));
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ import mage.client.util.gui.ArrowBuilder;
|
|||
import mage.client.util.gui.MageDialogState;
|
||||
import mage.constants.*;
|
||||
import mage.game.events.PlayerQueryEvent;
|
||||
import mage.game.turn.Phase;
|
||||
import mage.view.*;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.card.arcane.CardPanel;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ import javax.swing.SwingUtilities;
|
|||
import javax.swing.ToolTipManager;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.LineBorder;
|
||||
|
||||
import mage.client.SessionHandler;
|
||||
import mage.client.components.MageTextArea;
|
||||
|
|
|
|||
|
|
@ -31,18 +31,17 @@
|
|||
*
|
||||
* Created on 15-Dec-2009, 10:09:46 PM
|
||||
*/
|
||||
|
||||
package mage.client.table;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.deck.generator.DeckGenerator;
|
||||
import mage.client.util.Config;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -51,7 +50,9 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
|||
|
||||
private final JFileChooser fcSelectDeck;
|
||||
|
||||
/** Creates new form NewPlayerPanel */
|
||||
/**
|
||||
* Creates new form NewPlayerPanel
|
||||
*/
|
||||
public NewPlayerPanel() {
|
||||
initComponents();
|
||||
fcSelectDeck = new JFileChooser();
|
||||
|
|
@ -86,7 +87,8 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
|||
this.txtPlayerDeck.setText(file.getPath());
|
||||
try {
|
||||
MageFrame.getPreferences().put("lastDeckFolder", file.getCanonicalPath());
|
||||
} catch (IOException ex) { }
|
||||
} catch (IOException ex) {
|
||||
}
|
||||
}
|
||||
fcSelectDeck.setSelectedFile(null);
|
||||
}
|
||||
|
|
@ -111,7 +113,6 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
|||
this.txtPlayerDeck.setText(deckFile);
|
||||
}
|
||||
|
||||
|
||||
public int getLevel() {
|
||||
return (Integer) spnLevel.getValue();
|
||||
}
|
||||
|
|
@ -128,10 +129,10 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
|||
this.btnPlayerDeck.setVisible(show);
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
* initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is
|
||||
* always regenerated by the Form Editor.
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
|
|
@ -211,7 +212,6 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
|||
generateDeck();
|
||||
}//GEN-LAST:event_btnGenerateActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnGenerate;
|
||||
private javax.swing.JButton btnPlayerDeck;
|
||||
|
|
@ -238,7 +238,7 @@ class DeckFilter extends FileFilter {
|
|||
int i = s.lastIndexOf('.');
|
||||
|
||||
if (i > 0 && i < s.length() - 1) {
|
||||
ext = s.substring(i+1).toLowerCase();
|
||||
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
return (ext == null) ? false : ext.equals("dck");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.client.util;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Locale;
|
||||
import mage.view.CardView;
|
||||
|
||||
/**
|
||||
|
|
@ -99,7 +100,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
|
|||
boolean whenYouCast = false;
|
||||
|
||||
for (String str : card.getRules()) {
|
||||
String s = str.toLowerCase();
|
||||
String s = str.toLowerCase(Locale.ENGLISH);
|
||||
annihilator |= s.contains("annihilator");
|
||||
anyNumberOfTarget |= s.contains("any number");
|
||||
buyback |= s.contains("buyback");
|
||||
|
|
@ -332,16 +333,16 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
|
|||
}
|
||||
|
||||
if (card.getCardTypes().contains("Plainswalker")) {
|
||||
if (card.getName().toLowerCase().equals("jace, the mind sculptor")) {
|
||||
if (card.getName().toLowerCase(Locale.ENGLISH).equals("jace, the mind sculptor")) {
|
||||
thisMaxPower = Math.max(thisMaxPower, 6);
|
||||
}
|
||||
if (card.getName().toLowerCase().equals("ugin, the spirit dragon")) {
|
||||
if (card.getName().toLowerCase(Locale.ENGLISH).equals("ugin, the spirit dragon")) {
|
||||
thisMaxPower = Math.max(thisMaxPower, 5);
|
||||
}
|
||||
thisMaxPower = Math.max(thisMaxPower, 4);
|
||||
}
|
||||
|
||||
String cn = card.getName().toLowerCase();
|
||||
String cn = card.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (cn.equals("ancient tomb")
|
||||
|| cn.equals("anafenza, the foremost")
|
||||
|| cn.equals("arcum dagsson")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package mage.client.util;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.client.SessionHandler;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package mage.client.util;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.preference.MagePreferences;
|
||||
import mage.view.ChatMessage;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
public final class IgnoreList {
|
||||
|
||||
private static final String USAGE = "<br/><font color=yellow>\\ignore - shows current ignore list on this server."
|
||||
|
|
@ -15,8 +14,8 @@ public final class IgnoreList {
|
|||
+ "<br/>\\unignore [username] - remove a username from your ignore list on this server.</font>";
|
||||
|
||||
public static final int MAX_IGNORE_LIST_SIZE = 50;
|
||||
public static Set<ChatMessage.MessageType> IGNORED_MESSAGE_TYPES =
|
||||
ImmutableSet.of(ChatMessage.MessageType.TALK,
|
||||
public static Set<ChatMessage.MessageType> IGNORED_MESSAGE_TYPES
|
||||
= ImmutableSet.of(ChatMessage.MessageType.TALK,
|
||||
ChatMessage.MessageType.WHISPER_FROM);
|
||||
|
||||
public static String usage() {
|
||||
|
|
@ -45,22 +44,13 @@ public final class IgnoreList {
|
|||
}
|
||||
|
||||
if (userIsIgnored(serverAddress, user)) {
|
||||
return new StringBuilder()
|
||||
.append(user)
|
||||
.append(" is already on your ignore list on ")
|
||||
.append(serverAddress)
|
||||
.toString();
|
||||
return user + " is already on your ignore list on " + serverAddress;
|
||||
}
|
||||
|
||||
MagePreferences.addIgnoredUser(serverAddress, user);
|
||||
updateTablesTable();
|
||||
|
||||
return new StringBuilder()
|
||||
.append("Added ")
|
||||
.append(user)
|
||||
.append(" to your ignore list on ")
|
||||
.append(serverAddress)
|
||||
.toString();
|
||||
return "Added " + user + " to your ignore list on " + serverAddress;
|
||||
}
|
||||
|
||||
private static void updateTablesTable() {
|
||||
|
|
@ -76,19 +66,9 @@ public final class IgnoreList {
|
|||
}
|
||||
if (MagePreferences.removeIgnoredUser(serverAddress, user)) {
|
||||
updateTablesTable();
|
||||
return new StringBuilder()
|
||||
.append("Removed ")
|
||||
.append(user)
|
||||
.append(" from your ignore list on ")
|
||||
.append(serverAddress)
|
||||
.toString();
|
||||
return "Removed " + user + " from your ignore list on " + serverAddress;
|
||||
} else {
|
||||
return new StringBuilder()
|
||||
.append("No such user \"")
|
||||
.append(user)
|
||||
.append("\" on your ignore list on ")
|
||||
.append(serverAddress)
|
||||
.toString();
|
||||
return "No such user \"" + user + "\" on your ignore list on " + serverAddress;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package mage.client.util.audio;
|
|||
|
||||
import java.awt.List;
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.sound.sampled.*;
|
||||
import mage.client.constants.Constants;
|
||||
|
|
@ -38,7 +39,7 @@ public class MusicPlayer {
|
|||
}
|
||||
String filename;
|
||||
for (File f : fileread) {
|
||||
filename = f.getName().toLowerCase();
|
||||
filename = f.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (filename.endsWith(".mp3") || filename.endsWith(".wav")) {
|
||||
filelist.add(filename);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import java.awt.FlowLayout;
|
|||
import java.awt.Image;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JComboBox;
|
||||
|
|
@ -77,7 +78,7 @@ public class ColorsChooser extends JComboBox implements ListCellRenderer {
|
|||
|
||||
private void drawOn(JPanel panel, String value) {
|
||||
List<Image> images = new ArrayList<>();
|
||||
value = value.toUpperCase();
|
||||
value = value.toUpperCase(Locale.ENGLISH);
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char symbol = value.charAt(i);
|
||||
Image image = ManaSymbols.getSizedManaSymbol(String.valueOf(symbol));
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package mage.client.util.gui;
|
|||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import javax.swing.*;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
|
|
@ -65,7 +66,7 @@ public final class GuiDisplayUtil {
|
|||
out.append(c);
|
||||
}
|
||||
}
|
||||
return out.toString().toLowerCase();
|
||||
return out.toString().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
public static void keepComponentInsideScreen(int centerX, int centerY, Component component) {
|
||||
|
|
@ -256,7 +257,7 @@ public final class GuiDisplayUtil {
|
|||
rarity = card.getRarity().getCode();
|
||||
}
|
||||
if (card.getExpansionSetCode() != null) {
|
||||
buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(), rarity, GUISizeHelper.symbolTooltipSize));
|
||||
buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(Locale.ENGLISH), rarity, GUISizeHelper.symbolTooltipSize));
|
||||
}
|
||||
buffer.append("</td></tr></table>");
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ import org.mage.plugins.card.utils.impl.ImageManagerImpl;
|
|||
import mage.client.constants.Constants;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.LineBorder;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.Map;
|
||||
|
|
|
|||
|
|
@ -9,16 +9,13 @@ import mage.view.CardView;
|
|||
import mage.view.CounterView;
|
||||
import mage.view.PermanentView;
|
||||
import mage.view.StackAbilityView;
|
||||
import net.java.truevfs.access.TFile;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.jdesktop.swingx.graphics.GraphicsUtilities;
|
||||
import org.mage.plugins.card.dl.sources.DirectLinksForDownload;
|
||||
import org.mage.plugins.card.images.ImageCache;
|
||||
import mage.client.constants.Constants;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ public abstract class CardRenderer {
|
|||
/*
|
||||
// Just draw the as a code
|
||||
String code = cardView.getExpansionSetCode();
|
||||
code = (code != null) ? code.toUpperCase() : "";
|
||||
code = (code != null) ? code.toUpperCase(Locale.ENGLISH) : "";
|
||||
FontMetrics metrics = g.getFontMetrics();
|
||||
setSymbolWidth = metrics.stringWidth(code);
|
||||
if (cardView.getRarity() == Rarity.COMMON) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
import mage.view.CardView;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.jmx.LoggerDynamicMBean;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.net.InetAddress;
|
|||
import java.net.NetworkInterface;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
|
@ -16,8 +17,8 @@ import javax.swing.SwingUtilities;
|
|||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public final class Util {
|
||||
|
||||
public static final boolean isMac = System.getProperty("os.name").toLowerCase().contains("mac");
|
||||
public static final boolean isWindows = !System.getProperty("os.name").toLowerCase().contains("windows");
|
||||
public static final boolean isMac = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac");
|
||||
public static final boolean isWindows = !System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows");
|
||||
|
||||
public static final ThreadPoolExecutor threadPool;
|
||||
static private int threadCount;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.mage.plugins.card.dl.sources;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
|
|
@ -368,7 +369,7 @@ public enum MagicCardsImageSource implements CardImageSource {
|
|||
String preferedLanguage = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_PREF_LANGUAGE, "en");
|
||||
|
||||
StringBuilder url = new StringBuilder("http://magiccards.info/scans/").append(preferedLanguage).append('/');
|
||||
url.append(set.toLowerCase()).append('/').append(collectorId);
|
||||
url.append(set.toLowerCase(Locale.ENGLISH)).append('/').append(collectorId);
|
||||
|
||||
if (card.isTwoFacedCard()) {
|
||||
url.append(card.isSecondSide() ? "b" : "a");
|
||||
|
|
@ -395,7 +396,7 @@ public enum MagicCardsImageSource implements CardImageSource {
|
|||
if (card.getType() > 0) {
|
||||
name = name + ' ' + card.getType();
|
||||
}
|
||||
name = name.replaceAll(" ", "-").replace(",", "").toLowerCase();
|
||||
name = name.replaceAll(" ", "-").replace(",", "").toLowerCase(Locale.ENGLISH);
|
||||
String set = "not-supported-set";
|
||||
if (setNameTokenReplacement.containsKey(card.getSet())) {
|
||||
set = setNameTokenReplacement.get(card.getSet());
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import java.net.URI;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
|
@ -257,7 +258,7 @@ public enum MagidexImageSource implements CardImageSource {
|
|||
|
||||
@Override
|
||||
public String generateURL(CardDownloadData card) throws Exception {
|
||||
String cardDownloadName = card.getDownloadName().toLowerCase();
|
||||
String cardDownloadName = card.getDownloadName().toLowerCase(Locale.ENGLISH);
|
||||
String cardSet = card.getSet();
|
||||
|
||||
if (cardDownloadName == null || cardSet == null) {
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import java.util.Locale;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
/**
|
||||
|
|
@ -38,7 +38,6 @@ import org.mage.plugins.card.images.CardDownloadData;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public enum MtgImageSource implements CardImageSource {
|
||||
|
||||
instance;
|
||||
|
|
@ -66,7 +65,7 @@ public enum MtgImageSource implements CardImageSource {
|
|||
throw new Exception("Wrong parameters for image: collector id: " + collectorId + ",card set: " + cardSet);
|
||||
}
|
||||
StringBuilder url = new StringBuilder("http://mtgimage.com/set/");
|
||||
url.append(cardSet.toUpperCase()).append('/');
|
||||
url.append(cardSet.toUpperCase(Locale.ENGLISH)).append('/');
|
||||
|
||||
if (card.isSplitCard()) {
|
||||
url.append(card.getDownloadName().replaceAll(" // ", ""));
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.prefs.Preferences;
|
||||
|
|
@ -317,13 +318,13 @@ public enum MythicspoilerComSource implements CardImageSource {
|
|||
private Map<String, String> getSetLinks(String cardSet) {
|
||||
Map<String, String> setLinks = new HashMap<>();
|
||||
try {
|
||||
String setNames = setsAliases.get(cardSet.toLowerCase());
|
||||
String setNames = setsAliases.get(cardSet.toLowerCase(Locale.ENGLISH));
|
||||
Set<String> aliasesStart = new HashSet<>();
|
||||
if (cardNameAliasesStart.containsKey(cardSet)) {
|
||||
aliasesStart.addAll(cardNameAliasesStart.get(cardSet));
|
||||
}
|
||||
if (setNames == null) {
|
||||
setNames = cardSet.toLowerCase();
|
||||
setNames = cardSet.toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
Preferences prefs = MageFrame.getPreferences();
|
||||
Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None"));
|
||||
|
|
@ -423,7 +424,7 @@ public enum MythicspoilerComSource implements CardImageSource {
|
|||
return null;
|
||||
}
|
||||
Map<String, String> setLinks = sets.computeIfAbsent(cardSet, k -> getSetLinks(cardSet));
|
||||
String searchName = card.getDownloadName().toLowerCase()
|
||||
String searchName = card.getDownloadName().toLowerCase(Locale.ENGLISH)
|
||||
.replaceAll(" ", "")
|
||||
.replaceAll("\\.", "")
|
||||
.replaceAll("&", "and")
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.mage.plugins.card.dl.sources;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
|
@ -280,7 +281,7 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
if (setNameReplacement.containsKey(setName)) {
|
||||
setName = setNameReplacement.get(setName);
|
||||
}
|
||||
return setName.toLowerCase();
|
||||
return setName.toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
private static final Map<String, String> setNameReplacement = new HashMap<String, String>() {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
|
@ -97,7 +98,7 @@ public enum TokensMtgImageSource implements CardImageSource {
|
|||
private String getEmblemName(String originalName) {
|
||||
|
||||
for (SubType subType : SubType.getPlaneswalkerTypes(true)) {
|
||||
if (originalName.toLowerCase().contains(subType.toString().toLowerCase())) {
|
||||
if (originalName.toLowerCase(Locale.ENGLISH).contains(subType.toString().toLowerCase(Locale.ENGLISH))) {
|
||||
return subType.getDescription() + " Emblem";
|
||||
}
|
||||
}
|
||||
|
|
@ -111,13 +112,13 @@ public enum TokensMtgImageSource implements CardImageSource {
|
|||
int type = card.getType();
|
||||
|
||||
// handle emblems
|
||||
if (name.toLowerCase().contains("emblem")) {
|
||||
if (name.toLowerCase(Locale.ENGLISH).contains("emblem")) {
|
||||
name = getEmblemName(name);
|
||||
}
|
||||
|
||||
// we should replace some set names
|
||||
if (SET_NAMES_REPLACEMENT.containsKey(set.toLowerCase())) {
|
||||
set = SET_NAMES_REPLACEMENT.get(set.toLowerCase());
|
||||
if (SET_NAMES_REPLACEMENT.containsKey(set.toLowerCase(Locale.ENGLISH))) {
|
||||
set = SET_NAMES_REPLACEMENT.get(set.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
// Image URL contains token number
|
||||
|
|
@ -187,7 +188,7 @@ public enum TokensMtgImageSource implements CardImageSource {
|
|||
@Override
|
||||
public boolean isImageProvided(String setCode, String cardName) {
|
||||
String searchName = cardName;
|
||||
if (cardName.toLowerCase().contains("emblem")) {
|
||||
if (cardName.toLowerCase(Locale.ENGLISH).contains("emblem")) {
|
||||
searchName = getEmblemName(cardName);
|
||||
}
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import java.util.HashMap;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
|
@ -493,7 +494,7 @@ public enum WizardCardsImageSource implements CardImageSource {
|
|||
if (setLinks == null || setLinks.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
String searchKey = card.getDownloadName().toLowerCase().replace(" ", "").replace("&", "//");
|
||||
String searchKey = card.getDownloadName().toLowerCase(Locale.ENGLISH).replace(" ", "").replace("&", "//");
|
||||
String link = setLinks.get(searchKey);
|
||||
if (link == null) {
|
||||
int length = collectorId.length();
|
||||
|
|
@ -576,7 +577,7 @@ public enum WizardCardsImageSource implements CardImageSource {
|
|||
}
|
||||
}
|
||||
Integer preferedMultiverseId = getLocalizedMultiverseId(preferedLanguage, multiverseId);
|
||||
setLinks.put(cardName.toLowerCase() + numberChar, generateLink(preferedMultiverseId));
|
||||
setLinks.put(cardName.toLowerCase(Locale.ENGLISH) + numberChar, generateLink(preferedMultiverseId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -652,11 +653,11 @@ public enum WizardCardsImageSource implements CardImageSource {
|
|||
}
|
||||
}
|
||||
Integer landMultiverseId = Integer.parseInt(variation.attr("href").replaceAll("[^\\d]", ""));
|
||||
setLinks.put((cardName).toLowerCase() + colNumb, generateLink(landMultiverseId));
|
||||
setLinks.put((cardName).toLowerCase(Locale.ENGLISH) + colNumb, generateLink(landMultiverseId));
|
||||
iteration++;
|
||||
}
|
||||
} else {
|
||||
setLinks.put(cardName.toLowerCase(), generateLink(multiverseId));
|
||||
setLinks.put(cardName.toLowerCase(Locale.ENGLISH), generateLink(multiverseId));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -758,7 +759,7 @@ public enum WizardCardsImageSource implements CardImageSource {
|
|||
// setLinks.putAll(getLandVariations(multiverseId, cardName));
|
||||
// } else {
|
||||
// Integer preferedMultiverseId = getLocalizedMultiverseId(preferedLanguage, multiverseId);
|
||||
// setLinks.put(cardName.toLowerCase(), generateLink(preferedMultiverseId));
|
||||
// setLinks.put(cardName.toLowerCase(Locale.ENGLISH), generateLink(preferedMultiverseId));
|
||||
// }
|
||||
// } catch (IOException | NumberFormatException ex) {
|
||||
// logger.error("Exception when parsing the wizards page: " + ex.getMessage());
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package org.mage.plugins.card.images;
|
||||
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -190,7 +190,7 @@ public class CardDownloadData {
|
|||
private String lastDitchTokenDescriptor() {
|
||||
String tmpName = this.name.replaceAll("[^a-zA-Z0-9]", "");
|
||||
String descriptor = tmpName + "....";
|
||||
descriptor = descriptor.toUpperCase();
|
||||
descriptor = descriptor.toUpperCase(Locale.ENGLISH);
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
|
@ -504,23 +505,23 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
tokenClassName = params[6].trim();
|
||||
}
|
||||
|
||||
if (params[1].toLowerCase().equals("generate") && params[2].startsWith("TOK:")) {
|
||||
if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("TOK:")) {
|
||||
String set = params[2].substring(4);
|
||||
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true);
|
||||
card.setTokenClassName(tokenClassName);
|
||||
list.add(card);
|
||||
// logger.debug("Token: " + set + "/" + card.getName() + " type: " + type);
|
||||
} else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM:")) {
|
||||
} else if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("EMBLEM:")) {
|
||||
String set = params[2].substring(7);
|
||||
CardDownloadData card = new CardDownloadData("Emblem " + params[3], set, "0", false, type, "", "", true, fileName);
|
||||
card.setTokenClassName(tokenClassName);
|
||||
list.add(card);
|
||||
} else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM-:")) {
|
||||
} else if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("EMBLEM-:")) {
|
||||
String set = params[2].substring(8);
|
||||
CardDownloadData card = new CardDownloadData(params[3] + " Emblem", set, "0", false, type, "", "", true, fileName);
|
||||
card.setTokenClassName(tokenClassName);
|
||||
list.add(card);
|
||||
} else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM!:")) {
|
||||
} else if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("EMBLEM!:")) {
|
||||
String set = params[2].substring(8);
|
||||
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true, fileName);
|
||||
card.setTokenClassName(tokenClassName);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.io.File;
|
|||
import java.net.InetSocketAddress;
|
||||
import java.net.Proxy;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.prefs.Preferences;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.constants.Constants;
|
||||
|
|
@ -116,7 +117,7 @@ public final class CardImageUtils {
|
|||
}
|
||||
|
||||
public static String updateSet(String cardSet, boolean forUrl) {
|
||||
String set = cardSet.toLowerCase();
|
||||
String set = cardSet.toLowerCase(Locale.ENGLISH);
|
||||
if (set.equals("con")) {
|
||||
set = "cfx";
|
||||
}
|
||||
|
|
@ -172,7 +173,7 @@ public final class CardImageUtils {
|
|||
throw new IllegalArgumentException("Card " + card.getName() + " have empty set.");
|
||||
}
|
||||
|
||||
String set = updateSet(card.getSet(), false).toUpperCase(); // TODO: research auto-replace... old code?
|
||||
String set = updateSet(card.getSet(), false).toUpperCase(Locale.ENGLISH); // TODO: research auto-replace... old code?
|
||||
|
||||
if (card.isToken()) {
|
||||
return buildImagePathToSetAsToken(set);
|
||||
|
|
@ -236,7 +237,7 @@ public final class CardImageUtils {
|
|||
if (dirFile.exists() && !imageFile.exists()) {
|
||||
// search like names
|
||||
for (String fileName : dirFile.list()) {
|
||||
if (fileName.toLowerCase().equals(finalFileName.toLowerCase())) {
|
||||
if (fileName.toLowerCase(Locale.ENGLISH).equals(finalFileName.toLowerCase(Locale.ENGLISH))) {
|
||||
finalFileName = fileName;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import java.awt.image.FilteredImageSource;
|
|||
import java.awt.image.WritableRaster;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import javax.imageio.ImageIO;
|
||||
import mage.client.util.gui.BufferedImageBuilder;
|
||||
|
|
@ -20,7 +21,6 @@ import org.mage.plugins.card.utils.Transparency;
|
|||
public enum ImageManagerImpl implements ImageManager {
|
||||
instance;
|
||||
|
||||
|
||||
ImageManagerImpl() {
|
||||
init();
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ public enum ImageManagerImpl implements ImageManager {
|
|||
"Main2", "Cleanup", "Next_Turn"};
|
||||
phasesImages = new HashMap<>();
|
||||
for (String name : phases) {
|
||||
Image image = getImageFromResource("/phases/phase_" + name.toLowerCase() + ".png", new Rectangle(36, 36));
|
||||
Image image = getImageFromResource("/phases/phase_" + name.toLowerCase(Locale.ENGLISH) + ".png", new Rectangle(36, 36));
|
||||
phasesImages.put(name, image);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.mage.plugins.theme;
|
|||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
|
|
@ -49,7 +50,7 @@ public class ThemePluginImpl implements ThemePlugin {
|
|||
return false;
|
||||
}
|
||||
for (File f : filelist) {
|
||||
String filename = f.getName().toLowerCase();
|
||||
String filename = f.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (filename != null && (filename.endsWith(".png") || filename.endsWith(".jpg")
|
||||
|| filename.endsWith(".bmp"))) {
|
||||
flist.add(filename);
|
||||
|
|
|
|||
|
|
@ -988,7 +988,7 @@ public class CardView extends SimpleCardView {
|
|||
public String getColorText() {
|
||||
|
||||
String color = getColor().getDescription();
|
||||
return color.substring(0, 1).toUpperCase() + color.substring(1);
|
||||
return color.substring(0, 1).toUpperCase(Locale.ENGLISH) + color.substring(1);
|
||||
}
|
||||
|
||||
public String getTypeText() {
|
||||
|
|
|
|||
|
|
@ -31,14 +31,8 @@
|
|||
*
|
||||
* Created on 20-Jan-2010, 9:37:07 PM
|
||||
*/
|
||||
|
||||
package mage.server.console;
|
||||
|
||||
import mage.remote.Connection;
|
||||
import mage.remote.Connection.ProxyType;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
|
|
@ -46,8 +40,13 @@ import java.net.URL;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import javax.swing.*;
|
||||
import mage.remote.Connection;
|
||||
import mage.remote.Connection.ProxyType;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -60,7 +59,9 @@ public class ConnectDialog extends JDialog {
|
|||
private Connection connection;
|
||||
private ConnectTask task;
|
||||
|
||||
/** Creates new form ConnectDialog */
|
||||
/**
|
||||
* Creates new form ConnectDialog
|
||||
*/
|
||||
public ConnectDialog() {
|
||||
initComponents();
|
||||
cbProxyType.setModel(new DefaultComboBoxModel(Connection.ProxyType.values()));
|
||||
|
|
@ -73,7 +74,7 @@ public class ConnectDialog extends JDialog {
|
|||
this.chkAutoConnect.setSelected(Boolean.parseBoolean(ConsoleFrame.getPreferences().get("autoConnect", "false")));
|
||||
this.txtProxyServer.setText(ConsoleFrame.getPreferences().get("proxyAddress", "localhost"));
|
||||
this.txtProxyPort.setText(ConsoleFrame.getPreferences().get("proxyPort", Integer.toString(17171)));
|
||||
this.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(ConsoleFrame.getPreferences().get("proxyType", "NONE").toUpperCase()));
|
||||
this.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(ConsoleFrame.getPreferences().get("proxyType", "NONE").toUpperCase(Locale.ENGLISH)));
|
||||
this.txtProxyUserName.setText(ConsoleFrame.getPreferences().get("proxyUsername", ""));
|
||||
this.txtPasswordField.setText(ConsoleFrame.getPreferences().get("proxyPassword", ""));
|
||||
this.showProxySettings();
|
||||
|
|
@ -87,13 +88,11 @@ public class ConnectDialog extends JDialog {
|
|||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxyAuth.setVisible(false);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
}
|
||||
else if (cbProxyType.getSelectedItem() == Connection.ProxyType.HTTP) {
|
||||
} else if (cbProxyType.getSelectedItem() == Connection.ProxyType.HTTP) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxyAuth.setVisible(true);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
}
|
||||
else if (cbProxyType.getSelectedItem() == Connection.ProxyType.NONE) {
|
||||
} else if (cbProxyType.getSelectedItem() == Connection.ProxyType.NONE) {
|
||||
this.pnlProxy.setVisible(false);
|
||||
this.pnlProxyAuth.setVisible(false);
|
||||
this.pnlProxySettings.setVisible(false);
|
||||
|
|
@ -115,10 +114,10 @@ public class ConnectDialog extends JDialog {
|
|||
Arrays.fill(input, '0');
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
* initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is
|
||||
* always regenerated by the Form Editor.
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
|
|
@ -424,15 +423,15 @@ public class ConnectDialog extends JDialog {
|
|||
if (result) {
|
||||
lblStatus.setText("");
|
||||
connected();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
lblStatus.setText("Could not connect");
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
logger.fatal("Update Players Task error", ex);
|
||||
} catch (ExecutionException ex) {
|
||||
logger.fatal("Update Players Task error", ex);
|
||||
} catch (CancellationException ex) {}
|
||||
} catch (CancellationException ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -441,7 +440,6 @@ public class ConnectDialog extends JDialog {
|
|||
this.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
private void keyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyTyped
|
||||
char c = evt.getKeyChar();
|
||||
if (!Character.isDigit(c)) {
|
||||
|
|
@ -495,7 +493,10 @@ public class ConnectDialog extends JDialog {
|
|||
logger.error(ex, ex);
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try { in.close(); } catch (Exception e) {}
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_jButton1ActionPerformed
|
||||
|
|
@ -508,7 +509,6 @@ public class ConnectDialog extends JDialog {
|
|||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_txtPasswordFieldActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnCancel;
|
||||
private javax.swing.JButton btnConnect;
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ class UpdateUsersTask extends SwingWorker<Void, List<UserView>> {
|
|||
if (!panel.getjUserName().getText().equals("")) {
|
||||
List<UserView> users2 = new ArrayList<>();
|
||||
for (UserView user : users) {
|
||||
if (user.getUserName().toUpperCase().matches(".*" + panel.getjUserName().getText().toUpperCase() + ".*")) {
|
||||
if (user.getUserName().toUpperCase(Locale.ENGLISH).matches(".*" + panel.getjUserName().getText().toUpperCase(Locale.ENGLISH) + ".*")) {
|
||||
users2.add(user);
|
||||
}
|
||||
}
|
||||
|
|
@ -697,7 +697,7 @@ class UpdateTablesTask extends SwingWorker<Void, Collection<TableView>> {
|
|||
if (!panel.getjUserName().getText().equals("")) {
|
||||
Collection<TableView> tableViews2 = new ArrayList<>();
|
||||
for (TableView table : tableViews) {
|
||||
if (table.getControllerName().toUpperCase().matches(".*" + panel.getjUserName().getText().toUpperCase() + ".*")) {
|
||||
if (table.getControllerName().toUpperCase(Locale.ENGLISH).matches(".*" + panel.getjUserName().getText().toUpperCase(Locale.ENGLISH) + ".*")) {
|
||||
tableViews2.add(table);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ public class Commander extends Constructed {
|
|||
boolean whenYouCast = false;
|
||||
|
||||
for (String str : card.getRules()) {
|
||||
String s = str.toLowerCase();
|
||||
String s = str.toLowerCase(Locale.ENGLISH);
|
||||
annihilator |= s.contains("annihilator");
|
||||
anyNumberOfTarget |= s.contains("any number");
|
||||
buyback |= s.contains("buyback");
|
||||
|
|
@ -521,16 +521,16 @@ public class Commander extends Constructed {
|
|||
}
|
||||
|
||||
if (card.isPlaneswalker()) {
|
||||
if (card.getName().toLowerCase().equals("jace, the mind sculptor")) {
|
||||
if (card.getName().toLowerCase(Locale.ENGLISH).equals("jace, the mind sculptor")) {
|
||||
thisMaxPower = Math.max(thisMaxPower, 6);
|
||||
}
|
||||
if (card.getName().toLowerCase().equals("ugin, the spirit dragon")) {
|
||||
if (card.getName().toLowerCase(Locale.ENGLISH).equals("ugin, the spirit dragon")) {
|
||||
thisMaxPower = Math.max(thisMaxPower, 5);
|
||||
}
|
||||
thisMaxPower = Math.max(thisMaxPower, 4);
|
||||
}
|
||||
|
||||
String cn = card.getName().toLowerCase();
|
||||
String cn = card.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (cn.equals("ancient tomb")
|
||||
|| cn.equals("anafenza, the foremost")
|
||||
|| cn.equals("arcum dagsson")
|
||||
|
|
@ -678,7 +678,7 @@ public class Commander extends Constructed {
|
|||
ObjectColor color = null;
|
||||
for (Card commander : deck.getSideboard()) {
|
||||
int thisMaxPower = 0;
|
||||
String cn = commander.getName().toLowerCase();
|
||||
String cn = commander.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (color == null) {
|
||||
color = commander.getColor(null);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ public enum ChatManager {
|
|||
return true;
|
||||
}
|
||||
if (command.startsWith("CARD ")) {
|
||||
Matcher matchPattern = getCardTextPattern.matcher(message.toLowerCase());
|
||||
Matcher matchPattern = getCardTextPattern.matcher(message.toLowerCase(Locale.ENGLISH));
|
||||
if (matchPattern.find()) {
|
||||
String cardName = matchPattern.group(1);
|
||||
CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardName, true);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.server;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
|
|
@ -297,7 +298,7 @@ public class TableController {
|
|||
|
||||
// Check power level for table (currently only used for EDH/Commander table)
|
||||
int edhPowerLevel = table.getMatch().getOptions().getEdhPowerLevel();
|
||||
if (edhPowerLevel > 0 && table.getValidator().getName().toLowerCase().equals("commander")) {
|
||||
if (edhPowerLevel > 0 && table.getValidator().getName().toLowerCase(Locale.ENGLISH).equals("commander")) {
|
||||
int deckEdhPowerLevel = table.getValidator().getEdhPowerLevel(deck);
|
||||
if (deckEdhPowerLevel % 100 > edhPowerLevel) {
|
||||
String message = new StringBuilder("Your deck appears to be too powerful for this table.\n\nReduce the number of extra turn cards, infect, counters, fogs, reconsider your commander. ")
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
|
|
@ -121,7 +122,7 @@ class AngelicSkirmisherEffect extends OneShotEffect {
|
|||
if (ability != null) {
|
||||
GainAbilityControlledEffect effect = new GainAbilityControlledEffect(ability, Duration.EndOfTurn, new FilterControlledCreaturePermanent());
|
||||
game.addEffect(effect, source);
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " has chosen " + abilityChoice.getChoice().toLowerCase());
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " has chosen " + abilityChoice.getChoice().toLowerCase(Locale.ENGLISH));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -113,7 +114,7 @@ public class ConfusionInTheRanks extends CardImpl {
|
|||
if (!message.isEmpty()) {
|
||||
message += "or ";
|
||||
}
|
||||
message += cardTypeEntering.toString().toLowerCase() + ' ';
|
||||
message += cardTypeEntering.toString().toLowerCase(Locale.ENGLISH) + ' ';
|
||||
}
|
||||
filterTarget.add(Predicates.or(cardTypesPredicates));
|
||||
message += "you don't control";
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -38,8 +39,8 @@ import mage.abilities.keyword.FirstStrikeAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -95,7 +96,7 @@ class CosmicHorrorEffect extends OneShotEffect {
|
|||
Permanent cosmicHorror = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null && cosmicHorror != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append('?');
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
if (!sb.toString().toLowerCase(Locale.ENGLISH).startsWith("exile ") && !sb.toString().toLowerCase(Locale.ENGLISH).startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
if (controller.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -40,8 +41,8 @@ import mage.abilities.effects.common.DestroyTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
|
@ -106,7 +107,7 @@ class DemonicHordesEffect extends OneShotEffect {
|
|||
Permanent demonicHordes = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null && demonicHordes != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append('?');
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
if (!sb.toString().toLowerCase(Locale.ENGLISH).startsWith("exile ") && !sb.toString().toLowerCase(Locale.ENGLISH).startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
if (controller.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -145,7 +146,7 @@ public class DustOfMoments extends CardImpl {
|
|||
if (!game.isSimulation()) {
|
||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ")
|
||||
.append(controller.getLogName()).append(getActionStr()).append('s')
|
||||
.append(counter.getCount()).append(' ').append(counterName.toLowerCase())
|
||||
.append(counter.getCount()).append(' ').append(counterName.toLowerCase(Locale.ENGLISH))
|
||||
.append(" counter on ").append(card.getName()).toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -170,7 +171,7 @@ public class DustOfMoments extends CardImpl {
|
|||
if (!game.isSimulation()) {
|
||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ")
|
||||
.append(controller.getLogName()).append(getActionStr()).append("s ")
|
||||
.append(counter.getCount()).append(' ').append(counterName.toLowerCase())
|
||||
.append(counter.getCount()).append(' ').append(counterName.toLowerCase(Locale.ENGLISH))
|
||||
.append(" counter on ").append(card.getName()).toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -185,9 +186,9 @@ public class DustOfMoments extends CardImpl {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getActionStr());
|
||||
if (counter.getCount() > 1) {
|
||||
sb.append(Integer.toString(counter.getCount())).append(' ').append(counter.getName().toLowerCase()).append(" counters on each ");
|
||||
sb.append(Integer.toString(counter.getCount())).append(' ').append(counter.getName().toLowerCase(Locale.ENGLISH)).append(" counters on each ");
|
||||
} else {
|
||||
sb.append("a ").append(counter.getName().toLowerCase()).append(" counter on each ");
|
||||
sb.append("a ").append(counter.getName().toLowerCase(Locale.ENGLISH)).append(" counter on each ");
|
||||
}
|
||||
sb.append(permFilter.getMessage());
|
||||
staticText = sb.toString();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -44,7 +44,6 @@ import mage.filter.common.FilterControlledPermanent;
|
|||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
|
@ -113,7 +112,7 @@ class EquipoiseEffect extends OneShotEffect {
|
|||
int numberTargetPlayer = game.getBattlefield().count(filter, source.getSourceId(), targetPlayer.getId(), game);
|
||||
int excess = numberTargetPlayer - numberController;
|
||||
if (excess > 0) {
|
||||
FilterPermanent filterChoose = new FilterPermanent(cardType.toString().toLowerCase() + (excess > 1 ? "s" : "") + " of target player");
|
||||
FilterPermanent filterChoose = new FilterPermanent(cardType.toString().toLowerCase(Locale.ENGLISH) + (excess > 1 ? "s" : "") + " of target player");
|
||||
filterChoose.add(new ControllerIdPredicate(targetPlayer.getId()));
|
||||
filterChoose.add(new CardTypePredicate(cardType));
|
||||
Target target = new TargetPermanent(excess, excess, filterChoose, true);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
|
|
@ -108,7 +109,7 @@ class FatespinnerChooseEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
String chosenPhase = choice.getChoice();
|
||||
game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + '.');
|
||||
game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase(Locale.ENGLISH) + '.');
|
||||
game.addEffect(new FatespinnerSkipEffect(chosenPhase), source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
|
|
@ -153,9 +154,9 @@ class DoUnlessTargetPaysCost extends OneShotEffect {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
String costText = cost.getText();
|
||||
if (costText != null
|
||||
&& !costText.toLowerCase().startsWith("discard")
|
||||
&& !costText.toLowerCase().startsWith("sacrifice")
|
||||
&& !costText.toLowerCase().startsWith("remove")) {
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("discard")
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("sacrifice")
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("remove")) {
|
||||
sb.append("pay ");
|
||||
}
|
||||
return sb.append(costText).toString();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -93,14 +94,14 @@ class TabletOfTheGuildsEntersBattlefieldEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
game.getState().setValue(permanent.getId() + "_color1", colorChoice.getColor().toString());
|
||||
colors = colorChoice.getChoice().toLowerCase() + " and ";
|
||||
colors = colorChoice.getChoice().toLowerCase(Locale.ENGLISH) + " and ";
|
||||
colorChoice.getChoices().remove(colorChoice.getChoice());
|
||||
colorChoice.setMessage("Choose the second color");
|
||||
if (!player.choose(Outcome.GainLife, colorChoice, game) && player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
game.getState().setValue(permanent.getId() + "_color2", colorChoice.getColor().toString());
|
||||
colors = colors + colorChoice.getChoice().toLowerCase();
|
||||
colors = colors + colorChoice.getChoice().toLowerCase(Locale.ENGLISH);
|
||||
game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + colors);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
package org.mage.test.serverside;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Sets;
|
||||
import mage.cards.decks.Deck;
|
||||
|
|
@ -17,12 +23,6 @@ import org.junit.Ignore;
|
|||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.MageTestBase;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author ayratn
|
||||
*/
|
||||
|
|
@ -61,7 +61,6 @@ public class PlayGameTest extends MageTestBase {
|
|||
// game.cheat(playerA.getId(), libraryCardsA, handCardsA, battlefieldCardsA, graveyardCardsA);
|
||||
// game.cheat(playerB.getId(), commandsB);
|
||||
// game.cheat(playerB.getId(), libraryCardsB, handCardsB, battlefieldCardsB, graveyardCardsB);
|
||||
|
||||
//boolean testMode = false;
|
||||
boolean testMode = true;
|
||||
|
||||
|
|
@ -80,7 +79,7 @@ public class PlayGameTest extends MageTestBase {
|
|||
}
|
||||
|
||||
private Deck generateRandomDeck() {
|
||||
String selectedColors = colorChoices.get(new Random().nextInt(colorChoices.size())).toUpperCase();
|
||||
String selectedColors = colorChoices.get(new Random().nextInt(colorChoices.size())).toUpperCase(Locale.ENGLISH);
|
||||
List<ColoredManaSymbol> allowedColors = new ArrayList<>();
|
||||
logger.info("Building deck with colors: " + selectedColors);
|
||||
for (int i = 0; i < selectedColors.length(); i++) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
package org.mage.test.serverside;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Sets;
|
||||
import mage.cards.decks.Deck;
|
||||
|
|
@ -16,12 +22,6 @@ import org.junit.Ignore;
|
|||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.MageTestBase;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author ayratn
|
||||
*/
|
||||
|
|
@ -70,7 +70,7 @@ public class TestPlayRandomGame extends MageTestBase {
|
|||
}
|
||||
|
||||
private Deck generateRandomDeck() {
|
||||
String selectedColors = colorChoices.get(new Random().nextInt(colorChoices.size())).toUpperCase();
|
||||
String selectedColors = colorChoices.get(new Random().nextInt(colorChoices.size())).toUpperCase(Locale.ENGLISH);
|
||||
List<ColoredManaSymbol> allowedColors = new ArrayList<>();
|
||||
logger.info("Building deck with colors: " + selectedColors);
|
||||
for (int i = 0; i < selectedColors.length(); i++) {
|
||||
|
|
|
|||
|
|
@ -277,8 +277,8 @@ public class VerifyCardDataTest {
|
|||
for (String token : tokens) {
|
||||
if (!(token.equals(card.getName())
|
||||
|| containsInTypesOrText(ref, token)
|
||||
|| containsInTypesOrText(ref, token.toLowerCase())
|
||||
|| (ref2 != null && (containsInTypesOrText(ref2, token) || containsInTypesOrText(ref2, token.toLowerCase()))))) {
|
||||
|| containsInTypesOrText(ref, token.toLowerCase(Locale.ENGLISH))
|
||||
|| (ref2 != null && (containsInTypesOrText(ref2, token) || containsInTypesOrText(ref2, token.toLowerCase(Locale.ENGLISH)))))) {
|
||||
System.out.println("unexpected token " + token + " in " + card);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
package mage.abilities;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
|
@ -124,7 +125,7 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
String superRule = super.getRule(true);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (!superRule.isEmpty()) {
|
||||
String ruleLow = superRule.toLowerCase();
|
||||
String ruleLow = superRule.toLowerCase(Locale.ENGLISH);
|
||||
if (isOptional()) {
|
||||
if (ruleLow.startsWith("you ")) {
|
||||
if (!ruleLow.startsWith("you may")) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.abilities.abilityword;
|
|||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.AttachmentType;
|
||||
|
|
@ -88,7 +89,7 @@ public class AttacksAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder("Whenever ");
|
||||
sb.append(attachmentType.verb().toLowerCase());
|
||||
sb.append(attachmentType.verb().toLowerCase(Locale.ENGLISH));
|
||||
return sb.append(" creature attacks, ").append(super.getRule()).toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
|
@ -129,9 +130,9 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder(getEffects().getText(modes.getMode()));
|
||||
if (this.optional) {
|
||||
if (sb.substring(0, 6).toLowerCase().equals("target")) {
|
||||
if (sb.substring(0, 6).toLowerCase(Locale.ENGLISH).equals("target")) {
|
||||
sb.insert(0, "you may have ");
|
||||
} else if (!sb.substring(0, 4).toLowerCase().equals("you ")) {
|
||||
} else if (!sb.substring(0, 4).toLowerCase(Locale.ENGLISH).equals("you ")) {
|
||||
sb.insert(0, "you may ");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.TargetController;
|
||||
|
|
@ -141,9 +142,9 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl {
|
|||
switch (targetController) {
|
||||
case YOU:
|
||||
if (this.optional) {
|
||||
if (sb.substring(0, 6).toLowerCase().equals("target")) {
|
||||
if (sb.substring(0, 6).toLowerCase(Locale.ENGLISH).equals("target")) {
|
||||
sb.insert(0, "you may have ");
|
||||
} else if (!sb.substring(0, 4).toLowerCase().equals("you ")) {
|
||||
} else if (!sb.substring(0, 4).toLowerCase(Locale.ENGLISH).equals("you ")) {
|
||||
sb.insert(0, "you may ");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ package mage.abilities.common;
|
|||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.abilities.common;
|
|||
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.mana.TriggeredManaAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
|
|||
|
|
@ -31,9 +31,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.condition.Condition;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.cards.Card;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.abilities.condition.common;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import java.util.UUID;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import mage.constants.TurnPhase;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.abilities.condition.common;
|
|||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import mage.abilities.dynamicvalue.DynamicValue;
|
|||
import mage.abilities.effects.Effect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.abilities.effects.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
|
@ -88,8 +89,7 @@ public class DoIfCostPaid extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
player.resetStoredBookmark(game); // otherwise you can e.g. undo card drawn with Mentor of the Meek
|
||||
}
|
||||
else if (!otherwiseEffects.isEmpty()) {
|
||||
} else if (!otherwiseEffects.isEmpty()) {
|
||||
for (Effect effect : otherwiseEffects) {
|
||||
effect.setTargetPointer(this.targetPointer);
|
||||
if (effect instanceof OneShotEffect) {
|
||||
|
|
@ -99,8 +99,7 @@ public class DoIfCostPaid extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!otherwiseEffects.isEmpty()) {
|
||||
} else if (!otherwiseEffects.isEmpty()) {
|
||||
for (Effect effect : otherwiseEffects) {
|
||||
effect.setTargetPointer(this.targetPointer);
|
||||
if (effect instanceof OneShotEffect) {
|
||||
|
|
@ -135,12 +134,12 @@ public class DoIfCostPaid extends OneShotEffect {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
String costText = cost.getText();
|
||||
if (costText != null
|
||||
&& !costText.toLowerCase().startsWith("put")
|
||||
&& !costText.toLowerCase().startsWith("exile")
|
||||
&& !costText.toLowerCase().startsWith("discard")
|
||||
&& !costText.toLowerCase().startsWith("sacrifice")
|
||||
&& !costText.toLowerCase().startsWith("remove")
|
||||
&& !costText.toLowerCase().startsWith("pay")) {
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("put")
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("exile")
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("discard")
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("sacrifice")
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("remove")
|
||||
&& !costText.toLowerCase(Locale.ENGLISH).startsWith("pay")) {
|
||||
sb.append("pay ");
|
||||
}
|
||||
return sb.append(costText).toString();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
|
|
@ -77,7 +78,7 @@ public class EnterBattlefieldPayCostOrPutGraveyardEffect extends ReplacementEffe
|
|||
boolean replace = true;
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)) {
|
||||
if (player.chooseUse(outcome,
|
||||
cost.getText().substring(0, 1).toUpperCase() + cost.getText().substring(1)
|
||||
cost.getText().substring(0, 1).toUpperCase(Locale.ENGLISH) + cost.getText().substring(1)
|
||||
+ "? (otherwise " + sourceObject.getLogName() + " is put into graveyard)", source, game)) {
|
||||
cost.clearPaid();
|
||||
replace = !cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -106,6 +107,6 @@ public class ExileFromZoneTargetEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
private void setText() {
|
||||
staticText = "target player exiles " + CardUtil.numberToText(amount, "a") + ' ' + filter.getMessage() + " from his or her " + zone.toString().toLowerCase();
|
||||
staticText = "target player exiles " + CardUtil.numberToText(amount, "a") + ' ' + filter.getMessage() + " from his or her " + zone.toString().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.costs.Cost;
|
||||
|
|
@ -61,7 +62,7 @@ public class ExileSourceUnlessPaysEffect extends OneShotEffect {
|
|||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null && sourcePermanent != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append('?');
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
if (!sb.toString().toLowerCase(Locale.ENGLISH).startsWith("exile ") && !sb.toString().toLowerCase(Locale.ENGLISH).startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
String message = CardUtil.replaceSourceName(sb.toString(), sourcePermanent.getLogName());
|
||||
|
|
@ -91,12 +92,12 @@ public class ExileSourceUnlessPaysEffect extends OneShotEffect {
|
|||
|
||||
StringBuilder sb = new StringBuilder("exile {this} unless you ");
|
||||
String costText = cost.getText();
|
||||
if (costText.toLowerCase().startsWith("discard")
|
||||
|| costText.toLowerCase().startsWith("remove")
|
||||
|| costText.toLowerCase().startsWith("return")
|
||||
|| costText.toLowerCase().startsWith("exile")
|
||||
|| costText.toLowerCase().startsWith("sacrifice")) {
|
||||
sb.append(costText.substring(0, 1).toLowerCase());
|
||||
if (costText.toLowerCase(Locale.ENGLISH).startsWith("discard")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("remove")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("return")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("exile")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("sacrifice")) {
|
||||
sb.append(costText.substring(0, 1).toLowerCase(Locale.ENGLISH));
|
||||
sb.append(costText.substring(1));
|
||||
} else {
|
||||
sb.append("pay ").append(costText);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.abilities.effects.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import static java.lang.Integer.min;
|
||||
import java.util.Locale;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
|
@ -291,7 +292,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
|
||||
sb.append(" of them into your ");
|
||||
}
|
||||
sb.append(targetPickedCards.toString().toLowerCase());
|
||||
sb.append(targetPickedCards.toString().toLowerCase(Locale.ENGLISH));
|
||||
|
||||
if (targetZoneLookedCards == Zone.LIBRARY) {
|
||||
sb.append(". Put the rest ");
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
|
|||
|
|
@ -25,16 +25,15 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -103,6 +102,6 @@ public class RegenerateAttachedEffect extends ReplacementEffectImpl {
|
|||
}
|
||||
|
||||
private void setText() {
|
||||
staticText = "Regenerate " + attachmentType.verb().toLowerCase() + " creature";
|
||||
staticText = "Regenerate " + attachmentType.verb().toLowerCase(Locale.ENGLISH) + " creature";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,14 +25,14 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import java.util.Locale;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
|
@ -95,7 +95,7 @@ public class RegenerateTargetEffect extends ReplacementEffectImpl {
|
|||
sb.append("Regenerate ");
|
||||
Target target = mode.getTargets().get(0);
|
||||
if (target != null) {
|
||||
if (!target.getTargetName().toLowerCase().startsWith("another")) {
|
||||
if (!target.getTargetName().toLowerCase(Locale.ENGLISH).startsWith("another")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
sb.append(target.getTargetName());
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.abilities.effects.common;
|
|||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.costs.Cost;
|
||||
|
|
@ -34,7 +35,7 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect {
|
|||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null && sourcePermanent != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append('?');
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
if (!sb.toString().toLowerCase(Locale.ENGLISH).startsWith("exile ") && !sb.toString().toLowerCase(Locale.ENGLISH).startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
String message = CardUtil.replaceSourceName(sb.toString(), sourcePermanent.getLogName());
|
||||
|
|
@ -69,13 +70,13 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect {
|
|||
|
||||
StringBuilder sb = new StringBuilder("sacrifice {this} unless you ");
|
||||
String costText = cost.getText();
|
||||
if (costText.toLowerCase().startsWith("discard")
|
||||
|| costText.toLowerCase().startsWith("remove")
|
||||
|| costText.toLowerCase().startsWith("return")
|
||||
|| costText.toLowerCase().startsWith("put")
|
||||
|| costText.toLowerCase().startsWith("exile")
|
||||
|| costText.toLowerCase().startsWith("sacrifice")) {
|
||||
sb.append(costText.substring(0, 1).toLowerCase());
|
||||
if (costText.toLowerCase(Locale.ENGLISH).startsWith("discard")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("remove")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("return")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("put")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("exile")
|
||||
|| costText.toLowerCase(Locale.ENGLISH).startsWith("sacrifice")) {
|
||||
sb.append(costText.substring(0, 1).toLowerCase(Locale.ENGLISH));
|
||||
sb.append(costText.substring(1));
|
||||
} else {
|
||||
sb.append("pay ").append(costText);
|
||||
|
|
|
|||
|
|
@ -25,15 +25,14 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.effects.common.combat;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.Duration;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.Duration;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
|
@ -51,7 +50,7 @@ public class MustBeBlockedByAllAttachedEffect extends RequirementEffect {
|
|||
public MustBeBlockedByAllAttachedEffect(Duration duration, AttachmentType attachmentType) {
|
||||
super(duration);
|
||||
this.attachmentType = attachmentType;
|
||||
staticText = "All creatures able to block " + attachmentType.verb().toLowerCase() + " creature do so";
|
||||
staticText = "All creatures able to block " + attachmentType.verb().toLowerCase(Locale.ENGLISH) + " creature do so";
|
||||
}
|
||||
|
||||
public MustBeBlockedByAllAttachedEffect(final MustBeBlockedByAllAttachedEffect effect) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
|
@ -104,7 +105,7 @@ public class AddCardTypeSourceEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
article = true;
|
||||
}
|
||||
sb.append(cardType.toString().toLowerCase()).append(" ");
|
||||
sb.append(cardType.toString().toLowerCase(Locale.ENGLISH)).append(" ");
|
||||
}
|
||||
sb.append(" in addition to its other types ").append(this.getDuration().toString());
|
||||
return sb.toString();
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
|
@ -110,7 +111,7 @@ public class AddCardTypeTargetEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
article = true;
|
||||
}
|
||||
sb.append(cardType.toString().toLowerCase()).append(" ");
|
||||
sb.append(cardType.toString().toLowerCase(Locale.ENGLISH)).append(" ");
|
||||
}
|
||||
sb.append("in addition to its other types");
|
||||
if (getDuration().equals(Duration.EndOfTurn)) {
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@
|
|||
*/
|
||||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -126,7 +126,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()).append(" get ");
|
||||
} else {
|
||||
if (!target.getTargetName().toUpperCase().startsWith("ANOTHER")) {
|
||||
if (!target.getTargetName().toUpperCase(Locale.ENGLISH).startsWith("ANOTHER")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
sb.append(target.getTargetName()).append(" gets ");
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ package mage.abilities.effects.common.continuous;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
|
|
@ -180,12 +181,12 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
sb.append(filter.getMessage());
|
||||
if (duration == Duration.WhileOnBattlefield) {
|
||||
if (filter.getMessage().toLowerCase().startsWith("each")) {
|
||||
if (filter.getMessage().toLowerCase(Locale.ENGLISH).startsWith("each")) {
|
||||
sb.append(" has ");
|
||||
} else {
|
||||
sb.append(" have ");
|
||||
}
|
||||
} else if (filter.getMessage().toLowerCase().startsWith("each")) {
|
||||
} else if (filter.getMessage().toLowerCase(Locale.ENGLISH).startsWith("each")) {
|
||||
sb.append(" gains ");
|
||||
} else {
|
||||
sb.append(" gain ");
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
sb.append(target.getMaxNumberOfTargets()).append(" target ").append(target.getTargetName()).append(" gain ");
|
||||
} else {
|
||||
if (!target.getTargetName().toUpperCase().startsWith("ANOTHER")) {
|
||||
if (!target.getTargetName().toUpperCase(Locale.ENGLISH).startsWith("ANOTHER")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
sb.append(target.getTargetName()).append(" gains ");
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.effects.common.counter;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -69,7 +70,7 @@ public class AddCountersAllEffect extends OneShotEffect {
|
|||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
permanent.addCounters(counter.copy(), source, game);
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + counter.getCount() + ' ' + counter.getName().toLowerCase()
|
||||
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + counter.getCount() + ' ' + counter.getName().toLowerCase(Locale.ENGLISH)
|
||||
+ " counter on " + permanent.getLogName());
|
||||
}
|
||||
}
|
||||
|
|
@ -83,9 +84,9 @@ public class AddCountersAllEffect extends OneShotEffect {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("put ");
|
||||
if (counter.getCount() > 1) {
|
||||
sb.append(CardUtil.numberToText(counter.getCount(), "a")).append(' ').append(counter.getName().toLowerCase()).append(" counters on each ");
|
||||
sb.append(CardUtil.numberToText(counter.getCount(), "a")).append(' ').append(counter.getName().toLowerCase(Locale.ENGLISH)).append(" counters on each ");
|
||||
} else {
|
||||
sb.append("a ").append(counter.getName().toLowerCase()).append(" counter on each ");
|
||||
sb.append("a ").append(counter.getName().toLowerCase(Locale.ENGLISH)).append(" counter on each ");
|
||||
}
|
||||
sb.append(filter.getMessage());
|
||||
staticText = sb.toString();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.effects.common.counter;
|
||||
|
||||
import java.util.Locale;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
|
|
@ -41,7 +42,6 @@ import mage.util.CardUtil;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class AddCountersAttachedEffect extends OneShotEffect {
|
||||
|
||||
private Counter counter;
|
||||
|
|
@ -99,7 +99,7 @@ public class AddCountersAttachedEffect extends OneShotEffect {
|
|||
} else {
|
||||
sb.append("a ");
|
||||
}
|
||||
sb.append(counter.getName().toLowerCase()).append(" counter on ");
|
||||
sb.append(counter.getName().toLowerCase(Locale.ENGLISH)).append(" counter on ");
|
||||
sb.append(textEnchanted);
|
||||
if (!amount.getMessage().isEmpty()) {
|
||||
sb.append(" for each ").append(amount.getMessage());
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
package mage.abilities.effects.common.counter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
|
@ -110,7 +111,7 @@ public class AddCountersSourceEffect extends OneShotEffect {
|
|||
if (informPlayers && !game.isSimulation()) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
game.informPlayers(player.getLogName() + " puts " + newCounter.getCount() + ' ' + newCounter.getName().toLowerCase() + " counter on " + card.getLogName());
|
||||
game.informPlayers(player.getLogName() + " puts " + newCounter.getCount() + ' ' + newCounter.getName().toLowerCase(Locale.ENGLISH) + " counter on " + card.getLogName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -137,7 +138,7 @@ public class AddCountersSourceEffect extends OneShotEffect {
|
|||
int amountAdded = permanent.getCounters(game).getCount(newCounter.getName()) - before;
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
game.informPlayers(player.getLogName() + " puts " + amountAdded + ' ' + newCounter.getName().toLowerCase() + " counter on " + permanent.getLogName());
|
||||
game.informPlayers(player.getLogName() + " puts " + amountAdded + ' ' + newCounter.getName().toLowerCase(Locale.ENGLISH) + " counter on " + permanent.getLogName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -161,7 +162,7 @@ public class AddCountersSourceEffect extends OneShotEffect {
|
|||
sb.append("a ");
|
||||
plural = false;
|
||||
}
|
||||
sb.append(counter.getName().toLowerCase()).append(" counter");
|
||||
sb.append(counter.getName().toLowerCase(Locale.ENGLISH)).append(" counter");
|
||||
if (plural) {
|
||||
sb.append('s');
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue