Obligation
This commit is contained in:
@@ -208,7 +208,7 @@ def charData(user : str,cmd : str):
|
||||
except:
|
||||
return "Can't do that"
|
||||
|
||||
if (key == "Talents" or key == "Force-powers" or key == "Obligation") and "," in cmd:
|
||||
if (key == "Talents" or key == "Force-powers") and "," in cmd:
|
||||
cmd = cmd.split(",")
|
||||
while cmd[1][0] == " ":
|
||||
cmd[1] = cmd[1][1:]
|
||||
@@ -216,6 +216,18 @@ def charData(user : str,cmd : str):
|
||||
with open("resources/swcharacters.json", "w") as f:
|
||||
json.dump(data,f,indent = 4)
|
||||
return cmd[0]+" added to "+key+" for " + data[user]["Name"]
|
||||
|
||||
elif key == "Obligations" and "," in cmd:
|
||||
cmd = cmd.split(",")
|
||||
while cmd[1][0] == " ":
|
||||
cmd[1] = cmd[1][1:]
|
||||
try:
|
||||
data[user][key][cmd[0]] = int(cmd[1])
|
||||
except:
|
||||
return "Wrong data type"
|
||||
with open("resources/swcharacters.json", "w") as f:
|
||||
json.dump(data,f,indent = 4)
|
||||
return cmd[0]+" added to "+key+" for " + data[user]["Name"]
|
||||
|
||||
elif key == "Weapons":
|
||||
with open("resources/swtemplates.json", "r") as f:
|
||||
|
||||
Reference in New Issue
Block a user