Made the whole thing work

This commit is contained in:
NikolajDanger
2020-03-24 00:07:17 +01:00
parent 7a5d462a68
commit 9bb95cfa40
12 changed files with 119 additions and 40 deletions

View File

@ -23,8 +23,9 @@ def monsterFunc(content):
print("")
return("I don't know that monster...","","","","","")
else:
data = json.load(open('monsters.json', encoding = "utf8"))
data = json.load(open('funcs/lookup/monsters.json', encoding = "utf8"))
for monster in data:
print("Found it!")
if str(command) == monster["name"]:
if monster["subtype"] != "":
typs = (monster["type"]+" ("+monster["subtype"]+")")
@ -112,7 +113,7 @@ def monsterFunc(content):
def spellFunc(content):
command = gf.cap(content.lower().replace("!spell ",""))
print("Looking up "+command)
data = json.load(open('spells.json', encoding = "utf8"))
data = json.load(open('funcs/lookup/spells.json', encoding = "utf8"))
if str(command) in data:
print("Returning spell information")
spell_output = ("***"+str(command)+"***\n*"+str(data[str(command)]["level"])+" level "+str(data[str(command)]["school"])+"\nCasting Time: "+str(data[str(command)]["casting_time"])+"\nRange: "+str(data[str(command)]["range"])+"\nComponents: "+str(data[str(command)]["components"])+"\nDuration: "+str(data[str(command)]["duration"])+"*\n \n"+str(data[str(command)]["description"]))