66d65ab41aedab0ca77338fc579b201fe1e08857
[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 /* Bits past 10 indicate areas of interest to "hint" routines */
20 #define COND_HBASE      10      /* Base for location hint bits */
21 #define COND_HCAVE      11      /* Trying to get into cave */
22 #define COND_HBIRD      12      /* Trying to catch bird */
23 #define COND_HSNAKE     13      /* Trying to deal with snake */
24 #define COND_HMAZE      14      /* Lost in maze */
25 #define COND_HDARK      15      /* Pondering dark room */
26 #define COND_HWITT      16      /* At Witt's End */
27 #define COND_HCLIFF     17      /* Cliff with urn */
28 #define COND_HWOODS     18      /* Lost in forest */
29 #define COND_HOGRE      19      /* Trying to deal with ogre */
30 #define COND_HJADE      20      /* Found all treasures except jade */
31
32 typedef struct {{
33   const char** strs;
34   const int n;
35 }} string_group_t;
36
37 typedef struct {{
38   const string_group_t words;
39   const char* inventory;
40   int plac, fixd;
41   bool is_treasure;
42   const char** descriptions;
43   const char** sounds;
44   const char** texts;
45   const char** changes;
46 }} object_t;
47
48 typedef struct {{
49   const char* small;
50   const char* big;
51 }} descriptions_t;
52
53 typedef struct {{
54   descriptions_t description;
55   const long sound;
56   const bool loud;
57 }} location_t;
58
59 typedef struct {{
60   const char* query;
61   const char* yes_response;
62 }} obituary_t;
63
64 typedef struct {{
65   const int threshold;
66   const int point_loss;
67   const char* message;
68 }} turn_threshold_t;
69
70 typedef struct {{
71   const int threshold;
72   const char* message;
73 }} class_t;
74
75 typedef struct {{
76   const int number;
77   const int turns;
78   const int penalty;
79   const char* question;
80   const char* hint;
81 }} hint_t;
82
83 typedef struct {{
84   const string_group_t words;
85 }} motion_t;
86
87 typedef struct {{
88   const string_group_t words;
89   const char* message;
90   const bool noaction;
91 }} action_t;
92
93 enum condtype_t {{cond_goto, cond_pct, cond_carry, cond_with, cond_not}};
94 enum desttype_t {{dest_goto, dest_special, dest_speak}};
95
96 typedef struct {{
97   const long motion;
98   const long condtype;
99   const long condarg1;
100   const long condarg2;
101   const enum desttype_t desttype;
102   const long destval;
103   const bool nodwarves;
104   const bool stop;
105 }} travelop_t;
106
107 extern const location_t locations[];
108 extern const object_t objects[];
109 extern const char* arbitrary_messages[];
110 extern const class_t classes[];
111 extern const turn_threshold_t turn_thresholds[];
112 extern const obituary_t obituaries[];
113 extern const hint_t hints[];
114 extern long conditions[];
115 extern const motion_t motions[];
116 extern const action_t actions[];
117 extern const travelop_t travel[];
118 extern const long tkey[];
119 extern const char *ignore;
120
121 #define NLOCATIONS      {num_locations}
122 #define NOBJECTS        {num_objects}
123 #define NHINTS          {num_hints}
124 #define NCLASSES        {num_classes}
125 #define NDEATHS         {num_deaths}
126 #define NTHRESHOLDS     {num_thresholds}
127 #define NMOTIONS    {num_motions}
128 #define NACTIONS        {num_actions}
129 #define NTRAVEL         {num_travel}
130 #define NKEYS           {num_keys}
131
132 #define BIRD_ENDSTATE {bird_endstate}
133
134 enum arbitrary_messages_refs {{
135 {arbitrary_messages}
136 }};
137
138 enum locations_refs {{
139 {locations}
140 }};
141
142 enum object_refs {{
143 {objects}
144 }};
145
146 enum motion_refs {{
147 {motions}
148 }};
149
150 enum action_refs {{
151 {actions}
152 }};
153
154 /* State definitions */
155
156 {state_definitions}
157
158 #endif /* end DUNGEON_H */