diff --git a/Mage.Sets/src/mage/cards/c/ChandrasMagmutt.java b/Mage.Sets/src/mage/cards/c/ChandrasMagmutt.java index e4e617c127..d4d0d86132 100644 --- a/Mage.Sets/src/mage/cards/c/ChandrasMagmutt.java +++ b/Mage.Sets/src/mage/cards/c/ChandrasMagmutt.java @@ -26,7 +26,7 @@ public final class ChandrasMagmutt extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - // {T}: Chandra's Magmutt deals 1 damage to target player or planeswalker. + // {T}: Chandra's Magmutt deals 1 damage to target player or planeswalker.< Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(1), new TapSourceCost()); ability.addTarget(new TargetPlayerOrPlaneswalker()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GoblinBalloonBrigade.java b/Mage.Sets/src/mage/cards/g/GoblinBalloonBrigade.java index 679784ec56..e95ac8b313 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinBalloonBrigade.java +++ b/Mage.Sets/src/mage/cards/g/GoblinBalloonBrigade.java @@ -29,7 +29,10 @@ public final class GoblinBalloonBrigade extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + // {R}: Goblin Balloon Brigade gains flying until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(FlyingAbility.getInstance(), + Duration.EndOfTurn), new ManaCostsImpl("{R}"))); } public GoblinBalloonBrigade(final GoblinBalloonBrigade card) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChandrasMagmuttTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChandrasMagmuttTest.java index c8f33900f0..6a391c075b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChandrasMagmuttTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChandrasMagmuttTest.java @@ -10,9 +10,10 @@ public class ChandrasMagmuttTest extends CardTestPlayerBase { @Test public void pingPlayer(){ + // {T}: Chandra's Magmutt deals 1 damage to target player or planeswalker.< addCard(Zone.BATTLEFIELD, playerA, "Chandra's Magmutt"); - activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Chandra's Magmutt", playerB); + activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: {source} deals", playerB); setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); setStrictChooseMode(true); @@ -24,10 +25,14 @@ public class ChandrasMagmuttTest extends CardTestPlayerBase { @Test public void pingPlanesWalker(){ + // {T}: Chandra's Magmutt deals 1 damage to target player or planeswalker.< addCard(Zone.BATTLEFIELD, playerA, "Chandra's Magmutt"); + // +1: Put a +1/+1 counter on up to one target creature. It gains indestructible until end of turn. + // −2: Whenever one or more nontoken creatures attack this turn, create that many 1/1 white Soldier creature tokens that are tapped and attacking. + // −6: You get an emblem with "At the beginning of combat on your turn, create a 1/1 white Soldier creature token, then put a +1/+1 counter on each creature you control." addCard(Zone.BATTLEFIELD, playerB, "Basri Ket"); - activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Chandra's Magmutt", "Basri Ket"); + activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: {source} deals", "Basri Ket"); setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); setStrictChooseMode(true); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ConspicuousSnoopTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ConspicuousSnoopTest.java index 276548076a..140b141c3d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ConspicuousSnoopTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ConspicuousSnoopTest.java @@ -26,9 +26,12 @@ public class ConspicuousSnoopTest extends CardTestPlayerBase { public void castGoblinSpellsFromLibrary(){ // You may cast Goblin spells from the top of your library. addCard(Zone.BATTLEFIELD, playerA, "Conspicuous Snoop"); + addCard(Zone.LIBRARY, playerA, "Goblin Lackey"); + skipInitShuffling(); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + // Whenever Goblin Lackey deals damage to a player, you may put a Goblin permanent card from your hand onto the battlefield. castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Lackey"); setStopAt(1, PhaseStep.PRECOMBAT_MAIN); @@ -41,18 +44,22 @@ public class ConspicuousSnoopTest extends CardTestPlayerBase { @Test public void hasActivatedAbilities(){ - // As long as the top card of your library is a Goblin card, - // Conspicuous Snoop has all activated abilities of that card. - addCard(Zone.BATTLEFIELD, playerA, "Conspicuous Snoop"); - addCard(Zone.LIBRARY, playerA, "Goblin Balloon Brigade"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); - + // Play with the top card of your library revealed. + // You may cast Goblin spells from the top of your library. + // As long as the top card of your library is a Goblin card, Conspicuous Snoop has all activated abilities of that card. + addCard(Zone.BATTLEFIELD, playerA, "Conspicuous Snoop"); + // {R}: Goblin Balloon Brigade gains flying until end of turn. + addCard(Zone.LIBRARY, playerA, "Goblin Balloon Brigade"); + skipInitShuffling(); setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + setStrictChooseMode(true); execute(); + assertAllCommandsUsed(); - assertAbilityCount(playerA, "Conspicuous Snoop", ActivatedAbility.class,5); - + assertAbilityCount(playerA, "Conspicuous Snoop", ActivatedAbility.class, 3); // (2 X casts + gains flying ) + } } 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 2424f696e5..b594a1f1e9 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 @@ -906,21 +906,19 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } - public void assertAbilityCount(Player player, String cardName, Class ability, int amount) { - int foundCount = 0; + public void assertAbilityCount(Player player, String cardName, Class searchedAbility, int amount) { Permanent found = null; for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(player.getId())) { if (isObjectHaveTargetNameOrAlias(player, permanent, cardName)) { found = permanent; - foundCount++; + break; } } - Assert.assertNotNull("There is no such permanent under player's control, player=" + player.getName() + ", cardName=" + cardName, found); - + Assert.assertEquals(amount, found.getAbilities(currentGame).stream() - .filter(a -> a.getClass().isAssignableFrom(ability)).collect(Collectors.toList()).size()); + .filter(a -> searchedAbility.isAssignableFrom(a.getClass())).collect(Collectors.toList()).size()); } /**