Merge pull request #1799 from halljared/master

Fixes 1796
This commit is contained in:
Derek M 2016-04-06 23:26:53 -04:00
commit 13d915a728
2 changed files with 32 additions and 1 deletions

View file

@ -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> cardType = card.getCardType();
if(cardOwnerId != null
&& card.getOwnerId().equals(getControllerId())
&& cardType != null
&& cardType.contains(CardType.LAND)) {
return true;
}
}

View file

@ -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);
}
}