From f54c2562a8ac21dcc3191cadf82bfba7e73dd825 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 9 Jul 2017 11:16:03 +0200 Subject: [PATCH] * Unesh, Criosphinx Sovereign - Fixed that it did not trigger if a token of it came into play without the subtype Sphinx. --- .../cards/u/UneshCriosphinxSovereign.java | 4 +- .../copy/CopyCreatureCardToTokenTest.java | 57 +++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/copy/CopyCreatureCardToTokenTest.java diff --git a/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java b/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java index 96f310d36dd..13e7a6f0259 100644 --- a/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java +++ b/Mage.Sets/src/mage/cards/u/UneshCriosphinxSovereign.java @@ -66,7 +66,7 @@ import mage.target.TargetCard; public class UneshCriosphinxSovereign extends CardImpl { private static final FilterCard filter = new FilterCard("Sphinx spells"); - + static { filter.add(new SubtypePredicate(SubType.SPHINX)); } @@ -126,7 +126,7 @@ class UneshCriosphinxSovereignTriggeredAbility extends TriggeredAbilityImpl { if (permanent != null && permanent.getOwnerId().equals(controllerId) && permanent.isCreature() - && filter.match(permanent, game)) { + && (event.getTargetId().equals(getSourceId()) || filter.match(permanent, game))) { return true; } return false; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopyCreatureCardToTokenTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopyCreatureCardToTokenTest.java new file mode 100644 index 00000000000..d7295c0960b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopyCreatureCardToTokenTest.java @@ -0,0 +1,57 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.mage.test.cards.copy; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class CopyCreatureCardToTokenTest extends CardTestPlayerBase { + + /** + * Unesh, Criosphinx Sovereign did not have his ETB effect trigger when he + * had a token copy of himself made through casting Hour of Eternity. I + * think there was another creature too that didn't get the ETB effect + * either. + */ + @Test + public void testTokenTriggeresETBEffect() { + // Flying + // Sphinx spells you cast cost {2} less to cast. + // Whenever Unesh, Criosphinx Sovereign or another Sphinx enters the battlefield + // under your control, reveal the top four cards of your library. An opponent seperates + // those cards into two piles. Put one pile into your hand and the other into your graveyard. + addCard(Zone.GRAVEYARD, playerA, "Unesh, Criosphinx Sovereign", 1); // Sphinx 4/4 + + // Exile X target creature cards from your graveyard. For each card exiled this way, + // create a token that's a copy of that card, except it's a 4/4 black Zombie. + addCard(Zone.HAND, playerA, "Hour of Eternity"); // Sorcery {X}{X}{U}{U}{U} + addCard(Zone.BATTLEFIELD, playerA, "Island", 5); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hour of Eternity", "Unesh, Criosphinx Sovereign"); + setChoice(playerA, "X=1"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertGraveyardCount(playerA, "Hour of Eternity", 1); + assertPermanentCount(playerA, "Unesh, Criosphinx Sovereign", 1); + assertGraveyardCount(playerA, "Unesh, Criosphinx Sovereign", 0); + assertExileCount(playerA, "Unesh, Criosphinx Sovereign", 1); + + assertHandCount(playerA, 3); + assertGraveyardCount(playerA, 2); + } + +}