diff --git a/cogs/GamesCog.py b/cogs/GamesCog.py index a0844da..586be93 100644 --- a/cogs/GamesCog.py +++ b/cogs/GamesCog.py @@ -75,7 +75,7 @@ class GamesCog(commands.Cog): else: logThis("I didn't understand that (error code 1101)",str(ctx.message.channel.id)) await ctx.send("I didn't understand that (error code 1101)") - + # Runs a game of blackjack @commands.command(aliases = ["bj"]) async def blackjack(self, ctx, *, content = ""): @@ -257,22 +257,22 @@ class GamesCog(commands.Cog): else: logThis("Not a command (error code 1301)") await ctx.send("I didn't quite understand that (error code 1301)") - + # Runs a game of Connect four @commands.command(aliases = ["fiar","connect4","connectfour","4iar","4inarow"]) async def fourinarow(self, ctx, *, content = ""): await fiar(ctx.message.channel,content,"#"+str(ctx.message.author.id)) - + # Runs a game of Hex @commands.command(name="hex") async def hexCommand(self, ctx, *, content = ""): await runHex(ctx.message.channel,content,"#"+str(ctx.message.author.id)) - + # Runs a game of Monopoly @commands.command(aliases = ["m","mon","mono"]) async def monopoly(self, ctx, *, content = ""): await runMonopoly(ctx.message.channel,content,"#"+str(ctx.message.author.id)) - + # Runs a game of Hangman @commands.command(aliases = ["hm"]) async def hangman(self, ctx, *, content = "start"): diff --git a/funcs/__init__.py b/funcs/__init__.py index 8d475b4..39477e5 100644 --- a/funcs/__init__.py +++ b/funcs/__init__.py @@ -1,6 +1,6 @@ """A collection of all Gwendolyn functions.""" -__all__ = ["helloFunc", "cap", "imageFunc", "logThis", "findWikiPage", "makeFiles", "emojiToCommand", "fiarReactionTest", "deleteGame", "stopServer", "checkBalance", "giveMoney", "addMoney", "triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "spellFunc", "monsterFunc", "nameGen", "tavernGen", "movieFunc", "roll_dice", "parseChar", "parseRoll", "critRoll", "parseDestiny", "addToDict", "getName", "getID", "replaceMultiple", "monopolyReactionTest","parseInvest", "blackjackLoop", "fiar", "runMonopoly", "runHex"] +__all__ = ["helloFunc", "cap", "imageFunc", "logThis", "findWikiPage", "makeFiles", "emojiToCommand", "fiarReactionTest", "deleteGame", "stopServer", "checkBalance", "giveMoney", "addMoney", "triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "spellFunc", "monsterFunc", "nameGen", "tavernGen", "movieFunc", "roll_dice", "parseChar", "parseRoll", "critRoll", "parseDestiny", "addToDict", "getName", "getID", "replaceMultiple", "monopolyReactionTest","parseInvest", "blackjackLoop", "fiar", "runMonopoly", "runHex", "runHangman"] from .miscFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, replaceMultiple, emojiToCommand, fiarReactionTest, deleteGame, stopServer, addToDict, getName, getID, monopolyReactionTest diff --git a/funcs/games/__init__.py b/funcs/games/__init__.py index c4cac7f..5288c6f 100644 --- a/funcs/games/__init__.py +++ b/funcs/games/__init__.py @@ -1,6 +1,6 @@ """Functions for games Gwendolyn can play.""" -__all__ = ["checkBalance", "giveMoney", "addMoney","triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseInvest", "blackjackLoop", "fiar", "runMonopoly", "runHex"] +__all__ = ["checkBalance", "giveMoney", "addMoney","triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseInvest", "blackjackLoop", "fiar", "runMonopoly", "runHex", "runHangman"] from .money import checkBalance, giveMoney, addMoney from .trivia import triviaCountPoints, triviaStart, triviaAnswer diff --git a/funcs/games/hangman.py b/funcs/games/hangman.py index 7ec495b..cfa9fe0 100644 --- a/funcs/games/hangman.py +++ b/funcs/games/hangman.py @@ -6,7 +6,7 @@ from funcs import getName, logThis def hangmanStart(channel,user): with open("resources/games/hangmanGames.json", "r") as f: data = json.load(f) - + if channel not in data: with urllib.request.urlopen("https://random-word-api.herokuapp.com/word?number=10") as p: words = json.load(p) @@ -37,7 +37,7 @@ def parseHangman(channel,user,command): del data[channel] with open("resources/games/hangmanGames.json", "w") as f: json.dump(data,f,indent=4) - + return "Game stopped.", False, False, [] else: - return "I didn't understand that", False, False, [] \ No newline at end of file + return "I didn't understand that", False, False, [] diff --git a/funcs/games/hangmanDraw.py b/funcs/games/hangmanDraw.py index a1b1c8c..5cee420 100644 --- a/funcs/games/hangmanDraw.py +++ b/funcs/games/hangmanDraw.py @@ -56,7 +56,7 @@ def badCircle(): x = middle + (math.cos(math.radians(degree+start)) * (circleSize/2)) - (lineWidth/2) + devx y = middle + (math.sin(math.radians(degree+start)) * (circleSize/2)) - (lineWidth/2) + devy - + d.ellipse([(x,y),(x+lineWidth,y+lineWidth)],fill=(0,0,0,255)) return background @@ -176,7 +176,7 @@ def drawImage(channel): man = drawMan(6) except: logThis("Error drawing stick figure (error code 1712)") - + try: man = man.resize((smolManx,smolMany)) except: @@ -184,5 +184,5 @@ def drawImage(channel): background.paste(gallow,(100,100),gallow) background.paste(man,(280,210),man) - + background.save("resources/games/hangmanBoards/hangmanBoard"+channel+".png") diff --git a/funcs/miscFuncs.py b/funcs/miscFuncs.py index c77a219..5719bab 100644 --- a/funcs/miscFuncs.py +++ b/funcs/miscFuncs.py @@ -251,7 +251,7 @@ def stopServer(): with open("resources/games/hexGames.json", "w") as f: json.dump(emptyDict,f,indent=4) - + with open("resources/games/hangmanGames.json", "w") as f: json.dump(emptyDict,f,indent=4)