Commit | Line | Data |
---|---|---|
44e6f2da RH |
1 | # |
2 | /* ADVENTURE -- Jim Gillogly, Jul 1977 | |
3 | * This program is a re-write of ADVENT, written in FORTRAN mostly by | |
4 | * Don Woods of SAIL. In most places it is as nearly identical to the | |
5 | * original as possible given the language and word-size differences. | |
6 | * A few places, such as the message arrays and travel arrays were changed | |
7 | * to reflect the smaller core size and word size. The labels of the | |
8 | * original are reflected in this version, so that the comments of the | |
9 | * fortran are still applicable here. | |
10 | * | |
11 | * The data file distributed with the fortran source is assumed to be called | |
12 | * "glorkz" in the directory where the program is first run. | |
13 | */ | |
14 | ||
01eb5674 | 15 | static char hdr_sccsid[] = " hdr.h 4.1 82/05/11 "; |
44e6f2da RH |
16 | |
17 | /* \f hdr.h */ | |
18 | /* hdr.h: included by c advent files */ | |
19 | ||
20 | extern int setup; /* changed by savec & init */ | |
21 | int datfd; /* message file descriptor */ | |
22 | int delhit; | |
23 | int yea; | |
24 | ||
25 | #define TAB 011 | |
26 | #define LF 012 | |
27 | #define FLUSHLINE while (getchar()!='\n') | |
28 | #define FLUSHLF while (next()!=LF) | |
29 | ||
30 | int loc,newloc,oldloc,oldlc2,wzdark,SHORT,gaveup,kq,k,k2; | |
31 | char *wd1,*wd2; /* the complete words */ | |
32 | int verb,obj,spk; | |
33 | extern int blklin; | |
34 | int saved,savet,mxscor,latncy; | |
35 | ||
36 | #define MAXSTR 20 /* max length of user's words */ | |
37 | ||
38 | #define HTSIZE 512 /* max number of vocab words */ | |
39 | struct hashtab /* hash table for vocabulary */ | |
40 | { int val; /* word type &index (ktab) */ | |
41 | char *atab; /* pointer to actual string */ | |
42 | } voc[HTSIZE]; | |
43 | ||
44 | #define DATFILE "glorkz" /* all the original msgs */ | |
45 | #define TMPFILE "tmp.foo.baz" /* just the text msgs */ | |
46 | ||
47 | ||
48 | struct text | |
49 | { int seekadr; /* DATFILE must be < 2**16 */ | |
50 | int txtlen; /* length of msg starting here */ | |
51 | }; | |
52 | ||
53 | #define RTXSIZ 205 | |
54 | struct text rtext[RTXSIZ]; /* random text messages */ | |
55 | ||
56 | #define MAGSIZ 35 | |
57 | struct text mtext[MAGSIZ]; /* magic messages */ | |
58 | ||
59 | int clsses; | |
60 | #define CLSMAX 12 | |
61 | struct text ctext[CLSMAX]; /* classes of adventurer */ | |
62 | int cval[CLSMAX]; | |
63 | ||
64 | struct text ptext[101]; /* object descriptions */ | |
65 | ||
66 | #define LOCSIZ 141 /* number of locations */ | |
67 | struct text ltext[LOCSIZ]; /* long loc description */ | |
68 | struct text stext[LOCSIZ]; /* short loc descriptions */ | |
69 | ||
70 | struct travlist /* direcs & conditions of travel*/ | |
71 | { struct travlist *next; /* ptr to next list entry */ | |
72 | int conditions; /* m in writeup (newloc / 1000) */ | |
73 | int tloc; /* n in writeup (newloc % 1000) */ | |
74 | int tverb; /* the verb that takes you there*/ | |
75 | } *travel[LOCSIZ],*tkk; /* travel is closer to keys(...)*/ | |
76 | ||
77 | int atloc[LOCSIZ]; | |
78 | ||
79 | int plac[101]; /* initial object placement */ | |
80 | int fixd[101],fixed[101]; /* location fixed? */ | |
81 | ||
82 | int actspk[35]; /* rtext msg for verb <n> */ | |
83 | ||
84 | int cond[LOCSIZ]; /* various condition bits */ | |
85 | ||
86 | extern int setbit[16]; /* bit defn masks 1,2,4,... */ | |
87 | ||
88 | int hntmax; | |
89 | int hints[20][5]; /* info on hints */ | |
90 | int hinted[20],hintlc[20]; | |
91 | ||
92 | int place[101], prop[101],link[201]; | |
93 | int abb[LOCSIZ]; | |
94 | ||
95 | int maxtrs,tally,tally2; /* treasure values */ | |
96 | ||
97 | #define FALSE 0 | |
98 | #define TRUE 1 | |
99 | ||
100 | int keys,lamp,grate,cage,rod,rod2,steps,/* mnemonics */ | |
101 | bird,door,pillow,snake,fissur,tablet,clam,oyster,magzin, | |
102 | dwarf,knife,food,bottle,water,oil,plant,plant2,axe,mirror,dragon, | |
103 | chasm,troll,troll2,bear,messag,vend,batter, | |
104 | nugget,coins,chest,eggs,tridnt,vase,emrald,pyram,pearl,rug,chain, | |
105 | spices, | |
106 | back,look,cave,null,entrnc,dprssn, | |
107 | say,lock,throw,find,invent; | |
108 | ||
109 | int chloc,chloc2,dseen[7],dloc[7], /* dwarf stuff */ | |
110 | odloc[7],dflag,daltlc; | |
111 | ||
112 | int tk[21],stick,dtotal,attack; | |
113 | int turns,lmwarn,iwest,knfloc,detail, /* various flags & counters */ | |
114 | abbnum,maxdie,numdie,holdng,dkill,foobar,bonus,clock1,clock2, | |
115 | saved,closng,panic,closed,scorng; | |
116 | ||
117 | int demo,newloc,limit; | |
118 | ||
119 | char *malloc(); |