* Mistbind Clique - Added test for champpion triggered ability. Set zone ability has to work in.

This commit is contained in:
LevelX2 2015-04-28 14:45:38 +02:00
parent 4b393f949d
commit 63ae8a9f13
5 changed files with 41 additions and 18 deletions

View file

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

View file

@ -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) {

View file

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

View file

@ -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) {

View file

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