diff --git a/Mage.Sets/src/mage/sets/guildpact/GruulWarPlow.java b/Mage.Sets/src/mage/sets/guildpact/GruulWarPlow.java index 9b5b7d3e080..9a53f409a58 100644 --- a/Mage.Sets/src/mage/sets/guildpact/GruulWarPlow.java +++ b/Mage.Sets/src/mage/sets/guildpact/GruulWarPlow.java @@ -28,10 +28,6 @@ package mage.sets.guildpact; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -40,6 +36,9 @@ import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.permanent.token.Token; @@ -52,7 +51,11 @@ public class GruulWarPlow extends CardImpl { public GruulWarPlow(UUID ownerId) { super(ownerId, 151, "Gruul War Plow", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "GPT"; + + // Creatures you control have trample. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); + + // {1}{R}{G}: Gruul War Plow becomes a 4/4 Juggernaut artifact creature until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new GruulWarPlowToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{G}"))); } @@ -67,6 +70,7 @@ public class GruulWarPlow extends CardImpl { } class GruulWarPlowToken extends Token { + GruulWarPlowToken() { super("Juggernaut", "4/4 Juggernaut artifact creature"); cardType.add(CardType.CREATURE); @@ -75,4 +79,4 @@ class GruulWarPlowToken extends Token { power = new MageInt(4); toughness = new MageInt(4); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java b/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java index f43b44cac72..232964e4733 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java @@ -81,7 +81,7 @@ public class AnafenzaTheForemost extends CardImpl { this.addAbility(ability); // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnafenzaTheForemostEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnafenzaTheForemostEffect())); } public AnafenzaTheForemost(final AnafenzaTheForemost card) { @@ -119,16 +119,15 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (((ZoneChangeEvent)event).getFromZone().equals(Zone.BATTLEFIELD)) { - Permanent permanent = ((ZoneChangeEvent)event).getTarget(); + if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) { + Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null) { return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true); } - } - else { + } else { Card card = game.getCard(event.getTargetId()); if (card != null) { - return controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, ((ZoneChangeEvent)event).getFromZone(), true); + return controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, ((ZoneChangeEvent) event).getFromZone(), true); } } } @@ -142,11 +141,17 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.getCardType().contains(CardType.CREATURE) && - game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) { - return true; + if (card != null && game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) { // Anafenza only cares about cards + if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield + if (zEvent.getTarget().getCardType().contains(CardType.CREATURE)) { + return true; + } + } else if (card.getCardType().contains(CardType.CREATURE)) { + return true; + } } } return false; diff --git a/Mage.Sets/src/mage/sets/prophecy/ChimericIdol.java b/Mage.Sets/src/mage/sets/prophecy/ChimericIdol.java index d5ec0ab43c3..166d82e9fb6 100644 --- a/Mage.Sets/src/mage/sets/prophecy/ChimericIdol.java +++ b/Mage.Sets/src/mage/sets/prophecy/ChimericIdol.java @@ -53,7 +53,7 @@ public class ChimericIdol extends CardImpl { this.expansionSetCode = "PCY"; // {0}: Tap all lands you control. Chimeric Idol becomes a 3/3 Turtle artifact creature until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapAllEffect(new FilterControlledLandPermanent("all lands you control")), new ManaCostsImpl("{0}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapAllEffect(new FilterControlledLandPermanent("lands you control")), new ManaCostsImpl("{0}")); ability.addEffect(new BecomesCreatureSourceEffect(new ChimericIdolToken(), "", Duration.EndOfTurn)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java b/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java index 03616f85f12..c31ead38fb5 100644 --- a/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java +++ b/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,19 +20,14 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -44,6 +39,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.permanent.token.Token; /** @@ -55,9 +54,13 @@ public class LavaclawReaches extends CardImpl { public LavaclawReaches(UUID ownerId) { super(ownerId, 139, "Lavaclaw Reaches", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "WWK"; + + // Lavaclaw Reaches enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + // {T}: Add {B} or {R} to your mana pool. this.addAbility(new BlackManaAbility()); this.addAbility(new RedManaAbility()); + // {1}{B}{R}: Until end of turn, Lavaclaw Reaches becomes a 2/2 black and red Elemental creature with ": This creature gets +X/+0 until end of turn." It's still a land. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new LavaclawReachesToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{B}{R}"))); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java index e0056f8638c..834852f20fa 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java @@ -64,4 +64,29 @@ public class TargetedTriggeredTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Kira, Great Glass-Spinner", 1); } + /** + * With Ashenmoor Liege on the battlefield, my opponent casts Claustrophobia + * on it without losing 4hp. + */ + @Test + public void testAshenmoorLiege() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.HAND, playerA, "Claustrophobia"); // {1}{U}{U} + + // Other black creatures you control get +1/+1. + // Other red creatures you control get +1/+1. + // Whenever Ashenmoor Liege becomes the target of a spell or ability an opponent controls, that player loses 4 life. + addCard(Zone.BATTLEFIELD, playerB, "Ashenmoor Liege", 1); // 4/1 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Claustrophobia", "Ashenmoor Liege"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 16); + + assertPermanentCount(playerA, "Claustrophobia", 1); + assertPowerToughness(playerB, "Ashenmoor Liege", 4, 1); + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java index 109b704982e..a1624958674 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java @@ -139,4 +139,37 @@ public class AnafenzaTest extends CardTestCommanderDuelBase { assertLife(playerB, 40); } + // Anafenza + Animated permanents + @Test + public void testAnafenzaExileAnimatedPermanents() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + + // {0}: Tap all lands you control. Chimeric Idol becomes a 3/3 Turtle artifact creature until end of turn. + addCard(Zone.BATTLEFIELD, playerB, "Chimeric Idol"); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3); + + // Whenever Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control. + // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Anafenza, the Foremost"); // 4/4 + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{0}: Tap all lands you control"); + + attack(2, playerB, "Chimeric Idol"); + block(2, playerA, "Anafenza, the Foremost", "Chimeric Idol"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 40); + assertLife(playerB, 40); + + assertExileCount("Chimeric Idol", 1); + assertGraveyardCount(playerB, "Chimeric Idol", 0); + assertPermanentCount(playerB, "Chimeric Idol", 0); + + assertTappedCount("Mountain", true, 3); + + } }