diff --git a/res/cardsfolder/m/mirror_gallery.txt b/res/cardsfolder/m/mirror_gallery.txt index 9f55f8b7b35..04a99f0c225 100644 --- a/res/cardsfolder/m/mirror_gallery.txt +++ b/res/cardsfolder/m/mirror_gallery.txt @@ -1,7 +1,8 @@ Name:Mirror Gallery ManaCost:5 Types:Artifact -Text:The "legend rule" doesn't apply. +Text:no text +S:Mode$ Continuous | GlobalRule$ The legend rule doesn't apply. | Description$ The "legend rule" doesn't apply. SVar:RemRandomDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/mirror_gallery.jpg diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index 999468c86ba..ef30cc71fdc 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -1283,7 +1283,7 @@ public class GameAction { */ private void destroyLegendaryCreatures() { final List a = CardLists.getType(game.getCardsIn(ZoneType.Battlefield), "Legendary"); - if (a.isEmpty() || game.isCardInPlay("Mirror Gallery")) { + if (a.isEmpty() || game.getStaticEffects().isNoLegendRule()) { return; } diff --git a/src/main/java/forge/StaticEffects.java b/src/main/java/forge/StaticEffects.java index 8b7f3a9876c..78976a7bc0a 100644 --- a/src/main/java/forge/StaticEffects.java +++ b/src/main/java/forge/StaticEffects.java @@ -49,6 +49,7 @@ public class StaticEffects { //Global rule changes private boolean noPrevention = false; private boolean alwaysWither = false; + private boolean noLegendRule = false; /** * clearStaticEffect. TODO Write javadoc for this method. @@ -56,6 +57,7 @@ public class StaticEffects { public final void clearStaticEffects() { noPrevention = false; alwaysWither = false; + noLegendRule = false; // remove all static effects for (int i = 0; i < this.staticEffects.size(); i++) { @@ -95,6 +97,21 @@ public class StaticEffects { } + /** + * @return the noLegendRule + */ + public boolean isNoLegendRule() { + return noLegendRule; + } + + /** + * @param noLegendRule0 the noLegendRule to set + */ + public void setNoLegendRule(boolean noLegends) { + this.noLegendRule = noLegends; + } + + /** * addStaticEffect. TODO Write javadoc for this method. * diff --git a/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java b/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java index 59eb6444060..7925a396adb 100644 --- a/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java +++ b/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java @@ -189,7 +189,7 @@ public class ChangeZoneAi extends SpellAiLogic { //Ninjutsu if (sa.hasParam("Ninjutsu")) { - if (source.isType("Legendary") && !Singletons.getModel().getGame().isCardInPlay("Mirror Gallery")) { + if (source.isType("Legendary") && !Singletons.getModel().getGame().getStaticEffects().isNoLegendRule()) { final List list = ai.getCardsIn(ZoneType.Battlefield); if (Iterables.any(list, CardPredicates.nameEquals(source.getName()))) { return false; diff --git a/src/main/java/forge/card/spellability/SpellPermanent.java b/src/main/java/forge/card/spellability/SpellPermanent.java index 0866ef6f828..2604bfcb4aa 100644 --- a/src/main/java/forge/card/spellability/SpellPermanent.java +++ b/src/main/java/forge/card/spellability/SpellPermanent.java @@ -348,7 +348,7 @@ public class SpellPermanent extends Spell { } // check on legendary - if (card.isType("Legendary") && !Singletons.getModel().getGame().isCardInPlay("Mirror Gallery")) { + if (card.isType("Legendary") && !Singletons.getModel().getGame().getStaticEffects().isNoLegendRule()) { final List list = ai.getCardsIn(ZoneType.Battlefield); if (Iterables.any(list, CardPredicates.nameEquals(card.getName()))) { return false; diff --git a/src/main/java/forge/card/staticability/StaticAbilityContinuous.java b/src/main/java/forge/card/staticability/StaticAbilityContinuous.java index f835004ca77..edbdd0e824f 100644 --- a/src/main/java/forge/card/staticability/StaticAbilityContinuous.java +++ b/src/main/java/forge/card/staticability/StaticAbilityContinuous.java @@ -98,6 +98,8 @@ public class StaticAbilityContinuous { effects.setNoPrevention(true); } else if (params.get("GlobalRule").equals("All damage is dealt as though it's source had wither.")) { effects.setAlwayWither(true); + } else if (params.get("GlobalRule").equals("The legend rule doesn't apply.")) { + effects.setNoLegendRule(true); } }