From 7c1c169bf825de33a85624132a83724dc4ba07c6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 6 Jul 2017 16:41:06 -0400 Subject: [PATCH] More readable dungeon.c output. --- make_dungeon.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/make_dungeon.py b/make_dungeon.py index a02fd1e..7a16970 100755 --- a/make_dungeon.py +++ b/make_dungeon.py @@ -702,7 +702,7 @@ def buildtravel(locs, objs): # # In order to de-crypticize the runtime code, we're going to break these # magic numbers up into a struct. - travel = [[0, 0, 0, "false", "false"]] + travel = [[0, "LOC_NOWHERE", 0, 0, 0, "false", "false"]] tkey = [0] oldloc = 0 while ltravel: @@ -716,16 +716,19 @@ def buildtravel(locs, objs): travel[-1][-1] = "false" if travel[-1][-1] == "true" else "true" while rule: cond = newloc // 1000 - travel.append([rule.pop(0), + dest = newloc % 1000 + travel.append([len(tkey)-1, + locnames[len(tkey)-1], + rule.pop(0), cond, - newloc % 1000, + locnames[dest] if dest <= 300 else dest, "true" if cond==100 else "false", "false"]) travel[-1][-1] = "true" return (travel, tkey) def get_travel(travel): - template = """ {{ + template = """ {{ // from {}: {} .motion = {}, .cond = {}, .dest = {}, -- 2.31.1