diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java index a58b0bb718..fa7a6663c8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java @@ -192,4 +192,22 @@ public class DoublingSeasonTest extends CardTestPlayerBase { assertLife(playerA, 20); } + + @Test + public void testDoublePlaneswalkerLoyalty() { + addCard(Zone.BATTLEFIELD, playerA, "Tibalt, the Fiend-Blooded"); + + addCard(Zone.BATTLEFIELD, playerA, "Doubling Season"); + + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA,"+1: Draw a card, then discard a card at random."); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertCounterCount("Tibalt, the Fiend-Blooded", CounterType.LOYALTY, 4); + } } diff --git a/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java b/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java index 64945cb846..72f8d5ab38 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java @@ -27,7 +27,6 @@ */ package mage.abilities.costs.common; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.Cost; import mage.abilities.costs.CostImpl; @@ -35,6 +34,8 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.UUID; + /** * * @author BetaSteward_at_googlemail.com @@ -67,7 +68,7 @@ public class PayLoyaltyCost extends CostImpl { Permanent planeswalker = game.getPermanent(sourceId); if (planeswalker != null && planeswalker.getCounters(game).getCount(CounterType.LOYALTY) + amount >= 0 && planeswalker.canLoyaltyBeUsed(game)) { if (amount > 0) { - planeswalker.getCounters(game).addCounter(CounterType.LOYALTY.createInstance(amount)); + planeswalker.addCounters(CounterType.LOYALTY.createInstance(amount), ability, game, null); } else if (amount < 0) { planeswalker.removeCounters(CounterType.LOYALTY.getName(), Math.abs(amount), game); }