diff --git a/Mage.Sets/src/mage/cards/d/DoublingCube.java b/Mage.Sets/src/mage/cards/d/DoublingCube.java index 5a346038c9..da965df2db 100644 --- a/Mage.Sets/src/mage/cards/d/DoublingCube.java +++ b/Mage.Sets/src/mage/cards/d/DoublingCube.java @@ -27,6 +27,7 @@ */ package mage.cards.d; +import mage.ConditionalMana; import mage.Mana; import mage.abilities.Ability; import mage.abilities.costs.common.TapSourceCost; @@ -93,7 +94,16 @@ class DoublingCubeEffect extends ManaEffect { int greenMana = pool.getGreen(); int redMana = pool.getRed(); int colorlessMana = pool.getColorless(); - Mana mana = new Mana(redMana, greenMana, blueMana, whiteMana, blackMana, colorlessMana, 0, 0); + + for(ConditionalMana conditionalMana : pool.getConditionalMana()){ + blackMana += conditionalMana.getBlack(); + whiteMana += conditionalMana.getWhite(); + blueMana += conditionalMana.getBlue(); + greenMana += conditionalMana.getGreen(); + redMana += conditionalMana.getRed(); + colorlessMana += conditionalMana.getColorless(); + } + Mana mana = new Mana(redMana, greenMana, blueMana, whiteMana, blackMana, 0, 0, colorlessMana); checkToFirePossibleEvents(mana, game, source); pool.addMana(mana, game, source); return true; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/DoublingCubeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/DoublingCubeTest.java new file mode 100644 index 0000000000..ed477c2fa5 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/DoublingCubeTest.java @@ -0,0 +1,35 @@ +package org.mage.test.cards.mana; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; +import org.mage.test.serverside.base.impl.CardTestAPIImpl; + +public class DoublingCubeTest extends CardTestPlayerBase { + + String cube = "Doubling Cube"; + String temple = "Eldrazi Temple"; + + @Test + public void DoublingCubeEldraziTemple() { + + addCard(Zone.BATTLEFIELD, playerA, temple); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + addCard(Zone.BATTLEFIELD, playerA, cube); + + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G} to your mana pool"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G} to your mana pool"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G} to your mana pool"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {C}{C}"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3},{T}:"); + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + assertManaPool(playerA); + + + } +} 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 1e37b0c8b2..563c552ad1 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 @@ -22,6 +22,7 @@ import mage.game.GameOptions; import mage.game.command.CommandObject; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentCard; +import mage.players.ManaPool; import mage.players.Player; import org.junit.Assert; import org.junit.Before; @@ -833,6 +834,11 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.assertEquals("(Hand) Card counts for card " + cardName + " for " + player.getName() + " are not equal ", count, actual); } + + public void assertManaPool(Player player){ + ManaPool manaPool = currentGame.getPlayer(player.getId()).getManaPool(); + } + /** * Assert card count in player's graveyard. *