From 566966bf6b73d4bfd052fe064090b13cbbc3783a Mon Sep 17 00:00:00 2001 From: igoudt Date: Wed, 3 May 2017 11:02:23 +0200 Subject: [PATCH] fix and test for triumph of the hordes --- .../src/mage/cards/t/TriumphOfTheHordes.java | 17 +++++++----- .../cards/single/TriumphOfTheHordesTest.java | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/TriumphOfTheHordesTest.java diff --git a/Mage.Sets/src/mage/cards/t/TriumphOfTheHordes.java b/Mage.Sets/src/mage/cards/t/TriumphOfTheHordes.java index a0112ee17c..0193a81228 100644 --- a/Mage.Sets/src/mage/cards/t/TriumphOfTheHordes.java +++ b/Mage.Sets/src/mage/cards/t/TriumphOfTheHordes.java @@ -27,29 +27,32 @@ */ package mage.cards.t; -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.InfectAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; + +import java.util.UUID; /** - * * @author North */ public class TriumphOfTheHordes extends CardImpl { + private FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent(); + public TriumphOfTheHordes(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new GainAbilityControlledEffect(InfectAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, filterCreaturePermanent)); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(InfectAbility.getInstance(), Duration.EndOfTurn, filterCreaturePermanent)); } public TriumphOfTheHordes(final TriumphOfTheHordes card) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/TriumphOfTheHordesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/TriumphOfTheHordesTest.java new file mode 100644 index 0000000000..8bedb58557 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/TriumphOfTheHordesTest.java @@ -0,0 +1,27 @@ +package org.mage.test.cards.single; + +import mage.abilities.keyword.InfectAbility; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +public class TriumphOfTheHordesTest extends CardTestPlayerBase { + + //issue 3292, Triumph of the Hordes gives a Chromatic Lantern Infect + Trample + @Test + public void triumphOfTheHordesNonCreatureTest() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 10); + addCard(Zone.BATTLEFIELD, playerA, "Chromatic Lantern", 1); + addCard(Zone.HAND, playerA, "Triumph of the Hordes", 1); + addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Triumph of the Hordes"); + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + + execute(); + + assertAbility(playerA, "Chromatic Lantern", InfectAbility.getInstance(), false); + assertAbility(playerA, "Grizzly Bears", InfectAbility.getInstance(), true); + } +}