Logging
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
from . import swroll
|
||||
|
||||
from funcs import logThis
|
||||
|
||||
def destinyNew(num : int):
|
||||
logThis("Creating a new destiny pool with "+str(num)+" players")
|
||||
roll = swroll.roll(0,0,0,0,0,0,num)
|
||||
|
||||
with open("resources/destinyPoints.txt","wt") as f:
|
||||
@@ -13,20 +16,26 @@ def destinyUse(user : str):
|
||||
points = f.read()
|
||||
|
||||
if user == "Nikolaj":
|
||||
logThis("Trying to use a dark side destiny point")
|
||||
if 'B' in points:
|
||||
points = points.replace("B","L",1)
|
||||
with open("resources/destinyPoints.txt","wt") as f:
|
||||
f.write(points)
|
||||
logThis("Did it")
|
||||
return "Used a dark side destiny point. Destiny pool is now:\n"+swroll.resultToEmoji(points)
|
||||
else:
|
||||
logThis("There were no dark side destiny points")
|
||||
return "No dark side destiny points"
|
||||
else:
|
||||
logThis("Trying to use a light side destiny point")
|
||||
if 'L' in points:
|
||||
points = points.replace("L","B",1)
|
||||
with open("resources/destinyPoints.txt","wt") as f:
|
||||
f.write(points)
|
||||
logThis("Did it")
|
||||
return "Used a light side destiny point. Destiny pool is now:\n"+swroll.resultToEmoji(points)
|
||||
else:
|
||||
logThis("There were no dark side destiny points")
|
||||
return "No light side destiny points"
|
||||
|
||||
def parseDestiny(user : str, cmd : str):
|
||||
@@ -38,6 +47,7 @@ def parseDestiny(user : str, cmd : str):
|
||||
|
||||
|
||||
if cmd == "":
|
||||
logThis("Retrieving destiny pool info")
|
||||
with open("resources/destinyPoints.txt","rt") as f:
|
||||
return swroll.resultToEmoji(f.read())
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user