X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=newdungeon.py;h=68dbc39b1130c13d697758aa1dab9a03a2167015;hp=52c34e5ff5913e70135fb1a94f07831696c0acea;hb=ed4e6ad422e35770f9fdde6fa956b20fc33e6fca;hpb=6fe8f98b35424c06e7326a1aa85760871ad430cd diff --git a/newdungeon.py b/newdungeon.py index 52c34e5..68dbc39 100755 --- a/newdungeon.py +++ b/newdungeon.py @@ -548,7 +548,19 @@ def buildtravel(locs, objs, voc): elif cond[0] == "not": # FIXME: Allow named as well as numbered states try: - return 300 + objnames.index(cond[1]) + 100 * cond[2] + obj = objnames.index(cond[1]) + if type(cond[2]) == int: + state = cond[2] + else: + for (i, stateclause) in enumerate(objs[obj][1]["longs"]): + if type(stateclause) == list: + if stateclause[0] == cond[2]: + state = i + break + else: + sys.stderr.write("dungeon: unmatched state symbol %s in not caluase of %s\n" % (cond[2], name)) + sys.exit(0); + return 300 + obj + 100 * state except ValueError: sys.stderr.write("dungeon: unknown object name %s in not clause of %s\n" % (cond[1], name)) sys.exit(1)