Obligation
This commit is contained in:
@@ -103,6 +103,22 @@ def diceToEmoji(dice : list):
|
||||
def getDice(user : str, skill : str):
|
||||
return "yes"
|
||||
|
||||
def obligationRoll():
|
||||
with open("resources/swcharacters.json", "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
table = []
|
||||
|
||||
for character in data:
|
||||
for obligation in data[character]["Obligations"]:
|
||||
for x in range(data[character]["Obligations"][obligation]):
|
||||
table.append(obligation)
|
||||
|
||||
while len(table) < 100:
|
||||
table.append("Nothing")
|
||||
|
||||
return random.choice(table)
|
||||
|
||||
def parseRoll(user : str,cmd : str = ""):
|
||||
cmd = re.sub(' +',' ',cmd.upper()) + " "
|
||||
if cmd[0] == " ":
|
||||
@@ -115,7 +131,10 @@ def parseRoll(user : str,cmd : str = ""):
|
||||
else:
|
||||
rollParameters = [0,0,0,0,0,0,0]
|
||||
|
||||
if string.capwords(commands[0]) in skillData:
|
||||
if string.capwords(commands[0]) == "Obligations":
|
||||
return obligationRoll()
|
||||
|
||||
elif string.capwords(commands[0]) in skillData:
|
||||
if swchar.userHasChar:
|
||||
skillLevel = swchar.charData(user,"Skills " + string.capwords(commands[0]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user