commit partially implemented option to ignore line types

This commit is contained in:
Bill Zorn 2016-06-15 20:55:37 -07:00
parent 0132345ebe
commit 9227f870b9

View file

@ -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,10 +575,18 @@ def randomize_lines(text):
# print(line) # print(line)
else: else:
new_mainlines.append(line) new_mainlines.append(line)
random.shuffle(new_mainlines)
random.shuffle(costlines) if False: # TODO: make this an option
#random.shuffle(postlines) # only one kind ever (countertype) lines = prelines + keylines + new_mainlines + costlines + postlines
return utils.newline.join(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(costlines)
#random.shuffle(postlines) # only one kind ever (countertype)
return utils.newline.join(prelines+keylines+new_mainlines+costlines+postlines)
# Text unpasses, for decoding. All assume the text inside a Manatext, so don't do anything # Text unpasses, for decoding. All assume the text inside a Manatext, so don't do anything