diff --git a/funcs/games/monopoly.py b/funcs/games/monopoly.py index 4990add..0d29a60 100644 --- a/funcs/games/monopoly.py +++ b/funcs/games/monopoly.py @@ -3,6 +3,11 @@ import json, random from funcs import getName, logThis from . import monopolyDraw +rulesAndTerms = { + "pass go money" : 200, + "money term" : "GP" +} + def monopolyStart(channel): logThis("Starting a monopoly game") with open("resources/games/monopolyGames.json", "r") as f: @@ -83,7 +88,10 @@ def monopolyContinue(channel): turn = 0 else: - turn = (data[channel]["turn"])%len(data[channel]["player list"]) + if data[channel]["last roll"][0] == data[channel]["last roll"][1]: + turn = data[channel]["turn"] + else: + turn = (data[channel]["turn"] + 1)%len(data[channel]["player list"]) data[channel]["turn"] = turn playerList = list(data[channel]["players"].keys()) @@ -107,8 +115,17 @@ def monopolyRoll(channel,user): if user == currentPlayer: rolls = [random.randint(1,6),random.randint(1,6)] + message = getName(user)+" rolled a "+str(rolls[0])+" and a "+str(rolls[1])+"." + if rolls[0] == rolls[1]: + message += " Doubbles!" + roll = rolls[0] + rolls[1] - newPosition = (data[channel]["players"][user]["position"] + roll)%40 + oldPosition = data[channel]["players"][user]["position"] + newPosition = (oldPosition + roll)%40 + if newPosition < oldPosition: + data[channel]["players"][user]["money"] += rulesAndTerms["pass go money"] + message += "\nYou passed go and got "+str(rulesAndTerms["pass go money"])+" "+rulesAndTerms["money term"]+"." + data[channel]["players"][user]["position"] = newPosition data[channel]["last roll"] = rolls @@ -120,5 +137,5 @@ def monopolyRoll(channel,user): except: logThis("Error drawing board (error code 1640)") - return "Rolled a "+str(rolls[0])+" and a "+str(rolls[1])+".", True, True, False, True + return message, True, True, False, True else: return "", False, False, False, False diff --git a/gameLoops.py b/gameLoops.py index 893e737..b3ec204 100644 --- a/gameLoops.py +++ b/gameLoops.py @@ -212,7 +212,7 @@ async def runMonopoly(channel, command, user): if gameStarted: await asyncio.sleep(60) else: - await asyncio.sleep(5) + await asyncio.sleep(3) response, showImage, deleteImage, gameDone = monopolyContinue(str(channel.id)) em = discord.Embed(description=response,colour = 0x59f442) await channel.send(embed=em) diff --git a/resources/games/monopolyProperties/R1.png b/resources/games/monopolyProperties/R1.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and b/resources/games/monopolyProperties/R1.png differ diff --git a/resources/games/monopolyProperties/R2.png b/resources/games/monopolyProperties/R2.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and b/resources/games/monopolyProperties/R2.png differ diff --git a/resources/games/monopolyProperties/R3.png b/resources/games/monopolyProperties/R3.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and b/resources/games/monopolyProperties/R3.png differ diff --git a/resources/games/monopolyProperties/Y1.png b/resources/games/monopolyProperties/Y1.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and b/resources/games/monopolyProperties/Y1.png differ diff --git a/resources/games/monopolyProperties/Y2.png b/resources/games/monopolyProperties/Y2.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and b/resources/games/monopolyProperties/Y2.png differ diff --git a/resources/games/monopolyProperties/Y3.png b/resources/games/monopolyProperties/Y3.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and b/resources/games/monopolyProperties/Y3.png differ