From 1d2132648ba0e16f557a680a54fd2c7bff3f1d96 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 24 Dec 2017 11:23:33 +0100 Subject: [PATCH] * Augur of Bolas - Fixed a problem with AI that can't choose the card from libraray. --- Mage.Sets/src/mage/cards/a/AugurOfBolas.java | 5 +-- .../abilities/enters/AugurOfBolasTest.java | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/AugurOfBolasTest.java diff --git a/Mage.Sets/src/mage/cards/a/AugurOfBolas.java b/Mage.Sets/src/mage/cards/a/AugurOfBolas.java index e0e3b2b31d..5d626a7210 100644 --- a/Mage.Sets/src/mage/cards/a/AugurOfBolas.java +++ b/Mage.Sets/src/mage/cards/a/AugurOfBolas.java @@ -44,7 +44,6 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; -import mage.target.Target; import mage.target.TargetCard; /** @@ -113,8 +112,8 @@ class AugurOfBolasEffect extends OneShotEffect { if (number == 1) { card = topCards.getCards(new FilterInstantOrSorceryCard(), source.getSourceId(), source.getControllerId(), game).iterator().next(); } else { - Target target = new TargetCard(Zone.LIBRARY, new FilterInstantOrSorceryCard()); - controller.chooseTarget(outcome, target, source, game); + TargetCard target = new TargetCard(Zone.LIBRARY, new FilterInstantOrSorceryCard()); + controller.chooseTarget(outcome, topCards, target, source, game); card = topCards.get(target.getFirstTarget(), game); } if (card != null) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/AugurOfBolasTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/AugurOfBolasTest.java new file mode 100644 index 0000000000..f853087345 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/AugurOfBolasTest.java @@ -0,0 +1,39 @@ +package org.mage.test.cards.abilities.enters; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class AugurOfBolasTest extends CardTestPlayerBase { + + /* + Aether Figment {1}{U} + Creature - Illusion + 1/1 + Kicker {3} (You may pay an additional as you cast this spell.) + Aether Figment can't be blocked. + If Aether Figment was kicked, it enters the battlefield with two +1/+1 counters on it. + */ + @Test + public void testEnteringWithCounters() { + addCard(Zone.LIBRARY, playerA, "Lightning Bolt", 3); + skipInitShuffling(); + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + // When Augur of Bolas enters the battlefield, look at the top three cards of your library. + // You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in any order. + addCard(Zone.HAND, playerA, "Augur of Bolas"); // Creature {1}{U} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Augur of Bolas"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Augur of Bolas", 1); + assertHandCount(playerA, "Lightning Bolt", 1); + } +}