forked from External/mage
no need to use a stringbuilder for single line String creation. Java will compile this to use a StringBuilder automatically. StringBuilder performs best when initialized outside a loop
This commit is contained in:
parent
da3c861344
commit
43d305a4b1
109 changed files with 140 additions and 155 deletions
|
|
@ -86,8 +86,8 @@ class CombustibleGearhulkEffect extends OneShotEffect {
|
|||
if (opponentId != null) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
StringBuilder sb = new StringBuilder("Have " + controller.getLogName() + " draw three cards?");
|
||||
if (opponent.chooseUse(outcome, sb.toString(), source, game)) {
|
||||
String questionDrawThree = "Have " + controller.getLogName() + " draw three cards?";
|
||||
if (opponent.chooseUse(outcome, questionDrawThree, source, game)) {
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(opponent.getLogName() + " lets " + controller.getLogName() + " draw three cards");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class CutTheTethersEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(creature.getControllerId());
|
||||
if (player != null) {
|
||||
boolean paid = false;
|
||||
if (player.chooseUse(outcome, new StringBuilder("Pay {3} to keep ").append(creature.getName()).append(" on the battlefield?").toString(), source, game)) {
|
||||
if (player.chooseUse(outcome, "Pay {3} to keep " + creature.getName() + " on the battlefield?", source, game)) {
|
||||
Cost cost = new GenericManaCost(3);
|
||||
if (!cost.pay(source, game, source.getSourceId(), creature.getControllerId(), false, null)) {
|
||||
paid = true;
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class ExtraplanarLensTriggeredAbility extends TriggeredManaAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever a land with the same name as the exiled card is tapped for mana, ").append(super.getRule()).toString();
|
||||
return "Whenever a land with the same name as the exiled card is tapped for mana, " + super.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class EyeOfDoomEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanents.add(permanent);
|
||||
game.informPlayers((new StringBuilder(player.getLogName()).append(" chooses ").append(permanent.getName()).toString()));
|
||||
game.informPlayers(player.getLogName() + " chooses " + permanent.getName());
|
||||
}
|
||||
}
|
||||
player = playerList.getNext(game);
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ class FieryGambitEffect extends OneShotEffect {
|
|||
boolean controllerStopped = false;
|
||||
while (controller.flipCoin(game)) {
|
||||
++flipsWon;
|
||||
if (!controller.chooseUse(outcome, new StringBuilder("You won ").append(flipsWon).append(flipsWon == 1 ? " flip." : " flips.")
|
||||
.append(" Flip another coin?").toString(), source, game)) {
|
||||
if (!controller.chooseUse(outcome, "You won " + flipsWon + (flipsWon == 1 ? " flip." : " flips.") +
|
||||
" Flip another coin?", source, game)) {
|
||||
controllerStopped = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,9 +99,7 @@ class FightOrFlightEffect extends OneShotEffect {
|
|||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
StringBuilder sb = new StringBuilder("Creatures that can attack this turn: ");
|
||||
sb.append(otherPile.stream().map(Permanent::getLogName).collect(Collectors.joining(", ")));
|
||||
game.informPlayers(sb.toString());
|
||||
game.informPlayers("Creatures that can attack this turn: " + otherPile.stream().map(Permanent::getLogName).collect(Collectors.joining(", ")));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class GaeasBlessingGraveToLibraryEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
game.informPlayers(new StringBuilder(controller.getLogName()).append(" shuffle their graveyard into their library").toString());
|
||||
game.informPlayers(controller.getLogName() + " shuffle their graveyard into their library");
|
||||
for (Card card : controller.getGraveyard().getCards(game)) {
|
||||
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public final class GangUp extends CardImpl {
|
|||
if (ability instanceof SpellAbility) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
ability.getTargets().clear();
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature with power ").append(xValue).append(" or less").toString());
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power " + xValue + " or less");
|
||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class GoblinKaboomistFlipCoinEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
if (!player.flipCoin(game)) {
|
||||
String message = new StringBuilder(permanent.getLogName()).append(" deals 2 damage to itself").toString();
|
||||
String message = permanent.getLogName() + " deals 2 damage to itself";
|
||||
game.informPlayers(message);
|
||||
permanent.damage(2, source.getSourceId(), game, false, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class GodsendTriggeredAbility extends TriggeredAbilityImpl {
|
|||
this.getEffects().get(0).setTargetPointer(new FixedTarget(possibleTargets.iterator().next()));
|
||||
} else {
|
||||
this.getEffects().get(0).setTargetPointer(new FirstTargetPointer());
|
||||
targetName = new StringBuilder(targetName).append("equipped by ").append(equipment.getName()).toString();
|
||||
targetName = targetName + " equipped by " + equipment.getName();
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent(targetName);
|
||||
List<PermanentIdPredicate> uuidPredicates = new ArrayList<>();
|
||||
for (UUID creatureId : possibleTargets) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class GravebaneZombieEffect extends ReplacementEffectImpl {
|
|||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
if (permanent != null) {
|
||||
if (permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true)) {
|
||||
game.informPlayers(new StringBuilder(permanent.getName()).append(" was put on the top of its owner's library").toString());
|
||||
game.informPlayers(permanent.getName() + " was put on the top of its owner's library");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class GreatbowDoyenEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(controllerId);
|
||||
if (player != null) {
|
||||
player.damage(damageAmount, sourceOfDamage, game, false, true);
|
||||
game.informPlayers(new StringBuilder(permanent.getName()).append(" deals ").append(damageAmount).append(" damage to ").append(player.getLogName()).toString());
|
||||
game.informPlayers(permanent.getName() + " deals " + damageAmount + " damage to " + player.getLogName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class GusthasScepterExileEffect extends OneShotEffect {
|
|||
Card card = game.getCard(target.getFirstTarget());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (card != null && sourceObject != null) {
|
||||
if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), new StringBuilder(sourceObject.getIdName()).toString(), source.getSourceId(), game)) {
|
||||
if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), sourceObject.getIdName(), source.getSourceId(), game)) {
|
||||
card.setFaceDown(true, game);
|
||||
game.addEffect(new GusthasScepterLookAtCardEffect(card.getId()), source);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ class HeartmenderEffect extends OneShotEffect {
|
|||
if (creature != null
|
||||
&& creature.getCounters(game).getCount(counter.getName()) >= counter.getCount()) {
|
||||
creature.removeCounters(counter.getName(), counter.getCount(), game);
|
||||
game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(' ').append(counter.getName())
|
||||
.append(" counter from ").append(creature.getName()).toString());
|
||||
game.informPlayers("Removed " + counter.getCount() + ' ' + counter.getName() +
|
||||
" counter from " + creature.getName());
|
||||
applied = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class HiddenPredatorsStateTriggeredAbility extends StateTriggeredAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("When an opponent controls a creature with 4 or greater power, if {this} is an enchantment, ").append(super.getRule()).toString();
|
||||
return "When an opponent controls a creature with 4 or greater power, if {this} is an enchantment, " + super.getRule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,11 +71,11 @@ class HiddenStringsEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
if (permanent.isTapped()) {
|
||||
if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append('?').toString(), source, game)) {
|
||||
if (player.chooseUse(Outcome.Untap, "Untap " + permanent.getName() + '?', source, game)) {
|
||||
permanent.untap(game);
|
||||
}
|
||||
} else {
|
||||
if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append('?').toString(), source, game)) {
|
||||
if (player.chooseUse(Outcome.Tap, "Tap " + permanent.getName() + '?', source, game)) {
|
||||
permanent.tap(game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public final class HourOfEternity extends CardImpl {
|
|||
if (ability instanceof SpellAbility) {
|
||||
ability.getTargets().clear();
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard(new StringBuilder(xValue).append(xValue != 1 ? " creature cards" : "creature card").append(" from your graveyard").toString()));
|
||||
Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard((xValue != 1 ? " creature cards" : "creature card") + " from your graveyard"));
|
||||
ability.addTarget(target);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class IdentityThiefAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever {this} attacks, ").append(super.getRule()).toString();
|
||||
return "Whenever {this} attacks, " + super.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class CopyActivatedAbilityEffect extends OneShotEffect {
|
|||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (ability != null && controller != null && sourcePermanent != null) {
|
||||
ability.createCopyOnStack(game, source, source.getControllerId(), true);
|
||||
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(": ").append(controller.getLogName()).append(" copied activated ability").toString());
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " copied activated ability");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class IncreasingVengeanceEffect extends OneShotEffect {
|
|||
if (spell != null) {
|
||||
StackObject stackObjectCopy = spell.createCopyOnStack(game, source, source.getControllerId(), true);
|
||||
if (stackObjectCopy instanceof Spell) {
|
||||
game.informPlayers(new StringBuilder(controller.getLogName()).append(((Spell) stackObjectCopy).getActivatedMessage(game)).toString());
|
||||
game.informPlayers(controller.getLogName() + ((Spell) stackObjectCopy).getActivatedMessage(game));
|
||||
}
|
||||
Spell sourceSpell = (Spell) game.getStack().getStackObject(source.getSourceId());
|
||||
if (sourceSpell != null) {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class IsochronScepterCopyEffect extends OneShotEffect {
|
|||
if (scepter != null && scepter.getImprinted() != null && !scepter.getImprinted().isEmpty()) {
|
||||
Card imprintedInstant = game.getCard(scepter.getImprinted().get(0));
|
||||
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()) == Zone.EXILED) {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) {
|
||||
if (controller.chooseUse(outcome, "Create a copy of " + imprintedInstant.getName() + '?', source, game)) {
|
||||
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
||||
if (copiedCard != null) {
|
||||
game.getExile().add(source.getSourceId(), "", copiedCard);
|
||||
|
|
|
|||
|
|
@ -262,11 +262,11 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect {
|
|||
UUID playerId = targetPlayer.getFirstTarget();
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
String playerName = new StringBuilder(player.getLogName()).append("'s").toString();
|
||||
String playerName = player.getLogName() + "'s";
|
||||
if (source.isControlledBy(player.getId())) {
|
||||
playerName = "your";
|
||||
}
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterNonlandCard(new StringBuilder("nonland card from ").append(playerName).append(" library").toString()));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterNonlandCard("nonland card from " + playerName + " library"));
|
||||
if (controller.searchLibrary(target, game, playerId, !checkList.contains(playerId))) {
|
||||
checkList.add(playerId);
|
||||
UUID targetId = target.getFirstTarget();
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class JadeMonolithRedirectionEffect extends ReplacementEffectImpl {
|
|||
DamageEvent damageEvent = (DamageEvent) event;
|
||||
if (controller != null && targetCreature != null && sourceObject != null) {
|
||||
controller.damage(damageEvent.getAmount(), damageEvent.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), damageEvent.getAppliedEffects());
|
||||
StringBuilder sb = new StringBuilder(sourceObject != null ? sourceObject.getLogName() : "");
|
||||
StringBuilder sb = new StringBuilder(sourceObject.getLogName());
|
||||
sb.append(": ").append(damageEvent.getAmount()).append(" damage redirected from ").append(targetCreature.getLogName());
|
||||
sb.append(" to ").append(controller.getLogName());
|
||||
game.informPlayers(sb.toString());
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class JarJarBinksTapEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (permanentToTap != null) {
|
||||
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(" chosen creature: ").append(permanentToTap.getName()).toString());
|
||||
game.informPlayers(sourcePermanent.getName() + " chosen creature: " + permanentToTap.getName());
|
||||
return permanentToTap.tap(game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class JestersScepterEffect extends OneShotEffect {
|
|||
if (targetedPlayer.getLibrary().hasCards()) {
|
||||
Set<Card> cardsToExile = targetedPlayer.getLibrary().getTopCards(game, 5);
|
||||
for (Card card : cardsToExile) {
|
||||
if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), new StringBuilder(sourceObject.getName()).toString(), source.getSourceId(), game)) {
|
||||
if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), sourceObject.getName(), source.getSourceId(), game)) {
|
||||
card.setFaceDown(true, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,9 +109,9 @@ class JuxtaposeEffect extends ContinuousEffectImpl {
|
|||
|
||||
permanent1.changeControllerId(targetPlayer.getId(), game);
|
||||
permanent2.changeControllerId(you.getId(), game);
|
||||
game.informPlayers(new StringBuilder(sourceObject != null ? sourceObject.getLogName() : "").append(": ").append(you.getLogName())
|
||||
.append(" and ").append(targetPlayer.getLogName()).append(" exchange control of ").append(permanent1.getLogName())
|
||||
.append(" and ").append(permanent2.getName()).toString());
|
||||
game.informPlayers((sourceObject != null ? sourceObject.getLogName() : "") + ": " + you.getLogName() +
|
||||
" and " + targetPlayer.getLogName() + " exchange control of " + permanent1.getLogName() +
|
||||
" and " + permanent2.getName());
|
||||
} else {
|
||||
// discard if there are less than 2 permanents
|
||||
discard();
|
||||
|
|
|
|||
|
|
@ -106,10 +106,10 @@ class KavuPredatorEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
Integer gainedLife = (Integer) this.getValue("gainedLife");
|
||||
if (gainedLife != null) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(gainedLife.intValue()), source, game);
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(gainedLife), source, game);
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
game.informPlayers(new StringBuilder(player.getLogName()).append(" puts ").append(gainedLife).append(" +1/+1 counter on ").append(permanent.getName()).toString());
|
||||
game.informPlayers(player.getLogName() + " puts " + gainedLife + " +1/+1 counter on " + permanent.getName());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public final class KillingGlare extends CardImpl {
|
|||
if (ability instanceof SpellAbility) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
ability.getTargets().clear();
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature with power ").append(xValue).append(" or less").toString());
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power " + xValue + " or less");
|
||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class KioraPreventionEffect extends PreventionEffectImpl {
|
|||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(), CardUtil.addToolTipMarkTags("All damage that would be dealt to and dealt by this permanent is prevented."), game);
|
||||
permanent.addInfo("kioraPrevention" + getId(), CardUtil.addToolTipMarkTags("All damage that would be dealt to and dealt by this permanent is prevented."), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ class KioraPreventionEffect extends PreventionEffectImpl {
|
|||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(), "", game);
|
||||
permanent.addInfo("kioraPrevention" + getId(), "", game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class KurkeshOnakkeAncientEffect extends OneShotEffect {
|
|||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (ability != null && controller != null) {
|
||||
ability.createCopyOnStack(game, source, source.getControllerId(), true);
|
||||
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(": ").append(controller.getLogName()).append(" copied activated ability").toString());
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " copied activated ability");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class LastLaughStateTriggeredAbility extends StateTriggeredAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("When no creatures are on the battlefield, ").append(super.getRule()).toString() ;
|
||||
return "When no creatures are on the battlefield, " + super.getRule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,6 @@ class LegionsLandingTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("When you attack with three or more creatures, ").append(super.getRule()).toString();
|
||||
return "When you attack with three or more creatures, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
@ -95,7 +95,7 @@ class LinSivviDefiantHeroEffect extends OneShotEffect {
|
|||
|
||||
int xCost = source.getManaCostsToPay().getX();
|
||||
|
||||
FilterPermanentCard filter = new FilterPermanentCard(new StringBuilder("Rebel permanent card with converted mana cost ").append(xCost).append(" or less").toString());
|
||||
FilterPermanentCard filter = new FilterPermanentCard("Rebel permanent card with converted mana cost " + xCost + " or less");
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xCost + 1));
|
||||
filter.add(new SubtypePredicate(SubType.REBEL));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class LurkingJackalsStateTriggeredAbility extends StateTriggeredAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("When an opponent has 10 or less life, if {this} is an enchantment, ").append(super.getRule()).toString();
|
||||
return "When an opponent has 10 or less life, if {this} is an enchantment, " + super.getRule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class ManaChargedDragonEffect extends OneShotEffect {
|
|||
payed = true;
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder(player.getLogName()).append(" pays {").append(xValue).append("}.").toString());
|
||||
game.informPlayers(player.getLogName() + " pays {" + xValue + "}.");
|
||||
return xValue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class ManaVortexStateTriggeredAbility extends StateTriggeredAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("When there are no lands on the battlefield, ").append(super.getRule()).toString() ;
|
||||
return "When there are no lands on the battlefield, " + super.getRule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ class RevealVariableBlackCardsFromHandCost extends VariableCostImpl {
|
|||
|
||||
RevealVariableBlackCardsFromHandCost() {
|
||||
super("black cards to reveal");
|
||||
this.text = new StringBuilder("Reveal ").append(xText).append(" black cards from {this}").toString();
|
||||
this.text = "Reveal " + xText + " black cards from {this}";
|
||||
}
|
||||
|
||||
RevealVariableBlackCardsFromHandCost(final RevealVariableBlackCardsFromHandCost cost) {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class MerenOfClanNelTothEffect extends OneShotEffect {
|
|||
text = " put onto battlefield for ";
|
||||
}
|
||||
card.moveToZone(targetZone, source.getSourceId(), game, false);
|
||||
game.informPlayers(new StringBuilder("Meren of Clan Nel Toth: ").append(card.getName()).append(text).append(player.getLogName()).toString());
|
||||
game.informPlayers("Meren of Clan Nel Toth: " + card.getName() + text + player.getLogName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class MindsAglowEffect extends OneShotEffect {
|
|||
payed = true;
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder(player.getLogName()).append(" pays {").append(xValue).append("}.").toString());
|
||||
game.informPlayers(player.getLogName() + " pays {" + xValue + "}.");
|
||||
return xValue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ class MinionOfTheWastesEffect extends OneShotEffect {
|
|||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
int payAmount = controller.getAmount(0, controller.getLife(), "Pay any amount of life", game);
|
||||
controller.loseLife(payAmount, game, false);
|
||||
game.informPlayers(new StringBuilder(sourceCard.getLogName()).append(": ").append(controller.getLogName())
|
||||
.append(" pays ").append(payAmount).append(" life").toString());
|
||||
game.informPlayers(sourceCard.getLogName() + ": " + controller.getLogName() +
|
||||
" pays " + payAmount + " life");
|
||||
game.addEffect(new SetPowerToughnessSourceEffect(payAmount, payAmount, Duration.Custom, SubLayer.SetPT_7b), source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,10 +118,8 @@ class DoUnlessTargetPaysCost extends OneShotEffect {
|
|||
if (!staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(executingEffect.getText(mode));
|
||||
sb.append("unless he or she");
|
||||
sb.append(getCostText());
|
||||
return sb.toString();
|
||||
return executingEffect.getText(mode) + "unless they" +
|
||||
getCostText();
|
||||
}
|
||||
|
||||
private String getCostText() {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class MoonmistEffect extends OneShotEffect {
|
|||
for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
|
||||
if (permanent.isTransformable()) {
|
||||
permanent.transform(game);
|
||||
game.informPlayers(new StringBuilder(permanent.getName()).append(" transforms into ").append(permanent.getSecondCardFace().getName()).toString());
|
||||
game.informPlayers(permanent.getName() + " transforms into " + permanent.getSecondCardFace().getName());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -83,8 +83,6 @@ class MorgueBurstEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Return target creature card from your graveyard to your hand. Morgue Burst deals damage to any target equal to the power of the card returned this way");
|
||||
return sb.toString();
|
||||
return "Return target creature card from your graveyard to your hand. Morgue Burst deals damage to any target equal to the power of the card returned this way";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class MortalObstinacyAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever enchanted creature deals combat damage to a player, ").append(super.getRule()).toString();
|
||||
return "Whenever enchanted creature deals combat damage to a player, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class MossbridgeTrollCost extends CostImpl {
|
|||
}
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder("Tap creatures with total power of ").append(sumPower).toString());
|
||||
game.informPlayers("Tap creatures with total power of " + sumPower);
|
||||
paid = sumPower >= 10;
|
||||
return paid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class MyrBattlesphereEffect extends OneShotEffect {
|
|||
Permanent myr = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
int tappedAmount = 0;
|
||||
TargetPermanent target = new TargetPermanent(0, 1, filter, true);
|
||||
while (true && controller.canRespond()) {
|
||||
while (controller.canRespond()) {
|
||||
target.clearChosen();
|
||||
if (target.canChoose(source.getControllerId(), game)) {
|
||||
Map<String, Serializable> options = new HashMap<>();
|
||||
|
|
@ -145,7 +145,7 @@ class MyrBattlesphereEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (tappedAmount > 0) {
|
||||
game.informPlayers(new StringBuilder(controller.getLogName()).append(" taps ").append(tappedAmount).append(" Myrs").toString());
|
||||
game.informPlayers(controller.getLogName() + " taps " + tappedAmount + " Myrs");
|
||||
// boost effect
|
||||
game.addEffect(new BoostSourceEffect(tappedAmount, 0, Duration.EndOfTurn), source);
|
||||
// damage to defender
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ class NamelessRaceEffect extends OneShotEffect {
|
|||
int maxAmount = Math.min(permanentsInPlay + cardsInGraveyards, controller.getLife());
|
||||
int payAmount = controller.getAmount(0, maxAmount, "Pay up to " + maxAmount + " life", game);
|
||||
controller.loseLife(payAmount, game, false);
|
||||
game.informPlayers(new StringBuilder(sourceCard.getLogName()).append(": ").append(controller.getLogName())
|
||||
.append(" pays ").append(payAmount).append(" life").toString());
|
||||
game.informPlayers(sourceCard.getLogName() + ": " + controller.getLogName() +
|
||||
" pays " + payAmount + " life");
|
||||
game.addEffect(new SetPowerToughnessSourceEffect(payAmount, payAmount, Duration.Custom, SubLayer.SetPT_7b), source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class OpalAvengerStateTriggeredAbility extends StateTriggeredAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("When you have 10 or less life, if {this} is an enchantment, ").append(super.getRule()).toString();
|
||||
return "When you have 10 or less life, if {this} is an enchantment, " + super.getRule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class OrderOfSuccessionEffect extends OneShotEffect {
|
|||
}
|
||||
// if player is in range he chooses a creature to control
|
||||
if (currentPlayer != null && game.getState().getPlayersInRange(controller.getId(), game).contains(currentPlayer.getId())) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature controlled by ").append(nextPlayer.getLogName()).toString());
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature controlled by " + nextPlayer.getLogName());
|
||||
filter.add(new ControllerIdPredicate(nextPlayer.getId()));
|
||||
Target target = new TargetCreaturePermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
|
|
|
|||
|
|
@ -63,6 +63,6 @@ class OverwhelmingInstinctTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever you attack with three or more creatures, ").append(super.getRule()).toString();
|
||||
return "Whenever you attack with three or more creatures, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import mage.util.CardUtil;
|
|||
*/
|
||||
public final class ParadoxicalOutcome extends CardImpl {
|
||||
|
||||
private static FilterControlledPermanent filter = new FilterControlledPermanent(new StringBuilder("any number of of target nonland, nontoken permanents you control").toString());
|
||||
private static FilterControlledPermanent filter = new FilterControlledPermanent("any number of target nonland, nontoken permanents you control");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
||||
|
|
@ -107,7 +107,7 @@ class ParadoxicalOutcomeNumber implements DynamicValue {
|
|||
}
|
||||
}
|
||||
int number = 0;
|
||||
Integer sweepNumber = (Integer) game.getState().getValue(new StringBuilder("ParadoxicalOutcomeEffect").append(source.getSourceId()).append(zoneChangeCounter).toString());
|
||||
Integer sweepNumber = (Integer) game.getState().getValue("ParadoxicalOutcomeEffect" + source.getSourceId() + zoneChangeCounter);
|
||||
if (sweepNumber != null) {
|
||||
number = sweepNumber;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class PardicDragonEffect extends OneShotEffect {
|
|||
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (opponent != null && sourceCard != null) {
|
||||
if (opponent.chooseUse(outcome, new StringBuilder("Put a time counter on ").append(sourceCard.getName()).append('?').toString(), source, game)) {
|
||||
if (opponent.chooseUse(outcome, "Put a time counter on " + sourceCard.getName() + '?', source, game)) {
|
||||
sourceCard.addCounters(CounterType.TIME.createInstance(), source, game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class PhyrexianDreadnoughtSacrificeCost extends CostImpl {
|
|||
}
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder("Sacrificed creatures with total power of ").append(sumPower).toString());
|
||||
game.informPlayers("Sacrificed creatures with total power of " + sumPower);
|
||||
paid = sumPower >= 12;
|
||||
return paid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ class PhyrexianProcessorEffect extends OneShotEffect {
|
|||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
int payAmount = controller.getAmount(0, controller.getLife(), staticText, game);
|
||||
controller.loseLife(payAmount, game, false);
|
||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(controller.getLogName())
|
||||
.append(" pays ").append(payAmount).append(" life.").toString());
|
||||
game.informPlayers(sourceCard.getName() + ": " + controller.getLogName() +
|
||||
" pays " + payAmount + " life.");
|
||||
String key = CardUtil.getCardZoneString("lifePaid", source.getSourceId(), game);
|
||||
game.getState().setValue(key, payAmount);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class PlagueOfVerminEffect extends OneShotEffect {
|
|||
payLife.put(currentPlayer.getId(), currentLifePaid + totalPaidLife);
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(currentPlayer.getLogName()).append(" pays ").append(payLife.get(currentPlayer.getId())).append(" life").toString());
|
||||
game.informPlayers(sourceCard.getName() + ": " + currentPlayer.getLogName() + " pays " + payLife.get(currentPlayer.getId()) + " life");
|
||||
firstInactivePlayer = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class PorphyryNodesEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (permanentToDestroy != null) {
|
||||
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(" chosen creature: ").append(permanentToDestroy.getName()).toString());
|
||||
game.informPlayers(sourcePermanent.getName() + " chosen creature: " + permanentToDestroy.getName());
|
||||
return permanentToDestroy.destroy(source.getSourceId(), game, true);
|
||||
}
|
||||
return true;
|
||||
|
|
@ -132,7 +132,7 @@ class PorphyryNodesStateTriggeredAbility extends StateTriggeredAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("When there are no creatures on the battlefield, ").append(super.getRule()).toString() ;
|
||||
return "When there are no creatures on the battlefield, " + super.getRule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,14 +74,14 @@ class PowerSinkCounterUnlessPaysEffect extends OneShotEffect {
|
|||
String sb = String.valueOf("Pay " + cost.getText()) + Character.toString('?');
|
||||
if (player.chooseUse(Outcome.Benefit, sb, source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
|
||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": additional cost was paid").toString());
|
||||
game.informPlayers(sourceObject.getName() + ": additional cost was paid");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Counter target spell unless its controller pays {X}
|
||||
if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
|
||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": additional cost wasn't paid - countering ").append(spell.getName()).toString());
|
||||
game.informPlayers(sourceObject.getName() + ": additional cost wasn't paid - countering " + spell.getName());
|
||||
}
|
||||
|
||||
// that player taps all lands with mana abilities he or she controls...
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@ class DidNotCastCreatureCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("if that player didn't cast a creature spell this turn");
|
||||
return sb.toString();
|
||||
return "if that player didn't cast a creature spell this turn";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class PurgingScytheEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (permanentToDamage != null) {
|
||||
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(" chosen creature: ").append(permanentToDamage.getName()).toString());
|
||||
game.informPlayers(sourcePermanent.getName() + " chosen creature: " + permanentToDamage.getName());
|
||||
return permanentToDamage.damage(2, source.getSourceId(), game, false, true) > 0;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public final class Repeal extends CardImpl {
|
|||
if (ability instanceof SpellAbility) {
|
||||
ability.getTargets().clear();
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
FilterNonlandPermanent filter = new FilterNonlandPermanent(new StringBuilder("nonland permanent with converted mana cost ").append(xValue).toString());
|
||||
FilterNonlandPermanent filter = new FilterNonlandPermanent("nonland permanent with converted mana cost " + xValue);
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
||||
ability.addTarget(new TargetNonlandPermanent(filter));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class ReverseTheSandsEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
choices.add(new StringBuilder(Integer.toString(player.getLife())).append(" life of ").append(player.getLogName()).toString());
|
||||
choices.add(Integer.toString(player.getLife()) + " life of " + player.getLogName());
|
||||
}
|
||||
}
|
||||
lifeChoice.setChoices(choices);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class RiftsweeperEffect extends OneShotEffect {
|
|||
// move to exile
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
game.getPlayer(card.getOwnerId()).shuffleLibrary(source, game);
|
||||
game.informPlayers(new StringBuilder("Riftsweeper: Choosen card was ").append(card.getName()).toString());
|
||||
game.informPlayers("Riftsweeper: Choosen card was " + card.getName());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class RithTheAwakenerEffect extends OneShotEffect {
|
|||
}
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (controller.choose(outcome, choice, game)) {
|
||||
game.informPlayers(new StringBuilder(controller.getLogName()).append(" chooses ").append(choice.getColor()).toString());
|
||||
game.informPlayers(controller.getLogName() + " chooses " + choice.getColor());
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(new ColorPredicate(choice.getColor()));
|
||||
int cardsWithColor = game.getBattlefield().count(filter, source.getSourceId(), controller.getId(), game);
|
||||
|
|
|
|||
|
|
@ -127,11 +127,11 @@ class SageOfHoursEffect extends OneShotEffect {
|
|||
for (int i = 0; i < turns; i++) {
|
||||
game.getState().getTurnMods().add(new TurnMod(player.getId(), false));
|
||||
}
|
||||
game.informPlayers(new StringBuilder("Removed ").append(countersRemoved)
|
||||
.append(" +1/+1 counters: ").append(player.getLogName()).append(" takes ")
|
||||
.append(CardUtil.numberToText(turns, "an"))
|
||||
.append(turns > 1 ? " extra turns ":" extra turn ")
|
||||
.append("after this one").toString());
|
||||
game.informPlayers("Removed " + countersRemoved +
|
||||
" +1/+1 counters: " + player.getLogName() + " takes " +
|
||||
CardUtil.numberToText(turns, "an") +
|
||||
(turns > 1 ? " extra turns " : " extra turn ") +
|
||||
"after this one");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class SatyrFiredancerTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever an instant or sorcery spell you control deals damage to an opponent, ").append(super.getRule()).toString();
|
||||
return "Whenever an instant or sorcery spell you control deals damage to an opponent, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class SavageSummoningWatcher extends Watcher {
|
|||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && spell.isCreature()) {
|
||||
spellsCastWithSavageSummoning.put(spell.getId(), new HashSet<>(savageSummoningSpells));
|
||||
String cardKey = new StringBuilder(spell.getCard().getId().toString()).append('_').append(spell.getCard().getZoneChangeCounter(game)).toString();
|
||||
String cardKey = spell.getCard().getId().toString() + '_' + spell.getCard().getZoneChangeCounter(game);
|
||||
cardsCastWithSavageSummoning.put(cardKey, new HashSet<>(savageSummoningSpells));
|
||||
savageSummoningSpells.clear();
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ class SavageSummoningWatcher extends Watcher {
|
|||
}
|
||||
|
||||
public void setSavageSummoningSpellActive(Card card, Game game) {
|
||||
String cardKey = new StringBuilder(card.getId().toString()).append('_').append(card.getZoneChangeCounter(game)).toString();
|
||||
String cardKey = card.getId().toString() + '_' + card.getZoneChangeCounter(game);
|
||||
savageSummoningSpells.add(cardKey);
|
||||
}
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ class SavageSummoningWatcher extends Watcher {
|
|||
}
|
||||
|
||||
public boolean isSpellCastWithThisSavageSummoning(UUID spellId, UUID cardId, int zoneChangeCounter) {
|
||||
String cardKey = new StringBuilder(cardId.toString()).append('_').append(zoneChangeCounter).toString();
|
||||
String cardKey = cardId.toString() + '_' + zoneChangeCounter;
|
||||
Set<String> savageSpells = spellsCastWithSavageSummoning.get(spellId);
|
||||
return savageSpells != null && savageSpells.contains(cardKey);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,12 +126,12 @@ class ScoutsWarningWatcher extends Watcher {
|
|||
}
|
||||
|
||||
public void addScoutsWarningSpell(UUID sourceId, int zoneChangeCounter) {
|
||||
String spellKey = new StringBuilder(sourceId.toString()).append('_').append(zoneChangeCounter).toString();
|
||||
String spellKey = sourceId.toString() + '_' + zoneChangeCounter;
|
||||
activeScoutsWarningSpells.add(spellKey);
|
||||
}
|
||||
|
||||
public boolean isScoutsWarningSpellActive(UUID sourceId, int zoneChangeCounter) {
|
||||
String spellKey = new StringBuilder(sourceId.toString()).append('_').append(zoneChangeCounter).toString();
|
||||
String spellKey = sourceId.toString() + '_' + zoneChangeCounter;
|
||||
return activeScoutsWarningSpells.contains(spellKey);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class SharedTraumaEffect extends OneShotEffect {
|
|||
payed = true;
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder(player.getLogName()).append(" pays {").append(xValue).append("}.").toString());
|
||||
game.informPlayers(player.getLogName() + " pays {" + xValue + "}.");
|
||||
return xValue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public final class ShatteredCrypt extends CardImpl {
|
|||
if (ability instanceof SpellAbility) {
|
||||
ability.getTargets().clear();
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard(new StringBuilder(xValue).append(xValue != 1 ? " creature cards" : "creature card").append(" from your graveyard").toString()));
|
||||
Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard((xValue != 1 ? " creature cards" : "creature card") + " from your graveyard"));
|
||||
ability.addTarget(target);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class ShattergangBrothersEffect extends OneShotEffect {
|
|||
public ShattergangBrothersEffect(FilterControlledPermanent filter) {
|
||||
super(Outcome.Sacrifice);
|
||||
this.filter = filter;
|
||||
this.staticText = new StringBuilder("Each other player sacrifices ").append(filter.getMessage()).toString();
|
||||
this.staticText = "Each other player sacrifices " + filter.getMessage();
|
||||
}
|
||||
|
||||
public ShattergangBrothersEffect(final ShattergangBrothersEffect effect) {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class ShieldOfTheAvatarPreventionEffect extends PreventionEffectImpl {
|
|||
result = true;
|
||||
}
|
||||
if (toPrevent > 0) {
|
||||
game.informPlayers(new StringBuilder("Shield of the Avatar ").append("prevented ").append(toPrevent).append(" damage to ").append(game.getPermanent(equipment.getAttachedTo()).getName()).toString());
|
||||
game.informPlayers("Shield of the Avatar " + "prevented " + toPrevent + " damage to " + game.getPermanent(equipment.getAttachedTo()).getName());
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE,
|
||||
equipment.getAttachedTo(), source.getSourceId(), source.getControllerId(), toPrevent));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,8 +87,6 @@ class SigilCaptainTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Whenever a creature enters the battlefield under your control, if that creature is 1/1, put two +1/+1 counters on it");
|
||||
return sb.toString();
|
||||
return "Whenever a creature enters the battlefield under your control, if that creature is 1/1, put two +1/+1 counters on it";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public final class SkyfireKirin extends CardImpl {
|
|||
if (spell != null) {
|
||||
int cmc = spell.getConvertedManaCost();
|
||||
ability.getTargets().clear();
|
||||
FilterPermanent filter = new FilterCreaturePermanent(new StringBuilder("creature with converted mana costs of ").append(cmc).toString());
|
||||
FilterPermanent filter = new FilterCreaturePermanent("creature with converted mana costs of " + cmc);
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, cmc));
|
||||
Target target = new TargetPermanent(filter);
|
||||
ability.addTarget(target);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class SoulSeizerEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null && permanent.isTransformable()) {
|
||||
if (permanent.transform(game)) {
|
||||
game.informPlayers(new StringBuilder(permanent.getName()).append(" transforms into ").append(permanent.getSecondCardFace().getName()).toString());
|
||||
game.informPlayers(permanent.getName() + " transforms into " + permanent.getSecondCardFace().getName());
|
||||
Permanent attachTo = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (attachTo != null) {
|
||||
return attachTo.addAttachment(source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public final class SpellBlast extends CardImpl {
|
|||
if (ability instanceof SpellAbility) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
ability.getTargets().clear();
|
||||
FilterSpell newfilter = new FilterSpell(new StringBuilder("spell with converted mana cost ").append(xValue).toString());
|
||||
FilterSpell newfilter = new FilterSpell("spell with converted mana cost " + xValue);
|
||||
newfilter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
||||
Target target = new TargetSpell(newfilter);
|
||||
ability.addTarget(target);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class SpellRuptureCounterUnlessPaysEffect extends OneShotEffect {
|
|||
}
|
||||
if (!cost.isPaid()) {
|
||||
if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
|
||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": cost wasn't payed - countering ").append(spell.getName()).toString());
|
||||
game.informPlayers(sourceObject.getName() + ": cost wasn't payed - countering " + spell.getName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class SpellbinderCopyEffect extends OneShotEffect {
|
|||
if (spellbinder != null && spellbinder.getImprinted() != null && !spellbinder.getImprinted().isEmpty()) {
|
||||
Card imprintedInstant = game.getCard(spellbinder.getImprinted().get(0));
|
||||
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()) == Zone.EXILED) {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) {
|
||||
if (controller.chooseUse(outcome, "Create a copy of " + imprintedInstant.getName() + '?', source, game)) {
|
||||
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
||||
if (copiedCard != null) {
|
||||
game.getExile().add(source.getSourceId(), "", copiedCard);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public final class SpellstutterSprite extends CardImpl {
|
|||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability instanceof EntersBattlefieldTriggeredAbility) {
|
||||
int numberFaeries = game.getState().getBattlefield().countAll(filter, ability.getControllerId(), game);
|
||||
FilterSpell xFilter = new FilterSpell(new StringBuilder("spell with converted mana cost ").append(numberFaeries).append(" or less").toString());
|
||||
FilterSpell xFilter = new FilterSpell("spell with converted mana cost " + numberFaeries + " or less");
|
||||
xFilter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, numberFaeries + 1));
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetSpell(xFilter));
|
||||
|
|
|
|||
|
|
@ -98,6 +98,6 @@ class SpitefulReturnedTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever {this} or enchanted creature attacks, ").append(super.getRule()).toString();
|
||||
return "Whenever {this} or enchanted creature attacks, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,9 +122,7 @@ class StandOrFallEffect extends OneShotEffect {
|
|||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
StringBuilder sb = new StringBuilder("Creatures that can block this turn: ");
|
||||
sb.append(otherPile.stream().map(Permanent::getLogName).collect(Collectors.joining(", ")));
|
||||
game.informPlayers(sb.toString());
|
||||
game.informPlayers("Creatures that can block this turn: " + otherPile.stream().map(Permanent::getLogName).collect(Collectors.joining(", ")));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,10 +77,10 @@ class StonewiseFortifierPreventAllDamageToEffect extends PreventionEffectImpl {
|
|||
MageObject damageSource = game.getObject(event.getSourceId());
|
||||
MageObject preventionSource = game.getObject(source.getSourceId());
|
||||
if (damageSource != null && preventionSource != null) {
|
||||
StringBuilder message = new StringBuilder(preventedDamage).append(" damage from ");
|
||||
message.append(damageSource.getName()).append(" prevented ");
|
||||
message.append('(').append(preventionSource).append(')');
|
||||
game.informPlayers(message.toString());
|
||||
String message = " damage from " +
|
||||
damageSource.getName() + " prevented " +
|
||||
'(' + preventionSource + ')';
|
||||
game.informPlayers(message);
|
||||
}
|
||||
event.setAmount(0);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, event.getTargetId(), source.getSourceId(), source.getControllerId(), preventedDamage));
|
||||
|
|
|
|||
|
|
@ -78,8 +78,6 @@ class StrionicResonatorEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Copy ").append(mode.getTargets().get(0).getTargetName()).append(". You may choose new targets for the copy");
|
||||
return sb.toString();
|
||||
return "Copy " + mode.getTargets().get(0).getTargetName() + ". You may choose new targets for the copy";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class StromkirkOccultistExileEffect extends OneShotEffect {
|
|||
if (sourcePermanent != null && controller != null && controller.getLibrary().hasCards()) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
String exileName = new StringBuilder(sourcePermanent.getIdName()).append(" <this card may be played the turn it was exiled>").toString();
|
||||
String exileName = sourcePermanent.getIdName() + " <this card may be played the turn it was exiled>";
|
||||
if (controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY, true)) {
|
||||
ContinuousEffect effect = new StromkirkOccultistPlayFromExileEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class SurveyorsScopeEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder("Surveyor's Scope: X = ").append(numberOfLands).toString());
|
||||
game.informPlayers("Surveyor's Scope: X = " + numberOfLands);
|
||||
// 10/17/2013 If no players control at least two more lands than you when the ability resolves, you'll still search and shuffle your library.
|
||||
return new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, numberOfLands, StaticFilters.FILTER_CARD_BASIC_LAND)).apply(game, source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class TaintedPactEffect extends OneShotEffect{
|
|||
break;
|
||||
}
|
||||
names.add(card.getName());
|
||||
if (player.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append("into your hand?").toString(), source, game)) {
|
||||
if (player.chooseUse(outcome, "Put " + card.getName() + "into your hand?", source, game)) {
|
||||
//Adds the current card to hand if it is chosen.
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -113,9 +113,8 @@ class TalusPaladinEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent taluspPaladin = game.getPermanent(source.getSourceId());
|
||||
if (taluspPaladin != null && player != null) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Put a +1/+1 counter on Talus Paladin?");
|
||||
if (!player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
String question = "Put a +1/+1 counter on Talus Paladin?";
|
||||
if (!player.chooseUse(Outcome.Benefit, question, source, game)) {
|
||||
return false;
|
||||
}
|
||||
taluspPaladin.addCounters(CounterType.P1P1.createInstance(), source, game);
|
||||
|
|
|
|||
|
|
@ -96,8 +96,7 @@ class TariffEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
game.informPlayers(new StringBuilder(sourceObject != null ? sourceObject.getName() : "")
|
||||
.append(": ").append(player.getLogName()).append(" hasn't paid").toString());
|
||||
game.informPlayers(sourceObject.getName() + ": " + player.getLogName() + " hasn't paid");
|
||||
creatureToPayFor.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class TaskMageAssemblyStateTriggeredAbility extends StateTriggeredAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("When there are no creatures on the battlefield, ").append(super.getRule()).toString() ;
|
||||
return "When there are no creatures on the battlefield, " + super.getRule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class TemperPreventDamageTargetEffect extends PreventionEffectImpl {
|
|||
Permanent targetPermanent = game.getPermanent(source.getTargets().getFirstTarget());
|
||||
if (targetPermanent != null) {
|
||||
targetPermanent.addCounters(CounterType.P1P1.createInstance(prevented), source, game);
|
||||
game.informPlayers(new StringBuilder("Temper: Prevented ").append(prevented).append(" damage ").toString());
|
||||
game.informPlayers("Temper: Prevented " + prevented + " damage ");
|
||||
game.informPlayers("Temper: Adding " + prevented + " +1/+1 counters to " + targetPermanent.getName());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class TemptWithReflectionsEffect extends OneShotEffect {
|
|||
} else {
|
||||
decision = " won't copy ";
|
||||
}
|
||||
game.informPlayers((new StringBuilder(player.getLogName()).append(decision).append(permanent.getName()).toString()));
|
||||
game.informPlayers((player.getLogName() + decision + permanent.getName()));
|
||||
}
|
||||
player = playerList.getNext(game);
|
||||
} while (!player.getId().equals(game.getActivePlayerId()));
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class TestOfFaithPreventDamageTargetEffect extends PreventionEffectImpl {
|
|||
Permanent targetPermanent = game.getPermanent(source.getTargets().getFirstTarget());
|
||||
if (targetPermanent != null) {
|
||||
targetPermanent.addCounters(CounterType.P1P1.createInstance(prevented), source, game);
|
||||
game.informPlayers(new StringBuilder("Test of Faith: Prevented ").append(prevented).append(" damage ").toString());
|
||||
game.informPlayers("Test of Faith: Prevented " + prevented + " damage ");
|
||||
game.informPlayers("Test of Faith: Adding " + prevented + " +1/+1 counters to " + targetPermanent.getName());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class ThoughtPrisonImprintEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.imprint(card.getId(), game);
|
||||
permanent.addInfo("imprint", new StringBuilder("[Exiled card - ").append(card.getName()).append(']').toString(), game);
|
||||
permanent.addInfo("imprint", "[Exiled card - " + card.getName() + ']', game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class TideOfWarEffect extends OneShotEffect {
|
|||
creature.sacrifice(source.getSourceId(), game);
|
||||
Player player = game.getPlayer(creature.getControllerId());
|
||||
if (player != null) {
|
||||
game.informPlayers(new StringBuilder(player.getLogName()).append(" sacrifices ").append(creature.getName()).toString());
|
||||
game.informPlayers(player.getLogName() + " sacrifices " + creature.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,9 +64,9 @@ public final class ToilsOfNightAndDay extends CardImpl {
|
|||
for (UUID targetId : source.getTargets().get(0).getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append('?').toString(), source, game)) {
|
||||
if (player.chooseUse(Outcome.Tap, "Tap " + permanent.getName() + '?', source, game)) {
|
||||
permanent.tap(game);
|
||||
} else if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append('?').toString(), source, game)) {
|
||||
} else if (player.chooseUse(Outcome.Untap, "Untap " + permanent.getName() + '?', source, game)) {
|
||||
permanent.untap(game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class TrespassersCurseTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever a creature enters the battlefield under enchanted player's control, ").append(super.getRule()).toString();
|
||||
return "Whenever a creature enters the battlefield under enchanted player's control, " + super.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class TrevaTheRenewerEffect extends OneShotEffect {
|
|||
}
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (controller.choose(outcome, choice, game)) {
|
||||
game.informPlayers(new StringBuilder(controller.getLogName()).append(" chooses ").append(choice.getColor()).toString());
|
||||
game.informPlayers(controller.getLogName() + " chooses " + choice.getColor());
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(new ColorPredicate(choice.getColor()));
|
||||
int cardsWithColor = game.getBattlefield().count(filter, source.getSourceId(), controller.getId(), game);
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class TritonTacticsEndOfCombatEffect extends OneShotEffect {
|
|||
// tap creature and add the not untap effect
|
||||
creature.tap(game);
|
||||
doNotUntapNextUntapStep.add(creature);
|
||||
game.informPlayers(new StringBuilder("Triton Tactics: ").append(creature.getName()).append(" doesn't untap during its controller's next untap step").toString());
|
||||
game.informPlayers("Triton Tactics: " + creature.getName() + " doesn't untap during its controller's next untap step");
|
||||
}
|
||||
}
|
||||
if (!doNotUntapNextUntapStep.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class UneshCriosphinxSovereignTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever {this} or another Sphinx enters the battlefield under your control, ").append(super.getRule()).toString();
|
||||
return "Whenever {this} or another Sphinx enters the battlefield under your control, " + super.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class UnexpectedResultEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
} else {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Cast ").append(card.getName()).append(" without paying its mana cost?").toString(), source, game)) {
|
||||
if (controller.chooseUse(outcome, "Cast " + card.getName() + " without paying its mana cost?", source, game)) {
|
||||
return controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ class VectisDominatorEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(targetCreature.getControllerId());
|
||||
if (player != null) {
|
||||
cost.clearPaid();
|
||||
final StringBuilder sb = new StringBuilder("Pay 2 life? (Otherwise ").append(targetCreature.getName()).append(" will be tapped)");
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
String question = "Pay 2 life? (Otherwise " + targetCreature.getName()+" will be tapped)";
|
||||
if (player.chooseUse(Outcome.Benefit, question, source, game)) {
|
||||
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true, null);
|
||||
}
|
||||
if (!cost.isPaid()) {
|
||||
|
|
|
|||
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