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