mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
Refactor color restriction in edh. Change to look at commander color identity.
This commit is contained in:
parent
b8b6ddcc69
commit
faee8fb298
2 changed files with 43 additions and 18 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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue