Browse Source

secProblem logic

master
Noëlle 4 years ago
parent
commit
a29f050867
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      koboldgen.py

+ 7
- 4
koboldgen.py View File

@@ -134,15 +134,18 @@ class Plot:
self.mission = Plot.miss[self.missIndex]
self.probIndex = probIndex if probIndex != None else r.randint(0, len(Plot.prob)-1)
self.problem = Plot.prob[self.probIndex]
self.secProblem = [x for x in Plot.prob if x["id"] == secProblem][0] if (secProblem != None and secProblem in list(filter(lambda x:x["id"], Plot.prob))) else None
if (secProblem != None and secProblem in list(filter(lambda x:x["id"], Plot.prob))):
self.secProblem = [x for x in Plot.prob if x["id"] == secProblem][0]
else:
self.secProblem = None
self.thirdProblem = [x for x in Plot.prob if x["id"] == thirdProblem][0] if (thirdProblem != None and thirdProblem in list(filter(lambda x:x["id"], Plot.prob))) else None
self.problem["givenname"] = probName if probName != None else gen_name()
if self.problem["id"] == 3:
if self.problem["id"] == 3 and self.secProblem == None:
self.secProblem = {"name": "Parasites", "shortname": "parasites", "stats": [3,4,2,3]}
if self.problem["id"] == 10:
if self.problem["id"] == 10 and self.secProblem == None:
self.secProbIndex = r.randint(0, len(Plot.prob)-2)
self.secProblem = Plot.prob[self.secProbIndex]
if self.secProbIndex == 3:
if self.secProbIndex == 3 and self.thirdProblem == None:
self.thirdProblem = {"name": "Parasites", "shortname": "parasites", "stats": [3,4,2,3]}
self.fullProblem = self.problem["givenname"] + ", " + self.problem["name"]
if self.secProblem and self.secProblem["name"] != "Parasites":

Loading…
Cancel
Save