mirror of
https://github.com/magefree/mage.git
synced 2026-01-17 17:06:45 -08:00
All 1-character strings converted to primitives
"b" + "r" now changed to 'b' + 'w'. It's more straight-forward, and may cause perfomance improvements - character primitives allocation is faster and less expensive than string creation.
This commit is contained in:
parent
31589778ca
commit
f60ebfbb1f
451 changed files with 989 additions and 978 deletions
|
|
@ -105,7 +105,7 @@ class AcademyResearchersEffect extends OneShotEffect {
|
|||
game.getState().setValue("attachTo:" + auraInHand.getId(), academyResearchers);
|
||||
auraInHand.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), controller.getId());
|
||||
if (academyResearchers.addAttachment(auraInHand.getId(), game)) {
|
||||
game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + ".");
|
||||
game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + '.');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class AddleEffect extends OneShotEffect {
|
|||
controller.choose(outcome, choice, game);
|
||||
ObjectColor color = choice.getColor();
|
||||
if(color != null) {
|
||||
game.informPlayers(controller.getLogName() + " chooses " + color + ".");
|
||||
game.informPlayers(controller.getLogName() + " chooses " + color + '.');
|
||||
FilterCard filter = new FilterCard();
|
||||
filter.add(new ColorPredicate(color));
|
||||
Effect effect = new DiscardCardYouChooseTargetEffect(filter);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class AetherbornMarauderEffect extends OneShotEffect {
|
|||
filter.add(new CounterPredicate(CounterType.P1P1));
|
||||
boolean firstRun = true;
|
||||
while (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) {
|
||||
if (controller.chooseUse(outcome, "Move " + (firstRun ? "any" : "more") + " +1/+1 counters from other permanents you control to " + sourceObject.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Move " + (firstRun ? "any" : "more") + " +1/+1 counters from other permanents you control to " + sourceObject.getLogName() + '?', source, game)) {
|
||||
firstRun = false;
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class AlhammarretHighArbiterEffect extends OneShotEffect {
|
|||
controller.chooseTarget(Outcome.Benefit, revealedCards, target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
game.informPlayers("The choosen card name is [" + GameLog.getColoredObjectName(card) + "]");
|
||||
game.informPlayers("The choosen card name is [" + GameLog.getColoredObjectName(card) + ']');
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
sourcePermanent.addInfo("chosen card name", CardUtil.addToolTipMarkTags("Chosen card name: " + card.getName()), game);
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class AssaultSuitGainControlEffect extends OneShotEffect {
|
|||
if (equipment.getAttachedTo() != null) {
|
||||
Permanent equippedCreature = game.getPermanent(equipment.getAttachedTo());
|
||||
if (equippedCreature != null && controller.chooseUse(outcome,
|
||||
"Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + "?", source, game)) {
|
||||
"Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + '?', source, game)) {
|
||||
equippedCreature.untap(game);
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, activePlayer.getId());
|
||||
effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo()));
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ class AureliasFuryCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ")";
|
||||
return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ')';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class AuriokSurvivorsEffect extends OneShotEffect {
|
|||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (p != null && player != null && sourcePermanent != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Attach " + p.getName() + " to " + sourcePermanent.getName() + "?", source, game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Attach " + p.getName() + " to " + sourcePermanent.getName() + '?', source, game)) {
|
||||
sourcePermanent.addAttachment(p.getId(), game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class AurraSingBaneOfJediEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.chooseUse(outcome, "Deal 2 damage to " + game.getPermanent(getTargetPointer().getFirst(game, source)).getName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Deal 2 damage to " + game.getPermanent(getTargetPointer().getFirst(game, source)).getName() + '?', source, game)) {
|
||||
new DamageTargetEffect(2).apply(game, source);
|
||||
} else {
|
||||
new DamageControllerEffect(1).apply(game, source);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class BattletideAlchemistEffect extends PreventionEffectImpl {
|
|||
if (controller != null) {
|
||||
int numberOfClericsControlled = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent("Cleric", "Clerics")).calculate(game, source, this);
|
||||
int toPrevent = Math.min(numberOfClericsControlled, event.getAmount());
|
||||
if (toPrevent > 0 && controller.chooseUse(Outcome.PreventDamage, "Prevent " + toPrevent + " damage to " + targetPlayer.getName() + "?", source, game)) {
|
||||
if (toPrevent > 0 && controller.chooseUse(Outcome.PreventDamage, "Prevent " + toPrevent + " damage to " + targetPlayer.getName() + '?', source, game)) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, targetPlayer.getId(), source.getSourceId(), source.getControllerId(), toPrevent, false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
if (event.getAmount() >= toPrevent) {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class BlindZealotTriggeredAbility extends TriggeredAbilityImpl {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Do you wish to sacrifice ").append(sourcePermanent.getIdName());
|
||||
sb.append(" to destroy target creature controlled by ");
|
||||
sb.append(game.getPlayer(event.getTargetId()).getLogName()).append("?");
|
||||
sb.append(game.getPlayer(event.getTargetId()).getLogName()).append('?');
|
||||
if (player.chooseUse(Outcome.DestroyPermanent, sb.toString(), this, game)) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
filter.add(new ControllerIdPredicate(event.getTargetId()));
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class BorderlandExplorerEffect extends OneShotEffect {
|
|||
for (UUID cardId : cardsPlayer) {
|
||||
Cards cards = new CardsImpl(game.getCard(cardId));
|
||||
Card card = game.getCard(cardId);
|
||||
player.revealCards(card.getIdName() + " (" + player.getName() + ")", cards, game);
|
||||
player.revealCards(card.getIdName() + " (" + player.getName() + ')', cards, game);
|
||||
player.moveCardToHandWithInfo(card, source.getSourceId(), game);
|
||||
player.shuffleLibrary(source, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class BottledCloisterExileEffect extends OneShotEffect {
|
|||
card.moveToExile(exileId, sourcePermanent.getName(), source.getSourceId(), game);
|
||||
card.setFaceDown(true, game);
|
||||
}
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " exiles his or her hand face down (" + numberOfCards + "card" + (numberOfCards > 1 ?"s":"") +")");
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " exiles his or her hand face down (" + numberOfCards + "card" + (numberOfCards > 1 ?"s":"") + ')');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@ class BrainGorgersCounterSourceEffect extends OneShotEffect {
|
|||
cost.clearPaid();
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(outcome, "Sacrifice a creature to counter " + sourceObject.getIdName() + "?", source, game)) {
|
||||
&& player.chooseUse(outcome, "Sacrifice a creature to counter " + sourceObject.getIdName() + '?', source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) {
|
||||
game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + sourceObject.getIdName() + ".");
|
||||
game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + sourceObject.getIdName() + '.');
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -135,8 +135,8 @@ class BrilliantUltimatumEffect extends OneShotEffect {
|
|||
selectedPileCards = pileTwo;
|
||||
selectedPile = pile2;
|
||||
}
|
||||
game.informPlayers(controller.getLogName() + " chose " + selectedPileName + ".");
|
||||
while (!selectedPileCards.isEmpty() && controller.chooseUse(Outcome.PlayForFree, "Do you want to play a card for free from " + selectedPileName + "?", source, game)) {
|
||||
game.informPlayers(controller.getLogName() + " chose " + selectedPileName + '.');
|
||||
while (!selectedPileCards.isEmpty() && controller.chooseUse(Outcome.PlayForFree, "Do you want to play a card for free from " + selectedPileName + '?', source, game)) {
|
||||
TargetCard targetExiledCard = new TargetCard(Zone.EXILED, new FilterCard());
|
||||
if (controller.chooseTarget(Outcome.PlayForFree, selectedPile, targetExiledCard, source, game)) {
|
||||
Card card = selectedPile.get(targetExiledCard.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class CannibalizeEffect extends OneShotEffect {
|
|||
for(UUID targetId: getTargetPointer().getTargets(game, source)) {
|
||||
Permanent creature = game.getPermanent(targetId);
|
||||
if (creature != null) {
|
||||
if ((count == 0 && controller.chooseUse(Outcome.Exile, "Exile " + creature.getLogName() +"?", source, game))
|
||||
if ((count == 0 && controller.chooseUse(Outcome.Exile, "Exile " + creature.getLogName() + '?', source, game))
|
||||
|| (count == 1 && !exileDone)) {
|
||||
controller.moveCardToExileWithInfo(creature, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
exileDone = true;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class ChainLightningEffect extends OneShotEffect {
|
|||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
spell.createCopyOnStack(game, source, affectedPlayer.getId(), true);
|
||||
game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + ".");
|
||||
game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + '.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class ChainOfVaporEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
controller.moveCards(permanent, Zone.HAND, source, game);
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ")"), true);
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ')'), true);
|
||||
if (player.chooseTarget(Outcome.Sacrifice, target, source, game)) {
|
||||
Permanent land = game.getPermanent(target.getFirstTarget());
|
||||
if (land != null && land.sacrifice(source.getSourceId(), game)) {
|
||||
|
|
@ -109,7 +109,7 @@ class ChainOfVaporEffect extends OneShotEffect {
|
|||
if (activateMessage.startsWith(" casts ")) {
|
||||
activateMessage = activateMessage.substring(6);
|
||||
}
|
||||
game.informPlayers(player.getLogName() + " " + activateMessage);
|
||||
game.informPlayers(player.getLogName() + ' ' + activateMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl {
|
|||
payed = true;
|
||||
}
|
||||
}
|
||||
game.informPlayers(player.getLogName() + " pays {" + xValue + "}");
|
||||
game.informPlayers(player.getLogName() + " pays {" + xValue + '}');
|
||||
return xValue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class ChromeMoxEffect extends OneShotEffect {
|
|||
if (cardToImprint != null) {
|
||||
controller.moveCardsToExile(cardToImprint, source, game, true, source.getSourceId(), sourceObject.getIdName() + " (Imprint)");
|
||||
sourcePermanent.imprint(cardToImprint.getId(), game);
|
||||
sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + GameLog.getColoredObjectIdNameForTooltip(cardToImprint) + "]"), game);
|
||||
sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + GameLog.getColoredObjectIdNameForTooltip(cardToImprint) + ']'), game);
|
||||
} else {
|
||||
sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - None]"), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder(super.getRule());
|
||||
sb.deleteCharAt(sb.length() - 1); // remove last '.'
|
||||
sb.append(" and only if ").append(condition.toString()).append(".");
|
||||
sb.append(" and only if ").append(condition.toString()).append('.');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class CollectiveRestraintPayManaToAttackAllEffect extends CantAttackYouUnlessPay
|
|||
public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) {
|
||||
int domainValue = new DomainValue().calculate(game, source, this);
|
||||
if (domainValue > 0) {
|
||||
return new ManaCostsImpl<>("{" + domainValue + "}");
|
||||
return new ManaCostsImpl<>("{" + domainValue + '}');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class ConfiscationCoupEffect extends OneShotEffect {
|
|||
for (int i = 0; i < targetPermanent.getManaCost().convertedManaCost(); i++) {
|
||||
energy += "{E}";
|
||||
}
|
||||
if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + '?', source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
|
||||
ContinuousEffect controllEffect = new GainControlTargetEffect(Duration.Custom);
|
||||
controllEffect.setTargetPointer(new FixedTarget(targetPermanent, game));
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class ConfusionInTheRanks extends CardImpl {
|
|||
if (!message.isEmpty()) {
|
||||
message += "or ";
|
||||
}
|
||||
message += cardTypeEntering.toString().toLowerCase() + " ";
|
||||
message += cardTypeEntering.toString().toLowerCase() + ' ';
|
||||
}
|
||||
filterTarget.add(Predicates.or(cardTypesPredicates));
|
||||
message += "you do not control";
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class ConundrumSphinxEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
String cardName = cardChoice.getChoice();
|
||||
game.informPlayers("Conundrum Sphinx, player: " + player.getLogName() + ", named card: [" + cardName + "]");
|
||||
game.informPlayers("Conundrum Sphinx, player: " + player.getLogName() + ", named card: [" + cardName + ']');
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class CosmicHorrorEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent cosmicHorror = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null && cosmicHorror != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append("?");
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append('?');
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class CouncilsGuardianEffect extends OneShotEffect {
|
|||
}
|
||||
chosenColors.put(color, 1);
|
||||
}
|
||||
game.informPlayers(player.getLogName() + " has chosen " + color.getDescription() + ".");
|
||||
game.informPlayers(player.getLogName() + " has chosen " + color.getDescription() + '.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class CranialExtractionEffect extends SearchTargetGraveyardHandLibraryForCardNam
|
|||
String cardName = cardChoice.getChoice();
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]");
|
||||
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + ']');
|
||||
}
|
||||
super.applySearchAndExile(game, source, cardName, player.getId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,9 +95,9 @@ class DashHopesCounterSourceEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(playerId);
|
||||
cost.clearPaid();
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(outcome, "Pay 5 life to counter " + sourceObject.getIdName() + "?", source, game)) {
|
||||
&& player.chooseUse(outcome, "Pay 5 life to counter " + sourceObject.getIdName() + '?', source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) {
|
||||
game.informPlayers(player.getLogName() + " pays 5 life to counter " + sourceObject.getIdName() + ".");
|
||||
game.informPlayers(player.getLogName() + " pays 5 life to counter " + sourceObject.getIdName() + '.');
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ class DecayingSoilEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + "?", source, game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + '?', source, game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
UUID target = this.getTargetPointer().getFirst(game, source);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class DeepfireElemental extends CardImpl {
|
|||
if (ability.getOriginalId().equals(originalId)) {
|
||||
ability.getTargets().clear();
|
||||
FilterPermanent newFilter = filter.copy();
|
||||
newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append("}").toString());
|
||||
newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append('}').toString());
|
||||
newFilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, ability.getManaCostsToPay().getX()));
|
||||
Target target = new TargetPermanent(newFilter);
|
||||
ability.addTarget(target);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class DemonicHordesEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent demonicHordes = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null && demonicHordes != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append("?");
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append('?');
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class DieYoungEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
new GetEnergyCountersControllerEffect(2).apply(game, source);
|
||||
int max = controller.getCounters().getCount(CounterType.ENERGY);
|
||||
int numberToPayed = controller.getAmount(0, max, "How many energy counters do you like to pay? (maximum = " + max + ")", game);
|
||||
int numberToPayed = controller.getAmount(0, max, "How many energy counters do you like to pay? (maximum = " + max + ')', game);
|
||||
if (numberToPayed > 0) {
|
||||
Cost cost = new PayEnergyCost(numberToPayed);
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class DiluvianPrimordialEffect extends OneShotEffect {
|
|||
if (target instanceof TargetCardInOpponentsGraveyard) {
|
||||
Card targetCard = game.getCard(target.getFirstTarget());
|
||||
if (targetCard != null) {
|
||||
if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + '?', source, game)) {
|
||||
if (controller.cast(targetCard.getSpellAbility(), game, true)) {
|
||||
ContinuousEffect effect = new DiluvianPrimordialReplacementEffect();
|
||||
effect.setTargetPointer(new FixedTarget(targetCard.getId(), game.getState().getZoneChangeCounter(targetCard.getId())));
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class ExileTargetEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
if(sourcePermananent != null){
|
||||
sourcePermananent.imprint(permanent.getId(), game);
|
||||
sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append("]").toString(), game);
|
||||
sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append(']').toString(), game);
|
||||
}
|
||||
return permanent.moveToExile(null, null, source.getSourceId(), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,8 +144,8 @@ 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(controller.getLogName()).append(getActionStr()).append('s')
|
||||
.append(counter.getCount()).append(' ').append(counterName.toLowerCase())
|
||||
.append(" counter on ").append(card.getName()).toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -170,7 +170,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())
|
||||
.append(" counter on ").append(card.getName()).toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -185,7 +185,7 @@ 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()).append(" counters on each ");
|
||||
} else {
|
||||
sb.append("a ").append(counter.getName().toLowerCase()).append(" counter on each ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class EliteArcanistImprintEffect 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", new StringBuilder("[Exiled card - ").append(card.getName()).append(']').toString(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,13 +160,13 @@ class EpiphanyAtTheDrownyardEffect extends OneShotEffect {
|
|||
}
|
||||
game.informPlayers(sb.toString());
|
||||
|
||||
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(":");
|
||||
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(':');
|
||||
i = 0;
|
||||
for (UUID cardUuid : pile2CardsIds) {
|
||||
Card card = game.getCard(cardUuid);
|
||||
if (card != null) {
|
||||
i++;
|
||||
sb.append(" ").append(GameLog.getColoredObjectName(card));
|
||||
sb.append(' ').append(GameLog.getColoredObjectName(card));
|
||||
if (i < pile2CardsIds.size()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class ExpropriateDilemmaEffect extends CouncilsDilemmaVoteEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.chooseUse(Outcome.Vote, "Choose " + choiceOne + "?", source, game)) {
|
||||
if (player.chooseUse(Outcome.Vote, "Choose " + choiceOne + '?', source, game)) {
|
||||
voteOneCount++;
|
||||
game.informPlayers(player.getName() + " has voted for " + choiceOne);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class ExtraplanarLensImprintEffect extends OneShotEffect {
|
|||
if (targetLand != null) {
|
||||
targetLand.moveToExile(null, extraplanarLens.getName() + " (Imprint)", source.getSourceId(), game);
|
||||
extraplanarLens.imprint(targetLand.getId(), game);
|
||||
extraplanarLens.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + targetLand.getLogName() + "]"), game);
|
||||
extraplanarLens.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + targetLand.getLogName() + ']'), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -137,11 +137,11 @@ class FactOrFictionEffect extends OneShotEffect {
|
|||
}
|
||||
game.informPlayers(sb.toString());
|
||||
|
||||
sb = new StringBuilder("Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (":");
|
||||
sb = new StringBuilder("Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (':');
|
||||
i = 0;
|
||||
for (Card card: pile2) {
|
||||
i++;
|
||||
sb.append(" ").append(card.getName());
|
||||
sb.append(' ').append(card.getName());
|
||||
if (i < pile2.size()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class FaerieArtisansEffect extends OneShotEffect {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
for (Permanent permanent : effect.getAddedPermanent()) {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(";");
|
||||
sb.append(';');
|
||||
}
|
||||
sb.append(permanent.getId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class FatespinnerChooseEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
String chosenPhase = choice.getChoice();
|
||||
game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + ".");
|
||||
game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + '.');
|
||||
game.addEffect(new FatespinnerSkipEffect(chosenPhase), source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class FellShepherdEffect extends OneShotEffect {
|
|||
Card card = game.getCard(creatureId);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
sb.append(" ").append(card.getName());
|
||||
sb.append(' ').append(card.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class FlashEffect extends OneShotEffect {
|
|||
card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
|
||||
|
||||
ManaCosts<ManaCost> reducedCost = CardUtil.removeVariableManaCost(CardUtil.reduceCost(card.getManaCost(), 2));
|
||||
StringBuilder sb = new StringBuilder("Pay ").append(reducedCost.getText()).append("?");
|
||||
StringBuilder sb = new StringBuilder("Pay ").append(reducedCost.getText()).append('?');
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
reducedCost.clearPaid();
|
||||
if (reducedCost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
|
|
|
|||
|
|
@ -124,14 +124,16 @@ class FlowstoneSculptureEffect extends OneShotEffect {
|
|||
}
|
||||
else {
|
||||
Ability gainedAbility;
|
||||
if(chosen.equals("Flying")) {
|
||||
gainedAbility = FlyingAbility.getInstance();
|
||||
}
|
||||
else if(chosen.equals("First strike")) {
|
||||
gainedAbility = FirstStrikeAbility.getInstance();
|
||||
}
|
||||
else {
|
||||
gainedAbility = TrampleAbility.getInstance();
|
||||
switch (chosen) {
|
||||
case "Flying":
|
||||
gainedAbility = FlyingAbility.getInstance();
|
||||
break;
|
||||
case "First strike":
|
||||
gainedAbility = FirstStrikeAbility.getInstance();
|
||||
break;
|
||||
default:
|
||||
gainedAbility = TrampleAbility.getInstance();
|
||||
break;
|
||||
}
|
||||
game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.WhileOnBattlefield), source);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ public class ForgottenAncient extends CardImpl {
|
|||
continue;
|
||||
}
|
||||
|
||||
int amountToMove = controller.getAmount(0, numCounters, "How many counters do you want to move? " + "(" + numCounters + ")" + " counters remaining.", game);
|
||||
int amountToMove = controller.getAmount(0, numCounters, "How many counters do you want to move? " + '(' + numCounters + ')' + " counters remaining.", game);
|
||||
if(amountToMove > 0)
|
||||
{
|
||||
boolean previouslyChosen = false;
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class GoblinDarkDwellersEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
|
||||
if (card != null) {
|
||||
if (controller.chooseUse(outcome, "Cast " + card.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Cast " + card.getLogName() + '?', source, game)) {
|
||||
if (controller.cast(card.getSpellAbility(), game, true)) {
|
||||
ContinuousEffect effect = new GoblinDarkDwellersReplacementEffect(card.getId());
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId())));
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ class GodsendExileEffect extends OneShotEffect {
|
|||
if (creature != null && controller != null && sourcePermanent != null) {
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, source);
|
||||
controller.moveCardToExileWithInfo(creature, exileId,
|
||||
sourcePermanent.getIdName() + " (" + sourcePermanent.getZoneChangeCounter(game) + ")", source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
sourcePermanent.getIdName() + " (" + sourcePermanent.getZoneChangeCounter(game) + ')', source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
|
||||
}
|
||||
return false;
|
||||
|
|
@ -218,7 +218,7 @@ class GodsendRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast this spell because a card with the same name is exiled by " + mageObject.getLogName() + ".";
|
||||
return "You can't cast this spell because a card with the same name is exiled by " + mageObject.getLogName() + '.';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class GrandAbolisherEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (activePlayer != null && mageObject != null) {
|
||||
return "You can't cast spells or activate abilities of artifacts, creatures, or enchantments during the turns of " + activePlayer.getLogName() +
|
||||
" (" + mageObject.getLogName() + ")";
|
||||
" (" + mageObject.getLogName() + ')';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ 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())
|
||||
game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(' ').append(counter.getName())
|
||||
.append(" counter from ").append(creature.getName()).toString());
|
||||
applied = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class HellkiteChargerEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
ManaCosts cost = new ManaCostsImpl("{5}{R}{R}");
|
||||
if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + "?", source, game)) {
|
||||
if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + '?', source, game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
new UntapAllControllerEffect(new FilterAttackingCreature(),"").apply(game, source);
|
||||
|
|
|
|||
|
|
@ -98,11 +98,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, new StringBuilder("Untap ").append(permanent.getName()).append('?').toString(), 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, new StringBuilder("Tap ").append(permanent.getName()).append('?').toString(), source, game)) {
|
||||
permanent.tap(game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class HopeOfGhirapurCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ")";
|
||||
return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ')';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class InfiniteObliterationEffect extends SearchTargetGraveyardHandLibraryForCard
|
|||
cardName = cardChoice.getChoice();
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]");
|
||||
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + ']');
|
||||
}
|
||||
|
||||
super.applySearchAndExile(game, source, cardName, player.getId());
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class IntetTheDreamerCastEffect extends AsThoughEffectImpl {
|
|||
if (zone != null && zone.contains(card.getId())/* && CardUtil.cardCanBePlayedNow(card, controller.getId(), game)*/) {
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (game.canPlaySorcery(controller.getId()) && game.getPlayer(controller.getId()).canPlayLand()) {
|
||||
return controller.chooseUse(outcome, "Play " + card.getIdName() + "?", source, game);
|
||||
return controller.chooseUse(outcome, "Play " + card.getIdName() + '?', source, game);
|
||||
}
|
||||
} else {
|
||||
controller.setCastSourceIdWithAlternateMana(objectId, null, null);
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class IsochronScepterImprintEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.imprint(card.getId(), game);
|
||||
permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + "]"), game);
|
||||
permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + ']'), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -155,7 +155,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()).equals(Zone.EXILED)) {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append("?").toString(), source, game)) {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) {
|
||||
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
||||
if (copiedCard != null) {
|
||||
game.getExile().add(source.getSourceId(), "", copiedCard);
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ class JaceArchitectOfThoughtEffect2 extends OneShotEffect {
|
|||
private void postPileToLog(String pileName, Set<Card> cards, Game game) {
|
||||
StringBuilder message = new StringBuilder(pileName).append(": ");
|
||||
for (Card card : cards) {
|
||||
message.append(card.getName()).append(" ");
|
||||
message.append(card.getName()).append(' ');
|
||||
}
|
||||
if (cards.isEmpty()) {
|
||||
message.append(" (empty)");
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class KalitasDestroyEffect extends OneShotEffect {
|
|||
|
||||
class VampireToken extends Token {
|
||||
public VampireToken(int tokenPower, int tokenToughness) {
|
||||
super("Vampire", new StringBuilder(tokenPower).append("/").append(tokenToughness).append(" black Vampire creature token").toString());
|
||||
super("Vampire", new StringBuilder(tokenPower).append('/').append(tokenToughness).append(" black Vampire creature token").toString());
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlack(true);
|
||||
subtype.add("Vampire");
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class KnowledgePoolEffect1 extends OneShotEffect {
|
|||
if (player != null) {
|
||||
player.moveCardsToExile(player.getLibrary().getTopCards(game, 3), source, game, true,
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()),
|
||||
sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ")");
|
||||
sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ')');
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -119,12 +119,16 @@ class LunarAvengerEffect extends OneShotEffect {
|
|||
|
||||
Ability gainedAbility;
|
||||
String chosen = choice.getChoice();
|
||||
if (chosen.equals("Flying")) {
|
||||
gainedAbility = FlyingAbility.getInstance();
|
||||
} else if (chosen.equals("First strike")) {
|
||||
gainedAbility = FirstStrikeAbility.getInstance();
|
||||
} else {
|
||||
gainedAbility = HasteAbility.getInstance();
|
||||
switch (chosen) {
|
||||
case "Flying":
|
||||
gainedAbility = FlyingAbility.getInstance();
|
||||
break;
|
||||
case "First strike":
|
||||
gainedAbility = FirstStrikeAbility.getInstance();
|
||||
break;
|
||||
default:
|
||||
gainedAbility = HasteAbility.getInstance();
|
||||
break;
|
||||
}
|
||||
|
||||
game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class MagmasaurEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourceObject = (Permanent) source.getSourceObjectIfItStillExists(game);
|
||||
if (sourceObject != null && controller != null) {
|
||||
if (controller.chooseUse(outcome, "Remove a +1/+1 counter from " + sourceObject.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Remove a +1/+1 counter from " + sourceObject.getLogName() + '?', source, game)) {
|
||||
sourceObject.removeCounters(CounterType.P1P1.getName(), 1, game);
|
||||
} else {
|
||||
int counters = sourceObject.getCounters(game).getCount(CounterType.P1P1);
|
||||
|
|
|
|||
|
|
@ -110,10 +110,10 @@ class CounterSourceEffect extends OneShotEffect {
|
|||
}
|
||||
if(spell != null){
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if(controller.chooseUse(Outcome.Detriment, "Sacrifice a land to not counter " + spell.getName() + "?", source, game)){
|
||||
if(controller.chooseUse(Outcome.Detriment, "Sacrifice a land to not counter " + spell.getName() + '?', source, game)){
|
||||
SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent()));
|
||||
if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)){
|
||||
game.informPlayers(controller.getLogName() + " sacrifices a land to not counter " + spell.getName() + ".");
|
||||
game.informPlayers(controller.getLogName() + " sacrifices a land to not counter " + spell.getName() + '.');
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -113,8 +113,8 @@ class MindblazeEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
game.informPlayers("Mindblaze, named card: [" + cardChoice.getChoice() + "]");
|
||||
game.informPlayers("Mindblaze, chosen number: [" + numberChoice.getChoice() + "]");
|
||||
game.informPlayers("Mindblaze, named card: [" + cardChoice.getChoice() + ']');
|
||||
game.informPlayers("Mindblaze, chosen number: [" + numberChoice.getChoice() + ']');
|
||||
|
||||
Cards cards = new CardsImpl();
|
||||
cards.addAll(player.getLibrary().getCards(game));
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class DoUnlessTargetPaysCost extends OneShotEffect {
|
|||
if (player != null && mageObject != null) {
|
||||
String message = userMessage;
|
||||
if (message == null) {
|
||||
message = getCostText() + " to prevent " + executingEffect.getText(source.getModes().getMode()) + "?";
|
||||
message = getCostText() + " to prevent " + executingEffect.getText(source.getModes().getMode()) + '?';
|
||||
}
|
||||
message = CardUtil.replaceSourceName(message, mageObject.getLogName());
|
||||
cost.clearPaid();
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class MysticRemoraTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Cost cost = new GenericManaCost(4);
|
||||
String message = "Would you like to pay {4} to prevent the opponent to draw a card?";
|
||||
if (!(opponent.chooseUse(Outcome.Benefit, message, source, game) && cost.pay(source, game, source.getSourceId(), opponent.getId(), false, null))) {
|
||||
if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() +")", source, game)) {
|
||||
if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() + ')', source, game)) {
|
||||
controller.drawCards(1, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect {
|
|||
//TODO: Make sure the Equipment can legally enchant the token, preferably on targetting.
|
||||
Target target = new TargetControlledPermanent(0, 1, filter, true);
|
||||
if (target.canChoose(source.getSourceId(), controller.getId(), game)
|
||||
&& controller.chooseUse(outcome, "Attach an Equipment you control to the created " + tokenPermanent.getIdName() + "?", source, game)) {
|
||||
&& controller.chooseUse(outcome, "Attach an Equipment you control to the created " + tokenPermanent.getIdName() + '?', source, game)) {
|
||||
if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) {
|
||||
Permanent equipmentPermanent = game.getPermanent(target.getFirstTarget());
|
||||
if (equipmentPermanent != null) {
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ class NarsetTranscendentCantCastEffect extends ContinuousRuleModifyingEffectImpl
|
|||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast can't cast noncreature spells (it is prevented by emblem of " + mageObject.getLogName() + ")";
|
||||
return "You can't cast can't cast noncreature spells (it is prevented by emblem of " + mageObject.getLogName() + ')';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class NayaSoulbeastCastEffect extends OneShotEffect {
|
|||
if (player.getLibrary().size() > 0) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
cmc += card.getConvertedManaCost();
|
||||
player.revealCards(sourceObject.getName() + " (" + player.getName() + ")", new CardsImpl(card), game);
|
||||
player.revealCards(sourceObject.getName() + " (" + player.getName() + ')', new CardsImpl(card), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class NimDeathmantleEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||
if (controller != null && equipment != null) {
|
||||
if (controller.chooseUse(Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + "?", source, game)) {
|
||||
if (controller.chooseUse(Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + '?', source, game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
UUID target = targetPointer.getFirst(game, source);
|
||||
|
|
|
|||
|
|
@ -113,7 +113,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, new StringBuilder("Put a time counter on ").append(sourceCard.getName()).append('?').toString(), source, game)) {
|
||||
sourceCard.addCounters(CounterType.TIME.createInstance(), source, game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -101,9 +101,9 @@ class CounterSourceEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(playerId);
|
||||
cost.clearPaid();
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(outcome, "Discard three cards to counter " + sourceObject.getIdName() + "?", source, game)) {
|
||||
&& player.chooseUse(outcome, "Discard three cards to counter " + sourceObject.getIdName() + '?', source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), playerId, false, null)) {
|
||||
game.informPlayers(player.getLogName() + " discards 3 cards to counter " + sourceObject.getIdName() + ".");
|
||||
game.informPlayers(player.getLogName() + " discards 3 cards to counter " + sourceObject.getIdName() + '.');
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class PhyrexianMarauderCantAttackUnlessYouPayEffect extends CantAttackBlockUnles
|
|||
if (sourceObject != null) {
|
||||
int counter = sourceObject.getCounters(game).getCount(CounterType.P1P1);
|
||||
if (counter > 0) {
|
||||
return new ManaCostsImpl<>("{" + counter + "}");
|
||||
return new ManaCostsImpl<>("{" + counter + '}');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class PowerSinkCounterUnlessPaysEffect extends OneShotEffect {
|
|||
int amount = source.getManaCostsToPay().getX();
|
||||
if (amount > 0) {
|
||||
GenericManaCost cost = new GenericManaCost(amount);
|
||||
StringBuilder sb = new StringBuilder("Pay ").append(cost.getText()).append("?");
|
||||
StringBuilder sb = new StringBuilder("Pay ").append(cost.getText()).append('?');
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
|
||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": additional cost was paid").toString());
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class PyxisOfPandemoniumExileEffect extends OneShotEffect {
|
|||
exileId = UUID.randomUUID();
|
||||
exileIds.put(exileKey, exileId);
|
||||
}
|
||||
player.moveCardsToExile(card, source, game, false, exileId, sourceObject.getIdName() + " (" + player.getName() + ")");
|
||||
player.moveCardsToExile(card, source, game, false, exileId, sourceObject.getIdName() + " (" + player.getName() + ')');
|
||||
card.setFaceDown(true, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,12 +153,12 @@ class QuickenWatcher extends Watcher {
|
|||
}
|
||||
|
||||
public void addQuickenSpell(UUID playerId, UUID sourceId, int zoneChangeCounter) {
|
||||
String spellKey = playerId.toString() + sourceId.toString() + "_" + zoneChangeCounter;
|
||||
String spellKey = playerId.toString() + sourceId.toString() + '_' + zoneChangeCounter;
|
||||
activeQuickenSpells.add(spellKey);
|
||||
}
|
||||
|
||||
public boolean isQuickenSpellActive(UUID playerId, UUID sourceId, int zoneChangeCounter) {
|
||||
String spellKey = playerId.toString() + sourceId.toString() + "_" + zoneChangeCounter;
|
||||
String spellKey = playerId.toString() + sourceId.toString() + '_' + zoneChangeCounter;
|
||||
return activeQuickenSpells.contains(spellKey);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class ResearchEffect extends OneShotEffect {
|
|||
textToAsk = new StringBuilder(choiceText);
|
||||
textToAsk.append(" (");
|
||||
textToAsk.append(count);
|
||||
textToAsk.append(")");
|
||||
textToAsk.append(')');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ class DevelopmentEffect extends OneShotEffect {
|
|||
for (UUID opponentUuid : opponents) {
|
||||
Player opponent = game.getPlayer(opponentUuid);
|
||||
if (opponent != null && opponent.chooseUse(Outcome.Detriment,
|
||||
"Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i+1) + ")", source, game)) {
|
||||
"Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i+1) + ')', source, game)) {
|
||||
game.informPlayers(opponent.getLogName() + " had chosen to let " + player.getLogName() + " draw a card.");
|
||||
player.drawCards(1, game);
|
||||
putToken = false;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class ReverseTheSandsEffect extends OneShotEffect {
|
|||
} else {
|
||||
selectedChoice = choices.iterator().next();
|
||||
}
|
||||
int index = selectedChoice.indexOf(" ");
|
||||
int index = selectedChoice.indexOf(' ');
|
||||
if (index > 0) {
|
||||
String lifeString = selectedChoice.substring(0, index);
|
||||
int life = Integer.parseInt(lifeString);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class RhysticStudyDrawEffect extends OneShotEffect {
|
|||
Cost cost = new GenericManaCost(1);
|
||||
String message = "Would you like to pay {1} to prevent the opponent to draw a card?";
|
||||
if (!(opponent.chooseUse(Outcome.Benefit, message, source, game) && cost.pay(source, game, source.getSourceId(), opponent.getId(), false, null))) {
|
||||
if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() +")", source, game)) {
|
||||
if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() + ')', source, game)) {
|
||||
controller.drawCards(1, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl {
|
|||
if (permanent != null) {
|
||||
String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
|
||||
if (subtype != null) {
|
||||
protectionFilter = new FilterPermanent(subtype + "s");
|
||||
protectionFilter = new FilterPermanent(subtype + 's');
|
||||
protectionFilter.add(new SubtypePredicate(subtype));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class RunedHaloSetProtectionEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
|
||||
if (controller != null && cardName != null && !cardName.isEmpty()) {
|
||||
FilterObject filter = new FilterObject("the name [" + cardName + "]");
|
||||
FilterObject filter = new FilterObject("the name [" + cardName + ']');
|
||||
filter.add(new NamePredicate(cardName));
|
||||
ContinuousEffect effect = new GainAbilityControllerEffect(new ProtectionAbility(filter), Duration.Custom);
|
||||
game.addEffect(effect, source);
|
||||
|
|
|
|||
|
|
@ -135,20 +135,22 @@ class CreateSelectedTokenEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
String tokenType = game.getState().getValue(source.getSourceId().toString() + "_SarpadianEmpiresVolVii").toString();
|
||||
Token token;
|
||||
if(tokenType.equals("White Citizen")) {
|
||||
token = new CitizenToken();
|
||||
}
|
||||
else if(tokenType.equals("Blue Camarid")) {
|
||||
token = new CamaridToken();
|
||||
}
|
||||
else if(tokenType.equals("Black Thrull")) {
|
||||
token = new ThrullToken();
|
||||
}
|
||||
else if(tokenType.equals("Red Goblin")) {
|
||||
token = new GoblinToken();
|
||||
}
|
||||
else {
|
||||
token = new SaprolingToken();
|
||||
switch (tokenType) {
|
||||
case "White Citizen":
|
||||
token = new CitizenToken();
|
||||
break;
|
||||
case "Blue Camarid":
|
||||
token = new CamaridToken();
|
||||
break;
|
||||
case "Black Thrull":
|
||||
token = new ThrullToken();
|
||||
break;
|
||||
case "Red Goblin":
|
||||
token = new GoblinToken();
|
||||
break;
|
||||
default:
|
||||
token = new SaprolingToken();
|
||||
break;
|
||||
}
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ class SavageSummoningWatcher extends Watcher {
|
|||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && spell.getCardType().contains(CardType.CREATURE)) {
|
||||
spellsCastWithSavageSummoning.put(spell.getId(), new HashSet<>(savageSummoningSpells));
|
||||
String cardKey = new StringBuilder(spell.getCard().getId().toString()).append("_").append(spell.getCard().getZoneChangeCounter(game)).toString();
|
||||
String cardKey = new StringBuilder(spell.getCard().getId().toString()).append('_').append(spell.getCard().getZoneChangeCounter(game)).toString();
|
||||
cardsCastWithSavageSummoning.put(cardKey, new HashSet<>(savageSummoningSpells));
|
||||
savageSummoningSpells.clear();
|
||||
}
|
||||
|
|
@ -191,7 +191,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 = new StringBuilder(card.getId().toString()).append('_').append(card.getZoneChangeCounter(game)).toString();
|
||||
savageSummoningSpells.add(cardKey);
|
||||
}
|
||||
|
||||
|
|
@ -200,15 +200,15 @@ 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 = new StringBuilder(cardId.toString()).append('_').append(zoneChangeCounter).toString();
|
||||
HashSet<String> savageSpells = (HashSet<String>) spellsCastWithSavageSummoning.get(spellId);
|
||||
return savageSpells != null && savageSpells.contains(cardKey);
|
||||
}
|
||||
|
||||
public boolean isCardCastWithThisSavageSummoning(Card card, UUID cardId, int zoneChangeCounter, Game game) {
|
||||
String creatureCardKey = card.getId().toString() + "_" + (card.getZoneChangeCounter(game));
|
||||
String creatureCardKey = card.getId().toString() + '_' + (card.getZoneChangeCounter(game));
|
||||
// add one because card is now gone to battlefield as creature
|
||||
String cardKey = cardId.toString() + "_" + zoneChangeCounter;
|
||||
String cardKey = cardId.toString() + '_' + zoneChangeCounter;
|
||||
HashSet<String> savageSpells = (HashSet<String>) cardsCastWithSavageSummoning.get(creatureCardKey);
|
||||
return savageSpells != null && savageSpells.contains(cardKey);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,12 +152,12 @@ class ScoutsWarningWatcher extends Watcher {
|
|||
}
|
||||
|
||||
public void addScoutsWarningSpell(UUID sourceId, int zoneChangeCounter) {
|
||||
String spellKey = new StringBuilder(sourceId.toString()).append("_").append(zoneChangeCounter).toString();
|
||||
String spellKey = new StringBuilder(sourceId.toString()).append('_').append(zoneChangeCounter).toString();
|
||||
activeScoutsWarningSpells.add(spellKey);
|
||||
}
|
||||
|
||||
public boolean isScoutsWarningSpellActive(UUID sourceId, int zoneChangeCounter) {
|
||||
String spellKey = new StringBuilder(sourceId.toString()).append("_").append(zoneChangeCounter).toString();
|
||||
String spellKey = new StringBuilder(sourceId.toString()).append('_').append(zoneChangeCounter).toString();
|
||||
return activeScoutsWarningSpells.contains(spellKey);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class SealOfTheGuildpactChooseColorEffect extends OneShotEffect {
|
|||
}
|
||||
String color2 = choice2.getChoice();
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + color1 + " and " + color2 + ".");
|
||||
game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + color1 + " and " + color2 + '.');
|
||||
}
|
||||
game.getState().setValue(mageObject.getId() + "_color1", choice1.getColor());
|
||||
game.getState().setValue(mageObject.getId() + "_color2", choice2.getColor());
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class SenTripletsRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (targetPlayer != null && mageObject != null) {
|
||||
return "This turn you can't cast spells or activate abilities" +
|
||||
" (" + mageObject.getLogName() + ")";
|
||||
" (" + mageObject.getLogName() + ')';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class ShapeshifterEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
game.informPlayers("Shapeshifter, chosen number: [" + numberChoice.getChoice() + "]");
|
||||
game.informPlayers("Shapeshifter, chosen number: [" + numberChoice.getChoice() + ']');
|
||||
game.getState().setValue(source.getSourceId().toString() + "_Shapeshifter", numberChoice.getChoice());
|
||||
if (mageObject instanceof Permanent) {
|
||||
((Permanent) mageObject).addInfo("lastChosenNumber", CardUtil.addToolTipMarkTags("Last chosen number: " + numberChoice.getChoice()), game);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class SharedFateReplacementEffect extends ReplacementEffectImpl {
|
|||
game,
|
||||
false,
|
||||
CardUtil.getExileZoneId(source.getSourceId().toString() + sourcePermanent.getZoneChangeCounter(game) + playerToDraw.getId().toString(), game),
|
||||
"Shared Fate (" + playerToDraw.getName() + ")");
|
||||
"Shared Fate (" + playerToDraw.getName() + ')');
|
||||
card.setFaceDown(true, game);
|
||||
}
|
||||
}
|
||||
|
|
@ -159,7 +159,7 @@ class SharedFatePlayEffect extends AsThoughEffectImpl {
|
|||
if (exileId != null) {
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
if (exileZone != null && exileZone.contains(objectId)) {
|
||||
if (player.chooseUse(outcome, "Play " + game.getCard(objectId).getIdName() + "?", source, game)) {
|
||||
if (player.chooseUse(outcome, "Play " + game.getCard(objectId).getIdName() + '?', source, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,6 +143,6 @@ class SimicManipulatorGainControlTargetEffect extends ContinuousEffectImpl {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return "Gain control of target " + mode.getTargets().get(0).getTargetName() + " " + duration.toString();
|
||||
return "Gain control of target " + mode.getTargets().get(0).getTargetName() + ' ' + duration.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class SoulFoundryImprintEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.imprint(card.getId(), game);
|
||||
permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + "]"), game);
|
||||
permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + ']'), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class SparkOfCreativityEffect extends OneShotEffect {
|
|||
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetCreature != null) {
|
||||
int cmc = card.getManaCost().convertedManaCost();
|
||||
if (controller.chooseUse(outcome, "Let " + sourceObject.getLogName() + " deal " + cmc + " damage to " + targetCreature.getLogName() + "?", source, game)) {
|
||||
if (controller.chooseUse(outcome, "Let " + sourceObject.getLogName() + " deal " + cmc + " damage to " + targetCreature.getLogName() + '?', source, game)) {
|
||||
targetCreature.damage(cmc, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class SpellbinderImprintEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.imprint(card.getId(), game);
|
||||
permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + "]"), game);
|
||||
permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + ']'), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -189,7 +189,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()).equals(Zone.EXILED)) {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append("?").toString(), source, game)) {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) {
|
||||
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
||||
if (copiedCard != null) {
|
||||
game.getExile().add(source.getSourceId(), "", copiedCard);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class SphereOfSafetyPayManaToAttackAllEffect extends CantAttackYouUnlessPayManaA
|
|||
public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) {
|
||||
int enchantments = game.getBattlefield().countAll(new FilterEnchantmentPermanent(), source.getControllerId(), game);
|
||||
if (enchantments > 0) {
|
||||
return new ManaCostsImpl<>("{" + enchantments + "}");
|
||||
return new ManaCostsImpl<>("{" + enchantments + '}');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class SphinxAmbassadorEffect extends OneShotEffect {
|
|||
}
|
||||
String cardName = cardChoice.getChoice();
|
||||
|
||||
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(", named card: [").append(cardName).append("]").toString());
|
||||
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(", named card: [").append(cardName).append(']').toString());
|
||||
if (!card.getName().equals(cardName) && card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append(" onto the battlefield?").toString(), source, game)) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
|
|
|
|||
|
|
@ -162,13 +162,13 @@ class SphinxOfUthuunEffect extends OneShotEffect {
|
|||
}
|
||||
game.informPlayers(sb.toString());
|
||||
|
||||
sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (":");
|
||||
sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (':');
|
||||
i = 0;
|
||||
for (UUID cardUuid : pile2CardsIds) {
|
||||
Card card = game.getCard(cardUuid);
|
||||
if (card != null) {
|
||||
i++;
|
||||
sb.append(" ").append(card.getName());
|
||||
sb.append(' ').append(card.getName());
|
||||
if (i < pile2CardsIds.size()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class SqueesRevengeEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if(player != null) {
|
||||
int number = player.announceXMana(0, Integer.MAX_VALUE, "Choose how many times to flip a coin", game, source);
|
||||
game.informPlayers(player.getLogName() + " chooses " + number + ".");
|
||||
game.informPlayers(player.getLogName() + " chooses " + number + '.');
|
||||
for(int i = 0; i < number; i++) {
|
||||
if(!player.flipCoin(game)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -161,13 +161,13 @@ class SteamAuguryEffect extends OneShotEffect {
|
|||
}
|
||||
game.informPlayers(sb.toString());
|
||||
|
||||
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(":");
|
||||
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(':');
|
||||
i = 0;
|
||||
for (UUID cardUuid : pile2CardsIds) {
|
||||
Card card = game.getCard(cardUuid);
|
||||
if (card != null) {
|
||||
i++;
|
||||
sb.append(" ").append(GameLog.getColoredObjectName(card));
|
||||
sb.append(' ').append(GameLog.getColoredObjectName(card));
|
||||
if (i < pile2CardsIds.size()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class StonewiseFortifierPreventAllDamageToEffect extends PreventionEffectImpl {
|
|||
if (damageSource != null && preventionSource != null) {
|
||||
StringBuilder message = new StringBuilder(preventedDamage).append(" damage from ");
|
||||
message.append(damageSource.getName()).append(" prevented ");
|
||||
message.append("(").append(preventionSource).append(")");
|
||||
message.append('(').append(preventionSource).append(')');
|
||||
game.informPlayers(message.toString());
|
||||
}
|
||||
event.setAmount(0);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class StrongholdGambitEffect extends OneShotEffect {
|
|||
Card card = game.getCard(choosenCard.get(playerId));
|
||||
if (card != null) {
|
||||
Cards cardsToReveal = new CardsImpl(card);
|
||||
player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cardsToReveal, game);
|
||||
player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ')', cardsToReveal, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)
|
||||
&& lowestCMC > card.getConvertedManaCost()) {
|
||||
lowestCMC = card.getConvertedManaCost();
|
||||
|
|
|
|||
|
|
@ -89,10 +89,10 @@ class TemporalExtortionCounterSourceEffect extends OneShotEffect {
|
|||
if (sourceObject != null) {
|
||||
for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player.chooseUse(outcome, "Pay half your life, rounded up to counter " + sourceObject.getIdName() + "?", source, game)) {
|
||||
if (player.chooseUse(outcome, "Pay half your life, rounded up to counter " + sourceObject.getIdName() + '?', source, game)) {
|
||||
Integer amount = (int) Math.ceil(player.getLife() / 2f);
|
||||
player.loseLife(amount, game, false);
|
||||
game.informPlayers(player.getLogName() + " pays half his or her life, rounded up to counter " + sourceObject.getIdName() + ".");
|
||||
game.informPlayers(player.getLogName() + " pays half his or her life, rounded up to counter " + sourceObject.getIdName() + '.');
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class DestroySourceUnlessPaysEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "?", source, game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + '?', source, game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
return true;
|
||||
|
|
|
|||
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