[net.sources.games] Hack 1.0.2 - part 1 of 10

aeb@mcvax.UUCP (Andries Brouwer) (04/02/85)

# This is a shell archive.  Remove anything before this line, then
# unpack it by saving it in a file and typing "sh file".  (Files
# unpacked will be owned by you and have default permissions.)
#
# This archive contains:
# config.h date.h def.edog.h def.eshk.h def.flag.h def.func_tab.h
# def.gen.h def.gold.h def.mkroom.h def.monst.h def.obj.h def.objclass.h
# def.objects.h def.permonst.h def.rm.h def.trap.h def.wseg.h
# hack.h hack.mfndpos.h hack.onames.h data

echo x - config.h
cat > "config.h" << '//E*O*F config.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* config.h - version 1.0.2 */

#ifndef CONFIG	/* make sure the compiler doesnt see the typedefs twice */

#define	CONFIG
#define	UNIX		/* delete if no fork(), exec() available */
#define	CHDIR		/* delete if no chdir() available */

/*
 * Some include files are in a different place under SYSV
 * 	BSD		   SYSV
 * <strings.h>		<string.h>
 * <sys/wait.h>		<wait.h>
 * <sys/time.h>		<time.h>
 * <sgtty.h>		<termio.h>
 * Some routines are called differently
 * index		strchr
 * rindex		strrchr
 * Also, the code for suspend and various ioctls is only given for BSD4.2
 * (I do not have access to a SYSV system.)
 */
#define BSD		/* delete this line on System V */

/* #define STUPID */	/* avoid some complicated expressions if
			   your C compiler chokes on them */

#define WIZARD  "aeb"	/* the person allowed to use the -D option */
#define RECORD	"record"/* the file containing the list of topscorers */
#define	NEWS	"news"	/* the file containing the latest hack news */
#define	HELP	"help"	/* the file containing a description of the commands */
#define	SHELP	"hh"	/* abbreviated form of the same */
#define	FMASK	0660	/* file creation mask */

#ifdef UNIX
/*
 * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
 * If defined, it can be overridden by the environment variable PAGER.
 * Hack will use its internal pager if DEF_PAGER is not defined.
 * (This might be preferable for security reasons.)
 * #define DEF_PAGER	".../mydir/mypager"
 */

/*
 * If you define MAIL, then the player will be notified of new mail
 * when it arrives. If you also define DEF_MAILREADER then this will
 * be the default mail reader, and can be overridden by the environment
 * variable MAILREADER; otherwise an internal pager will be used.
 * A stat system call is done on the mailbox every MAILCKFREQ moves.
 */
#define	MAIL
#define	DEF_MAILREADER	"/usr/ucb/mail"		/* or e.g. /bin/mail */
#define	MAILCKFREQ	1


#define SHELL		/* do not delete the '!' command */

#ifdef BSD
#define	SUSPEND		/* let ^Z suspend the game */
#endif BSD
#endif UNIX

#ifdef CHDIR
/*
 * If you define HACKDIR, then this will be the default playground;
 * otherwise it will be the current directory.
 */
#define HACKDIR	"/usr/games/lib/hackdir"

/*
 * Some system administrators are stupid enough to make Hack suid root
 * or suid daemon, where daemon has other powers besides that of reading or
 * writing Hack files. In such cases one should be careful with chdir's
 * since the user might create files in a directory of his choice.
 * Of course SECURE is meaningful only if HACKDIR is defined.
 */
#define SECURE			/* do setuid(getuid()) after chdir() */

/*
 * If it is desirable to limit the number of people that can play Hack
 * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
 * #define MAX_NR_OF_PLAYERS	6
 */
#endif CHDIR

/* size of terminal screen is (at least) (ROWNO+2) by COLNO */
#define	COLNO	80
#define	ROWNO	22

/*
 * small signed integers (8 bits suffice)
 *	typedef	char	schar;
 * will do when you have signed characters; otherwise use
 *	typedef	short int schar;
 */
typedef	char	schar;

/*
 * small unsigned integers (8 bits suffice - but 7 bits do not)
 * - these are usually object types; be careful with inequalities! -
 *	typedef	unsigned char	uchar;
 * will be satisfactory if you have an "unsigned char" type; otherwise use
 *	typedef unsigned short int uchar;
 */
typedef	unsigned char	uchar;

/*
 * small integers in the range 0 - 127, usually coordinates
 * although they are nonnegative they must not be declared unsigned
 * since otherwise comparisons with signed quantities are done incorrectly
 */
typedef schar	xchar;
typedef	xchar	boolean;		/* 0 or 1 */
#define	TRUE	1
#define	FALSE	0

/*
 * Declaration of bitfields in various structs; if your C compiler
 * doesnt handle bitfields well, e.g., if it is unable to initialize
 * structs containing bitfields, then you might use
 *	#define Bitfield(x,n)	uchar x
 * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
 */
#define	Bitfield(x,n)	unsigned x:n

#define	SIZE(x)	(int)(sizeof(x) / sizeof(x[0]))

#endif CONFIG
//E*O*F config.h//

echo x - date.h
cat > "date.h" << '//E*O*F date.h//'

char datestring[] = "Mon Apr  1 1985";
//E*O*F date.h//

echo x - def.edog.h
cat > "def.edog.h" << '//E*O*F def.edog.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.edog.h - version 1.0.2 */

struct edog {
	long hungrytime;	/* at this time dog gets hungry */
	long eattime;		/* dog is eating */
	long droptime;		/* moment dog dropped object */
	unsigned dropdist;		/* dist of drpped obj from @ */
	unsigned apport;		/* amount of training */
	long whistletime;		/* last time he whistled */
};
#define	EDOG(mp)	((struct edog *)(&(mp->mextra[0])))
//E*O*F def.edog.h//

echo x - def.eshk.h
cat > "def.eshk.h" << '//E*O*F def.eshk.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.eshk.h - version 1.0.2 : added 'following' */

#define	BILLSZ	200
struct bill_x {
	unsigned bo_id;
	unsigned useup:1;
	unsigned bquan:7;
	unsigned price;		/* price per unit */
};

struct eshk {
	long int robbed;	/* amount stolen by most recent customer */
	boolean following;	/* following customer since he owes us sth */
	schar shoproom;		/* index in rooms; set by inshop() */
	coord shk;		/* usual position shopkeeper */
	coord shd;		/* position shop door */
	int shoplevel;		/* level of his shop */
	int billct;
	struct bill_x bill[BILLSZ];
	int visitct;		/* nr of visits by most recent customer */
	char customer[PL_NSIZ];	/* most recent customer */
	char shknam[PL_NSIZ];
};
//E*O*F def.eshk.h//

echo x - def.flag.h
cat > "def.flag.h" << '//E*O*F def.flag.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.flag.h - version 1.0.2 */

struct flag {
	unsigned ident;		/* social security number for each monster */
	unsigned toplin:2;	/* a top line (message) has been printed */
				/* 0: top line empty; 2: no --More-- reqd. */
	unsigned cbreak:1;	/* in cbreak mode, rogue format */
	unsigned standout:1;	/* use standout for --More-- */
	unsigned nonull:1;	/* avoid sending nulls to the terminal */
	unsigned time:1;	/* display elapsed 'time' */
	unsigned nonews:1;	/* suppress news printing */
	unsigned notombstone:1;
	unsigned end_top, end_around;	/* describe desired score list */
	unsigned end_own:1;		/* idem (list all own scores) */
	unsigned no_rest_on_space:1;	/* spaces are ignored */
	unsigned beginner:1;
	unsigned move:1;
	unsigned mv:1;
	unsigned run:3;		/* 0: h (etc), 1: H (etc), 2: fh (etc) */
				/* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
	unsigned nopick:1;	/* do not pickup objects */
	unsigned echo:1;	/* 1 to echo characters */
	unsigned botl:1;	/* partially redo status line */
	unsigned botlx:1;	/* print an entirely new bottom line */
	unsigned nscrinh:1;	/* inhibit nscr() in pline(); */
	unsigned made_amulet:1;
	unsigned no_of_wizards:2;/* 0, 1 or 2 (wizard and his shadow) */
				/* reset from 2 to 1, but never to 0 */
	unsigned moonphase:3;
#define	NEW_MOON	0
#define	FULL_MOON	4

};

extern struct flag flags;

//E*O*F def.flag.h//

echo x - def.func_tab.h
cat > "def.func_tab.h" << '//E*O*F def.func_tab.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.func_tab.h - version 1.0.2 */

struct func_tab {
	char f_char;
	int (*f_funct)();
};

extern struct func_tab cmdlist[];

struct ext_func_tab {
	char *ef_txt;
	int (*ef_funct)();
};

extern struct ext_func_tab extcmdlist[];
//E*O*F def.func_tab.h//

echo x - def.gen.h
cat > "def.gen.h" << '//E*O*F def.gen.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.gen.h version 1.0.1: added ONCE flag */

struct gen {
	struct gen *ngen;
	xchar gx,gy;
	unsigned gflag;		/* 037: trap type; 040: SEEN flag */
				/* 0100: ONCE only */
#define	TRAPTYPE	037
#define	SEEN	040
#define	ONCE	0100
};
extern struct gen *fgold, *ftrap;
struct gen *g_at();
#define newgen()	(struct gen *) alloc(sizeof(struct gen))
//E*O*F def.gen.h//

echo x - def.gold.h
cat > "def.gold.h" << '//E*O*F def.gold.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.gold.h - version 1.0.2 */

struct gold {
	struct gold *ngold;
	xchar gx,gy;
	long amount;
};

extern struct gold *fgold;
struct gold *g_at();
#define newgold()	(struct gold *) alloc(sizeof(struct gold))
//E*O*F def.gold.h//

echo x - def.mkroom.h
cat > "def.mkroom.h" << '//E*O*F def.mkroom.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.mkroom.h - version 1.0.2 */

struct mkroom {
	xchar lx,hx,ly,hy;
	schar rtype,rlit,doorct,fdoor;
};

#define	MAXNROFROOMS	15
extern struct mkroom rooms[MAXNROFROOMS+1];

#define	DOORMAX	100
extern coord doors[DOORMAX];

/* values values of rtype */
/* 0: ordinary room; 8-15: various shops */
/* Note: some code assumes that >= 8 means shop, so be careful when adding
   new roomtypes */
#define	SWAMP	3
#define	VAULT	4
#define	BEEHIVE	5
#define	MORGUE	6
#define	ZOO	7
#define	SHOPBASE	8
#define	WANDSHOP	9
#define	GENERAL	15
//E*O*F def.mkroom.h//

echo x - def.monst.h
cat > "def.monst.h" << '//E*O*F def.monst.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.monst.h - version 1.0.2 */

struct monst {
	struct monst *nmon;
	struct permonst *data;
	unsigned m_id;
	xchar mx,my;
	xchar mdx,mdy;		/* if mdispl then pos where last displayed */
#define	MTSZ	4
	coord mtrack[MTSZ];	/* monster track */
	schar mhp,mhpmax;
	char mappearance;	/* nonzero for undetected 'M's and for '1's */
	Bitfield(mimic,1);	/* undetected mimic */
	Bitfield(mdispl,1);	/* mdx,mdy valid */
	Bitfield(minvis,1);	/* invisible */
	Bitfield(cham,1);	/* shape-changer */
	Bitfield(mhide,1);	/* hides beneath objects */
	Bitfield(mundetected,1);	/* not seen in present hiding place */
	Bitfield(mspeed,2);
	Bitfield(msleep,1);
	Bitfield(mfroz,1);
	Bitfield(mconf,1);
	Bitfield(mflee,1);	/* fleeing */
	Bitfield(mfleetim,7);	/* timeout for mflee */
	Bitfield(mcan,1);	/* has been cancelled */
	Bitfield(mtame,1);		/* implies peaceful */
	Bitfield(mpeaceful,1);	/* does not attack unprovoked */
	Bitfield(isshk,1);	/* is shopkeeper */
	Bitfield(isgd,1);	/* is guard */
	Bitfield(mcansee,1);	/* cansee 1, temp.blinded 0, blind 0 */
	Bitfield(mblinded,7);	/* cansee 0, temp.blinded n, blind 0 */
	Bitfield(mtrapped,1);	/* trapped in a pit or bear trap */
	Bitfield(mnamelth,6);	/* length of name (following mxlth) */
#ifndef NOWORM
	Bitfield(wormno,5);	/* at most 31 worms on any level */
#endif NOWORM
	unsigned mtrapseen;	/* bitmap of traps we've been trapped in */
	long mlstmv;	/* prevent two moves at once */
	struct obj *minvent;
	long mgold;
	unsigned mxlth;		/* length of following data */
	/* in order to prevent alignment problems mextra should
	   be (or follow) a long int */
	long mextra[1];		/* monster dependent info */
};

#define newmonst(xl)	(struct monst *) alloc((unsigned)(xl) + sizeof(struct monst))

extern struct monst *fmon;
extern struct monst *fallen_down;
struct monst *m_at();

/* these are in mspeed */
#define MSLOW 1 /* slow monster */
#define MFAST 2 /* speeded monster */

#define	NAME(mtmp)	(((char *) mtmp->mextra) + mtmp->mxlth)
#define	MREGEN		"TVi1"
#define	UNDEAD		"ZVW "
//E*O*F def.monst.h//

echo x - def.obj.h
cat > "def.obj.h" << '//E*O*F def.obj.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.obj.h - version 1.0.2 */

struct obj {
	struct obj *nobj;
	unsigned o_id;
	unsigned o_cnt_id;		/* id of container object is in */
	xchar ox,oy;
	xchar odx,ody;
	uchar otyp;
	uchar owt;
	uchar quan;		/* use oextra for tmp gold objects */
	schar spe;		/* quality of weapon, armor or ring (+ or -)
				   number of charges for wand ( >= -1 )
				   special for uball and amulet %% BAH */
	char olet;
	Bitfield(oinvis,1);	/* not yet implemented */
	Bitfield(odispl,1);
	Bitfield(known,1);	/* exact nature known */
	Bitfield(dknown,1);	/* color or text known */
	Bitfield(cursed,1);
	Bitfield(unpaid,1);	/* on some bill */
	Bitfield(rustfree,1);
	Bitfield(onamelth,6);
	long age;		/* creation date */
	long owornmask;
#define	W_ARM	01L
#define	W_ARM2	02L
#define	W_ARMH	04L
#define	W_ARMS	010L
#define	W_ARMG	020L
#define	W_ARMOR		(W_ARM | W_ARM2 | W_ARMH | W_ARMS | W_ARMG)
#define	W_RINGL	010000L	/* make W_RINGL = RING_LEFT (see uprop) */
#define	W_RINGR	020000L
#define	W_RING		(W_RINGL | W_RINGR)
#define	W_WEP	01000L
#define	W_BALL	02000L
#define	W_CHAIN	04000L
	long oextra[1];		/* used for name of ordinary objects - length
				   is flexible; amount for tmp gold objects */
};

extern struct obj *fobj;

#define newobj(xl)	(struct obj *) alloc((unsigned)(xl) + sizeof(struct obj))
#define	ONAME(otmp)	((char *) otmp->oextra)
#define	OGOLD(otmp)	(otmp->oextra[0])
//E*O*F def.obj.h//

echo x - def.objclass.h
cat > "def.objclass.h" << '//E*O*F def.objclass.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.objclass.h - version 1.0.2 */

/* definition of a class of objects */

struct objclass {
	char *oc_name;		/* actual name */
	char *oc_descr;		/* description when name unknown */
	char *oc_uname;		/* called by user */
	Bitfield(oc_name_known,1);
	Bitfield(oc_merge,1);	/* merge otherwise equal objects */
	char oc_olet;
	schar oc_prob;		/* probability for mkobj() */
	schar oc_delay;		/* delay when using such an object */
	uchar oc_weight;
	schar oc_oc1, oc_oc2;
	int oc_oi;
#define	nutrition	oc_oi	/* for foods */
#define	a_ac		oc_oc1	/* for armors */
#define	a_can		oc_oc2	/* for armors */
#define bits		oc_oc1	/* for wands and rings */
				/* wands */
#define		NODIR		1
#define		IMMEDIATE	2
#define		RAY		4
				/* rings */
#define		SPEC		1	/* +n is meaningful */
#define	wldam		oc_oc1	/* for weapons and PICK_AXE */
#define	wsdam		oc_oc2	/* for weapons and PICK_AXE */
#define	g_val		oc_oi	/* for gems: value on exit */
};

extern struct objclass objects[];

/* definitions of all object-symbols */

#define	ILLOBJ_SYM	'\\'
#define	AMULET_SYM	'"'
#define	FOOD_SYM	'%'
#define	WEAPON_SYM	')'
#define	TOOL_SYM	'('
#define	BALL_SYM	'0'
#define	CHAIN_SYM	'_'
#define	ROCK_SYM	'`'
#define	ARMOR_SYM	'['
#define	POTION_SYM	'!'
#define	SCROLL_SYM	'?'
#define	WAND_SYM	'/'
#define	RING_SYM	'='
#define	GEM_SYM		'*'
/* Other places with explicit knowledge of object symbols:
 * ....shk.c:	char shtypes[] = "=/)%?![";
 * mklev.c:	"=/)%?![<>"
 * hack.mkobj.c:	char mkobjstr[] = "))[[!!!!????%%%%/=**";
 * hack.apply.c:   otmp = getobj("0#%", "put in");
 * hack.eat.c:     otmp = getobj("%", "eat");
 * hack.invent.c:          if(index("!%?[)=*(0/\"", sym)){
 * hack.invent.c:    || index("%?!*",otmp->olet))){
 */
//E*O*F def.objclass.h//

echo x - def.objects.h
cat > "def.objects.h" << '//E*O*F def.objects.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.objects.h - version 1.0.2 */

/* objects have letter " % ) ( 0 _ [ ! ? / = * */
#include "config.h"
#include "def.objclass.h"
#define	NULL	(char *)0

struct objclass objects[] = {

	{ "strange object", NULL, NULL, 1, 0,
		ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 },
	{ "amulet of Yendor", NULL, NULL, 1, 0,
		AMULET_SYM, 100, 0, 2, 0, 0, 0 },

#define	FOOD(name,prob,delay,weight,nutrition)	{ name, NULL, NULL, 1, 1,\
		FOOD_SYM, prob, delay, weight, 0, 0, nutrition }

/* dog eats foods 0-4 but prefers 1 above 0,2,3,4 */
/* food 4 can be read */
/* food 5 improves your vision */
/* food 6 makes you stronger (like Popeye) */
/* foods CORPSE up to CORPSE+52 are cadavers */

	FOOD("food ration", 	50, 5, 4, 800),
	FOOD("tripe ration",	20, 1, 2, 200),
	FOOD("pancake",		3, 1, 1, 200),
	FOOD("dead lizard",	3, 0, 1, 40),
	FOOD("fortune cookie",	7, 0, 1, 40),
	FOOD("carrot",		2, 0, 1, 50),
	FOOD("tin",		7, 0, 1, 0),
	FOOD("orange",		1, 0, 1, 80),
	FOOD("apple",		1, 0, 1, 50),
	FOOD("pear",		1, 0, 1, 50),
	FOOD("melon",		1, 0, 1, 100),
	FOOD("banana",		1, 0, 1, 80),
	FOOD("candy bar",	1, 0, 1, 100),
	FOOD("egg",		1, 0, 1, 80),
	FOOD("clove of garlic",	1, 0, 1, 40),
	FOOD("lump of royal jelly", 0, 0, 1, 200),

	FOOD("dead human",	0, 4, 40, 400),
	FOOD("dead giant ant",	0, 1, 3, 30),
	FOOD("dead giant bat",	0, 1, 3, 30),
	FOOD("dead centaur",	0, 5, 50, 500),
	FOOD("dead dragon",	0, 15, 150, 1500),
	FOOD("dead floating eye",	0, 1, 1, 10),
	FOOD("dead freezing sphere",	0, 1, 1, 10),
	FOOD("dead gnome",	0, 1, 10, 100),
	FOOD("dead hobgoblin",	0, 2, 20, 200),
	FOOD("dead stalker",	0, 4, 40, 400),
	FOOD("dead jackal",	0, 1, 10, 100),
	FOOD("dead kobold",	0, 1, 10, 100),
	FOOD("dead leprechaun",	0, 4, 40, 400),
	FOOD("dead mimic",	0, 4, 40, 400),
	FOOD("dead nymph",	0, 4, 40, 400),
	FOOD("dead orc",	0, 2, 20, 200),
	FOOD("dead purple worm",	0, 7, 70, 700),
	FOOD("dead quasit",	0, 2, 20, 200),
	FOOD("dead rust monster",	0, 5, 50, 500),
	FOOD("dead snake",	0, 1, 10, 100),
	FOOD("dead troll",	0, 4, 40, 400),
	FOOD("dead umber hulk",	0, 5, 50, 500),
	FOOD("dead vampire",	0, 4, 40, 400),
	FOOD("dead wraith",	0, 1, 1, 10),
	FOOD("dead xorn",	0, 7, 70, 700),
	FOOD("dead yeti",	0, 7, 70, 700),
	FOOD("dead zombie",	0, 1, 3, 30),
	FOOD("dead acid blob",	0, 1, 3, 30),
	FOOD("dead giant beetle",	0, 1, 1, 10),
	FOOD("dead cockatrice",	0, 1, 3, 30),
	FOOD("dead dog",	0, 2, 20, 200),
	FOOD("dead ettin",	0, 1, 3, 30),
	FOOD("dead fog cloud",	0, 1, 1, 10),
	FOOD("dead gelatinous cube",	0, 1, 10, 100),
	FOOD("dead homunculus",	0, 2, 20, 200),
	FOOD("dead imp",	0, 1, 1, 10),
	FOOD("dead jaguar",	0, 3, 30, 300),
	FOOD("dead killer bee",	0, 1, 1, 10),
	FOOD("dead leocrotta",	0, 5, 50, 500),
	FOOD("dead minotaur",	0, 7, 70, 700),
	FOOD("dead nurse",	0, 4, 40, 400),
	FOOD("dead owlbear",	0, 7, 70, 700),
	FOOD("dead piercer",	0, 2, 20, 200),
	FOOD("dead quivering blob",	0, 1, 10, 100),
	FOOD("dead giant rat",	0, 1, 3, 30),
	FOOD("dead giant scorpion",	0, 1, 10, 100),
	FOOD("dead tengu",	0, 3, 30, 300),
	FOOD("dead unicorn",	0, 3, 30, 300),
	FOOD("dead violet fungi",	0, 1, 10, 100),
	FOOD("dead long worm",	0, 5, 50, 500),
/* %% wt of long worm should be proportional to its length */
	FOOD("dead xan",	0, 3, 30, 300),
	FOOD("dead yellow light",	0, 1, 1, 10),
	FOOD("dead zruty",	0, 6, 60, 600),

/* weapons ... - ROCK come several at a time */
/* weapons ... - (ROCK-1) are shot using idem+(BOW-ARROW) */
/* weapons AXE, SWORD, THSWORD are good for worm-cutting */
/* weapons (PICK-)AXE, DAGGER, CRYSKNIFE are good for tin-opening */
#define WEAPON(name,prob,wt,ldam,sdam)	{ name, NULL, NULL, 1, 0 /*%%*/,\
		WEAPON_SYM, prob, 0, wt, ldam, sdam, 0 }

	WEAPON("arrow",		7, 0, 6, 6),
	WEAPON("sling bullet",	7, 0, 4, 6),
	WEAPON("crossbow bolt",	7, 0, 4, 6),
	WEAPON("dart",		7, 0, 3, 2),
	WEAPON("rock",		6, 1, 3, 3),
	WEAPON("boomerang",	2, 3, 9, 9),
	WEAPON("mace",		9, 3, 6, 7),
	WEAPON("axe",		6, 3, 6, 4),
	WEAPON("flail",		6, 3, 6, 5),
	WEAPON("long sword",	8, 3, 8, 12),
	WEAPON("two handed sword",	6, 4, 12, 6),
	WEAPON("dagger",	6, 3, 4, 3),
	WEAPON("worm tooth",	0, 4, 2, 2),
	WEAPON("crysknife",	0, 3, 10, 10),
	WEAPON("spear",		6, 3, 6, 8),
	WEAPON("bow",		6, 3, 4, 6),
	WEAPON("sling",		5, 3, 6, 6),
	WEAPON("crossbow",	6, 3, 4, 6),

	{ "whistle", "whistle", NULL, 0, 0,
		TOOL_SYM, 90, 0, 2, 0, 0, 0 },
	{ "magic whistle", "whistle", NULL, 0, 0,
		TOOL_SYM, 10, 0, 2, 0, 0, 0 },
	{ "expensive camera", NULL, NULL, 1, 1,
		TOOL_SYM, 0, 0, 3, 0, 0, 0 },
	{ "ice box", "large box", NULL, 0, 0,
		TOOL_SYM, 0, 0, 40, 0, 0, 0 },
	{ "pick-axe", NULL, NULL, 1, 1,
		TOOL_SYM, 0, 0, 5, 6, 3, 0 },
	{ "can opener", NULL, NULL, 1, 1,
		TOOL_SYM, 0, 0, 1, 0, 0, 0 },
	{ "heavy iron ball", NULL, NULL, 1, 0,
		BALL_SYM, 100, 0, 20, 0, 0, 0 },
	{ "iron chain", NULL, NULL, 1, 0,
		CHAIN_SYM, 100, 0, 20, 0, 0, 0 },
	{ "enormous rock", NULL, NULL, 1, 0,
		ROCK_SYM, 100, 0, 200 /* > MAX_CARR_CAP */, 0, 0, 0 },

#define ARMOR(name,prob,delay,ac,can)	{ name, NULL, NULL, 1, 0,\
		ARMOR_SYM, prob, delay, 8, ac, can, 0 }
	ARMOR("helmet",		 3, 1, 9, 0),
	ARMOR("plate mail",		 5, 5, 3, 2),
	ARMOR("splint mail",	 8, 5, 4, 1),
	ARMOR("banded mail",	10, 5, 4, 0),
	ARMOR("chain mail",		10, 5, 5, 1),
	ARMOR("scale mail",		10, 5, 6, 0),
	ARMOR("ring mail",		15, 5, 7, 0),
	/* the armors below do not rust */
	ARMOR("studded leather armor", 13, 3, 7, 1),
	ARMOR("leather armor",	17, 3, 8, 0),
	ARMOR("elven cloak",	 5, 0, 9, 3),
	ARMOR("shield",		 3, 0, 9, 0),
	ARMOR("pair of gloves",	 1, 1, 9, 0),

#define POTION(name,color)	{ name, color, NULL, 0, 1,\
		POTION_SYM, 0, 0, 2, 0, 0, 0 }

	POTION("restore strength",	"orange"),
	POTION("booze",		"bubbly"),
	POTION("invisibility",	"glowing"),
	POTION("fruit juice",	"smoky"),
	POTION("healing",	"pink"),
	POTION("paralysis",	"puce"),
	POTION("monster detection",	"purple"),
	POTION("object detection",	"yellow"),
	POTION("sickness",	"white"),
	POTION("confusion",	"swirly"),
	POTION("gain strength",	"purple-red"),
	POTION("speed",		"ruby"),
	POTION("blindness",	"dark green"),
	POTION("gain level",	"emerald"),
	POTION("extra healing",	"sky blue"),
	POTION("levitation",	"brown"),
	POTION(NULL,	"brilliant blue"),
	POTION(NULL,	"clear"),
	POTION(NULL,	"magenta"),
	POTION(NULL,	"ebony"),

#define SCROLL(name,text,prob) { name, text, NULL, 0, 1,\
		SCROLL_SYM, prob, 0, 3, 0, 0, 0 }
#ifdef MAIL
	SCROLL("mail",	"KIRJE", 0),
#endif MAIL
	SCROLL("enchant armor", "ZELGO MER", 6),
	SCROLL("destroy armor", "JUYED AWK YACC", 5),
	SCROLL("confuse monster", "NR 9", 5),
	SCROLL("scare monster", "XIXAXA XOXAXA XUXAXA", 4),
	SCROLL("blank paper", "READ ME", 3),
	SCROLL("remove curse", "PRATYAVAYAH", 6),
	SCROLL("enchant weapon", "DAIYEN FOOELS", 6),
	SCROLL("damage weapon", "HACKEM MUCHE", 5),
	SCROLL("create monster", "LEP GEX VEN ZEA", 5),
	SCROLL("taming", "PRIRUTSENIE", 1),
	SCROLL("genocide", "ELBIB YLOH",2),
	SCROLL("light", "VERR YED HORRE", 10),
	SCROLL("teleportation", "VENZAR BORGAVVE", 5),
	SCROLL("gold detection", "THARR", 4),
	SCROLL("food detection", "YUM YUM", 1),
	SCROLL("identify", "KERNOD WEL", 18),
	SCROLL("magic mapping", "ELAM EBOW", 5),
	SCROLL("amnesia", "DUAM XNAHT", 3),
	SCROLL("fire", "ANDOVA BEGARIN", 5),
	SCROLL("punishment", "VE FORBRYDERNE", 1),
	SCROLL(NULL, "VELOX NEB", 0),
	SCROLL(NULL, "FOOBIE BLETCH", 0),
	SCROLL(NULL, "TEMOV", 0),
	SCROLL(NULL, "GARVEN DEH", 0),

#define	WAND(name,metal,prob,flags)	{ name, metal, NULL, 0, 0,\
		WAND_SYM, prob, 0, 3, flags, 0, 0 }

	WAND("light",	"iridium",		10,	NODIR),
	WAND("secret door detection",	"tin",	5,	NODIR),
	WAND("create monster",	"platinum",	5,	NODIR),
	WAND("wishing",		"glass",	1,	NODIR),
	WAND("striking",	"zinc",		9,	IMMEDIATE),
	WAND("slow monster",	"balsa",	5,	IMMEDIATE),
	WAND("speed monster",	"copper",	5,	IMMEDIATE),
	WAND("undead turning",	"silver",	5,	IMMEDIATE),
	WAND("polymorph",	"brass",	5,	IMMEDIATE),
	WAND("cancellation",	"maple",	5,	IMMEDIATE),
	WAND("teleportation",	"pine",		5,	IMMEDIATE),
	WAND("make invisible",	"marble",	9,	IMMEDIATE),
	WAND("digging",		"iron",		5,	RAY),
	WAND("magic missile",	"aluminium",	10,	RAY),
	WAND("fire",	"steel",	5,	RAY),
	WAND("sleep",	"curved",	5,	RAY),
	WAND("cold",	"short",	5,	RAY),
	WAND("death",	"long",		1,	RAY),
	WAND(NULL,	"oak",		0,	0),
	WAND(NULL,	"ebony",	0,	0),
	WAND(NULL,	"runed",	0,	0),

#define	RING(name,stone,spec)	{ name, stone, NULL, 0, 0,\
		RING_SYM, 0, 0, 1, spec, 0, 0 }

	RING("adornment",	"engagement",	0),
	RING("teleportation",	"wooden",	0),
	RING("regeneration",	"black onyx",	0),
	RING("searching",	"topaz",	0),
	RING("see invisible",	"pearl",	0),
	RING("stealth",		"sapphire",	0),
	RING("levitation",	"moonstone",	0),
	RING("poison resistance", "agate",	0),
	RING("aggravate monster", "tiger eye",	0),
	RING("hunger",		"shining",	0),
	RING("fire resistance",	"gold",		0),
	RING("cold resistance",	"copper",	0),
	RING("protection from shape changers", "diamond", 0),
	RING("conflict",	"jade",		0),
	RING("gain strength",	"ruby",		SPEC),
	RING("increase damage",	"silver",	SPEC),
	RING("protection",	"granite",	SPEC),
	RING("warning",		"wire",		0),
	RING("teleport control", "iron",	0),
	RING(NULL,		"ivory",	0),
	RING(NULL,		"blackened",	0),

/* gems ************************************************************/
#define	GEM(name,color,prob,gval)	{ name, color, NULL, 0, 1,\
		GEM_SYM, prob, 0, 1, 0, 0, gval }
	GEM("diamond", "blue", 1, 4000),
	GEM("ruby", "red", 1, 3500),
	GEM("sapphire", "blue", 1, 3000),
	GEM("emerald", "green", 1, 2500),
	GEM("turquoise", "green", 1, 2000),
	GEM("aquamarine", "blue", 1, 1500),
	GEM("tourmaline", "green", 1, 1000),
	GEM("topaz", "yellow", 1, 900),
	GEM("opal", "yellow", 1, 800),
	GEM("garnet", "dark", 1, 700),
	GEM("amethyst", "violet", 2, 650),
	GEM("agate", "green", 2, 600),
	GEM("onyx", "white", 2, 550),
	GEM("jasper", "yellowish brown", 2, 500),
	GEM("jade", "green", 2, 450),
	GEM("worthless piece of blue glass", "blue", 20, 0),
	GEM("worthless piece of red glass", "red", 20, 0),
	GEM("worthless piece of yellow glass", "yellow", 20, 0),
	GEM("worthless piece of green glass", "green", 20, 0),
	{ NULL, NULL, NULL, 0, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 }
};

char obj_symbols[] = {
	ILLOBJ_SYM, AMULET_SYM, FOOD_SYM, WEAPON_SYM, TOOL_SYM,
	BALL_SYM, CHAIN_SYM, ROCK_SYM, ARMOR_SYM, POTION_SYM, SCROLL_SYM,
	WAND_SYM, RING_SYM, GEM_SYM, 0 };
int bases[sizeof(obj_symbols)];
//E*O*F def.objects.h//

echo x - def.permonst.h
cat > "def.permonst.h" << '//E*O*F def.permonst.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.permonst.h - version 1.0.2 */

struct permonst {
	char *mname,mlet;
	schar mlevel,mmove,ac,damn,damd;
	unsigned pxlth;
};

extern struct permonst mons[];
#define PM_ACID_BLOB	&mons[7]
#define	PM_ZOMBIE	&mons[13]
#define	PM_PIERCER	&mons[17]
#define	PM_KILLER_BEE	&mons[26]
#define	PM_WRAITH	&mons[33]
#define	PM_MIMIC	&mons[37]
#define	PM_VAMPIRE	&mons[43]
#define	PM_CHAMELEON	&mons[47]
#define	PM_DEMON	&mons[54]
#define	PM_MINOTAUR	&mons[55]	/* last in mons array */
#define	PM_SHK		&mons[56]	/* very last */
#define	PM_GHOST	&pm_ghost
#define	PM_EEL		&pm_eel
#define	PM_WIZARD	&pm_wizard
#define	CMNUM		55		/* number of common monsters */
//E*O*F def.permonst.h//

echo x - def.rm.h
cat > "def.rm.h" << '//E*O*F def.rm.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.rm.h - version 1.0.2 */

/* Level location types */
#define	HWALL 1
#define	VWALL 2
#define	SDOOR 3
#define	SCORR 4
#define	LDOOR 5
#define	POOL	6	/* not yet fully implemented */
			/* this should in fact be a bit like lit */
#define	DOOR 7
#define	CORR 8
#define	ROOM 9
#define	STAIRS 10

/*
 * Avoid using the level types in inequalities:
 *  these types are subject to change.
 * Instead, use one of the macros below.
 */
#define	IS_WALL(typ)	((typ) <= VWALL)
#define IS_ROCK(typ)	((typ) < POOL)		/* absolutely nonaccessible */
#define	ACCESSIBLE(typ)	((typ) >= DOOR)			/* good position */
#define	IS_ROOM(typ)		((typ) >= ROOM)		/* ROOM or STAIRS */
#define	ZAP_POS(typ)		((typ) > DOOR)

/*
 * A few of the associated symbols are not hardwired.
 */
#ifdef QUEST
#define	CORR_SYM	':'
#else
#define	CORR_SYM	'#'
#endif QUEST
#define	POOL_SYM	'}'

#define	ERRCHAR	'{'

/*
 * The structure describing a coordinate position.
 * Before adding fields, remember that this will significantly affect
 * the size of temporary files and save files.
 */
struct rm {
	char scrsym;
	unsigned typ:5;
	unsigned new:1;
	unsigned seen:1;
	unsigned lit:1;
};
extern struct rm levl[COLNO][ROWNO];
//E*O*F def.rm.h//

echo x - def.trap.h
cat > "def.trap.h" << '//E*O*F def.trap.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.trap.h - version 1.0.2 */

struct trap {
	struct trap *ntrap;
	xchar tx,ty;
	unsigned ttyp:5;
	unsigned tseen:1;
	unsigned once:1;
};

extern struct trap *ftrap;
struct trap *t_at();
#define newtrap()	(struct trap *) alloc(sizeof(struct trap))

/* various kinds of traps */
#define BEAR_TRAP	0
#define	ARROW_TRAP	1
#define	DART_TRAP	2
#define TRAPDOOR	3
#define	TELEP_TRAP	4
#define PIT 		5
#define SLP_GAS_TRAP	6
#define	PIERC		7
#define	MIMIC		8	/* used only in mklev.c */
#define TRAPNUM 	9	/* if not less than 32, change sizeof(ttyp) */
				/* see also mtrapseen (bit map) */
//E*O*F def.trap.h//

echo x - def.wseg.h
cat > "def.wseg.h" << '//E*O*F def.wseg.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* def.wseg.h - version 1.0.2 */

#ifndef NOWORM
/* worm structure */
struct wseg {
	struct wseg *nseg;
	xchar wx,wy;
	unsigned wdispl:1;
};

#define newseg()	(struct wseg *) alloc(sizeof(struct wseg))
#endif NOWORM
//E*O*F def.wseg.h//

echo x - hack.h
cat > "hack.h" << '//E*O*F hack.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.h - version 1.0.2 */

#include "config.h"

#ifdef BSD
#include <strings.h>		/* declarations for strcat etc. */
#else
#include <string.h>		/* idem on System V */
#define	index	strchr
#define	rindex	strrchr
#endif BSD

#define	Null(type)	((struct type *) 0)

#include	"def.objclass.h"

typedef struct {
	xchar x,y;
} coord;

#include	"def.monst.h"	/* uses coord */
#include	"def.gold.h"
#include	"def.trap.h"
#include	"def.obj.h"
#include	"def.flag.h"

extern char *sprintf();
#define	plur(x)	(((x) == 1) ? "" : "s")

#define	BUFSZ	256	/* for getlin buffers */
#define	PL_NSIZ	32	/* name of player, ghost, shopkeeper */

#include	"def.rm.h"
#include	"def.permonst.h"

extern long *alloc();

extern xchar xdnstair, ydnstair, xupstair, yupstair; /* stairs up and down. */

extern xchar dlevel;
#ifdef WIZARD
extern boolean wizard;
#endif WIZARD
#define	newstring(x)	(char *) alloc((unsigned)(x))
#include "hack.onames.h"

#define ON 1
#define OFF 0

extern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg, 
	*uleft, *uright, *fcobj;
extern struct obj *uchain;	/* defined iff PUNISHED */
extern struct obj *uball;	/* defined if PUNISHED */
struct obj *o_at(), *getobj(), *sobj_at();

struct prop {
#define	TIMEOUT		007777	/* mask */
#define	LEFT_RING	W_RINGL	/* 010000L */
#define	RIGHT_RING	W_RINGR	/* 020000L */
#define	INTRINSIC	040000L
#define	LEFT_SIDE	LEFT_RING
#define	RIGHT_SIDE	RIGHT_RING
#define	BOTH_SIDES	(LEFT_SIDE | RIGHT_SIDE)
	long p_flgs;
	int (*p_tofn)();	/* called after timeout */
};

struct you {
	xchar ux, uy;
	schar dx, dy, dz;	/* direction of move (or zap or ... ) */
#ifdef QUEST
	schar di;		/* direction of FF */
	xchar ux0, uy0;		/* initial position FF */
#endif QUEST
	xchar udisx, udisy;	/* last display pos */
	char usym;		/* usually '@' */
	schar uluck;
	int last_str_turn:3;	/* 0: none, 1: half turn, 2: full turn */
				/* +: turn right, -: turn left */
	unsigned udispl:1;	/* @ on display */
	unsigned ulevel:5;
#ifdef QUEST
	unsigned uhorizon:7;
#endif QUEST
	unsigned utrap:3;	/* trap timeout */
	unsigned utraptype:1;	/* defined if utrap nonzero */
#define	TT_BEARTRAP	0
#define	TT_PIT		1
	unsigned uinshop:6;	/* used only in shk.c - (roomno+1) of shop */


/* perhaps these #define's should also be generated by makedefs */
#define	TELEPAT		LAST_RING		/* not a ring */
#define	Telepat		u.uprops[TELEPAT].p_flgs
#define	FAST		(LAST_RING+1)		/* not a ring */
#define	Fast		u.uprops[FAST].p_flgs
#define	CONFUSION	(LAST_RING+2)		/* not a ring */
#define	Confusion	u.uprops[CONFUSION].p_flgs
#define	INVIS		(LAST_RING+3)		/* not a ring */
#define	Invis		u.uprops[INVIS].p_flgs
#define	GLIB		(LAST_RING+4)		/* not a ring */
#define	Glib		u.uprops[GLIB].p_flgs
#define	PUNISHED	(LAST_RING+5)		/* not a ring */
#define	Punished	u.uprops[PUNISHED].p_flgs
#define	SICK		(LAST_RING+6)		/* not a ring */
#define	Sick		u.uprops[SICK].p_flgs
#define	BLIND		(LAST_RING+7)		/* not a ring */
#define	Blind		u.uprops[BLIND].p_flgs
#define	WOUNDED_LEGS	(LAST_RING+8)		/* not a ring */
#define Wounded_legs	u.uprops[WOUNDED_LEGS].p_flgs
#define PROP(x) (x-RIN_ADORNMENT)       /* convert ring to index in uprops */
	unsigned umconf:1;
	char *usick_cause;
	struct prop uprops[LAST_RING+9];

	unsigned uswallow:1;		/* set if swallowed by a monster */
	unsigned uswldtim:4;		/* time you have been swallowed */
	unsigned uhs:3;			/* hunger state - see hack.eat.c */
	schar ustr,ustrmax;
	schar udaminc;
	schar uac;
	int uhp,uhpmax;
	long int ugold,ugold0,uexp,urexp;
	int uhunger;			/* refd only in eat.c and shk.c */
	int uinvault;
	struct monst *ustuck;
	int nr_killed[CMNUM+2];		/* used for experience bookkeeping */
};

extern struct you u;

extern char *traps[];
extern char *monnam(), *Monnam(), *amonnam(), *Amonnam(),
	*doname(), *aobjnam();
extern char readchar();
extern char vowels[];

extern xchar curx,cury;	/* cursor location on screen */

extern coord bhitpos;	/* place where thrown weapon falls to the ground */

extern xchar seehx,seelx,seehy,seely; /* where to see*/
extern char *save_cm,*killer;

extern xchar dlevel, maxdlevel; /* dungeon level */

extern long moves;

extern int multi;


extern char lock[];


#define DIST(x1,y1,x2,y2)       (((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2)))

#define	PL_CSIZ		20	/* sizeof pl_character */
#define	MAX_CARR_CAP	120	/* so that boulders can be heavier */
#define	FAR	(COLNO+2)	/* position outside screen */
//E*O*F hack.h//

echo x - hack.mfndpos.h
cat > "hack.mfndpos.h" << '//E*O*F hack.mfndpos.h//'
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.mfndpos.h - version 1.0.2 */

#define	ALLOW_TRAPS	0777
#define	ALLOW_U		01000
#define	ALLOW_M		02000
#define	ALLOW_TM	04000
#define	ALLOW_ALL	(ALLOW_U | ALLOW_M | ALLOW_TM | ALLOW_TRAPS)
#define	ALLOW_SSM	010000
#define	ALLOW_ROCK	020000
#define	NOTONL		040000
#define	NOGARLIC	0100000
//E*O*F hack.mfndpos.h//

echo x - hack.onames.h
cat > "hack.onames.h" << '//E*O*F hack.onames.h//'
#define	STRANGE_OBJECT	0
#define	AMULET_OF_YENDOR	1
#define	FOOD_RATION	2
#define	TRIPE_RATION	3
#define	PANCAKE	4
#define	DEAD_LIZARD	5
#define	FORTUNE_COOKIE	6
#define	CARROT	7
#define	TIN	8
#define	ORANGE	9
#define	APPLE	10
#define	PEAR	11
#define	MELON	12
#define	BANANA	13
#define	CANDY_BAR	14
#define	EGG	15
#define	CLOVE_OF_GARLIC	16
#define	LUMP_OF_ROYAL_JELLY	17
#define	DEAD_HUMAN	18
#define	DEAD_GIANT_ANT	19
#define	DEAD_GIANT_BAT	20
#define	DEAD_CENTAUR	21
#define	DEAD_DRAGON	22
#define	DEAD_FLOATING_EYE	23
#define	DEAD_FREEZING_SPHERE	24
#define	DEAD_GNOME	25
#define	DEAD_HOBGOBLIN	26
#define	DEAD_STALKER	27
#define	DEAD_JACKAL	28
#define	DEAD_KOBOLD	29
#define	DEAD_LEPRECHAUN	30
#define	DEAD_MIMIC	31
#define	DEAD_NYMPH	32
#define	DEAD_ORC	33
#define	DEAD_PURPLE_WORM	34
#define	DEAD_QUASIT	35
#define	DEAD_RUST_MONSTER	36
#define	DEAD_SNAKE	37
#define	DEAD_TROLL	38
#define	DEAD_UMBER_HULK	39
#define	DEAD_VAMPIRE	40
#define	DEAD_WRAITH	41
#define	DEAD_XORN	42
#define	DEAD_YETI	43
#define	DEAD_ZOMBIE	44
#define	DEAD_ACID_BLOB	45
#define	DEAD_GIANT_BEETLE	46
#define	DEAD_COCKATRICE	47
#define	DEAD_DOG	48
#define	DEAD_ETTIN	49
#define	DEAD_FOG_CLOUD	50
#define	DEAD_GELATINOUS_CUBE	51
#define	DEAD_HOMUNCULUS	52
#define	DEAD_IMP	53
#define	DEAD_JAGUAR	54
#define	DEAD_KILLER_BEE	55
#define	DEAD_LEOCROTTA	56
#define	DEAD_MINOTAUR	57
#define	DEAD_NURSE	58
#define	DEAD_OWLBEAR	59
#define	DEAD_PIERCER	60
#define	DEAD_QUIVERING_BLOB	61
#define	DEAD_GIANT_RAT	62
#define	DEAD_GIANT_SCORPION	63
#define	DEAD_TENGU	64
#define	DEAD_UNICORN	65
#define	DEAD_VIOLET_FUNGI	66
#define	DEAD_LONG_WORM	67
#define	DEAD_XAN	68
#define	DEAD_YELLOW_LIGHT	69
#define	DEAD_ZRUTY	70
#define	ARROW	71
#define	SLING_BULLET	72
#define	CROSSBOW_BOLT	73
#define	DART	74
#define	ROCK	75
#define	BOOMERANG	76
#define	MACE	77
#define	AXE	78
#define	FLAIL	79
#define	LONG_SWORD	80
#define	TWO_HANDED_SWORD	81
#define	DAGGER	82
#define	WORM_TOOTH	83
#define	CRYSKNIFE	84
#define	SPEAR	85
#define	BOW	86
#define	SLING	87
#define	CROSSBOW	88
#define	WHISTLE	89
#define	MAGIC_WHISTLE	90
#define	EXPENSIVE_CAMERA	91
#define	ICE_BOX	92
#define	PICK_AXE	93
#define	CAN_OPENER	94
#define	HEAVY_IRON_BALL	95
#define	IRON_CHAIN	96
#define	ENORMOUS_ROCK	97
#define	HELMET	98
#define	PLATE_MAIL	99
#define	SPLINT_MAIL	100
#define	BANDED_MAIL	101
#define	CHAIN_MAIL	102
#define	SCALE_MAIL	103
#define	RING_MAIL	104
#define	STUDDED_LEATHER_ARMOR	105
#define	LEATHER_ARMOR	106
#define	ELVEN_CLOAK	107
#define	SHIELD	108
#define	PAIR_OF_GLOVES	109
#define	POT_RESTORE_STRENGTH	110
#define	POT_BOOZE	111
#define	POT_INVISIBILITY	112
#define	POT_FRUIT_JUICE	113
#define	POT_HEALING	114
#define	POT_PARALYSIS	115
#define	POT_MONSTER_DETECTION	116
#define	POT_OBJECT_DETECTION	117
#define	POT_SICKNESS	118
#define	POT_CONFUSION	119
#define	POT_GAIN_STRENGTH	120
#define	POT_SPEED	121
#define	POT_BLINDNESS	122
#define	POT_GAIN_LEVEL	123
#define	POT_EXTRA_HEALING	124
#define	POT_LEVITATION	125
#define	SCR_MAIL	130
#define	SCR_ENCHANT_ARMOR	131
#define	SCR_DESTROY_ARMOR	132
#define	SCR_CONFUSE_MONSTER	133
#define	SCR_SCARE_MONSTER	134
#define	SCR_BLANK_PAPER	135
#define	SCR_REMOVE_CURSE	136
#define	SCR_ENCHANT_WEAPON	137
#define	SCR_DAMAGE_WEAPON	138
#define	SCR_CREATE_MONSTER	139
#define	SCR_TAMING	140
#define	SCR_GENOCIDE	141
#define	SCR_LIGHT	142
#define	SCR_TELEPORTATION	143
#define	SCR_GOLD_DETECTION	144
#define	SCR_FOOD_DETECTION	145
#define	SCR_IDENTIFY	146
#define	SCR_MAGIC_MAPPING	147
#define	SCR_AMNESIA	148
#define	SCR_FIRE	149
#define	SCR_PUNISHMENT	150
#define	WAN_LIGHT	155
#define	WAN_SECRET_DOOR_DETECTION	156
#define	WAN_CREATE_MONSTER	157
#define	WAN_WISHING	158
#define	WAN_STRIKING	159
#define	WAN_SLOW_MONSTER	160
#define	WAN_SPEED_MONSTER	161
#define	WAN_UNDEAD_TURNING	162
#define	WAN_POLYMORPH	163
#define	WAN_CANCELLATION	164
#define	WAN_TELEPORTATION	165
#define	WAN_MAKE_INVISIBLE	166
#define	WAN_DIGGING	167
#define	WAN_MAGIC_MISSILE	168
#define	WAN_FIRE	169
#define	WAN_SLEEP	170
#define	WAN_COLD	171
#define	WAN_DEATH	172
#define	Adornment	u.uprops[0].p_flgs
#define	RIN_ADORNMENT	176
#define	Teleportation	u.uprops[1].p_flgs
#define	RIN_TELEPORTATION	177
#define	Regeneration	u.uprops[2].p_flgs
#define	RIN_REGENERATION	178
#define	Searching	u.uprops[3].p_flgs
#define	RIN_SEARCHING	179
#define	See_invisible	u.uprops[4].p_flgs
#define	RIN_SEE_INVISIBLE	180
#define	Stealth	u.uprops[5].p_flgs
#define	RIN_STEALTH	181
#define	Levitation	u.uprops[6].p_flgs
#define	RIN_LEVITATION	182
#define	Poison_resistance	u.uprops[7].p_flgs
#define	RIN_POISON_RESISTANCE	183
#define	Aggravate_monster	u.uprops[8].p_flgs
#define	RIN_AGGRAVATE_MONSTER	184
#define	Hunger	u.uprops[9].p_flgs
#define	RIN_HUNGER	185
#define	Fire_resistance	u.uprops[10].p_flgs
#define	RIN_FIRE_RESISTANCE	186
#define	Cold_resistance	u.uprops[11].p_flgs
#define	RIN_COLD_RESISTANCE	187
#define	Protection_from_shape_changers	u.uprops[12].p_flgs
#define	RIN_PROTECTION_FROM_SHAPE_CHANGERS	188
#define	Conflict	u.uprops[13].p_flgs
#define	RIN_CONFLICT	189
#define	Gain_strength	u.uprops[14].p_flgs
#define	RIN_GAIN_STRENGTH	190
#define	Increase_damage	u.uprops[15].p_flgs
#define	RIN_INCREASE_DAMAGE	191
#define	Protection	u.uprops[16].p_flgs
#define	RIN_PROTECTION	192
#define	Warning	u.uprops[17].p_flgs
#define	RIN_WARNING	193
#define	Teleport_control	u.uprops[18].p_flgs
#define	RIN_TELEPORT_CONTROL	194
#define	DIAMOND	197
#define	RUBY	198
#define	SAPPHIRE	199
#define	EMERALD	200
#define	TURQUOISE	201
#define	AQUAMARINE	202
#define	TOURMALINE	203
#define	TOPAZ	204
#define	OPAL	205
#define	GARNET	206
#define	AMETHYST	207
#define	AGATE	208
#define	ONYX	209
#define	JASPER	210
#define	JADE	211
/* #define WORTHLESS_PIECE_OF_BLUE_GLASS	212 */
/* #define WORTHLESS_PIECE_OF_RED_GLASS	213 */
/* #define WORTHLESS_PIECE_OF_YELLOW_GLASS	214 */
/* #define WORTHLESS_PIECE_OF_GREEN_GLASS	215 */

#define	CORPSE	DEAD_HUMAN
#define	LAST_GEM	(JADE+1)
#define	LAST_RING	19
#define	NROFOBJECTS	215
//E*O*F hack.onames.h//

echo x - data
cat > "data" << '//E*O*F data//'
	Hack & Quest data file - version 1.0.2
@	human (or you)
-	a wall
|	a wall
+	a door
.	the floor of a room
 	a dark part of a room
#	a corridor
}	water filled area
<	the staircase to the previous level
>	the staircase to the next level
^	a trap
$	a pile, pot or chest of gold
%%	a piece of food
!	a potion
*	a gem
?	a scroll
=	a ring
/	a wand
[	a suit of armor
)	a weapon
(	a useful item (camera, key, rope etc.)
0	an iron ball
_	an iron chain
`	an enormous rock
"	an amulet
,	a trapper
:	a chameleon
'	a lurker above
&	a demon
A	a giant ant
B	a giant bat
C	a centaur;
	Of all the monsters put together by  the  Greek  imagination
	the  Centaurs (Kentauroi) constituted a class in themselves.
	Despite a strong streak  of  sensuality  in  their  make-up,
	their  normal  behaviour  was  moral, and they took a kindly
	thought of man's welfare. The attempted outrage of Nessos on
	Deianeira,  and  that  of the whole tribe of Centaurs on the
	Lapith women, are more than offset  by  the  hospitality  of
	Pholos  and  by  the  wisdom of Cheiron, physician, prophet,
	lyrist, and the instructor of Achilles.  Further,  the  Cen-
	taurs  were  peculiar in that their nature, which united the
	body of a horse with the trunk and head of a  man,  involved
	an  unthinkable  duplication  of  vital organs and important
	members. So grotesque a combination seems  almost  un-Greek.
	These  strange  creatures were said to live in the caves and
	clefts of the mountains, myths associating  them  especially
	with the hills of Thessaly and the range of Erymanthos.
	               [Mythology of all races, Vol. 1, pp. 270-271]
D	a dragon;
	In the West the dragon was the natural  enemy  of  man.  Although
	preferring to live in bleak and desolate regions, whenever it was
	seen among men it left in its wake a  trail  of  destruction  and
	disease. Yet any attempt to slay this beast was a perilous under-
	taking. For the dragon's assailant had to contend not  only  with
	clouds  of  sulphurous fumes pouring from its fire-breathing nos-
	trils, but also with the thrashings of its tail, the most  deadly
	part of its serpent-like body.
	[From: Mythical Beasts by Deirdre Headon (The Leprechaun Library)]
E	a floating eye
F	a freezing sphere
G	a gnome;
	... And then a gnome came by, carrying a bundle, an old fellow
	three times as large as an imp and wearing clothes of a sort,
	especially a hat. And he was clearly just as frightened as the
	imps though he could not go so fast. Ramon Alonzo saw that there
	must be some great trouble that was vexing magical things; and,
	since gnomes speak the language of men, and will answer if spoken
	to gently, he raised his hat, and asked of the gnome his name.
	The gnome did not stop his hasty shuffle a moment as he answered
	'Alaraba' and grabbed the rim of his hat but forgot to doff it.
	'What is the trouble, Alaraba?' said Ramon Alonzo.
	'White magic. Run!' said the gnome ...
			[From: The Charwoman's Shadow, by Lord Dunsany.]
H	a hobgoblin;
	Hobgoblin. Used by the  Puritans  and  in  later  times  for
	wicked  goblin  spirits,  as in Bunyan's 'Hobgoblin nor foul
	friend', but its more correct use is for the friendly  spir-
	its  of  the brownie type.  In 'A midsummer night's dream' a
	fairy says to Shakespeare's Puck:
	        Those that Hobgoblin call you, and sweet Puck,
	        You do their work, and they shall have good luck:
	        Are you not he?
	and obviously Puck would not wish to be called  a  hobgoblin
	if that was an ill-omened word.
	Hobgoblins are on the whole, good-humoured and ready  to  be
	helpful,  but fond of practical joking, and like most of the
	fairies rather nasty people to annoy. Boggarts hover on  the
	verge of hobgoblindom.  Bogles are just over the edge.
	One Hob mentioned by Henderson, was Hob Headless who haunted
	the  road  between Hurworth and Neasham, but could not cross
	the little river Kent, which flowed into the  Tess.  He  was
	exorcised  and  laid under a large stone by the roadside for
	ninety-nine years and a day. If anyone was so unwary  as  to
	sit  on  that stone, he would be unable to quit it for ever.
	The ninety-nine years is nearly up, so trouble may  soon  be
	heard of on the road between Hurworth and Neasham.
	               [Katharine Briggs, A  dictionary  of Fairies]
I	an invisible stalker
J	a jackal
K	a kobold
L	a leprechaun;
	The Irish Leprechaun is the Faeries' shoemaker and is  known
	under  various  names  in different parts of Ireland: Cluri-
	caune in Cork, Lurican in Kerry, Lurikeen in Kildare and Lu-
	rigadaun  in  Tipperary.  Although he works for the Faeries,
	the Leprechaun is not of the same species. He is small,  has
	dark  skin  and wears strange clothes.  His nature has some-
	thing of the manic-depressive about it: first  he  is  quite
	happy,  whistling merrily as he nails a sole on to a shoe; a
	few minutes later, he is sullen and  morose,  drunk  on  his
	home-made  heather ale. The Leprechaun's two great loves are
	tobacco and whiskey, and he is a first-rate con-man,  impos-
	sible  to  out-fox.  No  one, no matter how clever, has ever
	managed to cheat him out of his hidden pot of  gold  or  his
	magic  shilling. At the last minute he always thinks of some
	way to divert his captor's attention  and  vanishes  in  the
	twinkling  of  an eye.
	                  [From: A Field Guide to the Little People
	                     by  Nancy Arrowsmith & George Moorse. ]
M	a mimic
N	a nymph
O	an orc
P	a purple worm
Q	a quasit
R	a rust monster
S	a snake
T	a troll
U	an umber hulk
V	a vampire
W	a wraith
X	a xorn
Y	a yeti
Z	a zombie
a	an acid blob
b	a giant beetle
c	a cockatrice;
	Once in a great while, when the positions of the  stars  are
	just  right, a seven-year-old rooster will lay an egg. Then,
	along will come a snake, to coil around the egg, or a  toad,
	to  squat  upon  the  egg, keeping it warm and helping it to
	hatch. When it hatches, out comes a creature  called  basil-
	isk, or cockatrice, the most deadly of all creatures. A sin-
	gle glance from its yellow, piercing toad's eyes  will  kill
	both  man  and beast. Its power of destruction is said to be
	so great that sometimes simply to hear its  hiss  can  prove
	fatal.  Its breath is so venomenous that it causes all vege-
	tation to wither.
	There is, however, one  creature  which  can  withstand  the
	basilisk's deadly gaze, and this is the weasel. No one knows
	why this is so, but although the fierce weasel can slay  the
	basilisk,  it will itself be killed in the struggle. Perhaps
	the weasel knows the basilisk's fatal weakness: if  it  ever
	sees  its own reflection in a mirror it will perish instant-
	ly. But even a dead basilisk is dangerous, for  it  is  said
	that merely touching its lifeless body can cause a person to
	sicken and die.
	    [From: Mythical Beasts by Deirdre Headon (The Leprechaun
	           Library) and other sources. ]
d	a dog
e	an ettin
f	a fog cloud
g	a gelatinous cube
h	a homunculus
i	an imp;
	 ... imps ... little creatures of two feet high  that  could
	gambol and jump prodigiously; ...
			[From: The Charwoman's Shadow, by Lord Dunsany.]

	An 'imp' is an off-shoot or cutting. Thus an 'ymp tree'  was
	a grafted tree, or one grown from a cutting, not from seed.
	'Imp' properly means a small devil, an off-shoot  of  Satan,
	but  the distinction between goblins or bogles and imps from
	hell is hard to make, and many in the  Celtic  countries  as
	well as the English Puritans regarded all fairies as devils.
	The fairies of tradition often hover  uneasily  between  the
	ghostly and the diabolic state.
	                 [Katharine Briggs, A dictionary of Fairies]
j	a jaguar
k	a killer bee
l	a leocrotta
m	a minotaur
n	a nurse
o	an owlbear
p	a piercer
q	a quivering blob
r	a giant rat
s	a scorpion
t	a tengu;
	The tengu was the  most  troublesome  creature  of  Japanese
	legend.   Part  bird  and part man, with red beak for a nose
	and flashing eyes, the tengu was notorious for  stirring  up
	feuds  and  prolonging  enmity between families. Indeed, the
	belligerent tengus were supposed to have  been  man's  first
	instructors in the use of arms.
	                    [From: Mythical Beasts by Deirdre Headon
	                                 (The Leprechaun Library). ]
u	a unicorn;
	Men have always sought the elusive unicorn, for  the  single
	twisted  horn  which projected from its forehead was thought
	to be a powerful talisman. It was said that the unicorn  had
	simply  to  dip  the tip of its horn in a muddy pool for the
	water to become pure. Men also believed that to  drink  from
	this horn was a protection against all sickness, and that if
	the horn was ground to a powder it would act as an  antidote
	to  all poisons. Less than 200 years ago in France, the horn
	of a unicorn was used in a ceremony to test the  royal  food
	for poison.
	Although only the size of a small horse, the  unicorn  is  a
	very  fierce  beast,  capable  of killing an elephant with a
	single thrust from its horn.  Its  fleetness  of  foot  also
	makes  this solitary creature difficult to capture. However,
	it can be tamed and captured by a maiden. Made gentle by the
	sight  of a virgin, the unicorn can be lured to lay its head
	in her lap, and in this docile mood, the maiden  may  secure
	it with a golden rope.
	                    [From: Mythical Beasts by Deirdre Headon
	                                 (The Leprechaun Library). ]
v	a violet fungi
w	a long worm
~	the tail of a long worm
	From its teeth the crysknife can be manufactured.
x	a xan;
	The xan were animals sent to prick the legs of the Lords of Xibalba.
y	a yellow light
z	a zruty;
	The zruty are wild and gigantic beings, living in the wildernesses
	of the Tatra mountains.
1	The wizard of Yendor
2	The mail daemon
//E*O*F data//

exit 0