forked from External/mage
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
|
|
@ -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…
Add table
Add a link
Reference in a new issue