2 * WARNING: HEADER file for all adventure modules */
6 #define EXIT_SUCCESS (!(EXIT_FAILURE))
9 #define INPUTBUFLEN 80 /* Max input line length */
15 #define MAXOBJ 123 /* max # of objects in cave */
16 #define MAXLOC 248 /* max # of cave locations */
17 #define WORDSIZE 20 /* max # of chars in commands */
18 #define MAXMSG 408 /* max # of long location descr */
19 #define HNTMAX 18 /* max # of hints */
20 #define HNTMIN 7 /* hints starting count */
25 #define CLASS(word) ((word)<0 ? -((-(word)) / 1000) : (word) / 1000)
26 #define VAL(word) ((word)<0 ? -((-(word)) % 1000) : (word) % 1000)
27 #define MAXTRAV (23+1) /* max # of travel directions from loc */
28 /* +1 for terminator travel[x].tdest=-1 */
29 #define DWARFMAX 6 /* max # of nasty dwarves */
30 #define MAXDIE 3 /* max # of deaths before close */
31 #define MAXTRS 79 /* max # of */
46 #define BOOK2 BOOK + 1
56 #define CHASM2 CHASM + 1
63 #define DOOR 41 /* giant door */
96 #define PLANT2 PLANT + 1
120 #define TDOOR 42 /* tiny door */
121 #define TDOOR2 TDOOR + 1 /* wrought-iron door */
122 #define PDOOR TDOOR2 + 1 /* door to phone booth */
125 #define TROLL2 TROLL + 1
129 #define WALL2 WALL + 1
130 #define WATER 81 /* in bottle */
131 #define WATER2 WATER + 1 /* in cask */
132 #define WINE 85 /* in bottle */
133 #define WINE2 WINE + 1 /* in cask */
141 #define DEPRESSION 63
147 Action verb definitions
213 #define MOTION 0 /* CLASSD */
214 #define NOUN 1 /* CLASSN */
215 #define ACTION 2 /* CLASSA */
216 #define MISC 3 /* CLASSM */
217 #define PREPOSITION 4 /* CLASSP */
218 #define ADJACTIVE 5 /* CLASSJ */
219 #define CONJUNCTION 6 /* CLASSC */
222 and a few preposition. prefix PREP to distinguish them from
234 BIT mapping of "cond" array which indicates location status
241 /* Object condition bit functions */
248 Structure definitions
261 /* Function prototypes.
262 "#if (__STDC__)" should have been be enough,
263 but some compilers are stupid, so allow Makefile to say -DHAS_STDC=whatever.
265 #if defined(HAS_STDC) ? (HAS_STDC) : (__STDC__)
268 #define _PROTOTYPE(function, params) function params
271 #define _PROTOTYPE(function, params) function ()
277 _PROTOTYPE(void saveadv
, (char *username
));
278 _PROTOTYPE(void restore
, (char *username
));
282 _PROTOTYPE(void initialize
, (void));
286 _PROTOTYPE(int yes
, (int msg1
, int msg2
, int msg3
));
287 _PROTOTYPE(void rspeak
, (int msg
));
288 _PROTOTYPE(void pspeak
, (int item
, int state
));
289 _PROTOTYPE(void desclg
, (int loc
));
290 _PROTOTYPE(void descsh
, (int loc
));
294 _PROTOTYPE(int english
, (void));
295 _PROTOTYPE(int analyze
, (char *word
, int *type
, int *value
));
299 _PROTOTYPE(void itverb
, (void));
300 _PROTOTYPE(void ivblast
, (void));
301 _PROTOTYPE(void ivlook
, (void));
305 _PROTOTYPE(void turn
, (void));
306 _PROTOTYPE(void describe
, (void));
307 _PROTOTYPE(void descitem
, (void));
308 _PROTOTYPE(void dwarfend
, (void));
309 _PROTOTYPE(void normend
, (void));
310 _PROTOTYPE(void score
, (int));
311 _PROTOTYPE(void death
, (void));
312 _PROTOTYPE(char *probj
, (void));
313 _PROTOTYPE(void trobj
, (void));
314 _PROTOTYPE(void dwarves
, (void));
315 _PROTOTYPE(void dopirate
, (void));
316 _PROTOTYPE(int stimer
, (void));
320 _PROTOTYPE(void trverb
, (void));
321 _PROTOTYPE(void vtake
, (void));
322 _PROTOTYPE(void vdrop
, (void));
323 _PROTOTYPE(void vopen
, (void));
324 _PROTOTYPE(void vsay
, (void));
325 _PROTOTYPE(void von
, (void));
326 _PROTOTYPE(void voff
, (void));
327 _PROTOTYPE(void vwave
, (void));
328 _PROTOTYPE(void vkill
, (void));
329 _PROTOTYPE(void vpour
, (void));
330 _PROTOTYPE(void veat
, (void));
331 _PROTOTYPE(void vdrink
, (void));
332 _PROTOTYPE(void vthrow
, (void));
333 _PROTOTYPE(void vfind
, (void));
334 _PROTOTYPE(void vfill
, (void));
335 _PROTOTYPE(void vfeed
, (void));
336 _PROTOTYPE(void vread
, (void));
337 _PROTOTYPE(void vbreak
, (void));
338 _PROTOTYPE(void vwake
, (void));
339 _PROTOTYPE(void actspk
, (int verb
));
340 _PROTOTYPE(void vyank
, (void));
341 _PROTOTYPE(void vwear
, (void));
342 _PROTOTYPE(void vlock
, (void));
343 _PROTOTYPE(void vunlock
, (void));
344 _PROTOTYPE(void vclose
, (void));
348 _PROTOTYPE(boolean ajar
, (int));
349 _PROTOTYPE(boolean at
, (int item
));
350 _PROTOTYPE(boolean athand
, (int));
351 _PROTOTYPE(void bitoff
, (int, int));
352 _PROTOTYPE(void biton
, (int, int));
353 _PROTOTYPE(boolean bitset
, (long, int));
354 _PROTOTYPE(boolean blind
, (void));
355 _PROTOTYPE(int burden
, (int));
356 _PROTOTYPE(void carry
, (int obj
, int where
));
357 _PROTOTYPE(int confuz
, (void));
358 _PROTOTYPE(boolean dark
, (void));
359 _PROTOTYPE(boolean dcheck
, (void));
360 _PROTOTYPE(boolean dead
, (int));
361 _PROTOTYPE(void drop
, (int obj
, int where
));
362 _PROTOTYPE(void destroy
, (int obj
));
363 _PROTOTYPE(boolean edible
, (int));
364 _PROTOTYPE(boolean enclosed
, (int));
365 _PROTOTYPE(void extract
, (int));
366 _PROTOTYPE(boolean forced
, (int atloc
));
367 _PROTOTYPE(boolean here
, (int item
));
368 _PROTOTYPE(boolean hinged
, (int));
369 _PROTOTYPE(boolean holding
, (int));
370 _PROTOTYPE(void insert
, (int, int));
371 _PROTOTYPE(boolean inside
, (int));
372 _PROTOTYPE(void juggle
, (int loc
));
373 _PROTOTYPE(int liq
, (int));
374 _PROTOTYPE(int liqloc
, (int loc
));
375 _PROTOTYPE(int liq2
, (int pbottle
));
376 _PROTOTYPE(boolean living
, (int));
377 _PROTOTYPE(boolean locked
, (int));
378 _PROTOTYPE(boolean locks
, (int));
379 _PROTOTYPE(void lookin
, (int));
380 _PROTOTYPE(void move
, (int obj
, int where
));
381 _PROTOTYPE(int noway
, (void));
382 _PROTOTYPE(boolean opaque
, (int));
383 _PROTOTYPE(boolean outside
, (int));
384 _PROTOTYPE(boolean pct
, (int x
));
385 _PROTOTYPE(boolean plural
, (int));
386 _PROTOTYPE(boolean portal
, (int));
387 _PROTOTYPE(boolean printed
, (int));
388 _PROTOTYPE(int put
, (int obj
, int where
, int pval
));
389 _PROTOTYPE(int ranz
, (int));
390 _PROTOTYPE(boolean small
, (int));
391 _PROTOTYPE(boolean toting
, (int item
));
392 _PROTOTYPE(boolean treasr
, (int));
393 _PROTOTYPE(boolean vessel
, (int));
394 _PROTOTYPE(boolean wearng
, (int));
395 _PROTOTYPE(boolean worn
, (int));
396 _PROTOTYPE(void bug
, (unsigned int n
));
397 _PROTOTYPE(char *ask
, (char *prompt
, char *buf
, int buflen
));
398 _PROTOTYPE(void panic
, (char *msg
, boolean save
));
401 _PROTOTYPE(void domove
, (void));
402 _PROTOTYPE(void gettrav
, (int loc
, struct trav
*travel
));
405 _PROTOTYPE(int vocab
, (char *word
, int val
));