Skip to content

Commit

Permalink
Now automatically splitting up Übernatürliche Talente based on Ferts …
Browse files Browse the repository at this point in the history
…by one line if there is enough space
  • Loading branch information
Aeolitus committed Jul 8, 2017
1 parent 5cd6b87 commit be945c6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Charakter.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,18 @@ def pdfSechsterBlock(self, fields):
print("PDF Block 6")

addedTals = {} # Name: (PWT, base)

# Get number of talents
countFerts = 0
talsList = []
for f in self.übernatürlicheFertigkeiten:
if self.übernatürlicheFertigkeiten[f].wert > 0 and len(self.übernatürlicheFertigkeiten[f].gekaufteTalente) > 0:
talsList.extend(self.übernatürlicheFertigkeiten[f].gekaufteTalente)
countFerts += 1
talsList = set(talsList)
flagPutEmpty = False
if len(talsList)+countFerts-1 < 31:
flagPutEmpty = True

countF = 1
countT = 1
Expand All @@ -925,7 +937,7 @@ def pdfSechsterBlock(self, fields):
# Fill Talente
tals = sorted(fe.gekaufteTalente, key=lambda s: s.lower())
for t in tals:
if countT < 30:
if countT < 31:
base = 'Uebertal' + str(countT)
mod = ""
if t in self.talenteVariable:
Expand Down Expand Up @@ -955,7 +967,9 @@ def pdfSechsterBlock(self, fields):
if len(res) == 1:
fields[base + 'KO'] = res[0].strip()
countT += 1

if flagPutEmpty:
countT += 1

return fields

def pdfSiebterBlock(self, fields):
Expand Down

0 comments on commit be945c6

Please sign in to comment.