From 9227f870b972a0d65af68cd038810030a2e3fb9d Mon Sep 17 00:00:00 2001 From: Bill Zorn Date: Wed, 15 Jun 2016 20:55:37 -0700 Subject: [PATCH] commit partially implemented option to ignore line types --- lib/transforms.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/transforms.py b/lib/transforms.py index bb4946e..c3036a8 100644 --- a/lib/transforms.py +++ b/lib/transforms.py @@ -561,14 +561,12 @@ def randomize_choice(line): 1) return new_line - def randomize_lines(text): if text == '' or 'level up' in text: return text prelines, keylines, mainlines, costlines, postlines = separate_lines(text) - random.shuffle(prelines) - random.shuffle(keylines) + new_mainlines = [] for line in mainlines: if line.endswith(utils.choice_close_delimiter): @@ -577,10 +575,18 @@ def randomize_lines(text): # print(line) else: new_mainlines.append(line) - 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) + + 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(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