[comp.sources.games] v03i020: NetHack2.2 - display oriented dungeons and dragons, Part20/20

games-request@tekred.TEK.COM (12/03/87)

Submitted by: mike@genat.UUCP (Mike Stephenson)
Comp.sources.games: Volume 3, Issue 20
Archive-name: nethack2.2/Part20



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 20 (of 20)."
# Contents:  Make.ini Maketcc.ini eshk.h extern.h func_tab.h hack.h hh
#   ioctl.c mfndpos.h mkroom.h msdos.h nethack.cnf nethack.sh
#   netquest.sh obj.h rip.c rnd.c rumors.mrx spell.h termcap.cnf
#   track.c worn.c wseg.h
# Wrapped by billr@tekred on Tue Dec  1 16:25:19 1987
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f Make.ini -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Make.ini\"
else
echo shar: Extracting \"Make.ini\" \(1759 characters\)
sed "s/^X//" >Make.ini <<'END_OF_Make.ini'
X#	SCCS Id: @(#)Make.ini	1.4	87/08/08
X# This is a sample `make.ini' file for NDMAKE v3.7.  You will probably want
X# to customize it for your system.
X
X
X
X# The order to search for rules and files is specified by .SUFFIXES
X.SUFFIXES : .exe .obj .c .for .asm
X
X# A few macros.
XCFLAGS = -A$(MODEL)
XMODEL = S
XSETARGV = $(LIB)\$(MODEL)SETARGV
XLIBS =
XBIN =
XLFLAGS =
X
X# A universally useful target.
Xclean:
X	+-erase *.bak
X	+-erase *.map
X
X# .BEFORE and .AFTER can be used to turn DPATH off and on.
X.BEFORE:; @+echo For help with ndmake, use the command `make -h'
X.AFTER:; @+echo All done.
X
X
X# DEFAULT RULES
X# To produce a `.obj' file from a `.asm' file using MASM.
X.asm.obj:; masm $*.asm;
X
X# To produce a `.obj' file from a `.c' file using Microsoft C. 
X.c.obj:; msc $(CFLAGS) -I\c $*.c
X
X# To produce a `.obj' file from a `.for' file using Microsoft Fortran.
X.for.obj:
X	for1 $*.for;
X	pas2
X
X# To produce a `.exe' file from an `.obj' file.  Note that there is a
X# problem because LIBS may be different for linking `.obj' files
X# produced by different compilers (C, FORTRAN, PASCAL, etc).  To avoid
X# this problem you may want to have the C compiler produce `.cbj' files,
X# the FORTRAN compiler produce `.fbj' files, etc.  Then you could write
X# specific rules for `.cbj.exe' and `.fbj.exe' which would use the correct
X# libraries.
X.obj.exe:
X	link $*.obj $(SETARGV), $@,, $(LIBS) $(LFLAGS);
X
X# To produce a `.exe' file from a `.asm' file.
X.asm.exe:
X	masm $*.asm;
X	link $*.obj, $@,, $(LIBS)
X	erase $*.obj
X
X# To produce a `.exe' file from a `.c' file.
X.c.exe:
X	msc $(CFLAGS) -I\c $*.c
X	link $*.obj $(SETARGV), $@,, $(LIBS) $(LFLAGS)
X	erase $*.obj
X
X# To produce a `.exe' file from a `.for' file.
X.for.exe:
X	for1 $*.for;
X	pas2
X	link $*.obj, $@,, $(LIB)\FORTRAN.LIB
X	erase $*.obj
END_OF_Make.ini
if test 1759 -ne `wc -c <Make.ini`; then
    echo shar: \"Make.ini\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Maketcc.ini -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Maketcc.ini\"
else
echo shar: Extracting \"Maketcc.ini\" \(1759 characters\)
sed "s/^X//" >Maketcc.ini <<'END_OF_Maketcc.ini'
X#	SCCS Id: @(#)Maketcc.ini	1.4	87/08/08
X# This is a sample `make.ini' file for NDMAKE v3.7.  You will probably want
X# to customize it for your system.
X
X
X
X# The order to search for rules and files is specified by .SUFFIXES
X#.SUFFIXES : .exe .obj .c .for .asm
X
X# A few macros.
XCFLAGS = -m$(MODEL)
XMODEL = h
XLIBS = c:\c\lib\emu.lib c:\c\lib\math$(MODEL).lib c:\c\lib\c$(MODEL).lib
XBIN =
XLFLAGS =
X
X# A universally useful target.
X#clean:
X#	+-erase *.bak
X#	+-erase *.map
X
X# .BEFORE and .AFTER can be used to turn DPATH off and on.
X#.BEFORE:; @+echo For help with ndmake, use the command `make -h'
X#.AFTER:; @+echo All done.
X
X
X# DEFAULT RULES
X# To produce a `.obj' file from a `.asm' file using MASM.
X.asm.obj:
X	masm $*.asm;
X
X# To produce a `.obj' file from a `.c' file using Microsoft C. 
X.c.obj:
X	tcc -c $(CFLAGS) $*.c
X
X# To produce a `.obj' file from a `.for' file using Microsoft Fortran.
X.for.obj:
X	for1 $*.for;
X	pas2
X
X# To produce a `.exe' file from an `.obj' file.  Note that there is a
X# problem because LIBS may be different for linking `.obj' files
X# produced by different compilers (C, FORTRAN, PASCAL, etc).  To avoid
X# this problem you may want to have the C compiler produce `.cbj' files,
X# the FORTRAN compiler produce `.fbj' files, etc.  Then you could write
X# specific rules for `.cbj.exe' and `.fbj.exe' which would use the correct
X# libraries.
X.obj.exe:
X	tlink c:\c\lib\c0$(MODEL).obj $*.obj,$@,,$(LIBS) $(LFLAGS);
X
X# To produce a `.exe' file from a `.asm' file.
X.asm.exe:
X	masm $*.asm;
X	tlink $*.obj, $@,, $(LIBS)
X	erase $*.obj
X
X# To produce a `.exe' file from a `.c' file.
X.c.exe:
X	tcc $(CFLAGS) $*.c
X	erase $*.obj
X
X# To produce a `.exe' file from a `.for' file.
X.for.exe:
X	for1 $*.for;
X	pas2
X	link $*.obj, $@,, $(LIB)\FORTRAN.LIB
X	erase $*.obj
END_OF_Maketcc.ini
if test 1759 -ne `wc -c <Maketcc.ini`; then
    echo shar: \"Maketcc.ini\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f eshk.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"eshk.h\"
else
echo shar: Extracting \"eshk.h\" \(742 characters\)
sed "s/^X//" >eshk.h <<'END_OF_eshk.h'
X/*	SCCS Id: @(#)eshk.h	2.1	87/09/28
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X
X#define	BILLSZ	200
X
Xstruct bill_x {
X	unsigned bo_id;
X	unsigned price;		/* price per unit */
X	Bitfield(useup,1);
X	Bitfield(bquan,7);
X};
X
Xstruct eshk {
X	long int robbed;	/* amount stolen by most recent customer */
X	boolean following;	/* following customer since he owes us sth */
X	schar shoproom;		/* index in rooms; set by inshop() */
X	coord shk;		/* usual position shopkeeper */
X	coord shd;		/* position shop door */
X	int shoplevel;		/* level of his shop */
X	int billct;
X	struct bill_x bill[BILLSZ];
X	int visitct;		/* nr of visits by most recent customer */
X	char customer[PL_NSIZ];	/* most recent customer */
X	char shknam[PL_NSIZ];
X};
END_OF_eshk.h
if test 742 -ne `wc -c <eshk.h`; then
    echo shar: \"eshk.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f extern.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"extern.h\"
else
echo shar: Extracting \"extern.h\" \(1342 characters\)
sed "s/^X//" >extern.h <<'END_OF_extern.h'
X/*	SCCS Id: @(#)extern.h	2.1	87/10/19
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X
X#include "config.h"
X
X#ifndef MSDOS
Xextern char *sprintf();
X#endif
X
Xextern long *alloc();
X
Xextern xchar xdnstair, ydnstair, xupstair, yupstair; /* stairs up and down. */
X
Xextern xchar dlevel;
X
X#ifdef SPELLS
X#include "spell.h"
Xextern	struct spell spl_book[];
X#endif
X
Xextern int occtime;
Xextern char *occtxt;		/* defined when occupation != NULL */
X
X#ifdef REDO
Xextern int in_doagain;
X#endif
X
Xextern char *HI, *HE;		/* set up in termcap.c */
X#ifdef MSDOSCOLOR
Xextern char *HI_MON, *HI_OBJ;	/* set up in termcap.c */
X#endif
X
X#include "obj.h"
Xextern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg, 
X	*uleft, *uright, *fcobj;
Xextern struct obj *uchain;	/* defined iff PUNISHED */
Xextern struct obj *uball;	/* defined if PUNISHED */
Xstruct obj *o_at(), *getobj(), *sobj_at();
X
Xextern char *traps[];
Xextern char *monnam(), *Monnam(), *amonnam(), *Amonnam(),
X	*doname(), *aobjnam();
Xextern char readchar();
Xextern char vowels[];
X
X#include "you.h"
X
Xextern struct you u;
X
Xextern xchar curx,cury;	/* cursor location on screen */
X
Xextern xchar seehx,seelx,seehy,seely; /* where to see*/
Xextern char *save_cm,*killer;
X
Xextern xchar dlevel, maxdlevel; /* dungeon level */
X
Xextern long moves;
X
Xextern int multi;
X
Xextern char lock[];
END_OF_extern.h
if test 1342 -ne `wc -c <extern.h`; then
    echo shar: \"extern.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f func_tab.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"func_tab.h\"
else
echo shar: Extracting \"func_tab.h\" \(360 characters\)
sed "s/^X//" >func_tab.h <<'END_OF_func_tab.h'
X/*	SCCS Id: @(#)func_tab.h	1.4	87/08/08
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* func_tab.h - version 1.0.2 */
X
Xstruct func_tab {
X	char f_char;
X	int (*f_funct)();
X	char *f_text;
X};
X
Xextern struct func_tab cmdlist[];
X
Xstruct ext_func_tab {
X	char *ef_txt, *ef_desc;
X	int (*ef_funct)();
X};
X
Xextern struct ext_func_tab extcmdlist[];
END_OF_func_tab.h
if test 360 -ne `wc -c <func_tab.h`; then
    echo shar: \"func_tab.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f hack.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"hack.h\"
else
echo shar: Extracting \"hack.h\" \(1654 characters\)
sed "s/^X//" >hack.h <<'END_OF_hack.h'
X/*	SCCS Id: @(#)hack.h	2.1	87/10/18
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X
X#ifndef HACK_H
X#define HACK_H
X
X#include "extern.h"
X
X#ifdef __TURBOC__
X/* work around the case-insensitivity of the DOS linker */
X#define Amonnam Amonnam_
X#define Xmonnam Xmonnam_
X#define Monnam Monnam_
X#define POISONOUS POISONOUS_
X#define Doname Doname_
X#define Tmp_at Tmp_at_
X/* rename the next two functions because they clash with the Turbo C library */
X#define getdate getdate_
X#define itoa itoa_
X#endif
X
X
X#define	Null(type)	((struct type *) 0)
X
X#include	"objclass.h"
X
Xtypedef struct {
X	xchar x,y;
X} coord;
X
Xextern coord bhitpos;	/* place where thrown weapon falls to the ground */
X
X#include	"monst.h"	/* uses coord */
X#include	"gold.h"
X#include	"trap.h"
X#include	"flag.h"
X
X#define	plur(x)	(((x) == 1) ? "" : "s")
X#define min(x,y) ((x) < (y) ? (x) : (y))
X
X#define	BUFSZ	256	/* for getlin buffers */
X#define	PL_NSIZ	32	/* name of player, ghost, shopkeeper */
X
X#include	"rm.h"
X
X#define Inhell		(dlevel >= 30)
X#define	newstring(x)	(char *) alloc((unsigned)(x))
X
X#ifdef SPELLS
X#define	NO_SPELL	0
X#endif
X
X#define	TELL	1
X#define NOTELL	0
X
X#define ON 1
X#define OFF 0
X
X#ifdef GENIX
X#define DIST	jhndist
X/*	genix compiler chokes on DIST macro below - jhn*/
X#else
X#define DIST(x1,y1,x2,y2)       (((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2)))
X#endif
X
X#define	PL_CSIZ		20	/* sizeof pl_character */
X#ifdef HARD
X#define	MAX_CARR_CAP	120	/* so that boulders can be heavier */
X#else
X#define	MAX_CARR_CAP	500
X#endif
X#ifdef RPH
X#define	MAXLEVEL	60
X#else
X#define	MAXLEVEL	40
X#endif
X#define	FAR	(COLNO+2)	/* position outside screen */
X
X#endif /* HACK_H /**/
END_OF_hack.h
if test 1654 -ne `wc -c <hack.h`; then
    echo shar: \"hack.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f hh -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"hh\"
else
echo shar: Extracting \"hh\" \(2141 characters\)
sed "s/^X//" >hh <<'END_OF_hh'
Xy k u	Move commands:
X \|/		hykulnjb: single move in specified direction
Xh-+-l		HYKULNJB: repeated move in specified direction
X /|\			  (until stopped by e.g. a wall)
Xb j n		g<dir>:   fast movement in direction <dir>
X			  (until something interesting is seen)
X		m<dir>:   move without picking up objects
X
XMeta commands:
XQ	quit	leave the game
XS	save	save the game (to be continued later)
X!	sh	escape to some SHELL
X^Z	suspend suspend the game (independent of your current suspend char)
XO	set	set options
X?	help	print information
X/	whatis	give name (and sometimes more info) of specified monster
X\	known	print list of what's been discovered
Xv	version	print version number
XV	history	print game history.
X^R	redraw	redraw the screen (^R denotes the symbol CTRL/R)
X^P	print	repeat last message  (subsequent ^P's repeat earlier messages)
X#		introduces a long command (# ? for list of long commands)
X
XGame commands:
X^T	teleport teleport
Xa	apply, use  use something (a key, camera, etc.)
Xc	call	give a name to a class of objects
Xd	drop	drop an object. d7a: drop seven items of object a.
Xe	eat	eat something
Xi	invent	list the inventory (all objects you are carrying)
XI	invent	list selected parts of the inventory
X		IU: list unpaid objects
X		IX: list unpaid but used up items
X		I$: count your money
Xp	pay	pay your bill
Xq	drink	quaff a potion
Xr	read	read a scroll
Xs	search	search for secret doors, hidden traps and monsters
Xt	throw	throw or shoot a weapon
Xw	wield	wield a weapon	(w-  wield nothing)
Xx	spells	print a list of know spells
XX	Xcribe	transcribe (learn) a spell
Xz	zap	zap a wand
XX	cast	cast a spell
XC	name	name an individual monster (e.g., baptize your dog)
XD	Drop	drop several things
XE	Engrave write a message in the dust on the floor  (E-  use fingers)
XP	wear	put on a ring
XR	remove	remove a ring
XW	wear	put on some armor
XT	remove	take off some armor
XA	remove	take off some or all armor
X<	up	go up the stairs
X>	down	go down the stairs
X^	trap_id identify a previously found trap
X),[,=		ask for current weapon, armor, rings, respectively
X$	gold	count your gold
X.	rest	wait a moment
X,	pickup	pick up all you can carry
X:	look	look at what is here
END_OF_hh
if test 2141 -ne `wc -c <hh`; then
    echo shar: \"hh\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f ioctl.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"ioctl.c\"
else
echo shar: Extracting \"ioctl.c\" \(1399 characters\)
sed "s/^X//" >ioctl.c <<'END_OF_ioctl.c'
X/*	SCCS Id: @(#)ioctl.c	2.0	87/09/18
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X
X/* This cannot be part of hack.tty.c (as it was earlier) since on some
X   systems (e.g. MUNIX) the include files <termio.h> and <sgtty.h>
X   define the same constants, and the C preprocessor complains. */
X#include <stdio.h>
X#include "config.h"
X#ifdef BSD
X#include	<sgtty.h>
Xstruct ltchars ltchars, ltchars0;
X#else
X#include	<termio.h>	/* also includes part of <sgtty.h> */
Xstruct termio termio;
X#endif
X
Xgetioctls() {
X#ifdef BSD
X	(void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) &ltchars);
X	(void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) &ltchars0);
X#else
X	(void) ioctl(fileno(stdin), (int) TCGETA, &termio);
X#endif
X}
X
Xsetioctls() {
X#ifdef BSD
X	(void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) &ltchars);
X#else
X	/* Now modified to run under Sys V R3.	- may have to be #ifdef'ed */
X	(void) ioctl(fileno(stdin), (int) TCSETAW, &termio);
X#endif
X}
X
X#ifdef SUSPEND		/* implies BSD */
Xdosuspend() {
X#include	<signal.h>
X#ifdef SIGTSTP
X	if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
X		settty((char *) 0);
X		(void) signal(SIGTSTP, SIG_DFL);
X		(void) kill(0, SIGTSTP);
X		gettty();
X		setftty();
X		docrt();
X	} else {
X		pline("I don't think your shell has job control.");
X	}
X#else SIGTSTP
X	pline("Sorry, it seems we have no SIGTSTP here. Try ! or S.");
X#endif
X	return(0);
X}
X#endif /* SUSPEND /**/
END_OF_ioctl.c
if test 1399 -ne `wc -c <ioctl.c`; then
    echo shar: \"ioctl.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f mfndpos.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"mfndpos.h\"
else
echo shar: Extracting \"mfndpos.h\" \(641 characters\)
sed "s/^X//" >mfndpos.h <<'END_OF_mfndpos.h'
X/*	SCCS Id: @(#)mfndpos.h	1.4	87/08/08
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* mfndpos.h - version 1.0.2 */
X 
X/* changed by GAN 02/06/87 to add nine extra bits for traps -
X * this because new traps make nine for traps insufficient
X */
X 
X#define ALLOW_TRAPS     0777777
X#define ALLOW_U         01000000
X#define ALLOW_M         02000000
X#define ALLOW_TM        04000000
X#define ALLOW_ALL       (ALLOW_U | ALLOW_M | ALLOW_TM | ALLOW_TRAPS)
X#define ALLOW_SSM       010000000
X#define ALLOW_ROCK      020000000
X#define NOTONL          040000000
X#define NOGARLIC        0100000000
X#define ALLOW_WALL      0200000000
END_OF_mfndpos.h
if test 641 -ne `wc -c <mfndpos.h`; then
    echo shar: \"mfndpos.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f mkroom.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"mkroom.h\"
else
echo shar: Extracting \"mkroom.h\" \(1536 characters\)
sed "s/^X//" >mkroom.h <<'END_OF_mkroom.h'
X/*	SCCS Id: @(#)mkroom.h	2.1	87/09/23
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X
X/* mkroom.h - types and structures for room and shop initialization */
X
Xstruct mkroom {
X	schar lx,hx,ly,hy;	/* usually xchar, but hx may be -1 */
X	schar rtype,rlit,doorct,fdoor;
X};
X
Xstruct shclass {
X	char	*name;	/* name of the shop type */
X	char	symb;	/* this identifies the shop type */
X    	int	prob;	/* the shop type probability in % */
X	schar	dist;	/* artifact placement type */
X#define D_SCATTER	0	/* normal placement */
X#define D_SHOP		1	/* shop-like placement */
X#define D_TEMPLE	2	/* temple-like placement */
X	struct itp {
X	    int	iprob;	/* probability of an item type */
X	    int itype;	/* item type: if >=0 a class, if < 0 a specific item */
X	} iprobs[3];
X	char **shknms;	/* string list of shopkeeper names for this type */
X};
Xextern struct shclass shtypes[];	/* defined in shknam.c */
X
X#define	MAXNROFROOMS	15
Xextern struct mkroom rooms[MAXNROFROOMS+1];
X
X#define	DOORMAX	100
Xextern coord doors[DOORMAX];
X
X/* values for rtype in the room definition structure */
X#define OROOM		 0	/* ordinary room */
X#define COURT		 2	/* contains a throne */
X#define	SWAMP		 3	/* contains pools */
X#define	VAULT		 4	/* contains piles of gold */
X#define	BEEHIVE		 5	/* contains killer bees and royal jelly */
X#define	MORGUE		 6	/* contains corpses, undead and ghosts */
X#define	ZOO		 7	/* floor covered with treasure and monsters */
X#define	SHOPBASE	 8	/* everything above this is a shop */
X
X#define IS_SHOP(x)	((x).rtype >= SHOPBASE)
END_OF_mkroom.h
if test 1536 -ne `wc -c <mkroom.h`; then
    echo shar: \"mkroom.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f msdos.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"msdos.h\"
else
echo shar: Extracting \"msdos.h\" \(1206 characters\)
sed "s/^X//" >msdos.h <<'END_OF_msdos.h'
X/*	SCCS Id: @(#)msdos.h	1.4	87/08/08
X/* msdos.h - function declarations for msdos.c */
X
Xextern char *alllevels, *allbones;
Xextern char levels[], bones[], permbones[], SAVEF[], hackdir[];
Xextern int ramdisk, count_only;
X
X#define CTRL(ch) (ch & 0x37)
X#define ABORT CTRL('A')
X#define COUNT 0x1
X#define WRITE 0x2
X
X#ifdef LINT_ARGS		/* arg. checking enabled */
X
Xvoid	append_slash(char *);
Xvoid	chdrive(char *);
Xint	check_then_creat(char *, int);
Xvoid	copybones(int);
Xint	dosh();
Xint	dotogglepickup();
Xlong	filesize(char *);
Xvoid	flushout();
Xlong	freediskspace(char *);
Xvoid	gameDiskPrompt();
Xchar *	getlogin();
Xvoid	getreturn(char *);
Xchar *	getenv();
Xint	getuid();
Xchar *	let_to_name(char);
Xvoid	msexit(int);
Xvoid	msmsg(char *, ...);
Xvoid	name_file(char *, int);
Xvoid	pushch(char);
Xvoid	read_config_file();
X#ifdef DGK
Xint	savelev(int, xchar, int);
X#endif
Xint	saveDiskPrompt(int);
Xvoid	set_lock_and_bones();
Xint	tgetch();
X
X#else
X
Xextern long	filesize(), freediskspace();
Xextern char	*getlogin(), *let_to_name();
Xextern void	append_slash(), chdrive(), copybones();
Xextern void	gameDiskPrompt(), getreturn(), msexit(), msmsg(), name_file();
Xextern void	pushch(), read_config_file(), set_lock_and_bones();
X
X#endif
END_OF_msdos.h
if test 1206 -ne `wc -c <msdos.h`; then
    echo shar: \"msdos.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f nethack.cnf -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"nethack.cnf\"
else
echo shar: Extracting \"nethack.cnf\" \(572 characters\)
sed "s/^X//" >nethack.cnf <<'END_OF_nethack.cnf'
XHACKDIR=c:\games\nethack
XSAVE=c:\games\nethack\save
XLEVELS=c:\games\nethack\save
XOPTIONS=male,rawio,IBMBIOS,no rest_on_space,time,packorder:"/!?=)[%(*0
XOPTIONS=silent,endgame:10t/0a
X# The 9 GRAPHICS characters are:
X# vertical wall, horizontal wall, top left corner, top right corner
X# bottom left corner, bottom right corner, door, floor, corridor
X# An example using the IBM graphics character set.
X# from hack.35: GRAPHICS = 186 205 201 187 200 188 206 249 177
X# from hack.36: GRAPHICS = 179 196 218 191 192 217 206 250 176
XGRAPHICS = 186 205 201 187 200 188 206 249 177
END_OF_nethack.cnf
if test 572 -ne `wc -c <nethack.cnf`; then
    echo shar: \"nethack.cnf\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f nethack.sh -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"nethack.sh\"
else
echo shar: Extracting \"nethack.sh\" \(219 characters\)
sed "s/^X//" >nethack.sh <<'END_OF_nethack.sh'
X#!/bin/sh
X#	SCCS Id: @(#)nethack.sh	1.4	87/08/08
XHACKDIR=/usr/games/lib/nethackdir
XHACK=$HACKDIR/nethack
XMAXNROFPLAYERS=4
X
Xcd $HACKDIR
Xcase $1 in
X	-s*)
X		exec $HACK $@
X		;;
X	*)
X		exec $HACK $@ $MAXNROFPLAYERS
X		;;
Xesac
END_OF_nethack.sh
if test 219 -ne `wc -c <nethack.sh`; then
    echo shar: \"nethack.sh\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f netquest.sh -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"netquest.sh\"
else
echo shar: Extracting \"netquest.sh\" \(224 characters\)
sed "s/^X//" >netquest.sh <<'END_OF_netquest.sh'
X#!/bin/sh
X#	SCCS Id: @(#)netquest.sh	1.4	87/08/08
XQUESTDIR=/usr/games/lib/questdir
XQUEST=$HACKDIR/netquest
XMAXNROFPLAYERS=4
X
Xcd $QUESTDIR
Xcase $1 in
X	-s*)
X		exec $QUEST $@
X		;;
X	*)
X		exec $QUEST $@ $MAXNROFPLAYERS
X		;;
Xesac
END_OF_netquest.sh
if test 224 -ne `wc -c <netquest.sh`; then
    echo shar: \"netquest.sh\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f obj.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"obj.h\"
else
echo shar: Extracting \"obj.h\" \(1655 characters\)
sed "s/^X//" >obj.h <<'END_OF_obj.h'
X/*	SCCS Id: @(#)obj.h	1.4	87/08/08
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* obj.h - version 1.0.3 */
X
X#ifndef OBJ_H
X#define OBJ_H
X
Xstruct obj {
X	struct obj *nobj;
X	unsigned o_id;
X	unsigned o_cnt_id;		/* id of container object is in */
X	xchar ox,oy;
X	xchar odx,ody;
X	unsigned otyp;
X#ifdef DGK
X	unsigned int	owt;
X	unsigned int	quan;
X#else
X	uchar owt;
X	uchar quan;		/* use oextra for tmp gold objects */
X#endif
X	schar spe;		/* quality of weapon, armor or ring (+ or -)
X				   number of charges for wand ( >= -1 )
X				   special for uball and amulet %% BAH */
X	char olet;
X	char invlet;
X	Bitfield(oinvis,1);	/* not yet implemented */
X	Bitfield(odispl,1);
X	Bitfield(known,1);	/* exact nature known */
X	Bitfield(dknown,1);	/* color or text known */
X	Bitfield(cursed,1);
X	Bitfield(unpaid,1);	/* on some bill */
X	Bitfield(rustfree,1);
X	Bitfield(no_charge, 1);	/* if shk shouldn't charge for this */
X	Bitfield(onamelth,6);
X	long age;		/* creation date */
X	long owornmask;
X#define	W_ARM	01L
X#define	W_ARM2	02L
X#define	W_ARMH	04L
X#define	W_ARMS	010L
X#define	W_ARMG	020L
X#define	W_ARMOR		(W_ARM | W_ARM2 | W_ARMH | W_ARMS | W_ARMG)
X#define	W_RINGL	010000L	/* make W_RINGL = RING_LEFT (see uprop) */
X#define	W_RINGR	020000L
X#define	W_RING		(W_RINGL | W_RINGR)
X#define	W_WEP	01000L
X#define	W_BALL	02000L
X#define	W_CHAIN	04000L
X	long oextra[1];		/* used for name of ordinary objects - length
X				   is flexible; amount for tmp gold objects */
X};
X
Xextern struct obj *fobj;
X
X#define newobj(xl)	(struct obj *) alloc((unsigned)(xl) + sizeof(struct obj))
X#define	ONAME(otmp)	((char *) otmp->oextra)
X#define	OGOLD(otmp)	(otmp->oextra[0])
X
X#endif
END_OF_obj.h
if test 1655 -ne `wc -c <obj.h`; then
    echo shar: \"obj.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f rip.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"rip.c\"
else
echo shar: Extracting \"rip.c\" \(2051 characters\)
sed "s/^X//" >rip.c <<'END_OF_rip.c'
X/*	SCCS Id: @(#)rip.c	1.4	87/08/08
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* hack.rip.c - version 1.0.2 */
X
X#include <stdio.h>
X#include "hack.h"
X#ifdef GENIX
X#define	void	int	/* jhn - mod to prevent compiler from bombing */
X#endif
X
Xextern char plname[];
X
Xstatic char *rip[] = {
X"                       ----------",
X"                      /          \\",
X"                     /    REST    \\",
X"                    /      IN      \\",
X"                   /     PEACE      \\",
X"                  /                  \\",
X"                  |                  |",
X"                  |                  |",
X"                  |                  |",
X"                  |                  |",
X"                  |                  |",
X"                  |       1001       |",
X"                 *|     *  *  *      | *",
X"        _________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______\n",
X0
X};
X
Xoutrip(){
X	register char **dp = rip;
X	register char *dpx;
X	char buf[BUFSZ];
X	register x,y;
X
X	cls();
X	(void) strcpy(buf, plname);
X	buf[16] = 0;
X	center(6, buf);
X	(void) sprintf(buf, "%ld AU", u.ugold);
X	center(7, buf);
X	(void) sprintf(buf, "killed by%s",
X		!strncmp(killer, "the ", 4) ? "" :
X		!strcmp(killer, "starvation") ? "" :
X		index(vowels, *killer) ? " an" : " a");
X	center(8, buf);
X	(void) strcpy(buf, killer);
X	if(strlen(buf) > 16) {
X	    register int i,i0,i1;
X		i0 = i1 = 0;
X		for(i = 0; i <= 16; i++)
X			if(buf[i] == ' ') i0 = i, i1 = i+1;
X		if(!i0) i0 = i1 = 16;
X		buf[i1 + 16] = 0;
X		center(10, buf+i1);
X		buf[i0] = 0;
X	}
X	center(9, buf);
X	(void) sprintf(buf, "%4d", getyear());
X	center(11, buf);
X	for(y=8; *dp; y++,dp++){
X		x = 0;
X		dpx = *dp;
X		while(dpx[x]) {
X			while(dpx[x] == ' ') x++;
X			curs(x,y);
X			while(dpx[x] && dpx[x] != ' '){
X				extern int done_stopprint;
X				if(done_stopprint)
X					return;
X				curx++;
X				(void) putchar(dpx[x++]);
X			}
X		}
X	}
X	getret();
X}
X
Xcenter(line, text) int line; char *text; {
Xregister char *ip,*op;
X	ip = text;
X	op = &rip[line][28 - ((strlen(text)+1)/2)];
X	while(*ip) *op++ = *ip++;
X}
END_OF_rip.c
if test 2051 -ne `wc -c <rip.c`; then
    echo shar: \"rip.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f rnd.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"rnd.c\"
else
echo shar: Extracting \"rnd.c\" \(811 characters\)
sed "s/^X//" >rnd.c <<'END_OF_rnd.c'
X/*	SCCS Id: @(#)rnd.c	2.0	87/09/15
X */
X#include	"config.h"
X#ifdef UNIX
X#define RND(x)	(random() % (x))
X#else
X/* Good luck: the bottom order bits are cyclic. */
X#define RND(x)	((rand()>>3) % (x))
X#endif
X
Xrn1(x,y)	/* y <= rn1(x,y) < (y+x) */ 
Xregister x,y;
X{
X	return(RND(x)+y);
X}
X
Xrn2(x)		/* 0 <= rn2(x) < x */
Xregister x;
X{
X	return(RND(x));
X}
X
Xrnd(x)		/* 1 <= rnd(x) <= x */
Xregister x;
X{
X	return(RND(x)+1);
X}
X
Xd(n,x)		/* n <= d(n,x) <= (n*x) */
Xregister n,x;
X{
X	register tmp = n;
X
X	while(n--) tmp += RND(x);
X	return(tmp);
X}
X
Xrne(x)          /* by stewr 870807 */
Xregister x;
X{
X        register tmp = 1;
X	while(!rn2(x)) tmp++;
X	return(tmp);
X}
X
Xrnz(x)
Xregister x;
X{
X        register tmp = 1000;
X	tmp += rn2(1000);
X	tmp *= rne(4);
X	if (rn2(2)) { x *= tmp; x /= 1000; }
X	else { x *= 1000; x /= tmp; }
X	return(x);
X}
END_OF_rnd.c
if test 811 -ne `wc -c <rnd.c`; then
    echo shar: \"rnd.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f rumors.mrx -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"rumors.mrx\"
else
echo shar: Extracting \"rumors.mrx\" \(1861 characters\)
sed "s/^X//" >rumors.mrx <<'END_OF_rumors.mrx'
XA Ninja is very stealthy.
XA Ninja knows how to backstab.
XA Ninja knows how to throw things.
XA Ninja knows how to use poison.
XA Priest can get the Gods to listen easily.
XA Priest can go to hell just like the rest of us.
XA Priest and a virgin you might be, but that unicorn won't care.
XA Priestess may be a virgin; then again...
XA Priestess may be a virgin, but who would believe that???
XA Samurai is fast on his feet.
XA Samurai is very good with a katana.
XA Samurai is just a fighter with a bent sword.
XA katana might cut a demon.
XA katana might slice a worm in two.
XDemon-lords are greedy.
XDemon-princes have very bad tempers.
XDemons *HATE* Priests and Priestesses.
XDemons are one thing, Demon-lords, on the other hand...
XGods expect the best from their priesthood.
XGods look down their noses at demi-gods.
XHave you been a demi-god yet?
XHave you ever seen a Demon-prince?
XHELL is a four letter word.
XIf you kill the wizard, you get promoted to demi-god.
XIf you're a Samurai, you must obey the Mikado.
XIf you're a Ninja, don't let the Mikado see you.
XKatanas are very sharp, watch you don't cut yourself.
XMulti-player Hack is a myth.
XNetHack is a fantasy, in fact you're dreaming.
XNetHack is addictive.  Too late, you're already hooked.
XOrcs go around poisoning the spikes in pits!
XSomeone has been spiking the pits.
XThe Gods don't appreciate pesky priesthood.
XThe Gods don't like competition.
XThe wizard gets quite an experience out of death.
XTry calling your katana Moulinette.
XTry calling your katana Snikersnee.
XWatch out for pits with spikes in them!
XWatch out, that piercer might have gotten back up on the ceiling.
XWatch out, the mimic may hide again.
XWatch out, the wizard might come back.
XWhat does a Demon-prince look like, anyway?
XWhat is this demi-god stuff anyway?
XYou might be able to bribe a Demon-lord.
XYou might be able to bribe a Demon-prince.
END_OF_rumors.mrx
if test 1861 -ne `wc -c <rumors.mrx`; then
    echo shar: \"rumors.mrx\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f spell.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"spell.h\"
else
echo shar: Extracting \"spell.h\" \(285 characters\)
sed "s/^X//" >spell.h <<'END_OF_spell.h'
X/*	SCCS Id: @(#)spell.h	2.1	87/10/18
X/* M. Stephenson  07-07-86 */
X
X#ifndef SPELL_H
X#define SPELL_H
X
Xstruct	spell  {
X
X	int	sp_id;			/* spell id */
X	int	sp_lev;			/* power level */
X	int	sp_flags;		/* spfx flags */
X#ifdef HARD
X	int 	sp_uses;		/* uses left to spell */
X#endif
X};
X
X
X#endif
END_OF_spell.h
if test 285 -ne `wc -c <spell.h`; then
    echo shar: \"spell.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f termcap.cnf -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"termcap.cnf\"
else
echo shar: Extracting \"termcap.cnf\" \(862 characters\)
sed "s/^X//" >termcap.cnf <<'END_OF_termcap.cnf'
X#
X# ibm-pc with color monitor: orange foreground, blue background
X#			     highlight is intense red on blue
X#			     underline is intense red on blue
X#
Xibmpc:\
X	:co#80:\
X	:li#24:\
X	:cl=\E[2J:\
X	:bs:\
X	:ho=\E[H:\
X	:cm=\E[%i%2;%2H:\
X	:up=\E[A:\
X	:xd=\E[B:\
X	:nd=\E[C:\
X	:bc=\E[D:\
X	:ce=\E[K:\
X	:ti=\E[0;33;44m:\
X	:te=\E[0;33;44m:\
X	:so=\E[1;31;44m:\
X	:se=\E[0;33;44m:\
X	:us=\E[1;31;44m:\
X	:ue=\E[0;33;44m:\
X	:al=\E[L:\
X	:dl=\E[M:
X#
X# Monochrome IBMPC.
X#	This is a termcap for the NANSI.SYS device driver.
X#	It is the same as the ANSI termcap, except NANSI supports
X#	line insert (al) and delete (dl) while ANSI does not.
X#
Xibmpc-mono:\
X	:co#80:\
X	:li#24:\
X	:cl=\E[2J:\
X	:bs:\
X	:ho=\E[H:\
X	:cm=\E[%i%2;%2H:\
X	:up=\E[A:\
X	:xd=\E[B:\
X	:nd=\E[C:\
X	:bc=\E[D:\
X	:ce=\E[K:\
X	:ti=\E[m:\
X	:te=\E[m:\
X	:so=\E[1m:\
X	:se=\E[m:\
X	:us=\E[1m:\
X	:ue=\E[m:\
X	:al=\E[L:\
X	:dl=\E[M:
END_OF_termcap.cnf
if test 862 -ne `wc -c <termcap.cnf`; then
    echo shar: \"termcap.cnf\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f track.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"track.c\"
else
echo shar: Extracting \"track.c\" \(688 characters\)
sed "s/^X//" >track.c <<'END_OF_track.c'
X/*	SCCS Id: @(#)track.c	1.4	87/08/08
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* track.c - version 1.0.2 */
X
X#include "hack.h"
X
X#define	UTSZ	50
X
Xcoord utrack[UTSZ];
Xint utcnt = 0;
Xint utpnt = 0;
X
Xinitrack(){
X	utcnt = utpnt = 0;
X}
X
X/* add to track */
Xsettrack(){
X	if(utcnt < UTSZ) utcnt++;
X	if(utpnt == UTSZ) utpnt = 0;
X	utrack[utpnt].x = u.ux;
X	utrack[utpnt].y = u.uy;
X	utpnt++;
X}
X
Xcoord *
Xgettrack(x,y) register x,y; {
Xregister int i,cnt,dist;
Xcoord tc;
X	cnt = utcnt;
X	for(i = utpnt-1; cnt--; i--){
X		if(i == -1) i = UTSZ-1;
X		tc = utrack[i];
X		dist = (x-tc.x)*(x-tc.x) + (y-tc.y)*(y-tc.y);
X		if(dist < 3)
X			return(dist ? &(utrack[i]) : 0);
X	}
X	return(0);
X}
END_OF_track.c
if test 688 -ne `wc -c <track.c`; then
    echo shar: \"track.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f worn.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"worn.c\"
else
echo shar: Extracting \"worn.c\" \(1402 characters\)
sed "s/^X//" >worn.c <<'END_OF_worn.c'
X/*	SCCS Id: @(#)worn.c	1.4	87/08/08
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* worn.c - version 1.0.2 */
X
X#include "hack.h"
X
Xstruct worn {
X	long w_mask;
X	struct obj **w_obj;
X} worn[] = {
X	{ W_ARM, &uarm },
X	{ W_ARM2, &uarm2 },
X	{ W_ARMH, &uarmh },
X	{ W_ARMS, &uarms },
X	{ W_ARMG, &uarmg },
X	{ W_RINGL, &uleft },
X	{ W_RINGR, &uright },
X	{ W_WEP, &uwep },
X	{ W_BALL, &uball },
X	{ W_CHAIN, &uchain },
X	{ 0, 0 }
X};
X
Xsetworn(obj, mask)
Xregister struct obj *obj;
Xlong mask;
X{
X	register struct worn *wp;
X	register struct obj *oobj;
X
X	for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) {
X		oobj = *(wp->w_obj);
X		if(oobj && !(oobj->owornmask & wp->w_mask))
X			impossible("Setworn: mask = %ld.", wp->w_mask);
X		if(oobj) oobj->owornmask &= ~wp->w_mask;
X		if(obj && oobj && wp->w_mask == W_ARM){
X			if(uarm2) {
X				impossible("Setworn: uarm2 set?");
X			} else
X				setworn(uarm, W_ARM2);
X		}
X		*(wp->w_obj) = obj;
X		if(obj) obj->owornmask |= wp->w_mask;
X	}
X	if(uarm2 && !uarm) {
X		uarm = uarm2;
X		uarm2 = 0;
X		uarm->owornmask ^= (W_ARM | W_ARM2);
X	}
X}
X
X/* called e.g. when obj is destroyed */
Xsetnotworn(obj) register struct obj *obj; {
X	register struct worn *wp;
X
X	for(wp = worn; wp->w_mask; wp++)
X		if(obj == *(wp->w_obj)) {
X			*(wp->w_obj) = 0;
X			obj->owornmask &= ~wp->w_mask;
X		}
X	if(uarm2 && !uarm) {
X		uarm = uarm2;
X		uarm2 = 0;
X		uarm->owornmask ^= (W_ARM | W_ARM2);
X	}
X}
END_OF_worn.c
if test 1402 -ne `wc -c <worn.c`; then
    echo shar: \"worn.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f wseg.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"wseg.h\"
else
echo shar: Extracting \"wseg.h\" \(311 characters\)
sed "s/^X//" >wseg.h <<'END_OF_wseg.h'
X/*	SCCS Id: @(#)wseg.h	1.4	87/08/08
X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
X/* wseg.h - version 1.0.2 */
X
X#ifndef NOWORM
X/* worm structure */
Xstruct wseg {
X	struct wseg *nseg;
X	xchar wx,wy;
X	Bitfield(wdispl,1);
X};
X
X#define newseg()	(struct wseg *) alloc(sizeof(struct wseg))
X#endif
END_OF_wseg.h
if test 311 -ne `wc -c <wseg.h`; then
    echo shar: \"wseg.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 20 \(of 20\).
cp /dev/null ark20isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 20 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0