From 63ae8a9f13682e3972cafa2aafc321d739d5084e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 28 Apr 2015 14:45:38 +0200 Subject: [PATCH] * Mistbind Clique - Added test for champpion triggered ability. Set zone ability has to work in. --- .../avacynrestored/TreacherousPitDweller.java | 1 - .../src/mage/sets/futuresight/Narcomoeba.java | 1 - .../src/mage/sets/lorwyn/MistbindClique.java | 27 ++++++++--------- .../mage/sets/timeshifted/GaeasBlessing.java | 1 - .../abilities/keywords/ChampionTest.java | 29 +++++++++++++++++++ 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TreacherousPitDweller.java b/Mage.Sets/src/mage/sets/avacynrestored/TreacherousPitDweller.java index 337d893d1aa..66bfd0fb33b 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TreacherousPitDweller.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TreacherousPitDweller.java @@ -77,7 +77,6 @@ class TreacherousPitDwellerTriggeredAbility extends ZoneChangeTriggeredAbility { public TreacherousPitDwellerTriggeredAbility() { super(Zone.GRAVEYARD, Zone.BATTLEFIELD, new TreacherousPitDwellerEffect(), ruleText, false); - zone = Zone.BATTLEFIELD; addTarget(new TargetOpponent()); } diff --git a/Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java b/Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java index 2abf5743481..7e96c98e54a 100644 --- a/Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java +++ b/Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java @@ -73,7 +73,6 @@ public class Narcomoeba extends CardImpl { class NarcomoebaAbility extends ZoneChangeTriggeredAbility { public NarcomoebaAbility() { super(Zone.LIBRARY, Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), "", true); - this.zone = Zone.ALL; } public NarcomoebaAbility(final NarcomoebaAbility ability) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/MistbindClique.java b/Mage.Sets/src/mage/sets/lorwyn/MistbindClique.java index dc5ce7dcea2..5eaf9d8f525 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/MistbindClique.java +++ b/Mage.Sets/src/mage/sets/lorwyn/MistbindClique.java @@ -63,7 +63,6 @@ public class MistbindClique extends CardImpl { this.subtype.add("Faerie"); this.subtype.add("Wizard"); - this.color.setBlue(true); this.power = new MageInt(4); this.toughness = new MageInt(4); @@ -73,7 +72,6 @@ public class MistbindClique extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Champion a Faerie this.addAbility(new ChampionAbility(this, "Faerie")); - // When a Faerie is championed with Mistbind Clique, tap all lands target player controls. this.addAbility(new MistbindCliqueAbility()); @@ -93,7 +91,8 @@ public class MistbindClique extends CardImpl { class MistbindCliqueAbility extends ZoneChangeTriggeredAbility { public MistbindCliqueAbility() { - super(Zone.BATTLEFIELD, Zone.EXILED, new MistbindCliqueTapEffect(), "When a Faerie is championed with {this}, ", false); + // ability has to trigger independant where the source object is now + super(Zone.ALL, Zone.BATTLEFIELD, Zone.EXILED, new MistbindCliqueTapEffect(), "When a Faerie is championed with {this}, ", false); this.addTarget(new TargetPlayer()); } @@ -101,25 +100,23 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility { super(ability); } - @Override - public boolean isInUseableZone(Game game, MageObject source, GameEvent event) { - return game.getState().getZone(getSourceId()) == Zone.BATTLEFIELD; - } - @Override public MistbindCliqueAbility copy() { return new MistbindCliqueAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getSourceId() != null && event.getSourceId().equals(getSourceId())) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.EXILED) { - if (zEvent.getTarget() != null && zEvent.getTarget().hasSubtype("Faerie")) { - return true; - } - } + if (event.getSourceId() != null && event.getSourceId().equals(getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getTarget() != null && zEvent.getTarget().hasSubtype("Faerie")) { + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/timeshifted/GaeasBlessing.java b/Mage.Sets/src/mage/sets/timeshifted/GaeasBlessing.java index c26aef40530..9edf288614b 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/GaeasBlessing.java +++ b/Mage.Sets/src/mage/sets/timeshifted/GaeasBlessing.java @@ -151,7 +151,6 @@ class GaeasBlessingTarget extends TargetCard { class GaeasBlessingTriggeredAbility extends ZoneChangeTriggeredAbility { public GaeasBlessingTriggeredAbility() { super(Zone.LIBRARY, Zone.GRAVEYARD, new GaeasBlessingGraveToLibraryEffect(), "", false); - this.zone = Zone.ALL; } public GaeasBlessingTriggeredAbility(final GaeasBlessingTriggeredAbility ability) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ChampionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ChampionTest.java index 8f1f28707cd..0f893d38f7d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ChampionTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ChampionTest.java @@ -100,4 +100,33 @@ public class ChampionTest extends CardTestPlayerBase { } + /** + * Mistblind clique land tap ability does not work + */ + + @Test + public void testMistbindClique() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + addCard(Zone.BATTLEFIELD, playerA, "Zephyr Sprite"); + // Flash, Flying + // Champion a Faerie + // When a Faerie is championed with Mistbind Clique, tap all lands target player controls. + addCard(Zone.HAND, playerA, "Mistbind Clique"); + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 4); + addTarget(playerA, playerB); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mistbind Clique"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Mistbind Clique", 1); + assertExileCount("Zephyr Sprite", 1); + + assertTapped("Plains", true); + + } + + }