This commit is contained in:
NikolajDanger
2020-08-07 18:01:47 +02:00
parent 5839cd5a8f
commit 5a4eebdd7b
6 changed files with 14 additions and 14 deletions

View File

@ -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"):

View File

@ -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

View File

@ -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

View File

@ -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, []
return "I didn't understand that", False, False, []

View File

@ -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")

View File

@ -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)