commit partially implemented option to ignore line types
This commit is contained in:
parent
0132345ebe
commit
9227f870b9
1 changed files with 13 additions and 7 deletions
|
@ -561,14 +561,12 @@ def randomize_choice(line):
|
||||||
1)
|
1)
|
||||||
return new_line
|
return new_line
|
||||||
|
|
||||||
|
|
||||||
def randomize_lines(text):
|
def randomize_lines(text):
|
||||||
if text == '' or 'level up' in text:
|
if text == '' or 'level up' in text:
|
||||||
return text
|
return text
|
||||||
|
|
||||||
prelines, keylines, mainlines, costlines, postlines = separate_lines(text)
|
prelines, keylines, mainlines, costlines, postlines = separate_lines(text)
|
||||||
random.shuffle(prelines)
|
|
||||||
random.shuffle(keylines)
|
|
||||||
new_mainlines = []
|
new_mainlines = []
|
||||||
for line in mainlines:
|
for line in mainlines:
|
||||||
if line.endswith(utils.choice_close_delimiter):
|
if line.endswith(utils.choice_close_delimiter):
|
||||||
|
@ -577,6 +575,14 @@ def randomize_lines(text):
|
||||||
# print(line)
|
# print(line)
|
||||||
else:
|
else:
|
||||||
new_mainlines.append(line)
|
new_mainlines.append(line)
|
||||||
|
|
||||||
|
if False: # TODO: make this an option
|
||||||
|
lines = prelines + keylines + new_mainlines + costlines + postlines
|
||||||
|
random.shuffle(lines)
|
||||||
|
return utils.newline.join(lines)
|
||||||
|
else:
|
||||||
|
random.shuffle(prelines)
|
||||||
|
random.shuffle(keylines)
|
||||||
random.shuffle(new_mainlines)
|
random.shuffle(new_mainlines)
|
||||||
random.shuffle(costlines)
|
random.shuffle(costlines)
|
||||||
#random.shuffle(postlines) # only one kind ever (countertype)
|
#random.shuffle(postlines) # only one kind ever (countertype)
|
||||||
|
|
Loading…
Reference in a new issue