diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index fb4d960589..529f1c7460 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -816,6 +816,15 @@ public class TestPlayer implements Player { wasProccessed = true; } + // show available mana + if (params[0].equals(SHOW_COMMAND_AVAILABLE_MANA) && params.length == 1) { + printStart(action.getActionName()); + printMana(game, computerPlayer.getManaAvailable(game)); + printEnd(); + actions.remove(action); + wasProccessed = true; + } + // show aliases if (params[0].equals(SHOW_COMMAND_ALIASES) && params.length == 1) { printStart(action.getActionName()); @@ -906,9 +915,14 @@ public class TestPlayer implements Player { } } + private void printMana(Game game, ManaOptions manaOptions) { + System.out.println("Total mana options: " + manaOptions.size()); + manaOptions.forEach(mana -> { + System.out.println(mana.toString()); + }); + } + private void printAbilities(Game game, List abilities) { - - System.out.println("Total abilities: " + (abilities != null ? abilities.size() : 0)); if (abilities == null) { return; diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index 13dce61483..7fb9965c0d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -77,6 +77,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement public static final String SHOW_COMMAND_GRAVEYEARD = "GRAVEYARD"; public static final String SHOW_COMMAND_EXILE = "EXILE"; public static final String SHOW_COMMAND_AVAILABLE_ABILITIES = "AVAILABLE_ABILITIES"; + public static final String SHOW_COMMAND_AVAILABLE_MANA = "AVAILABLE_MANA"; public static final String SHOW_COMMAND_ALIASES = "ALIASES"; // TODO: add target player param to commands @@ -421,6 +422,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement show(showName, turnNum, step, player, SHOW_COMMAND_AVAILABLE_ABILITIES); } + public void showAvaileableMana(String showName, int turnNum, PhaseStep step, TestPlayer player) { + show(showName, turnNum, step, player, SHOW_COMMAND_AVAILABLE_MANA); + } + public void showAliases(String showName, int turnNum, PhaseStep step, TestPlayer player) { show(showName, turnNum, step, player, SHOW_COMMAND_ALIASES); } @@ -1347,6 +1352,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement public void castSpell(int turnNum, PhaseStep step, TestPlayer player, String cardName, Player target) { //Assert.assertNotEquals("", cardName); + // warning, target in spell cast command setups without choose target call player.addAction(turnNum, step, "activate:Cast " + cardName + "$targetPlayer=" + target.getName()); }