From b8b6ddcc6930914ae1f0f51b813dfe35a5d77faf Mon Sep 17 00:00:00 2001 From: spjspj Date: Wed, 1 Mar 2017 08:27:39 +1100 Subject: [PATCH 1/2] Boros Guildgate --- Utils/mtg-cards-data.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 8d1b25e945c..a5837c323e3 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -30581,7 +30581,7 @@ Grafdigger's Cage|Modern Masters 2017|221|R|{1}|Artifact|||Creature cards can't Arcane Sanctum|Modern Masters 2017|228|U||Land|||Arcane Sanctum enters the battlefield tapped.${T}: Add {W}, {U}, or {B} to your mana pool.| Arid Mesa|Modern Masters 2017|229|R||Land|||{T}, Pay 1 life, Sacrifice Arid Mesa: Search your library for a Mountain or Plains card and put it onto the battlefield. Then shuffle your library.| Azorius Guildgate|Modern Masters 2017|230|C||Land - Gate||||Azorius Guildgate enters the battlefield tapped.${T}: Add {W} or {U} to your mana pool.| -Boros Guidgate|Modern Masters 2017|231|C||Land - Gate|||Boros Guildgate enters the battlefield tapped.${T}: Add {R} or {W} to your mana pool.| +Boros Guildgate|Modern Masters 2017|231|C||Land - Gate|||Boros Guildgate enters the battlefield tapped.${T}: Add {R} or {W} to your mana pool.| Crumbling Necropolis|Modern Masters 2017|233|U||Land|||Crumbling Necropolis enters the battlefield tapped.${T}: Add {U}, {B}, or {R} to your mana pool.| Dimir Guildgate|Modern Masters 2017|234|C||Land - Gate|||Dimir Guildgate enters the battlefield tapped.${T}: Add {U} or {B} to your mana pool.| Golgari Guildgate|Modern Masters 2017|235|C||Land - Gate|||Golgari Guildgate enters the battlefield tapped.${T}: Add {B} or {G} to your mana pool.| From faee8fb298059c6bc66b79a842294388d6f4776f Mon Sep 17 00:00:00 2001 From: spjspj Date: Wed, 1 Mar 2017 08:56:52 +1100 Subject: [PATCH 2/2] Refactor color restriction in edh. Change to look at commander color identity. --- .../src/mage/deck/Commander.java | 17 +++++++ .../java/mage/server/TableController.java | 44 +++++++++++-------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java index 752ebc90799..fbc137c0913 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java @@ -658,6 +658,23 @@ public class Commander extends Constructed { } else { color = color.union(commander.getColor(null)); } + + FilterMana commanderColor = CardUtil.getColorIdentity(commander); + if (commanderColor.isWhite()) { + color.setWhite(true); + } + if (commanderColor.isBlue()) { + color.setBlue(true); + } + if (commanderColor.isBlack()) { + color.setBlack(true); + } + if (commanderColor.isRed()) { + color.setRed(true); + } + if (commanderColor.isGreen()) { + color.setGreen(true); + } // Least fun commanders if (cn.equals("animar, soul of element") diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index e6870319fe0..566cfd21cce 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -307,28 +307,36 @@ public class TableController { user.showUserMessage("Join Table", message); return false; } - if (edhPowerLevel % 10 == 6 && deckEdhPowerLevel >= 10000000) { - String message = "Your deck contains white. The creator of the table has requested no white cards on the table!"; - user.showUserMessage("Join Table", message); - return false; + + boolean restrictedColor = false; + String badColor = ""; + int colorVal = edhPowerLevel % 10; + if (colorVal == 6 && deckEdhPowerLevel >= 10000000) { + restrictedColor = true; + badColor = "white"; } - if (edhPowerLevel % 10 == 4 && deckEdhPowerLevel % 10000000 >= 1000000) { - String message = "Your deck contains blue. The creator of the table has requested no blue cards on the table!"; - user.showUserMessage("Join Table", message); - return false; + if (colorVal == 4 && deckEdhPowerLevel % 10000000 >= 1000000) { + restrictedColor = true; + badColor = "blue"; } - if (edhPowerLevel % 10 == 3 && deckEdhPowerLevel % 1000000 >= 100000) { - String message = "Your deck contains black. The creator of the table has requested no black cards on the table!"; - user.showUserMessage("Join Table", message); - return false; + if (colorVal == 3 && deckEdhPowerLevel % 1000000 >= 100000) { + restrictedColor = true; + badColor = "black"; } - if (edhPowerLevel % 10 == 2 && deckEdhPowerLevel % 100000 >= 10000) { - String message = "Your deck contains red. The creator of the table has requested no red cards on the table!"; - user.showUserMessage("Join Table", message); - return false; + if (colorVal == 2 && deckEdhPowerLevel % 100000 >= 10000) { + restrictedColor = true; + badColor = "red"; } - if (edhPowerLevel % 10 == 1 && deckEdhPowerLevel % 10000 >= 1000) { - String message = "Your deck contains green. The creator of the table has requested no green cards on the table!"; + if (colorVal == 1 && deckEdhPowerLevel % 10000 >= 1000) { + restrictedColor = true; + badColor = "green"; + } + if (restrictedColor) { + String message = new StringBuilder("Your deck contains ") + .append(restrictedColor) + .append(". The creator of the table has requested no ") + .append(restrictedColor) + .append(" cards to be on the table!").toString(); user.showUserMessage("Join Table", message); return false; }