e42ab072e66500d6fb1586794f79d6fcc7ecd785
[open-adventure.git] / templates / dungeon.h.tpl
1 #ifndef DUNGEON_H
2 #define DUNGEON_H
3
4 #include <stdio.h>
5 #include <stdbool.h>
6
7 #define SILENT  -1      /* no sound */
8
9 /* Symbols for cond bits */
10 #define COND_LIT        0       /* Light */
11 #define COND_OILY       1       /* If bit 2 is on: on for oil, off for water */
12 #define COND_FLUID      2       /* Liquid asset, see bit 1 */
13 #define COND_NOARRR     3       /* Pirate doesn't go here unless following */
14 #define COND_NOBACK     4       /* Cannot use "back" to move away */
15 #define COND_ABOVE      5       /* Aboveground, but not in forest */
16 #define COND_DEEP       6       /* Deep - e.g where dwarves are active */
17 #define COND_FOREST     7       /* In the forest */
18 #define COND_FORCED     8       /* Only one way in or out of here */
19 #define COND_ALLDIFFERENT       9       /* Room is in maze all different */
20 #define COND_ALLALIKE   10      /* Room is in maze all alike */
21 /* Bits past 11 indicate areas of interest to "hint" routines */
22 #define COND_HBASE      11      /* Base for location hint bits */
23 #define COND_HCAVE      12      /* Trying to get into cave */
24 #define COND_HBIRD      13      /* Trying to catch bird */
25 #define COND_HSNAKE     14      /* Trying to deal with snake */
26 #define COND_HMAZE      15      /* Lost in maze */
27 #define COND_HDARK      16      /* Pondering dark room */
28 #define COND_HWITT      17      /* At Witt's End */
29 #define COND_HCLIFF     18      /* Cliff with urn */
30 #define COND_HWOODS     19      /* Lost in forest */
31 #define COND_HOGRE      20      /* Trying to deal with ogre */
32 #define COND_HJADE      21      /* Found all treasures except jade */
33
34 typedef struct {{
35   const char** strs;
36   const int n;
37 }} string_group_t;
38
39 typedef struct {{
40   const string_group_t words;
41   const char* inventory;
42   int plac, fixd;
43   bool is_treasure;
44   const char** descriptions;
45   const char** sounds;
46   const char** texts;
47   const char** changes;
48 }} object_t;
49
50 typedef struct {{
51   const char* small;
52   const char* big;
53 }} descriptions_t;
54
55 typedef struct {{
56   descriptions_t description;
57   const long sound;
58   const bool loud;
59 }} location_t;
60
61 typedef struct {{
62   const char* query;
63   const char* yes_response;
64 }} obituary_t;
65
66 typedef struct {{
67   const int threshold;
68   const int point_loss;
69   const char* message;
70 }} turn_threshold_t;
71
72 typedef struct {{
73   const int threshold;
74   const char* message;
75 }} class_t;
76
77 typedef struct {{
78   const int number;
79   const int turns;
80   const int penalty;
81   const char* question;
82   const char* hint;
83 }} hint_t;
84
85 typedef struct {{
86   const string_group_t words;
87 }} motion_t;
88
89 typedef struct {{
90   const string_group_t words;
91   const char* message;
92   const bool noaction;
93 }} action_t;
94
95 enum condtype_t {{cond_goto, cond_pct, cond_carry, cond_with, cond_not}};
96 enum desttype_t {{dest_goto, dest_special, dest_speak}};
97
98 typedef struct {{
99   const long motion;
100   const long condtype;
101   const long condarg1;
102   const long condarg2;
103   const enum desttype_t desttype;
104   const long destval;
105   const bool nodwarves;
106   const bool stop;
107 }} travelop_t;
108
109 extern const location_t locations[];
110 extern const object_t objects[];
111 extern const char* arbitrary_messages[];
112 extern const class_t classes[];
113 extern const turn_threshold_t turn_thresholds[];
114 extern const obituary_t obituaries[];
115 extern const hint_t hints[];
116 extern long conditions[];
117 extern const motion_t motions[];
118 extern const action_t actions[];
119 extern const travelop_t travel[];
120 extern const long tkey[];
121 extern const char *ignore;
122
123 #define NLOCATIONS      {num_locations}
124 #define NOBJECTS        {num_objects}
125 #define NHINTS          {num_hints}
126 #define NCLASSES        {num_classes}
127 #define NDEATHS         {num_deaths}
128 #define NTHRESHOLDS     {num_thresholds}
129 #define NMOTIONS    {num_motions}
130 #define NACTIONS        {num_actions}
131 #define NTRAVEL         {num_travel}
132 #define NKEYS           {num_keys}
133
134 #define BIRD_ENDSTATE {bird_endstate}
135
136 enum arbitrary_messages_refs {{
137 {arbitrary_messages}
138 }};
139
140 enum locations_refs {{
141 {locations}
142 }};
143
144 enum object_refs {{
145 {objects}
146 }};
147
148 enum motion_refs {{
149 {motions}
150 }};
151
152 enum action_refs {{
153 {actions}
154 }};
155
156 /* State definitions */
157
158 {state_definitions}
159
160 #endif /* end DUNGEON_H */