Give the FORCED property a real cond bit. Delete some unused code.
[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 #define COND_FORCED     8       /* Only one way in or out of here */
21 /* Bits past 10 indicate areas of interest to "hint" routines */
22 #define COND_HBASE      10      /* Base for location hint bits */
23 #define COND_HCAVE      11      /* Trying to get into cave */
24 #define COND_HBIRD      12      /* Trying to catch bird */
25 #define COND_HSNAKE     13      /* Trying to deal with snake */
26 #define COND_HMAZE      14      /* Lost in maze */
27 #define COND_HDARK      15      /* Pondering dark room */
28 #define COND_HWITT      16      /* At Witt's End */
29 #define COND_HCLIFF     17      /* Cliff with urn */
30 #define COND_HWOODS     18      /* Lost in forest */
31 #define COND_HOGRE      19      /* Trying to deal with ogre */
32 #define COND_HJADE      20      /* Found all treasures except jade */
33
34 enum bugtype {
35    MESSAGE_LINE_GT_70_CHARACTERS,                         // 0
36    NULL_LINE_IN_MESSAGE,                                  // 1
37    TOO_MANY_WORDS_OF_MESSAGES,                            // 2
38    TOO_MANY_TRAVEL_OPTIONS,                               // 3
39    TOO_MANY_VOCABULARY_WORDS,                             // 4
40    REQUIRED_VOCABULARY_WORD_NOT_FOUND,                    // 5
41    TOO_MANY_RTEXT_MESSAGES,                               // 6
42    TOO_MANY_HINTS,                                        // 7
43    LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE,            // 8
44    INVALID_SECTION_NUMBER_IN_DATABASE,                    // 9
45    TOO_MANY_LOCATIONS,                                    // 10
46    SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST = 20, // 20
47    RAN_OFF_END_OF_VOCABULARY_TABLE,                       // 21
48    VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3,       // 22
49    INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST,            // 23
50    TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST,              // 24
51    CONDITIONAL_TRAVEL_ENTRY_WITH_NO_ALTERATION,           // 25
52    LOCATION_HAS_NO_TRAVEL_ENTRIES,                        // 26
53    HINT_NUMBER_EXCEEDS_GOTO_LIST,                         // 27
54    TOO_MANY_PARAMETERS_GIVEN_TO_SETPRM,                   // 28
55    SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN=99, // 99
56    ACTION_RETURNED_PHASE_CODE_BEYOND_END_OF_SWITCH,       // 100
57 };
58
59 /* Alas, declaring this static confuses the coverage analyzer */
60 void bug(enum bugtype, const char *) __attribute__((__noreturn__));
61
62 #define BUG(x) bug(x, #x)
63
64 #endif