mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Added the global rule change: "The legend rule doesn't apply.".
- Converted Mirror Gallery to script.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1283,7 +1283,7 @@ public class GameAction {
|
||||
*/
|
||||
private void destroyLegendaryCreatures() {
|
||||
final List<Card> a = CardLists.getType(game.getCardsIn(ZoneType.Battlefield), "Legendary");
|
||||
if (a.isEmpty() || game.isCardInPlay("Mirror Gallery")) {
|
||||
if (a.isEmpty() || game.getStaticEffects().isNoLegendRule()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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<Card> list = ai.getCardsIn(ZoneType.Battlefield);
|
||||
if (Iterables.any(list, CardPredicates.nameEquals(source.getName()))) {
|
||||
return false;
|
||||
|
||||
@@ -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<Card> list = ai.getCardsIn(ZoneType.Battlefield);
|
||||
if (Iterables.any(list, CardPredicates.nameEquals(card.getName()))) {
|
||||
return false;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user