1*47851Sbostic /*- 2*47851Sbostic * Copyright (c) 1991 The Regents of the University of California. 3*47851Sbostic * All rights reserved. 4*47851Sbostic * 5*47851Sbostic * The game adventure was original written Fortran by Will Crowther 6*47851Sbostic * and Don Woods. It was later translated to C and enhanced by 7*47851Sbostic * Jim Gillogly. 8*47851Sbostic * 9*47851Sbostic * %sccs.include.redist.c% 10*47851Sbostic * 11*47851Sbostic * @(#)hdr.h 5.1 (Berkeley) 04/08/91 12*47851Sbostic */ 13*47851Sbostic 146743Srrh /* ADVENTURE -- Jim Gillogly, Jul 1977 156743Srrh * This program is a re-write of ADVENT, written in FORTRAN mostly by 166743Srrh * Don Woods of SAIL. In most places it is as nearly identical to the 176743Srrh * original as possible given the language and word-size differences. 186743Srrh * A few places, such as the message arrays and travel arrays were changed 196743Srrh * to reflect the smaller core size and word size. The labels of the 206743Srrh * original are reflected in this version, so that the comments of the 216743Srrh * fortran are still applicable here. 226743Srrh * 236743Srrh * The data file distributed with the fortran source is assumed to be called 246743Srrh * "glorkz" in the directory where the program is first run. 256743Srrh */ 266743Srrh 276743Srrh /* hdr.h: included by c advent files */ 286743Srrh 296743Srrh extern int setup; /* changed by savec & init */ 306743Srrh int datfd; /* message file descriptor */ 316743Srrh int delhit; 326743Srrh int yea; 336743Srrh 346743Srrh #define TAB 011 356743Srrh #define LF 012 366743Srrh #define FLUSHLINE while (getchar()!='\n') 376743Srrh #define FLUSHLF while (next()!=LF) 386743Srrh 396743Srrh int loc,newloc,oldloc,oldlc2,wzdark,SHORT,gaveup,kq,k,k2; 406743Srrh char *wd1,*wd2; /* the complete words */ 416743Srrh int verb,obj,spk; 426743Srrh extern int blklin; 436743Srrh int saved,savet,mxscor,latncy; 446743Srrh 456743Srrh #define MAXSTR 20 /* max length of user's words */ 466743Srrh 476743Srrh #define HTSIZE 512 /* max number of vocab words */ 486743Srrh struct hashtab /* hash table for vocabulary */ 496743Srrh { int val; /* word type &index (ktab) */ 506743Srrh char *atab; /* pointer to actual string */ 516743Srrh } voc[HTSIZE]; 526743Srrh 536743Srrh #define DATFILE "glorkz" /* all the original msgs */ 546743Srrh #define TMPFILE "tmp.foo.baz" /* just the text msgs */ 556743Srrh 566743Srrh 576743Srrh struct text 586743Srrh { int seekadr; /* DATFILE must be < 2**16 */ 596743Srrh int txtlen; /* length of msg starting here */ 606743Srrh }; 616743Srrh 626743Srrh #define RTXSIZ 205 636743Srrh struct text rtext[RTXSIZ]; /* random text messages */ 646743Srrh 656743Srrh #define MAGSIZ 35 666743Srrh struct text mtext[MAGSIZ]; /* magic messages */ 676743Srrh 686743Srrh int clsses; 696743Srrh #define CLSMAX 12 706743Srrh struct text ctext[CLSMAX]; /* classes of adventurer */ 716743Srrh int cval[CLSMAX]; 726743Srrh 736743Srrh struct text ptext[101]; /* object descriptions */ 746743Srrh 756743Srrh #define LOCSIZ 141 /* number of locations */ 766743Srrh struct text ltext[LOCSIZ]; /* long loc description */ 776743Srrh struct text stext[LOCSIZ]; /* short loc descriptions */ 786743Srrh 796743Srrh struct travlist /* direcs & conditions of travel*/ 806743Srrh { struct travlist *next; /* ptr to next list entry */ 816743Srrh int conditions; /* m in writeup (newloc / 1000) */ 826743Srrh int tloc; /* n in writeup (newloc % 1000) */ 836743Srrh int tverb; /* the verb that takes you there*/ 846743Srrh } *travel[LOCSIZ],*tkk; /* travel is closer to keys(...)*/ 856743Srrh 866743Srrh int atloc[LOCSIZ]; 876743Srrh 886743Srrh int plac[101]; /* initial object placement */ 896743Srrh int fixd[101],fixed[101]; /* location fixed? */ 906743Srrh 916743Srrh int actspk[35]; /* rtext msg for verb <n> */ 926743Srrh 936743Srrh int cond[LOCSIZ]; /* various condition bits */ 946743Srrh 956743Srrh extern int setbit[16]; /* bit defn masks 1,2,4,... */ 966743Srrh 976743Srrh int hntmax; 986743Srrh int hints[20][5]; /* info on hints */ 996743Srrh int hinted[20],hintlc[20]; 1006743Srrh 1016743Srrh int place[101], prop[101],link[201]; 1026743Srrh int abb[LOCSIZ]; 1036743Srrh 1046743Srrh int maxtrs,tally,tally2; /* treasure values */ 1056743Srrh 1066743Srrh #define FALSE 0 1076743Srrh #define TRUE 1 1086743Srrh 1096743Srrh int keys,lamp,grate,cage,rod,rod2,steps,/* mnemonics */ 1106743Srrh bird,door,pillow,snake,fissur,tablet,clam,oyster,magzin, 1116743Srrh dwarf,knife,food,bottle,water,oil,plant,plant2,axe,mirror,dragon, 1126743Srrh chasm,troll,troll2,bear,messag,vend,batter, 1136743Srrh nugget,coins,chest,eggs,tridnt,vase,emrald,pyram,pearl,rug,chain, 1146743Srrh spices, 1156743Srrh back,look,cave,null,entrnc,dprssn, 1166743Srrh say,lock,throw,find,invent; 1176743Srrh 1186743Srrh int chloc,chloc2,dseen[7],dloc[7], /* dwarf stuff */ 1196743Srrh odloc[7],dflag,daltlc; 1206743Srrh 1216743Srrh int tk[21],stick,dtotal,attack; 1226743Srrh int turns,lmwarn,iwest,knfloc,detail, /* various flags & counters */ 1236743Srrh abbnum,maxdie,numdie,holdng,dkill,foobar,bonus,clock1,clock2, 1246743Srrh saved,closng,panic,closed,scorng; 1256743Srrh 1266743Srrh int demo,newloc,limit; 1276743Srrh 1286743Srrh char *malloc(); 129