Add double streets to !roulette in modules/coins.py
This commit is contained in:
parent
399e20acc7
commit
84b4a064b8
1 changed files with 6 additions and 0 deletions
|
@ -29,6 +29,7 @@ SECOND_COLUMN = list(range(1, 37))[1::3]
|
||||||
THIRD_COLUMN = list(range(1, 37))[2::3]
|
THIRD_COLUMN = list(range(1, 37))[2::3]
|
||||||
|
|
||||||
REGEX_STREET = re.compile("street([1-9]|1[0-2])$")
|
REGEX_STREET = re.compile("street([1-9]|1[0-2])$")
|
||||||
|
REGEX_DOUBLESTREET = re.compile("2street([1-9]|1[0-1])$")
|
||||||
|
|
||||||
WALLET_DEFAULT_NAME = "default"
|
WALLET_DEFAULT_NAME = "default"
|
||||||
WALLET_DEFAULTS = {"in": WALLET_DEFAULT_NAME, "out": WALLET_DEFAULT_NAME,
|
WALLET_DEFAULTS = {"in": WALLET_DEFAULT_NAME, "out": WALLET_DEFAULT_NAME,
|
||||||
|
@ -562,6 +563,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
colour = "red" if choice in RED else "black"
|
colour = "red" if choice in RED else "black"
|
||||||
for i, bet in enumerate(bets):
|
for i, bet in enumerate(bets):
|
||||||
street_match = REGEX_STREET.match(bet)
|
street_match = REGEX_STREET.match(bet)
|
||||||
|
doublestreet_match = REGEX_DOUBLESTREET.match(bet)
|
||||||
|
|
||||||
odds = 0
|
odds = 0
|
||||||
if bet == "even":
|
if bet == "even":
|
||||||
odds = 1*((choice % 2) == 0)
|
odds = 1*((choice % 2) == 0)
|
||||||
|
@ -590,6 +593,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
elif street_match:
|
elif street_match:
|
||||||
row = int(street_match.group(1))
|
row = int(street_match.group(1))
|
||||||
odds = 11*(((row*3)-2) <= choice <= (row*3))
|
odds = 11*(((row*3)-2) <= choice <= (row*3))
|
||||||
|
elif doublestreet_match:
|
||||||
|
row = int(doublestreet_match.group(1))
|
||||||
|
odds = 5*(((row*3)-2) <= choice <= ((row*3)+3))
|
||||||
elif bet.isdigit() and (1 <= int(bet) <= 36):
|
elif bet.isdigit() and (1 <= int(bet) <= 36):
|
||||||
odds = 35*(choice == int(bet))
|
odds = 35*(choice == int(bet))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue