mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 04:39:18 -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
|
|
@ -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;
|
||||
|
|
@ -52,7 +53,7 @@ import mage.players.Player;
|
|||
public class CosmicHorror extends CardImpl {
|
||||
|
||||
public CosmicHorror(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}");
|
||||
this.subtype.add(SubType.HORROR);
|
||||
this.power = new MageInt(7);
|
||||
this.toughness = new MageInt(7);
|
||||
|
|
@ -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;
|
||||
|
|
@ -61,7 +62,7 @@ import mage.target.common.TargetOpponent;
|
|||
public class DemonicHordes extends CardImpl {
|
||||
|
||||
public DemonicHordes(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}");
|
||||
this.subtype.add(SubType.DEMON);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue