From b705ba48cfcb4b5d864585bf35d71e0d7b87f7fb Mon Sep 17 00:00:00 2001 From: Alex Vasile <48962821+Alex-Vasile@users.noreply.github.com> Date: Thu, 25 Aug 2022 20:38:18 -0400 Subject: [PATCH] [CLB] Fixed Astarion's Thirst not giving counters properly. Closes #9414 --- .../src/mage/cards/a/AstarionsThirst.java | 2 +- .../cards/single/clb/AstarionsThirstTest.java | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/clb/AstarionsThirstTest.java diff --git a/Mage.Sets/src/mage/cards/a/AstarionsThirst.java b/Mage.Sets/src/mage/cards/a/AstarionsThirst.java index 2378a9269d..57080004e1 100644 --- a/Mage.Sets/src/mage/cards/a/AstarionsThirst.java +++ b/Mage.Sets/src/mage/cards/a/AstarionsThirst.java @@ -80,7 +80,7 @@ class AstarionsThirstEffect extends OneShotEffect { } List commanders = game .getBattlefield() - .getActivePermanents(filter, source.getSourceId(), source, game); + .getActivePermanents(filter, source.getControllerId(), source, game); Permanent commander; switch (commanders.size()) { case 0: diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/clb/AstarionsThirstTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/clb/AstarionsThirstTest.java new file mode 100644 index 0000000000..eeb20e5e19 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/clb/AstarionsThirstTest.java @@ -0,0 +1,49 @@ +package org.mage.test.cards.single.clb; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestCommander4Players; + +/** + * Astarion's Thirst + * {3}{B} + * Instant + * Exile target creature. + * Put X +1/+1 counters on a commander creature you control, where X is the power of the creature exiled this way. + * + * @author Alex-Vasile + */ +public class AstarionsThirstTest extends CardTestCommander4Players { + private static final String astarionsThirst = "Astarion's Thirst"; + + /** + * Reported bug: https://github.com/magefree/mage/issues/9414 + * Adding counters portion does not work + */ + @Test + public void canAddCounters() { + // {R}{W} + // 0/3 + String akiri = "Akiri, Line-Slinger"; + addCard(Zone.COMMAND, playerA, akiri); + addCard(Zone.HAND, playerA, astarionsThirst); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + + // 7/7 + addCard(Zone.BATTLEFIELD, playerD, "Ancient Bronze Dragon"); + + setStrictChooseMode(true); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, akiri, true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, astarionsThirst, "Ancient Bronze Dragon"); + + execute(); + + assertPowerToughness(playerA, akiri, 7, 10); + assertCounterCount(playerA, akiri, CounterType.P1P1, 7); + } +}