mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Merge pull request #2899 from spjspj/master
Refactor color restriction in edh. Change to look at commander color identity.
This commit is contained in:
commit
18b6279f2e
3 changed files with 44 additions and 19 deletions
|
@ -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")
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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.|
|
||||
|
|
Loading…
Reference in a new issue