* 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:
LevelX2 2018-03-18 18:18:54 +01:00
parent 03ebdc17d8
commit b073ce1c42
147 changed files with 1419 additions and 1496 deletions

View file

@ -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;
@ -38,7 +39,7 @@ import mage.players.Player;
import mage.util.CardUtil;
/**
*
*
* @author fireshoes
*/
public class ExileSourceUnlessPaysEffect extends OneShotEffect {
@ -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);