From 6fb344a306796cf4e763a09939e5db395383489a Mon Sep 17 00:00:00 2001 From: Alexsandro Date: Mon, 6 Mar 2017 16:15:02 -0300 Subject: [PATCH 1/4] Create test class to validate error --- .../cards/abilities/other/SakashimaTheImpostorTest.java | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java new file mode 100644 index 0000000000..2e7439f1cb --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java @@ -0,0 +1,7 @@ +package org.mage.test.cards.abilities.other; + +/** + * Created by alexsandro on 06/03/17. + */ +public class SakashimaTheImpostorTest { +} From d98e43ded262f6bd94cd1442538dc9f8ebd0feef Mon Sep 17 00:00:00 2001 From: Alexsandro Date: Mon, 6 Mar 2017 16:15:17 -0300 Subject: [PATCH 2/4] Create test class to validate error --- .../other/SakashimaTheImpostorTest.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java index 2e7439f1cb..aefc3b8197 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java @@ -1,7 +1,26 @@ package org.mage.test.cards.abilities.other; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + /** * Created by alexsandro on 06/03/17. */ -public class SakashimaTheImpostorTest { +public class SakashimaTheImpostorTest extends CardTestPlayerBase { + @Test + public void copySpellStutterTest() { + addCard(Zone.BATTLEFIELD, playerA, "Spellstutter Sprite", 1); + addCard(Zone.BATTLEFIELD, playerB, "Island", 4); + addCard(Zone.HAND, playerB, "Sakashima the Impostor", 4); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Sakashima the Impostor"); + setChoice(playerB, "Spellstutter Sprite"); + + setStopAt(4, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Spellstutter Sprite", 1); + } } From 3c5bd9acce820dd08d3e738cb34041aebb424b7e Mon Sep 17 00:00:00 2001 From: Alexsandro Date: Mon, 6 Mar 2017 19:06:37 -0300 Subject: [PATCH 3/4] Check if exists a target to counter in Stack before counter --- .../src/mage/cards/s/SpellstutterSprite.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/s/SpellstutterSprite.java b/Mage.Sets/src/mage/cards/s/SpellstutterSprite.java index 5331e2a849..bbe621ba64 100644 --- a/Mage.Sets/src/mage/cards/s/SpellstutterSprite.java +++ b/Mage.Sets/src/mage/cards/s/SpellstutterSprite.java @@ -126,7 +126,8 @@ class SpellstutterSpriteCounterTargetEffect extends OneShotEffect { */ int numberFaeries = game.getState().getBattlefield().countAll(SpellstutterSprite.filter, source.getControllerId(), game); StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); - if (stackObject.getConvertedManaCost() <= numberFaeries) { + // If do'nt have any spell targeted + if (stackObject != null && stackObject.getConvertedManaCost() <= numberFaeries) { if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) { return true; } @@ -134,6 +135,21 @@ class SpellstutterSpriteCounterTargetEffect extends OneShotEffect { return false; } +// @Override +// public boolean apply(Game game, Ability source) { +// Player controller = game.getPlayer(source.getControllerId()); +// MageObject sourceObject = source.getSourceObject(game); +// if (controller != null && sourceObject != null) { +// Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); +// if (spell != null) { +// UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); +// return controller.moveCardsToExile(spell, source, game, true, exileId, sourceObject.getIdName()); +// } +// return true; +// } +// return false; +// } + @Override public String getText(Mode mode) { return "counter target spell with converted mana cost X or less, where X is the number of Faeries you control"; From b83bc9d68a50074cfd7b83c75e3fc3dba8218384 Mon Sep 17 00:00:00 2001 From: Alexsandro Date: Mon, 6 Mar 2017 21:11:09 -0300 Subject: [PATCH 4/4] Assert if Sakashima copied SpellStutter by S/T --- .../src/mage/cards/s/SpellstutterSprite.java | 15 --------------- .../abilities/other/SakashimaTheImpostorTest.java | 2 ++ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Mage.Sets/src/mage/cards/s/SpellstutterSprite.java b/Mage.Sets/src/mage/cards/s/SpellstutterSprite.java index bbe621ba64..c62fd10c29 100644 --- a/Mage.Sets/src/mage/cards/s/SpellstutterSprite.java +++ b/Mage.Sets/src/mage/cards/s/SpellstutterSprite.java @@ -135,21 +135,6 @@ class SpellstutterSpriteCounterTargetEffect extends OneShotEffect { return false; } -// @Override -// public boolean apply(Game game, Ability source) { -// Player controller = game.getPlayer(source.getControllerId()); -// MageObject sourceObject = source.getSourceObject(game); -// if (controller != null && sourceObject != null) { -// Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); -// if (spell != null) { -// UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); -// return controller.moveCardsToExile(spell, source, game, true, exileId, sourceObject.getIdName()); -// } -// return true; -// } -// return false; -// } - @Override public String getText(Mode mode) { return "counter target spell with converted mana cost X or less, where X is the number of Faeries you control"; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java index aefc3b8197..267229cccd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SakashimaTheImpostorTest.java @@ -22,5 +22,7 @@ public class SakashimaTheImpostorTest extends CardTestPlayerBase { execute(); assertPermanentCount(playerA, "Spellstutter Sprite", 1); + + assertPowerToughness(playerB, "Sakashima the Impostor", 1, 1); } }