From 29eaa8280aa647a6cf012fc62a7e74137dc7b5be Mon Sep 17 00:00:00 2001 From: Jared Hall Date: Wed, 6 Apr 2016 22:41:45 -0400 Subject: [PATCH] Fixes 1796 --- .../TheGitrogMonster.java | 8 +++++- .../single/soi/TheGitrogMonsterTest.java | 25 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/TheGitrogMonster.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/TheGitrogMonster.java index 1ec1029bf4..ca5388454e 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/TheGitrogMonster.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/TheGitrogMonster.java @@ -27,6 +27,7 @@ */ package mage.sets.shadowsoverinnistrad; +import java.util.List; import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; @@ -108,7 +109,12 @@ class TheGitrogMonsterTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event; if (Zone.GRAVEYARD == zEvent.getToZone()) { for (Card card : zEvent.getCards()) { - if (card.getOwnerId().equals(getControllerId()) && card.getCardType().contains(CardType.LAND)) { + UUID cardOwnerId = card.getOwnerId(); + List cardType = card.getCardType(); + if(cardOwnerId != null + && card.getOwnerId().equals(getControllerId()) + && cardType != null + && cardType.contains(CardType.LAND)) { return true; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/TheGitrogMonsterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/TheGitrogMonsterTest.java index 4373220e34..322f47980c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/TheGitrogMonsterTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/TheGitrogMonsterTest.java @@ -70,4 +70,29 @@ public class TheGitrogMonsterTest extends CardTestPlayerBase { assertPermanentCount(playerA, "The Gitrog Monster", 1); assertHandCount(playerA, 2); // 1 for turn, 1 more for land sacrificed } + + /** + * Basic sacrifice test when there is a land + */ + @Test + public void boardSweeperWithTokens() { + + addCard(Zone.HAND, playerA, "The Gitrog Monster", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + + addCard(Zone.HAND, playerB, "Planar Outburst", 1); // destroy all non-land creatures + addCard(Zone.BATTLEFIELD, playerB, "Plains", 7); + addCard(Zone.BATTLEFIELD, playerB, "Archangel of Tithes", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "The Gitrog Monster"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Raise the Alarm"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Planar Outburst"); + + setStopAt(3, PhaseStep.DRAW); + execute(); + + assertPermanentCount(playerA, "The Gitrog Monster", 0); + assertPermanentCount(playerB, "Planar Outburst", 0); + } }