const long message;
}} action_t;
+typedef struct {{
+ const string_group_t words;
+ const char* message;
+}} special_t;
+
typedef struct {{
const long motion;
const long cond;
extern long conditions[];
extern const motion_t motions[];
extern const action_t actions[];
-extern const action_t specials[];
+extern const special_t specials[];
extern const travelop_t travel[];
extern const long tkey[];
extern const char *ignore;
{}
}};
-const action_t specials[] = {{
+const special_t specials[] = {{
{}
}};
act_str = act_str[:-1] # trim trailing newline
return act_str
+def get_specials(specials):
+ template = """ {{
+ .words = {},
+ .message = {},
+ }},
+"""
+ spc_str = ""
+ for special in specials:
+ contents = special[1]
+
+ if contents["words"] == None:
+ words_str = get_string_group([])
+ else:
+ words_str = get_string_group(contents["words"])
+
+ if contents["message"] == None:
+ message = "NULL"
+ else:
+ message = make_c_string(contents["message"])
+
+ spc_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()
+ spc_str = spc_str[:-1] # trim trailing newline
+ return spc_str
+
def bigdump(arr):
out = ""
for (i, entry) in enumerate(arr):
get_condbits(db["locations"]),
get_motions(db["motions"]),
get_actions(db["actions"]),
- get_actions(db["specials"]),
+ get_specials(db["specials"]),
bigdump(tkey),
get_travel(travel),
ignore,