diff --git a/.gitignore b/.gitignore index f37edd1..38d611f 100644 --- a/.gitignore +++ b/.gitignore @@ -160,7 +160,6 @@ resources/games/blackjackTables/ resources/games/oldImages/ resources/games/4InARowBoards/ resources/games/hexBoards/ -resources/games/monopolyBoards/ resources/games/hangmanBoards/ resources/lookup/monsters.json resources/lookup/spells.json diff --git a/cogs/ReactionCog.py b/cogs/ReactionCog.py index 62cdbf3..25dab5c 100644 --- a/cogs/ReactionCog.py +++ b/cogs/ReactionCog.py @@ -39,8 +39,6 @@ class ReactionCog(commands.Cog): else: imdbName = imdbIds[showPick-1] await self.client.bedreNetflix.addShow(channel,imdbName) - elif self.client.funcs.monopolyReactionTest(channel,message): - await self.client.gameLoops.runMonopoly(channel,"roll","#"+str(user.id)) elif self.client.funcs.hangmanReactionTest(channel,message) and ord(reaction.emoji) in range(127462,127488): guess = chr(ord(reaction.emoji)-127397) await self.client.gameLoops.runHangman(channel,"#"+str(user.id),command="guess "+guess) diff --git a/funcs/funcs.py b/funcs/funcs.py index 15dc4ee..b50f7b4 100644 --- a/funcs/funcs.py +++ b/funcs/funcs.py @@ -32,7 +32,6 @@ class Funcs(): def stopServer(self): self.bot.database["trivia questions"].delete_many({}) self.bot.database["blackjack games"].delete_many({}) - self.bot.database["werewolf games"].delete_many({}) g = git.cmd.Git("") g.pull() @@ -54,19 +53,6 @@ class Funcs(): else: return False, 0 - def monopolyReactionTest(self,channel,message): - try: - with open("resources/games/oldImages/monopoly"+str(channel.id), "r") as f: - oldImage = int(f.read()) - except: - return False - - if message.id == oldImage: - logThis("They reacted to the monopoly game") - return True - else: - return False - def hangmanReactionTest(self, channel,message): try: with open("resources/games/oldImages/hangman"+str(channel.id), "r") as f: diff --git a/funcs/games/gameLoops.py b/funcs/games/gameLoops.py index 8556dcf..d70f172 100644 --- a/funcs/games/gameLoops.py +++ b/funcs/games/gameLoops.py @@ -92,48 +92,6 @@ class GameLoops(): self.bot.funcs.deleteGame("4 in a row games",str(channel.id)) - async def runMonopoly(self,channel, command, user): - #try: - response, showImage, deleteImage, gameStarted, gameContinue = self.bot.monopoly.parseMonopoly(command,str(channel.id),user) - #except: - # logThis("Error parsing command (error code 1610)") - if response != "": - await channel.send(response) - logThis(response,str(channel.id)) - if showImage: - if deleteImage: - try: - oldImage = await self.deleteMessage("monopoly"+str(channel.id),channel) - except: - logThis("Error deleting message (error code 1601)") - oldImage = await channel.send(file = discord.File("resources/games/monopolyBoards/monopolyBoard"+str(channel.id)+".png")) - with open("resources/games/oldImages/monopoly"+str(channel.id), "w") as f: - f.write(str(oldImage.id)) - - if gameContinue: - if gameStarted: - await asyncio.sleep(60) - else: - await asyncio.sleep(3) - response, showImage, deleteImage, gameDone = self.bot.monopoly.monopolyContinue(str(channel.id)) - em = discord.Embed(description=response,colour = 0x59f442) - await channel.send(embed=em) - if deleteImage: - try: - oldImage = await self.deleteMessage("monopoly"+str(channel.id),channel) - except: - logThis("Error deleting message (error code 1601)") - - if showImage: - oldImage = await channel.send(file = discord.File("resources/games/monopolyBoards/monopolyBoard"+str(channel.id)+".png")) - with open("resources/games/oldImages/monopoly"+str(channel.id), "w") as f: - f.write(str(oldImage.id)) - if gameDone == False: - try: - await oldImage.add_reaction("🎲") - except: - logThis("Image deleted before I could react to all of them") - async def runHangman(self,channel,user,command = "start"): try: response, showImage, deleteImage, remainingLetters = self.bot.hangman.parseHangman(str(channel.id),user,command) @@ -210,39 +168,3 @@ class GameLoops(): self.bot.money.addMoney(game["players"][winner-1].lower(),winnings) self.bot.funcs.deleteGame("hex games",str(channel.id)) - - - # Runs Love letter - async def runLoveletter(self,channel,command,user,userchannel): - try: - response, showImage, deleteImage = self.bot.loveletter.parseLove(command,str(channel.id),user,userchannel) - except: - logThis("Error parsing command (error code 1810)") - - await channel.send(response) - logThis(response,str(channel.id)) - if showImage: - if deleteImage: - await self.deleteMessage("loveletter"+str(channel.id),channel) - oldImage = await channel.send(file = discord.File("resources/games/loveletterBoards/loveletterBoard"+str(channel.id)+".png")) - - if len(remainingLetters) > 15: - otherMessage = await channel.send("_ _") - reactionMessages = {oldImage : remainingLetters[:15],otherMessage : remainingLetters[15:]} - else: - otherMessage = "" - reactionMessages = {oldImage : remainingLetters} - - oldMessages = str(oldImage.id) - if otherMessage != "": - oldMessages += "\n"+str(otherMessage.id) - with open("resources/games/oldImages/hangman"+str(channel.id), "w") as f: - f.write(oldMessages) - - try: - for message, letters in reactionMessages.items(): - for letter in letters: - emoji = chr(ord(letter)+127397) - await message.add_reaction(emoji) - except: - logThis("Image deleted before adding all reactions") \ No newline at end of file diff --git a/funcs/games/games.py b/funcs/games/games.py index a59d07a..c17a142 100644 --- a/funcs/games/games.py +++ b/funcs/games/games.py @@ -3,10 +3,8 @@ from .trivia import Trivia from .blackjack import Blackjack from .fourInARow import FourInARow from .gameLoops import GameLoops -from .monopoly import Monopoly from .hangman import Hangman from .hex import HexGame -from .werewolf import Werewolf class Games(): def __init__(self, bot): @@ -17,7 +15,5 @@ class Games(): bot.blackjack = Blackjack(bot) bot.fourInARow = FourInARow(bot) bot.gameLoops = GameLoops(bot) - bot.monopoly = Monopoly(bot) bot.hangman = Hangman(bot) bot.hex = HexGame(bot) - bot.werewolf = Werewolf(bot) diff --git a/resources/errorCodes.txt b/resources/errorCodes.txt index bd33632..68a664a 100644 --- a/resources/errorCodes.txt +++ b/resources/errorCodes.txt @@ -116,17 +116,6 @@ 1541 - Error loading board-image 1542 - Error swapping -16 - Monopoly -1600 - Unspecified error -1601 - Error deleting old image -1602 - Not a command -1610 - Unspecified parsing error -1620 - Unspecified monopolyStart() error -1630 - Unspecified monopolyJoin() error -1640 - Unspecified monopolyDraw error -1641 - Error in getPosition() -1650 - Error in monopolyRoll() - 17 - Hangman 1700 - Unspecified error 1701 - Error parsing command @@ -137,7 +126,3 @@ 1714 - Error in drawMisses() 1720 - Unspecified hangmanGuess() error 1730 - Unspecified hangmanStart() error - -18 - Love Letter -1800 - Unspecified error -1801 - Error parsing command diff --git a/resources/games/monopolyBoard.png b/resources/games/monopolyBoard.png deleted file mode 100644 index a7cb5c8..0000000 Binary files a/resources/games/monopolyBoard.png and /dev/null differ diff --git a/resources/games/monopolyProperties/R1.png b/resources/games/monopolyProperties/R1.png deleted file mode 100644 index f9ade6d..0000000 Binary files a/resources/games/monopolyProperties/R1.png and /dev/null differ diff --git a/resources/games/monopolyProperties/R2.png b/resources/games/monopolyProperties/R2.png deleted file mode 100644 index f9ade6d..0000000 Binary files a/resources/games/monopolyProperties/R2.png and /dev/null differ diff --git a/resources/games/monopolyProperties/R3.png b/resources/games/monopolyProperties/R3.png deleted file mode 100644 index f9ade6d..0000000 Binary files a/resources/games/monopolyProperties/R3.png and /dev/null differ diff --git a/resources/games/monopolyProperties/Y1.png b/resources/games/monopolyProperties/Y1.png deleted file mode 100644 index f9ade6d..0000000 Binary files a/resources/games/monopolyProperties/Y1.png and /dev/null differ diff --git a/resources/games/monopolyProperties/Y2.png b/resources/games/monopolyProperties/Y2.png deleted file mode 100644 index f9ade6d..0000000 Binary files a/resources/games/monopolyProperties/Y2.png and /dev/null differ diff --git a/resources/games/monopolyProperties/Y3.png b/resources/games/monopolyProperties/Y3.png deleted file mode 100644 index f9ade6d..0000000 Binary files a/resources/games/monopolyProperties/Y3.png and /dev/null differ diff --git a/resources/startingFiles.json b/resources/startingFiles.json index 4f99be3..baaa5f4 100644 --- a/resources/startingFiles.json +++ b/resources/startingFiles.json @@ -66,7 +66,6 @@ "resources/games/blackjackTables", "resources/games/4InARowBoards", "resources/games/hexBoards", - "resources/games/monopolyBoards", "resources/games/hangmanBoards", "resources/bedreNetflix" ]