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: 
  15: static char hdr_sccsid[] = "	hdr.h	4.1	82/05/11	";
  16: 
  17: /*  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();

Defined variables

SHORT defined in line 30; used 1 times
abb defined in line 93; used 3 times
abbnum defined in line 114; used 3 times
actspk defined in line 82; used 2 times
atloc defined in line 77; used 12 times
attack defined in line 112; used 5 times
axe defined in line 102; used 11 times
back defined in line 106; used 2 times
bear defined in line 103; used 34 times
bird defined in line 101; used 30 times
bottle defined in line 102; used 25 times
cage defined in line 100; used 8 times
cave defined in line 106; used 2 times
chasm defined in line 103; used 6 times
chloc defined in line 109; used 7 times
chloc2 defined in line 109; used 3 times
clsses defined in line 59; used 6 times
coins defined in line 104; used 3 times
ctext defined in line 61; used 3 times
cval defined in line 62; used 3 times
daltlc defined in line 110; used 2 times
delhit defined in line 22; used 3 times
demo defined in line 117; used 3 times
dkill defined in line 114; used 3 times
dprssn defined in line 106; used 2 times
dragon defined in line 102; used 23 times
dseen defined in line 109; used 8 times
dtotal defined in line 112; used 5 times
eggs defined in line 104; used 11 times
emrald defined in line 104; used 6 times
entrnc defined in line 106; used 2 times
foobar defined in line 114; used 8 times
gaveup defined in line 30; used 6 times
hdr_sccsid defined in line 15; never used
hintlc defined in line 90; used 5 times
iwest defined in line 113; used 2 times
k defined in line 30; used 99 times
k2 defined in line 30; never used
keys defined in line 100; used 4 times
knife defined in line 102; used 2 times
kq defined in line 30; used 2 times
latncy defined in line 34; used 4 times
limit defined in line 117; used 13 times
link defined in line 92; used 8 times
lmwarn defined in line 113; used 4 times
loc defined in line 30; used 104 times
lock defined in line 107; used 4 times
look defined in line 106; used 2 times
maxdie defined in line 114; used 4 times
mtext defined in line 57; used 3 times
mxscor defined in line 34; used 11 times
newloc defined in line 117; used 40 times
nugget defined in line 104; used 2 times
numdie defined in line 114; used 7 times
obj defined in line 32; used 182 times
odloc defined in line 110; used 9 times
oldlc2 defined in line 30; used 8 times
oldloc defined in line 30; used 31 times
oyster defined in line 101; used 20 times
pearl defined in line 104; used 2 times
pillow defined in line 101; used 5 times
plant defined in line 102; used 13 times
plant2 defined in line 102; used 5 times
prop defined in line 92; used 121 times
pyram defined in line 104; used 6 times
rod defined in line 100; used 13 times
rod2 defined in line 100; used 12 times
savet defined in line 34; used 2 times
say defined in line 107; used 5 times
snake defined in line 101; used 17 times
spices defined in line 105; used 1 times
spk defined in line 32; used 111 times
steps defined in line 100; used 4 times
stext defined in line 68; used 3 times
stick defined in line 112; used 6 times
tablet defined in line 101; used 4 times
throw defined in line 107; used 2 times
tk defined in line 112; used 4 times
tkk defined in line 75; used 26 times
tridnt defined in line 104; used 2 times
troll defined in line 103; used 39 times
troll2 defined in line 103; used 9 times
vend defined in line 103; used 2 times
verb defined in line 32; used 22 times
voc defined in line 42; used 2 times
wd1 defined in line 31; used 18 times
wd2 defined in line 31; used 21 times
wzdark defined in line 30; used 4 times
yea defined in line 23; used 3 times

Defined struct's

hashtab defined in line 39; used 4 times
text defined in line 48; used 20 times
travlist defined in line 70; used 18 times

Defined macros

CLSMAX defined in line 60; used 2 times
DATFILE defined in line 44; used 2 times
FLUSHLF defined in line 28; used 4 times
FLUSHLINE defined in line 27; used 5 times
HTSIZE defined in line 38; used 6 times
LF defined in line 26; used 12 times
LOCSIZ defined in line 66; used 7 times
MAGSIZ defined in line 56; used 2 times
MAXSTR defined in line 36; used 3 times
RTXSIZ defined in line 53; used 2 times
TAB defined in line 25; used 6 times
TMPFILE defined in line 45; used 4 times

Usage of this include

Last modified: 1982-06-09
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3042
Valid CSS Valid XHTML 1.0 Strict