X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=make_dungeon.py;fp=make_dungeon.py;h=de7251cd4bd5fbacb30458810104e9b06466bfdb;hb=5f28f9524472ef6784191470747d708262b31386;hp=b37856368947d219bcb5a79ef66deeaf38fdbdcf;hpb=80b2b9b356efad12257f26f541693377bf8056fb;p=open-adventure.git diff --git a/make_dungeon.py b/make_dungeon.py index b378563..de7251c 100755 --- a/make_dungeon.py +++ b/make_dungeon.py @@ -105,11 +105,13 @@ typedef struct {{ typedef struct {{ const string_group_t words; const char* message; + const bool noaction; }} action_t; typedef struct {{ const string_group_t words; const char* message; + const bool noaction; }} special_t; enum condtype_t {{cond_goto, cond_pct, cond_carry, cond_with, cond_not}}; @@ -497,39 +499,11 @@ def get_motions(motions): ignore += word.upper() return mot_str -def get_actions(actions): - template = """ {{ - .words = {}, - .message = {}, - }}, -""" - act_str = "" - for action in actions: - contents = action[1] - - if contents["words"] == None: - words_str = get_string_group([]) - else: - words_str = get_string_group(contents["words"]) - - if contents["message"] == None: - message = "NO_MESSAGE" - else: - message = contents["message"] - - act_str += template.format(words_str, message) - global ignore - if contents.get("oldstyle", True) == False: - for word in contents["words"]: - if len(word) == 1: - ignore += word.upper() - act_str = act_str[:-1] # trim trailing newline - return act_str - def get_specials(specials): template = """ {{ .words = {}, .message = {}, + .noaction = {}, }}, """ spc_str = "" @@ -546,7 +520,12 @@ def get_specials(specials): else: message = make_c_string(contents["message"]) - spc_str += template.format(words_str, message) + if contents.get("noaction") == None: + noaction = "false" + else: + noaction = "true" + + spc_str += template.format(words_str, message, noaction) global ignore if contents.get("oldstyle", True) == False: for word in contents["words"]: