diff --git a/Mage.Sets/src/mage/cards/b/BenthicExplorers.java b/Mage.Sets/src/mage/cards/b/BenthicExplorers.java index 9e9ad15128..dd8c20015c 100644 --- a/Mage.Sets/src/mage/cards/b/BenthicExplorers.java +++ b/Mage.Sets/src/mage/cards/b/BenthicExplorers.java @@ -21,6 +21,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetLandPermanent; import mage.util.CardUtil; + import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -45,13 +46,12 @@ public final class BenthicExplorers extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(4); - // {tap}, Untap a tapped land an opponent controls: Add one mana of any type that land could produce. + // {T}, Untap a tapped land an opponent controls: Add one mana of any type that land could produce. Ability ability = new BenthicExplorersManaAbility(); - TargetLandPermanent targetOpponentLand = new TargetLandPermanent(filter); - targetOpponentLand.setNotTarget(true); // not a target, it is chosen - ability.addCost(new BenthicExplorersCost(targetOpponentLand)); + ability.addCost(new BenthicExplorersCost( + new TargetLandPermanent(1, 1, filter, true) + )); this.addAbility(ability); - } private BenthicExplorers(final BenthicExplorers card) { @@ -136,7 +136,20 @@ class BenthicExplorersManaEffect extends ManaEffect { @Override public List getNetMana(Game game, Ability source) { List netManas = new ArrayList<>(); - Mana types = getManaTypes(game, source); + + Mana types = new Mana(); + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(opponentId)) { + if (permanent.isLand() && permanent.isTapped()) { + for (ActivatedManaAbilityImpl ability : permanent.getAbilities(game).getActivatedManaAbilities(Zone.BATTLEFIELD)) { + for (Mana mana : ability.getNetMana(game)) { + types.add(mana); + } + } + } + } + } + if (types.getBlack() > 0) { netManas.add(new Mana(ColoredManaSymbol.B)); } diff --git a/Mage.Sets/src/mage/cards/r/RishadanPort.java b/Mage.Sets/src/mage/cards/r/RishadanPort.java index 45fe3d81e0..3cb6c5a151 100644 --- a/Mage.Sets/src/mage/cards/r/RishadanPort.java +++ b/Mage.Sets/src/mage/cards/r/RishadanPort.java @@ -1,7 +1,5 @@ - package mage.cards.r; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; @@ -14,18 +12,19 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** - * * @author jonubuu */ public final class RishadanPort extends CardImpl { public RishadanPort(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},null); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, null); - // {tap}: Add {C}. + // {T}: Add {C}. this.addAbility(new ColorlessManaAbility()); - // {1}, {tap}: Tap target land. + // {1}, {T}: Tap target land. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(1)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetLandPermanent()); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostReduceForEachTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostReduceForEachTest.java index e8eab146be..ef5ad19477 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostReduceForEachTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostReduceForEachTest.java @@ -182,4 +182,35 @@ public class CostReduceForEachTest extends CardTestPlayerBaseWithAIHelps { assertGraveyardCount(playerA, "Shower of Coals", 1); } + + @Test + public void test_BenthicExplorers_ManaAbilityFromOpponentCard() { + // {T}, Untap a tapped land an opponent controls: Add one mana of any type that land could produce. + addCard(Zone.BATTLEFIELD, playerA, "Benthic Explorers", 1); + // + addCard(Zone.HAND, playerA, "Balduvian Bears", 1); // {1}{G} + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerB, "Forest", 1); // give 1 mana + // + // {1}, {T}: Tap target land. + addCard(Zone.BATTLEFIELD, playerA, "Rishadan Port", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + + // prepare tapped land + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}, {T}: Tap target land", "Forest"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + checkPermanentTapped("must be tapped", 1, PhaseStep.PRECOMBAT_MAIN, playerA, playerB, "Forest", true, 1); + + // cast with opponent's mana + checkPlayableAbility("must play", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Balduvian Bears", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears"); + setChoice(playerA, "Forest"); // mana from tapped + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + assertPermanentCount(playerA, "Balduvian Bears", 1); + } }