# If the inventory desription begins with "*" the object is dungeon
# furniture that cannot be taken or carried.
#
+# obituaries: Death messages abd reincarnation queries. Order is
+# significant, they're used in succession as the player racks up
+# deaths.
+#
# hints: Each item contains a hint number (add 10 to get cond bit),
# the number of turns he must be at the right loc(s) before
# triggering the hint, the points deducted for taking the hint, the
h_name = "newdb.h"
c_name = "newdb.c"
-h_template = """#include <stdio.h>
+h_template = """/* Generated from adventure.yaml - do not hand-hack! */
+
+#include <stdio.h>
typedef struct {{
const char* inventory;
extern obituary_t obituaries[];
extern hint_t hints[];
-extern size_t CLSSES;
-extern int maximum_deaths;
-extern int turn_threshold_count;
+extern const size_t CLSSES;
+extern const int maximum_deaths;
+extern const int turn_threshold_count;
enum arbitrary_messages_refs {{
{}
enum object_descriptions_refs {{
{}
}};
+
+/* end */
"""
-c_template = """#include "{}"
+c_template = """/* Generated from adventure.yaml - do not hand-hack! */
+
+#include "{}"
const char* arbitrary_messages[] = {{
{}
{}
}};
-size_t CLSSES = {};
-int maximum_deaths = {};
-int turn_threshold_count = {};
+const size_t CLSSES = {};
+const int maximum_deaths = {};
+const int turn_threshold_count = {};
+
+/* end */
"""
def make_c_string(string):
with open(c_name, "w") as cf:
cf.write(c)
+
+# end