diff --git a/Mage.Sets/src/mage/cards/l/LaezelVlaakithsChampion.java b/Mage.Sets/src/mage/cards/l/LaezelVlaakithsChampion.java index 7a5482a14b2..66815e26a2c 100644 --- a/Mage.Sets/src/mage/cards/l/LaezelVlaakithsChampion.java +++ b/Mage.Sets/src/mage/cards/l/LaezelVlaakithsChampion.java @@ -76,7 +76,10 @@ class LaezelVlaakithsChampionEffect extends ReplacementEffectImpl { if (source.isControlledBy(event.getTargetId())) { return true; } - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = game.getPermanentEntering(event.getTargetId()); + if (permanent == null) { + permanent = game.getPermanent(event.getTargetId()); + } return permanent != null && (permanent.isCreature(game) || permanent.isPlaneswalker(game)) && permanent.isControlledBy(source.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/v/VorinclexMonstrousRaider.java b/Mage.Sets/src/mage/cards/v/VorinclexMonstrousRaider.java index 2a8e25cec1c..5f30f6f7cd7 100644 --- a/Mage.Sets/src/mage/cards/v/VorinclexMonstrousRaider.java +++ b/Mage.Sets/src/mage/cards/v/VorinclexMonstrousRaider.java @@ -88,13 +88,13 @@ class VorinclexMonstrousRaiderEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Player targetPlayer = game.getPlayer(event.getTargetId()); - Permanent targetPermanet = game.getPermanentEntering(event.getTargetId()); - if (targetPermanet == null) { - targetPermanet = game.getPermanent(event.getTargetId()); + Permanent targetPermanent = game.getPermanentEntering(event.getTargetId()); + if (targetPermanent == null) { + targetPermanent = game.getPermanent(event.getTargetId()); } // on a permanent or player - if (targetPlayer == null && targetPermanet == null) { + if (targetPlayer == null && targetPermanent == null) { return false; } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/clb/LaezelVlaakithsChampionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/clb/LaezelVlaakithsChampionTest.java new file mode 100644 index 00000000000..7de1e3e9b9d --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/clb/LaezelVlaakithsChampionTest.java @@ -0,0 +1,130 @@ +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.CardTestPlayerBase; + +public class LaezelVlaakithsChampionTest extends CardTestPlayerBase { + + // If you would put one or more counters on a creature or planeswalker you control or on yourself, + // put that many plus one of each of those kinds of counters on that permanent or player instead. + + private static final String laezel = "Lae'zel, Vlaakith's Champion"; + private static final String boon = "Dragonscale Boon"; + private static final String bear = "Grizzly Bears"; + private static final String rats = "Ichor Rats"; + private static final String planeswalker = "Chandra, Fire Artisan"; // 4 loyalty + + @Test + public void testExtraCounterOnMyStuff() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); + addCard(Zone.BATTLEFIELD, playerA, laezel); + addCard(Zone.BATTLEFIELD, playerA, bear); + addCard(Zone.HAND, playerA, boon); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, boon, bear); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertCounterCount(bear, CounterType.P1P1, 2 + 1); + } + + @Test + public void testNoExtraCounterOnTheirStuff() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); + addCard(Zone.BATTLEFIELD, playerA, laezel); + addCard(Zone.BATTLEFIELD, playerB, bear); + addCard(Zone.HAND, playerA, boon); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, boon, bear); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertCounterCount(bear, CounterType.P1P1, 2); + } + + @Test + public void testExtraCounterOnMyselfNotThem() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + addCard(Zone.BATTLEFIELD, playerA, laezel); + addCard(Zone.HAND, playerA, rats); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, rats); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertCounterCount(playerA, CounterType.POISON, 1 + 1); + assertCounterCount(playerB, CounterType.POISON, 1); + } + + @Test + public void testExtraCounterOnMyPlaneswalker() { + addCard(Zone.BATTLEFIELD, playerA, laezel); + addCard(Zone.HAND, playerA, planeswalker); // {2}{R}{R} + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, planeswalker); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertCounterCount(playerA, planeswalker, CounterType.LOYALTY, 4 + 1); + } + + @Test + public void testTheyPutCountersOnTheirStuff() { + addCard(Zone.BATTLEFIELD, playerB, "Forest", 4); + addCard(Zone.BATTLEFIELD, playerA, laezel); + addCard(Zone.BATTLEFIELD, playerB, bear); + addCard(Zone.HAND, playerB, boon); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, boon, bear); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertCounterCount(bear, CounterType.P1P1, 2); + } + + @Test + public void testTheyPutCountersOnMyStuff() { + addCard(Zone.BATTLEFIELD, playerB, "Forest", 4); + addCard(Zone.BATTLEFIELD, playerA, laezel); + addCard(Zone.BATTLEFIELD, playerA, bear); + addCard(Zone.HAND, playerB, boon); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, boon, bear); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertCounterCount(bear, CounterType.P1P1, 2); + } + + @Test + public void testTheyPutCountersOnMe() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + addCard(Zone.BATTLEFIELD, playerB, laezel); + addCard(Zone.HAND, playerA, rats); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, rats); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertCounterCount(playerA, CounterType.POISON, 1); + assertCounterCount(playerB, CounterType.POISON, 1); + } +}