Generate initializer from YAML for Section 9 bits.
[open-adventure.git] / common.h
1 #ifndef COMMON_H
2 #define COMMON_H
3 /* maximum size limits shared by dungeon compiler and runtime */
4
5 #define LOCSIZ          185
6 #define NOBJECTS        100
7
8 extern const char advent_to_ascii[128];
9 extern const char ascii_to_advent[128];
10
11 /* Symbols for cond bits - used by advent.h */
12 #define COND_LIT        0       /* Light */
13 #define COND_OILY       1       /* If bit 2 is on: on for oil, off for water */
14 #define COND_FLUID      2       /* Liquid asset, see bit 1 */
15 #define COND_NOARRR     3       /* Pirate doesn't go here unless following */
16 #define COND_NOBACK     4       /* Cannot use "back" to move away */
17 #define COND_ABOVE      5
18 #define COND_DEEP       6       /* Deep - e.g where dwarves are active */
19 #define COND_FOREST     7       /* in the forest */
20 /* Bits past 10 indicate areas of interest to "hint" routines */
21 #define COND_HBASE      10      /* Base for location hint bits */
22 #define COND_HCAVE      11      /* Trying to get into cave */
23 #define COND_HBIRD      12      /* Trying to catch bird */
24 #define COND_HSNAKE     13      /* Trying to deal with snake */
25 #define COND_HMAZE      14      /* Lost in maze */
26 #define COND_HDARK      15      /* Pondering dark room */
27 #define COND_HWITT      16      /* At Witt's End */
28 #define COND_HCLIFF     17      /* Cliff with urn */
29 #define COND_HWOODS     18      /* Lost in forest */
30 #define COND_HOGRE      19      /* Trying to deal with ogre */
31 #define COND_HJADE      20      /* Found all treasures except jade */
32
33 enum bugtype {
34    MESSAGE_LINE_GT_70_CHARACTERS,                         // 0
35    NULL_LINE_IN_MESSAGE,                                  // 1
36    TOO_MANY_WORDS_OF_MESSAGES,                            // 2
37    TOO_MANY_TRAVEL_OPTIONS,                               // 3
38    TOO_MANY_VOCABULARY_WORDS,                             // 4
39    REQUIRED_VOCABULARY_WORD_NOT_FOUND,                    // 5
40    TOO_MANY_RTEXT_MESSAGES,                               // 6
41    TOO_MANY_HINTS,                                        // 7
42    LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE,            // 8
43    INVALID_SECTION_NUMBER_IN_DATABASE,                    // 9
44    TOO_MANY_LOCATIONS,                                    // 10
45    SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST = 20, // 20
46    RAN_OFF_END_OF_VOCABULARY_TABLE,                       // 21
47    VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3,       // 22
48    INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST,            // 23
49    TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST,              // 24
50    CONDITIONAL_TRAVEL_ENTRY_WITH_NO_ALTERATION,           // 25
51    LOCATION_HAS_NO_TRAVEL_ENTRIES,                        // 26
52    HINT_NUMBER_EXCEEDS_GOTO_LIST,                         // 27
53    TOO_MANY_PARAMETERS_GIVEN_TO_SETPRM,                   // 28
54    SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN=99, // 99
55    ACTION_RETURNED_PHASE_CODE_BEYOND_END_OF_SWITCH,       // 100
56 };
57
58 /* Alas, declaring this static confuses the coverage analyzer */
59 void bug(enum bugtype, const char *) __attribute__((__noreturn__));
60
61 #define BUG(x) bug(x, #x)
62
63 #endif