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 4c7c0e855e..4f99f38568 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 @@ -108,6 +108,7 @@ public class TestPlayer implements Player { private int maxCallsWithoutAction = 100; private int foundNoAction = 0; + private boolean AIPlayer; private final List actions = new ArrayList<>(); private final List choices = new ArrayList<>(); @@ -119,6 +120,7 @@ public class TestPlayer implements Player { public TestPlayer(ComputerPlayer computerPlayer) { this.computerPlayer = computerPlayer; + AIPlayer = false; } public TestPlayer(final TestPlayer testPlayer) { @@ -414,7 +416,11 @@ public class TestPlayer implements Player { } } } - computerPlayer.pass(game); + if (AIPlayer) { + computerPlayer.priority(game); + } else { + computerPlayer.pass(game); + } // check to prevent endless loops if (numberOfActions == actions.size()) { foundNoAction++; @@ -1809,4 +1815,12 @@ public class TestPlayer implements Player { computerPlayer.pickCard(cards, deck, draft); } + public void setAIPlayer(boolean AIPlayer) { + this.AIPlayer = AIPlayer; + } + + public boolean isAIPlayer() { + return AIPlayer; + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBaseAI.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBaseAI.java index 2fa9998510..2f50da22db 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBaseAI.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBaseAI.java @@ -58,7 +58,9 @@ public abstract class CardTestPlayerBaseAI extends CardTestPlayerAPIImpl { @Override protected TestPlayer createPlayer(String name) { if (name.equals("PlayerA")) { - return new TestPlayer(new ComputerPlayer7("PlayerA", RangeOfInfluence.ONE, skill)); + TestPlayer testPlayer = new TestPlayer(new ComputerPlayer7("PlayerA", RangeOfInfluence.ONE, skill)); + testPlayer.setAIPlayer(true); + return testPlayer; } return super.createPlayer(name); }