Fixed player names in some game logs;

This commit is contained in:
Oleg Agafonov 2020-12-27 02:00:52 +04:00
parent fed97c040a
commit 46e0bb9473
11 changed files with 24 additions and 23 deletions

View file

@ -91,7 +91,7 @@ class CustodiSquireVoteEffect extends OneShotEffect {
player.chooseTarget(outcome, possibleCards, target, source, game);
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
game.informPlayers(player.getName() + " voted for " + card.getLogName());
game.informPlayers(player.getLogName() + " voted for " + card.getLogName());
if (!cardCounter.containsKey(target.getFirstTarget())) {
cardCounter.put(target.getFirstTarget(), 1);
} else {

View file

@ -110,10 +110,10 @@ class DecoyGambitEffect extends OneShotEffect {
}
if (player.chooseUse(outcome, "Have " + controller.getName() + " draw a card? If you don't, "
+ permanent.getName() + " will be returned to its owner's hand.", source, game)) {
game.informPlayers(player.getName() + " chose to have " + controller.getName() + " draw a card.");
game.informPlayers(player.getLogName() + " chose to have " + controller.getName() + " draw a card.");
numberOfCardsToDraw += 1;
} else {
game.informPlayers(player.getName() + " chose to have their creature returned to their hand.");
game.informPlayers(player.getLogName() + " chose to have their creature returned to their hand.");
permanentToHand.add(permanent);
}
}

View file

@ -79,9 +79,9 @@ class DistantMemoriesEffect extends OneShotEffect {
if (opponent != null) {
if (opponent.chooseUse(Outcome.Detriment, sb.toString(), source, game)) {
putInHand = true;
game.informPlayers(opponent.getName() + " decides to put the selected card into the player's hand.");
game.informPlayers(opponent.getLogName() + " decides to put the selected card into the player's hand.");
} else {
game.informPlayers(opponent.getName() + " decides to leave the card in exile.");
game.informPlayers(opponent.getLogName() + " decides to leave the card in exile.");
}
}
}

View file

@ -85,9 +85,9 @@ class ExpropriateDilemmaEffect extends CouncilsDilemmaVoteEffect {
private void turnsForTimeVote(int timeCount, Player controller, Game game, Ability source) {
if (timeCount == 1) {
game.informPlayers(controller.getName() + " will take an extra turn");
game.informPlayers(controller.getLogName() + " will take an extra turn");
} else {
game.informPlayers(controller.getName() + " will take " + timeCount + " extra turns");
game.informPlayers(controller.getLogName() + " will take " + timeCount + " extra turns");
}
do {
game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false));
@ -119,7 +119,7 @@ class ExpropriateDilemmaEffect extends CouncilsDilemmaVoteEffect {
ContinuousEffect effect = new ExpropriateControlEffect(controller.getId());
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
game.informPlayers(controller.getName() + " gained control of " + permanent.getIdName() + " owned by " + game.getPlayer(permanent.getOwnerId()).getName());
game.informPlayers(controller.getLogName() + " gained control of " + permanent.getIdName() + " owned by " + game.getPlayer(permanent.getOwnerId()).getName());
}
}
}
@ -133,10 +133,10 @@ class ExpropriateDilemmaEffect extends CouncilsDilemmaVoteEffect {
"Choose " + choiceOne + " or " + choiceTwo + "?",
source.getRule(), choiceOne, choiceTwo, source, game)) {
voteOneCount++;
game.informPlayers(player.getName() + " has voted for " + choiceOne);
game.informPlayers(player.getLogName() + " has voted for " + choiceOne);
} else {
voteTwoCount++;
game.informPlayers(player.getName() + " has voted for " + choiceTwo);
game.informPlayers(player.getLogName() + " has voted for " + choiceTwo);
choiceTwoVoters.add(player.getId());
}
}

View file

@ -21,6 +21,7 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetOpponent;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
@ -107,11 +108,11 @@ class NeganTheColdBloodedEffect extends OneShotEffect {
if (permanent == null) {
continue;
}
if (controllerChoice.equals(creatureId)) {
game.informPlayers(controller.getName() + " chose " + permanent.getIdName());
if (Objects.equals(controllerChoice, creatureId)) {
game.informPlayers(controller.getLogName() + " chose " + permanent.getIdName());
}
if (opponentChoice.equals(creatureId)) {
game.informPlayers(opponent.getName() + " chose " + permanent.getIdName());
if (Objects.equals(opponentChoice, creatureId)) {
game.informPlayers(opponent.getLogName() + " chose " + permanent.getIdName());
}
permanent.sacrifice(source, game);
}

View file

@ -133,7 +133,7 @@ class NivMizzetRebornEffect extends OneShotEffect {
return false;
}
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 10));
game.informPlayers(player.getName() + " reveals " +
game.informPlayers(player.getLogName() + " reveals " +
cards.getCards(game).stream().map(card -> card.getName() + " ").reduce((a, b) -> a + b));
Cards cards2 = new CardsImpl();
if (cards.isEmpty()) {
@ -156,7 +156,7 @@ class NivMizzetRebornEffect extends OneShotEffect {
player.putCardsOnBottomOfLibrary(cards, game, source, false);
if (player.moveCards(cards2, Zone.HAND, source, game)) {
for (Card card : cards2.getCards(game)) {
game.informPlayers(player.getName() + " chose " + card.getName() + " and put it into their hand.");
game.informPlayers(player.getLogName() + " chose " + card.getName() + " and put it into their hand.");
}
}
return true;

View file

@ -70,11 +70,11 @@ class ScryingGlassEffect extends OneShotEffect {
filter.add(new ColorPredicate(color.getColor()));
targetOpponent.revealCards(source, targetOpponent.getHand(), game);
if (targetOpponent.getHand().count(filter, game) == amount) {
game.informPlayers(controller.getName() + " has chosen the exact number and color of the revealed cards from " + targetOpponent.getName() + "'s hand. They draw a card.");
game.informPlayers(controller.getLogName() + " has chosen the exact number and color of the revealed cards from " + targetOpponent.getName() + "'s hand. They draw a card.");
controller.drawCards(1, source, game);
return true;
} else {
game.informPlayers(controller.getName() + " has chosen incorrectly and will not draw a card.");
game.informPlayers(controller.getLogName() + " has chosen incorrectly and will not draw a card.");
}
}
return false;

View file

@ -107,7 +107,7 @@ class TruthOrTaleEffect extends OneShotEffect {
Card finalChosenCard = game.getCard(finalChosenCardTarget.getFirstTarget());
if (finalChosenCard != null) {
if (!game.isSimulation()) {
game.informPlayers(controller.getName() + " chose to put " + finalChosenCard.getIdName() + " into their hand.");
game.informPlayers(controller.getLogName() + " chose to put " + finalChosenCard.getIdName() + " into their hand.");
}
cards.remove(finalChosenCard);
controller.moveCards(finalChosenCard, Zone.HAND, source, game);

View file

@ -70,7 +70,7 @@ class WheelOfMisfortuneEffect extends OneShotEffect {
if (player == null) {
continue;
}
game.informPlayers(player.getName() + " chose " + entry.getValue());
game.informPlayers(player.getLogName() + " chose " + entry.getValue());
}
int maxValue = playerMap.values().stream().mapToInt(x -> x).max().orElse(0);
game.informPlayers("The highest number chosen was " + maxValue);

View file

@ -30,10 +30,10 @@ public abstract class CouncilsDilemmaVoteEffect extends OneShotEffect {
"Choose " + choiceOne + " or " + choiceTwo + "?",
source.getRule(), choiceOne, choiceTwo, source, game)) {
voteOneCount++;
game.informPlayers(player.getName() + " has voted for " + choiceOne);
game.informPlayers(player.getLogName() + " has voted for " + choiceOne);
} else {
voteTwoCount++;
game.informPlayers(player.getName() + " has voted for " + choiceTwo);
game.informPlayers(player.getLogName() + " has voted for " + choiceTwo);
}
}
}

View file

@ -77,7 +77,7 @@ public class ProliferateEffect extends OneShotEffect {
player.addCounters(newCounter, source, game);
}
if (newCounter != null) {
game.informPlayers(player.getName()
game.informPlayers(player.getLogName()
+ " had 1 "
+ newCounter.getName()
+ " counter added to them.");