diff --git a/Mage.Sets/src/mage/cards/h/Hivestone.java b/Mage.Sets/src/mage/cards/h/Hivestone.java index badf162e41..a159823ef5 100644 --- a/Mage.Sets/src/mage/cards/h/Hivestone.java +++ b/Mage.Sets/src/mage/cards/h/Hivestone.java @@ -10,6 +10,7 @@ import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.players.Player; import java.util.List; import java.util.UUID; @@ -49,10 +50,11 @@ class CreaturesAreSliversEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game); for (Permanent perm : permanents) { List cardSubType = perm.getSubtype(game); - if (!cardSubType.contains("Sliver")) { + if (!cardSubType.contains("Sliver") && perm.getOwnerId() == player.getId()) { cardSubType.add("Sliver"); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/HivestoneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/HivestoneTest.java index 94db7d00ad..945e184811 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/HivestoneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/HivestoneTest.java @@ -1,13 +1,14 @@ package org.mage.test.cards.single.tsp; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.filter.Filter; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** * Created by Alexsandr0x. */ - - public class HivestoneTest extends CardTestPlayerBase { /** @@ -15,8 +16,21 @@ public class HivestoneTest extends CardTestPlayerBase { */ @Test public void abilityCheckTest() { - // Coloca criatura qualquer em campo, uma no player A e outra no player B, checa se - // receberam o subtipo + addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1); + addCard(Zone.BATTLEFIELD, playerA, "Hivestone", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Muscle Sliver", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Runeclaw Bear", 1); + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPowerToughness(playerA, "Grizzly Bears", 3, 3, Filter.ComparisonScope.Any); + + assertPowerToughness(playerB, "Runeclaw Bear", 2, 2, Filter.ComparisonScope.Any); + + } /** @@ -25,7 +39,22 @@ public class HivestoneTest extends CardTestPlayerBase { */ @Test public void rootSliverTest() { - // com o root sliver e a hivestone em campo, tenta counterar uma carta que não é sliver vinda - // da mão (tem que funcionar, ja que a carta não é sliver na stack) + addCard(Zone.HAND, playerA, "Grizzly Bears", 1); + addCard(Zone.BATTLEFIELD, playerA, "Hivestone", 1); + // Root Sliver can't be countered. Sliver spells can't be countered by spells or abilities. + addCard(Zone.BATTLEFIELD, playerA, "Root Sliver", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.HAND, playerB, "Counterspell"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Grizzly Bears", "Grizzly Bears"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, 1); } }