From 1a4e892f0435123d2385f0118ba5eed61645ae90 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 6 May 2018 01:05:04 +0400 Subject: [PATCH] Cheat engine: + added commands to show my hand and library (@show my hand, @show my library); + added params to show color identity ("color commander") and card's color ("color cost"); --- .../java/mage/server/util/SystemUtil.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java index 1f2adf2d19..0d0941623e 100644 --- a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java +++ b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java @@ -41,6 +41,8 @@ public final class SystemUtil { private static final String COMMAND_CLEAR_BATTLEFIELD = "@clear battlefield"; private static final String COMMAND_SHOW_OPPONENT_HAND = "@show opponent hand"; private static final String COMMAND_SHOW_OPPONENT_LIBRARY = "@show opponent library"; + private static final String COMMAND_SHOW_MY_HAND = "@show my hand"; + private static final String COMMAND_SHOW_MY_LIBRARY = "@show my library"; private static final Map supportedCommands = new HashMap<>(); static { @@ -50,6 +52,8 @@ public final class SystemUtil { supportedCommands.put(COMMAND_CLEAR_BATTLEFIELD, "CLAR BATTLEFIELD"); supportedCommands.put(COMMAND_SHOW_OPPONENT_HAND, "SHOW OPPONENT HAND"); supportedCommands.put(COMMAND_SHOW_OPPONENT_LIBRARY, "SHOW OPPONENT LIBRARY"); + supportedCommands.put(COMMAND_SHOW_MY_HAND, "SHOW MY HAND"); + supportedCommands.put(COMMAND_SHOW_MY_LIBRARY, "SHOW MY LIBRARY"); } private static final Pattern patternGroup = Pattern.compile("\\[(.+)\\]"); // [test new card] @@ -57,7 +61,8 @@ public final class SystemUtil { private static final Pattern patternCardInfo = Pattern.compile("([\\S ]+):([\\S ]+)"); // Island:XLN // show ext info for special commands - private static final String PARAM_COLOR = "color"; + private static final String PARAM_COLOR_COST = "color cost"; + private static final String PARAM_COLOR_COMMANDER = "color commander"; private static final String PARAM_PT = "pt"; // power toughness private static final String PARAM_ABILITIES_COUNT = "abilities count"; private static final String PARAM_ABILITIES_LIST = "abilities list"; @@ -114,7 +119,10 @@ public final class SystemUtil { ArrayList resInfo = new ArrayList<>(); for (String param : commandParams) { switch (param) { - case PARAM_COLOR: + case PARAM_COLOR_COST: + resInfo.add(card.getColor(game).toString()); + break; + case PARAM_COLOR_COMMANDER: resInfo.add(card.getColorIdentity().toString()); break; case PARAM_PT: @@ -359,6 +367,20 @@ public final class SystemUtil { game.informPlayer(feedbackPlayer, info); } break; + + case COMMAND_SHOW_MY_HAND: + if (feedbackPlayer != null) { + String info = getCardsListForSpecialInform(game, feedbackPlayer.getHand(), runGroup.commands); + game.informPlayer(feedbackPlayer, info); + } + break; + + case COMMAND_SHOW_MY_LIBRARY: + if (feedbackPlayer != null) { + String info = getCardsListForSpecialInform(game, feedbackPlayer.getLibrary().getCardList(), runGroup.commands); + game.informPlayer(feedbackPlayer, info); + } + break; } return;