release version 4.1
[unix-history] / usr / src / games / adventure / hdr.h
CommitLineData
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 15static 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
20extern int setup; /* changed by savec & init */
21int datfd; /* message file descriptor */
22int delhit;
23int yea;
24
25#define TAB 011
26#define LF 012
27#define FLUSHLINE while (getchar()!='\n')
28#define FLUSHLF while (next()!=LF)
29
30int loc,newloc,oldloc,oldlc2,wzdark,SHORT,gaveup,kq,k,k2;
31char *wd1,*wd2; /* the complete words */
32int verb,obj,spk;
33extern int blklin;
34int 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 */
39struct 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
48struct text
49{ int seekadr; /* DATFILE must be < 2**16 */
50 int txtlen; /* length of msg starting here */
51};
52
53#define RTXSIZ 205
54struct text rtext[RTXSIZ]; /* random text messages */
55
56#define MAGSIZ 35
57struct text mtext[MAGSIZ]; /* magic messages */
58
59int clsses;
60#define CLSMAX 12
61struct text ctext[CLSMAX]; /* classes of adventurer */
62int cval[CLSMAX];
63
64struct text ptext[101]; /* object descriptions */
65
66#define LOCSIZ 141 /* number of locations */
67struct text ltext[LOCSIZ]; /* long loc description */
68struct text stext[LOCSIZ]; /* short loc descriptions */
69
70struct 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
77int atloc[LOCSIZ];
78
79int plac[101]; /* initial object placement */
80int fixd[101],fixed[101]; /* location fixed? */
81
82int actspk[35]; /* rtext msg for verb <n> */
83
84int cond[LOCSIZ]; /* various condition bits */
85
86extern int setbit[16]; /* bit defn masks 1,2,4,... */
87
88int hntmax;
89int hints[20][5]; /* info on hints */
90int hinted[20],hintlc[20];
91
92int place[101], prop[101],link[201];
93int abb[LOCSIZ];
94
95int maxtrs,tally,tally2; /* treasure values */
96
97#define FALSE 0
98#define TRUE 1
99
100int 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
109int chloc,chloc2,dseen[7],dloc[7], /* dwarf stuff */
110 odloc[7],dflag,daltlc;
111
112int tk[21],stick,dtotal,attack;
113int 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
117int demo,newloc,limit;
118
119char *malloc();