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

aeb@mcvax.UUCP (Andries Brouwer) (04/03/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:
# Makefile Original_READ_ME READ_ME help hh rumors hack.6 hack.sh

echo x - Makefile
cat > "Makefile" << '//E*O*F Makefile//'
# Hack or Quest Makefile.

# on some systems the termcap library is in -ltermcap
TERMLIB = -ltermlib


# make hack
GAME = hack
GAMEDIR = /usr/games/lib/hackdir
CFLAGS = -O
HACKCSRC = hack.Decl.c\
	hack.apply.c hack.bones.c hack.c hack.cmd.c hack.do.c\
	hack.do_name.c hack.do_wear.c hack.dog.c hack.eat.c hack.end.c\
	hack.engrave.c hack.fight.c hack.invent.c hack.ioctl.c\
	hack.lev.c hack.main.c hack.makemon.c hack.mhitu.c\
	hack.mklev.c hack.mkmaze.c hack.mkobj.c hack.mkshop.c\
	hack.mon.c hack.monst.c hack.o_init.c hack.objnam.c\
	hack.options.c hack.pager.c hack.potion.c hack.pri.c\
	hack.read.c hack.rip.c hack.rumors.c hack.save.c\
	hack.search.c hack.shk.c hack.shknam.c hack.steal.c\
	hack.termcap.c hack.timeout.c hack.topl.c\
	hack.track.c hack.trap.c hack.tty.c hack.unix.c\
	hack.u_init.c hack.vault.c\
	hack.wield.c hack.wizard.c hack.worm.c hack.worn.c hack.zap.c\
	hack.version.c rnd.c alloc.c

CSOURCES = $(HACKCSRC) makedefs.c

HSOURCES = hack.h hack.mfndpos.h config.h\
	def.edog.h def.eshk.h def.flag.h def.func_tab.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

SOURCES = $(CSOURCES) $(HSOURCES)

AUX = data help hh rumors hack.6 hack.sh

HOBJ = hack.Decl.o hack.apply.o hack.bones.o hack.o hack.cmd.o hack.do.o\
	hack.do_name.o hack.do_wear.o hack.dog.o hack.eat.o hack.end.o\
	hack.engrave.o hack.fight.o hack.invent.o hack.ioctl.o\
	hack.lev.o hack.main.o hack.makemon.o hack.mhitu.o hack.mklev.o\
	hack.mkmaze.o hack.mkobj.o hack.mkshop.o hack.mon.o\
	hack.monst.o hack.o_init.o hack.objnam.o hack.options.o\
	hack.pager.o hack.potion.o hack.pri.o\
	hack.read.o hack.rip.o hack.rumors.o hack.save.o\
	hack.search.o hack.shk.o hack.shknam.o hack.steal.o\
	hack.termcap.o hack.timeout.o hack.topl.o\
	hack.track.o hack.trap.o\
	hack.tty.o hack.unix.o hack.u_init.o hack.vault.o hack.wield.o\
	hack.wizard.o hack.worm.o hack.worn.o hack.zap.o\
	hack.version.o rnd.o alloc.o

$(GAME):	$(HOBJ) Makefile
	@echo "Loading ..."
	@ld -X -o $(GAME) /lib/crt0.o $(HOBJ) $(TERMLIB) -lc

makedefs:	makedefs.c
	cc -o makedefs makedefs.c


hack.onames.h:	makedefs def.objects.h
	makedefs > hack.onames.h

lint:
# lint cannot have -p here because (i) capitals are meaningful:
# [Ww]izard, (ii) identifiers may coincide in the first six places:
# doweararm() versus dowearring().
# _flsbuf comes from <stdio.h>, a bug in the system libraries.
	@echo lint -axbh -DLINT ...
	@lint -axbh -DLINT $(HACKCSRC) | sed '/_flsbuf/d'


diff:
	@- for i in $(SOURCES) $(AUX) ; do \
		echo ; echo diff $D/$$i $$i ; \
		diff $D/$$i $$i ; done

distribution: Makefile
	@- for i in READ_ME $(SOURCES) $(AUX) Makefile date.h hack.onames.h\
		; do \
		cmp -s $$i $D/$$i || \
		( echo cp $$i $D ; cp $$i $D ) ; done
# the distribution directory also contains the empty files
# perm and record, and the informative files Porting and Bugs.


install:
	rm -f $(GAMEDIR)/$(GAME)
	cp $(GAME) $(GAMEDIR)/$(GAME)
	chmod 04511 $(GAMEDIR)/$(GAME)
	rm -f $(GAMEDIR)/bones*


depend:
# For the moment we are lazy and disregard /usr/include files because
# the sources contain them conditionally. Perhaps we should use cpp.
#		( /bin/grep '^#[ 	]*include' $$i | sed -n \
#			-e 's,<\(.*\)>,"/usr/include/\1",' \
#
	for i in ${CSOURCES}; do \
		( /bin/grep '^#[ 	]*include[ 	]*"' $$i | sed -n \
			-e 's/[^"]*"\([^"]*\)".*/\1/' \
			-e H -e '$$g' -e '$$s/\n/ /g' \
			-e '$$s/.*/'$$i': &/' -e '$$s/\.c:/.o:/p' \
			>> makedep); done
	for i in ${HSOURCES}; do \
		( /bin/grep '^#[ 	]*include[ 	]*"' $$i | sed -n \
			-e 's/[^"]*"\([^"]*\)".*/\1/' \
			-e H -e '$$g' -e '$$s/\n/ /g' \
			-e '$$s/.*/'$$i': &\
				touch '$$i/p \
			>> makedep); done
	@echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
	@echo '$$r makedep' >>eddep
	@echo 'w' >>eddep
	@cp Makefile Makefile.bak
	ed - Makefile < eddep
	@rm -f eddep makedep
	@echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
	@echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	@echo '# see make depend above' >> Makefile
	- diff Makefile Makefile.bak
	@rm -f Makefile.bak

# DO NOT DELETE THIS LINE

hack.Decl.o:  hack.h def.mkroom.h
hack.apply.o:  hack.h def.edog.h def.mkroom.h
hack.bones.o:  hack.h
hack.o:  hack.h
hack.cmd.o:  hack.h def.func_tab.h
hack.do.o:  hack.h
hack.do_name.o:  hack.h
hack.do_wear.o:  hack.h
hack.dog.o:  hack.h hack.mfndpos.h def.edog.h def.mkroom.h
hack.eat.o:  hack.h
hack.end.o:  hack.h
hack.engrave.o:  hack.h
hack.fight.o:  hack.h
hack.invent.o:  hack.h def.wseg.h
hack.ioctl.o:  config.h
hack.lev.o:  hack.h def.mkroom.h def.wseg.h
hack.main.o:  hack.h
hack.makemon.o:  hack.h
hack.mhitu.o:  hack.h
hack.mklev.o:  hack.h def.mkroom.h
hack.mkmaze.o:  hack.h def.mkroom.h
hack.mkobj.o:  hack.h
hack.mkshop.o:  hack.h def.mkroom.h def.eshk.h
hack.mon.o:  hack.h hack.mfndpos.h
hack.monst.o:  hack.h def.eshk.h
hack.o_init.o:  config.h def.objects.h hack.onames.h
hack.objnam.o:  hack.h
hack.options.o:  config.h hack.h
hack.pager.o:  hack.h
hack.potion.o:  hack.h
hack.pri.o:  hack.h def.wseg.h
hack.read.o:  hack.h
hack.rip.o:  hack.h
hack.rumors.o:  config.h
hack.save.o:  hack.h
hack.search.o:  hack.h
hack.shk.o:  hack.h hack.mfndpos.h def.mkroom.h def.eshk.h
hack.shknam.o:  hack.h
hack.steal.o:  hack.h
hack.termcap.o:  config.h def.flag.h
hack.timeout.o:  hack.h
hack.topl.o:  hack.h
hack.track.o:  hack.h
hack.trap.o:  hack.h def.mkroom.h
hack.tty.o:  hack.h
hack.unix.o:  hack.h def.mkroom.h
hack.u_init.o:  hack.h
hack.vault.o:  hack.h def.mkroom.h
hack.wield.o:  hack.h
hack.wizard.o:  hack.h
hack.worm.o:  hack.h def.wseg.h
hack.worn.o:  hack.h
hack.zap.o:  hack.h
hack.version.o:  date.h
hack.h:  config.h def.objclass.h def.monst.h def.gold.h def.trap.h def.obj.h def.flag.h def.rm.h def.permonst.h hack.onames.h
			touch hack.h
def.objects.h:  config.h def.objclass.h
			touch def.objects.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
//E*O*F Makefile//

echo x - Original_READ_ME
cat > "Original_READ_ME" << '//E*O*F Original_READ_ME//'
This is export hack, my first semester programming project.

To set it up for your system, you will have to do the following:
	1: create a hack uid, to own the top ten list, etc.
	2: create a hack directory "/usr/lib/game/hack" is the default.
	2.5: make the directory 700 mode.	/* sav files go in there...*/
	3: modify hack.main.c to use the new directory.
	4: modify hack.main.c so it uses the new hack gid.  Gid accounts can
go into magic mode without the password, can get cores with ^G, etc.
(make sure gid isn't checked anywhere else...)
	5: recompile hack.
	6: put it in games after making it set-uid hack.
	8: fix the bugs I undobtedly left in it.
	9: tell me what you think of it.

	Hack uses the UCB file /etc/termcap to get your terminal escape codes.
If you don't use it, you will have to make extensive changes to hack.pri.c

If you find any bugs (That you think I don't know about), or have any
awesome new changes (Like a better save (One that works!)), or have ANY
questions, write me
		Jay Fenlason
		29 East St.
		Sudbury Mass.
			01776

or call me at (617) 443-5036.  Since I have both a modem and a teen-age
sister, Good Luck.


Hack is split (roughly) into several source files that do different things.
I have tried to fit all the procedures having to do with a certain segment
of the game into a single file, but the job is not the best in the world.
The rough splits are:

hack.c		General random stuff and things I never got around to moving.
hack.main.c	main() and other random procedures, also the lock file stuff.
hack.mon.c	Monsters, moving, attacking, etc.
hack.do.c	drink, eat, read, wield, save, etc.
hack.do1.c	zap, wear, remove, etc...
hack.pri.c	stuff having to do with the screen, most of the terminal
		independant stuff is in here.
hack.lev.c	temp files and calling of mklev.

Because of the peculiar restraints on our system, I make mklev (create
a level) a separate procedure execd by hack when needed.  The source for
mklev is (Naturaly) mklev.c.  You may want to put mklev back into hack.
Good luck.

Most of hack was written by me, with help from
		Kenny Woodland (KW)	(general random things including
			the original BUZZ())
		Mike Thome	(MT)	(The original chamelian)
	and	Jon Payne	(JP)	(The original lock file kludge and
			the massive CURS())

This entire program would not have been possible without the SFSU Logo
Workshop.  I am eternally grateful to all of our students (Especially K.L.),
without whom I would never have seen Rogue.  I am especially grateful to
Mike Clancy, without whose generous help I would never have gotten to play
ROGUE.
//E*O*F Original_READ_ME//

echo x - READ_ME
cat > "READ_ME" << '//E*O*F READ_ME//'
Hack is a display oriented dungeons & dragons - like game.
Both display and command structure resemble rogue.
(For a game with the same structure but entirely different display -
a real cave instead of dull rectangles - try Quest)

Hack was originally written by Jay Fenlason (at lincolnsudbury:
 29 East St., Sudbury Mass., 01776) with help from
 Kenny Woodland, Mike Thome and Jon Payne.
Basically it was an implementation of Rogue, however, with 52+ instead of 26
 monster types.
The current version is more than thrice as large (with such new features as
 the dog, the long worms, the shops, etc.) and almost entirely rewritten
 (only the display routines are the original ones - I must rewrite these
 too one day; especially when you are blind strange things still happen).

Files for hack:
	hack		The actual game
	record		Top 100 list (just start with an empty file)
	news		Tells about recent changes in hack, or bugs found ...
			(Just start with no news file.)
	data		Auxiliary file used by hack to give you the names
			and sometimes some more information on the
			objects and monsters.
	help		Introductory information (no doubt outdated).
	hh		Compactified version of help.
	perm		An empty file used for locking purposes.
	rumors		Texts for fortune cookies.
			(Some of these contain information on the game,
			others are just plain stupid. Additional rumors
			are appreciated.)
	hack.sh		A shell script.
			(We have hack.sh in /usr/games/hack and
			hack in /usr/games/lib/hackdir/hack and all the other
			hack stuff in /usr/games/lib/hackdir - perhaps this
			will make the script clear.
			There is no need for you to use it.)
	READ_ME		This file.
	Original_READ_ME Jay Fenlason's READ_ME

System files used:
	/etc/termcap	Used in conjunction with the environment variable
			$TERM.
	/bin/cat
	/usr/ucb/more
	/bin/sh		Used when $SHELL is undefined.

How to install hack:
0. Compile the sources. Perhaps you should first look at the file config.h
   and define BSD if you are on a BSDtype system,
   define STUPID if your C-compiler chokes on complicated expressions.
   Make sure schar and uchar represent signed and unsigned types.
   If your C compiler doesnt allow initialization of bit fields
   change Bitfield. When config.h looks reasonable, say 'make'.
   (Perhaps you have to change TERMLIB in the makefile.)
1. If it didnt exist already, introduce a loginnname `play' .
2. The program  hack  resides in a directory so that it is executable
   for everybody and is suid play:
	---s--s--x  1 play	206848 Apr  3 00:17 hack
   Perhaps you wish to restrict playing to certain hours, or have games
   running under nice; in that case you might write a program play.c
   such that the program play is suid play and executable for everybody
   while all the games in /usr/games are readable or executable for
   play only; all the program play does is asking for the name of a game,
   checking that time-of-day and system load do not forbid playing,
   and then executing the game. Thus:
	-r-sr-sr-x  1 play	 13312 May 24 12:52 play
	---x------  1 play	206848 Apr  3 00:17 hack
   If you are worried about security you might let play do
   chroot("/usr/games") so that no player can get access to the rest
   of the system via shell escapes and the likes.
   If you #define SECURE in config.h then hack will not setuid(getuid())
   before executing a chdir(). Hack will always do setuid(getuid()) with
   a fork. If you do not define UNIX then hack will not fork.
3. The rest of the stuff belonging to hack sits in a subdirectory hackdir
   (on our system /usr/games/lib/hackdir) with modes
	drwx------  3 play	1024 Aug  9 09:03 hackdir
   Here all the temporary files will be created (with names like xlock.17
   or user.5).
4. If you are not really short on file space, creating a subdirectory
   hackdir/save (modes again drwx------) will enable users to save their
   unfinished games.

The program hack is called
$ hack [-d hackdir] [maxnrofplayers]
(for playing) or
$ hack [-d hackdir] -s [listofusers | limit | all]
(for seeing part of the scorelist).
The shell file hack (in this kit called hack.sh) takes care of
calling hack with the right arguments.

Send complaints, bug reports, suggestions for improvements to
mcvax!aeb - in real life Andries Brouwer.
//E*O*F READ_ME//

echo x - help
cat > "help" << '//E*O*F help//'
	Welcome to HACK!		   ( description of version 1.0.2 )

	Hack is a Dungeons and Dragons like game where you (the adventurer)
descend into the depths of the dungeon in search of the Amulet of Yendor
(reputed to be hidden on the twentieth level).  You are accompanied by a
little dog that can help you in many ways and can be trained to do all
sorts of things. On the way you will find useful (or useless) items, (quite
possibly with magic properties) and assorted monsters.  You attack a monster
by trying to move into the space a monster is in (but often it is much
wiser to leave it alone).

	Unlike most adventure games, which give you a verbal description of
your location, hack gives you a visual image of the dungeon level you are on.

	Hack uses the following symbols:
		A to Z and a to z:  monsters.  You can find out what a letter
represents by saying "/ (letter)", as in "/A", which will tell you that 'A'
is a giant ant.
		- and |  These form the walls of a room (or maze).
		.  this is the floor of a room.
		#  this is a corridor.
		>  this is the staircase to the next level.
		<  the staircase to the previous level.
		`  A large boulder.
		@  You (usually).
		^  A trap.
		)  A weapon of some sort.
		(  Some other useful object (key, rope, dynamite, camera, ...)
		[  A suit of armor.
		%  A piece of food (not necessarily healthy ...).
		/  A wand.
		=  A ring.
		?  A scroll.
		!  A magic potion.
		$  A pile or pot of gold.

Commands:
	Hack knows the following commands:
	?	help: print this list.
	Q	Quit the game.
	S	Save the game.
	!	Escape to a shell.
	^Z	Suspend the game.
	<	up: go up the staircase (if you are standing on it).
	>	down: go down (just like up).
	kjhlyubn - go one step in the direction indicated.
		k: north (i.e., to the top of the screen),
		j: south, h: west, l: east, y: ne, u: nw, b: se, n: sw.
	KJHLYUBN - Go in that direction until you hit a wall or run
		into something.
	m	(followed by one of kjhlyubn): move without picking up
		any objects.
	M	(followed by one of KJHLYUBN): Move far, no pickup.
	f	(followed by one of kjhlyubn): move until something
		interesting is found.
	F	(followed by one of KJHLYUBN): as previous, but forking
		of corridors is not considered interesting.
	I	print your inventory.
	i	print selected parts of your inventory, like in
		i* - print all gems in inventory;
		iu - print all unpaid items;
		ix - print all used up items that are on your shopping bill;
		i$ - count your money.
	s	search for secret doors and traps around you.
	^	ask for the type of a trap you found earlier.
	)	ask for current wielded weapon.
	[	ask for current armor.
	=	ask for current rings.
	$	count how many gold pieces you are carrying.
	.	rest, do nothing.
	,	pick up some things.
	:	look at what is here.
	^T	teleport.
	^R	redraw the screen.
	^P	repeat last message
		(subsequent ^P's repeat earlier messages).
	/	(followed by any symbol): tell what this symbol represents.
	e	eat food.
	w	wield weapon. w- means: wield nothing, use bare hands.
	q	drink (quaff) a potion.
	r	read a scroll.
	T	Takeoff armor.
	R	Remove Ring.
	W	Wear armor.
	P	Put on a ring.
	z	zap a wand.
	t	throw an object or shoot an arrow.
	p	pay your shopping bill.
	d	drop something. d7a: drop seven items of object a.
	D	Drop several things.
		In answer to the question "What kinds of things do you
		want to drop? [!%= au]" you should give zero or more
		object symbols possibly followed by 'a' and/or 'u'.
		'a' means: drop all such objects, without asking for
			confirmation.
		'u' means: drop only unpaid objects (when in a shop).
	a	use, apply - Generic command for using a key to lock
		or unlock a door, using a camera, using a rope, etc.
	c	call: name a certain object or class of objects.
	C	Call: Name an individual monster.
	E	Engrave: Write a message in the dust on the floor.
		E- means: use fingers for writing.
	O	Set options. You will be asked to enter an option line.
		If this is empty, the current options are reported.
		Otherwise it should be a list of options separated by commas.
		Possible boolean options are: oneline, time, news, tombstone,
		rest_on_space, beginner.
		They can be negated by prefixing them with '!' or "no".
		A string option is name; it supplies the answer to the question
		"Who are you?"; it may have a suffix.
		A compound option is endgame; it is followed by a description
		of what parts of the list of topscorers should be printed
		when the game is finished.
		Usually one will not want to use the 'o' command, but instead
		put a HACKOPTIONS="...." line in one's environment.
	v	print version number.

	You can put a number before a command to repeat it that many times,
	as in "20s" or "40.".

	At present, some information is displayed on the bottom line.
	(It is expected that this information will go away in future versions.)
	You see on what dungeon level you are, how many hit points you have
	now (and will have when fully recovered), what your armor class is
	(the lower the better), your strength, experience level/experience
	points and the state of your stomach.

	Have Fun, and Good Hacking!



//E*O*F help//

echo x - hh
cat > "hh" << '//E*O*F hh//'
y k u	Move commands:
 \|/		hykulnjb: single move in specified direction
h-+-l		HYKULNJB: repeated move in specified direction
 /|\			(until stopped by e.g. a wall)
b j n		f<dir>: fast movement in direction <dir>
			(until something interesting is seen)
		m<dir>: move without picking up objects

Meta commands:
Q	quit	leave the game
S	save	save the game (to be continued later)
!	sh	escape to some SHELL
^Z	suspend	suspend the game (independent of your current suspend char)
O	set	set options
?	help	print information
/	whatis	give name (and sometimes more info) of specified monster
\	known	print list of what's been discovered
v	version	print version number
^R	redraw	redraw the screen (^R denotes the symbol CTRL/R)
^P	print	repeat last message  (subsequent ^P's repeat earlier messages)

Game commands:
a	apply, use  use something (a key, camera, etc.)
c	call	give a name to a class of objects
d	drop	drop an object. d7a: drop seven items of object a.
e	eat	eat something
I	invent	list the inventory (all objects you are carrying)
i	invent	list selected parts of the inventory
		iu: list unpaid objects
		ix: list unpaid but used up items
		i$: count your money
p	pay	pay your bill
q	drink	quaff a potion
r	read	read a scroll
s	search	search for secret doors, hidden traps and monsters
t	throw	throw or shoot a weapon
w	wield	wield a weapon	(w-  wield nothing)
z	zap	zap a wand
C	name	name an individual monster (e.g., baptize your dog)
D	Drop	drop several things
E	Engrave write a message in the dust on the floor  (E-  use fingers)
P	wear	put on a ring
R	remove	remove a ring
T	remove	take off some armor
W	wear	put on some armor
<	up	go up the stairs
>	down	go down the stairs
^	trap_id	identify a previously found trap
),[,=		ask for current weapon, armor, rings, respectively
$	gold	count your gold
.	rest	wait a moment
,	pickup	pick up all you can carry
:	look	look at what is here
//E*O*F hh//

echo x - rumors
cat > "rumors" << '//E*O*F rumors//'
"Quit" is a four letter word.
A dead lizard is a good thing to turn undead.
A fading corridor enlightens your insight.
A glowing potion is too hot to drink.
A good amulet may protect you against guards.
A homunculus wouldnt want to hurt a wizard.
A long worm hits with all of its length.
A monstrous mind is a toy for ever.
A nurse a day keeps the doctor away.
A ring of adornment protects against Nymphs.
A rumour has it that rumours are just rumours.
A smoky potion surely affects your vision.
A spear might hit a nurse.
A spear will hit an ettin.
A tin of smoked eel is a wonderful find.
A truly wise man never plays leapfrog with a unicorn.
A two-handed sword usually misses.
A unicorn can be tamed only by a fair maiden.
A visit to the Zoo is very educational; you meet interesting animals.
A wand of vibration might bring the whole cave crashing about your ears.
Affairs with Nymphs are often very expensive.
Affraid of Mimics? Try to wear a ring of true seeing.
Afraid of falling piercers? Wear a helmet!
All monsters are created evil, but some are more evil than others.
Always be aware of the phase of the moon!
Amulets are hard to make. Even for a wand of wishing.
An elven cloak is always the height of fashion.
An elven cloak protects against magic.
Any small object that is accidentally dropped will hide under a larger object.
Asking about monsters may be very useful.
Attack long worms from the rear - that is so much safer!
Be careful when eating bananas. Monsters might slip on the peels.
Be careful when eating salmon - your fingers might become greasy.
Be careful when the moon is its its last quarter.
Be careful when throwing a boomerang - you might hit the back of your head.
Better go home and hit your kids. They are just little monsters!
Better go home and play with your kids. They are just little monsters!
Better leave the dungeon, otherwise you might get hurt badly.
Beware of dark rooms - they may be the Morgue.
Beware of death rays!
Beware of falling rocks, wear a helmet!
Beware of hungry dogs!
Beware of the minotaur. He's very horny!
Beware of the potion of Nitroglycerine - it's not for the weak of heart.
Beware of wands of instant disaster.
Beyond the 23-rd level lies a happy retirement in a room of your own.
Blank scrolls make more interesting reading.
Blind? Eat a carrot!
Booksellers never read scrolls; it might carry them to far away.
Booksellers never read scrolls; it might leave their shop unguarded.
Cockatrices might turn themselves to stone faced with a mirror.
Consumption of home-made food is strictly forbidden in this dungeon.
Dead lizards protect against a cockatrice.
Death is just around the next door.
Death is life's way of telling you you've been fired.
Descend in order to meet more decent monsters.
Direct a direct hit on your direct opponent, directing in the right direction.
Do something big today: lift a boulder.
Dogs do not eat when the moon is full.
Dogs never step on cursed items.
Don't bother about money: only Leprechauns and shopkeepers are interested.
Don't create fireballs: they might turn against you.
Don't forget! Large dogs are MUCH harder to kill than little dogs.
Don't tell a soul you found a secret door, otherwise it isn't secret anymore.
Don't throw gems. They are so precious! Besides, you might hit a roommate.
Drinking might affect your health.
Drop your vanity and get rid of your jewels! Pickpockets about!
Dungeon expects every monster to do his duty.
Dust is an armor of poor quality.
Eat 10 cloves of garlic and keep all humans at a two-square distance.
Eat a homunculus if you want to avoid sickness.
Eating unpaid Leprechauns may be advantageous.
Engrave your wishes with a wand of wishing.
Eventually all wands of striking do strike.
Eventually you will come to admire the swift elegance of a retreating nymph.
Ever tried to catch a flying boomerang?
Ever tried to put a Troll into a large box?
Every dog should be a domesticated one.
Every hand has only one finger to put a ring on. You've got only two hands. So?
Everybody should have tasted a scorpion at least once in his life.
Feeding the animals is strictly prohibited. The Management.
Feeling lousy? Why don't you drink a potion of tea?
Fiery letters might deter monsters.
First Law of Hacking: leaving is much more difficult than entering.
For any remedy there is a misery.
Fourth Law of Hacking: you will find the exit at the entrance.
Gems are the droppings of other inmates.
Gems do get a burden.
Genocide on shopkeepers is punishable.
Getting Hungry? Stop wearing rings!
Getting Hungry? Wear an amulet!
Giving head to a long worm is like a long lasting reception.
Good day for overcoming obstacles.  Try a steeplechase.
Gossip is the opiate of the depressed.
Hackers do it with bugs.
Half Moon tonight.  (At least it's better than no Moon at all.)
Have a good meal today: eat a minotaur.
Hey guys, you *WIELD* a dead lizard against a cocatrice! [David London]
Hitting is the lingua franca in these regions.
Hungry dogs are unreliable.
Hungry? There is an abundance of food on the next level.
I doubt whether nurses are virgins.
I once knew a hacker who ate too fast and choked to death.....
I smell a maze of twisty little passages.
I wished, I never wished a wand of wishing. (Wishful thinking)
If a shopkeeper kicks you out of his shop, he'll kick you out of the dungeon.
If you are the shopkeeper you can take things for free.
If you are too cute some monsters might be tempted to embrace you.
If you can't learn to do it well, learn to enjoy doing it badly.
If you need a wand of digging, kindly ask the minotaur.
If you see nurses you better start looking somewhere for a doctor.
If you turn blind: don't expect your dog to be turned into a seeing-eye dog.
If you want to feal great, you must eat something real big.
If you want to float you'd better eat a floating eye.
If you want to hit, use a dagger.
If you want to rob a shop, train your dog.
If you're afraid of trapdoors, just cover the floor with all you've got.
If you're lost, try buying a map next time you're in a shop.
Important mail? Be careful that it isn't stolen!
Improve your environment, using a wand of rearrangement.
In a hurry? Try a ride on a fast moving quasit!
In need of a rest? Quaff a potion of sickness!
Inside a shop you better take a look at the price tags before buying anything.
It is bad manners to use a wand in a shop.
It is not always a good idea to whistle for your dog.
It is said that Giant Rabbits can be tamed with carrots only.
It might be a good idea to offer the unicorn a ruby.
It seems you keep overlooking a sign reading "No trespassing"!
It's all a matter of life and death, so beware of the undead.
It's bad luck, being punished.
It's not safe to Save.
Jackals are intrinsically rotten.
Just below any trapdoor there may be another one. Just keep falling!
Keep a clear mind: quaff clear potions.
Keep your armours away from rust.
Keep your weaponry away from acids.
Kicking the terminal doesn't hurt the monsters.
Kill a unicorn and you kill your luck.
Large dogs make larger turds than little ones.
Latest news? Put 'net.games.hack' in your .newsrc !
Latest news? Put newsgroup 'netUNX.indoor.hackers-scroll' in your .newsrc!
Learn how to spell. Play Hack!
Leprechauns are the most skilled cutpurses in this dungeon.
Leprechauns hide their gold in a secret room.
Let your fingers do the walking on the yulkjhnb keys.
Liquor sellers do not drink; they hate to see you twice.
Looking pale? Quaff a red potion!
M.M.Vault cashiers teleport any amount of gold to the next local branch.
Many monsters make a murdering mob.
Money is the root of all evil.
Money to invest? Take it to the local branch of the Magic Memory Vault!
Monsters come from nowhere to hit you everywhere.
Monsters sleep because you are boring, not because they ever get tired.
Most monsters prefer minced meat. That's why they are hitting you!
Most rumors are just as misleading as this one.
Much ado Nothing Happens.
Murder complaint? Mail to 'netnix!devil!gamble!freak!trap!lastwill!rip'.
Never ask a shopkeeper for a price list.
Never attack a guard.
Never eat with glowing hands!
Never fight a monster: you might get killed.
Never go into the dungeon at midnight.
Never kick a sleeping dog.
Never kiss an animal. It may cause kissing disease.
Never map the labyrinth.
Never mind the monsters hitting you: they just replace the charwomen.
Never ride a long worm.
Never step on a cursed engraving.
Never trust a random generator in magic fields.
Never use a wand of death.
Never use your best weapon to engrave a curse.
Never vomit on a door mat.
No weapon is better than a crysknife.
Not all rumors are as misleading as this one.
Not even a spear will hit a Xorn.
Now what is it that cures digestion?
Nymphs and nurses like beautiful rings.
One has to leave shops before closing time.
One homunculus a day keeps the doctor away.
One level further down somebody is getting killed, right now.
One wand of concentration equals eight scrolls of create monster.
Only Today! A dramatic price-cut on slightly used wands.
Only a wizard can use a magic whistle.
Only adventurers of evil alignment think of killing their dog.
Only chaotic evils kill sleeping monsters.
Only david can find the zoo!
Only real trappers escape traps.
Only real wizards can write scrolls.
Only wizards are able to zap a wand.
Opening a tin is difficult, especially when you are not so strong!
Opening a tin is difficult, especially when you attempt this bare handed!
Operation coded OVERKILL has started now.
Orcs do not procreate in dark rooms.
PLEASE ignore previous rumour.
Plain nymphs are harmless.
Playing billiards pays when you are in a shop.
Polymorphing your dog probably makes you safer.
Praying will frighten Demons.
Pursue the monsters and you will be had indeed.
Put on a ring of teleportation: it will take you away from onslaught.
Read the manual before entering the cave - You might get killed otherwise.
Reading Herbert will disgust you, but in one case it might be enlightening.
Reading Tolkien might help you.
Reading might change your vision.
Reading might improve your scope.
Relying on a dog might turn you in a dog addict.
Savings do include amnesia.
Scorpions often hide under tripe rations.
Screw up your courage!  You've screwed up everything else.
Scrolls of fire are useful against fog clouds.
Second Law of Hacking: first in, first out.
Shopkeepers accept creditcards, as long as you pay cash.
Shopkeepers often have strange names.
Snakes are often found under worthless objects.
Some monsters can be tamed. I once saw a hacker with a tame Dragon!
Sometimes monsters are more likely to fight each other than attack you.
Speed Kills (The Doors)
Spinach, carrot, and a melon - a meal fit for a nurse!
Stay clear of the level of no return.
Suddenly the dungeon will collapse ...
Take a long worm from the rear, according to its mate it's a lot more fun.
Tame a troll and it will learn you fighting.
Teleportation lessens your orientation.
The Jackal only eats bad food.
The Leprechaun Gold Tru$t is no division of the Magic Memory Vault.
The Leprechauns hide their treasure in a small hidden room.
The air is positively magic in here. Better wear a negative armor.
The best equipment for your work is, of course, the most expensive.
The emptiness of a ghost is too heavy to bear.
The longer the wand the better.
The postman always rings twice.
The secret of wands of Nothing Happens: try again!
The use of dynamite is dangerous.
There are monsters of softening penetration.
There are monsters of striking charity.
There have been people like you in here; their ghosts seek revenge on you.
There is a VIP-lounge on this level. Only first-class travellers admitted.
There is a big treasure hidden in the zoo!
There is a message concealed in each fortune cookie.
There is a trap on this level!
There is more magic in this cave than meets the eye.
There is no business like throw business.
There is no harm in praising a large dog.
There seem to be monsters of touching benevolence.
They say that a dagger hits.
They say that a dog avoids traps.
They say that a dog can be trained to fetch objects.
They say that a dog never steps on a cursed object.
They say that a spear will hit a Dragon.
They say that a spear will hit a Xorn.
They say that a spear will hit a neo-otyugh. (Do YOU know what that is?)
They say that a spear will hit an ettin.
They say that a two-handed sword misses.
They say that a unicorn might bring you luck.
They say that an elven cloak may be worn over your armor.
They say that an elven cloak protects against magic.
They say that cavemen seldom find tins in the dungeon.
They say that dead lizards protect against a cockatrice.
They say that killing a shopkeeper brings bad luck.
They say that monsters never step on a scare monster scroll.
They say that only david can find the zoo!
They say that shopkeepers often have a large amount of money in their purse.
They say that the owner of the dungeon might change it slightly.
They say that the use of dynamite is dangerous.
They say that there is a big treasure hidden in the zoo!
They say that there is a message concealed in each fortune cookie.
They say that there is a trap on this level!
They say that throwing food at a wild dog might tame him.
They say that you can meet old friends in the caves.
They say that you cannot trust scrolls of rumour.
They say that you need a key in order to open locked doors.
Third Law of Hacking: the last blow counts most.
This is the Leprechaun Law: every purse has a price.
Throwing food at a wild dog might tame him.
Tin openers are rare indeed.
Tired of irritating bats? Try a scroll of silence.
To hit or not to hit, that is the question.
Tranquillizers might get you killed.
Travel fast, use some magic speed!
Tripe on its own is revolting,  but with onions it's delicious!
Try hacking in the wee hours: you will have more room.
Unwanted mail? Sell it to the bookshop!
Vampires hate garlic.
Vault guards always make sure you aren't a shopkeeper.
Visitors are requested not to apply genocide to shopkeepers.
WARNING from H.M. Govt:  Quaffing may be dangerous to your health.
Wanna fly? Eat a bat.
Watch your steps on staircases.
Wear armor, going naked seems to offend public decency in here.
What do you think is the use of dead lizards?
What do you think would be the use of a sword called "Orcrist" ?
When a piercer drops in on you, you will be tempted to hit the ceiling!
When in a maze follow the right wall and you will never get lost.
When in a shop, do as shopkeepers do.
When punished, watch your steps on the stairs!
Why would anybody in his sane mind engrave "Elbereth" ?
Wish for a master key and open the Magic Memory Vault!
Wish for a pass-key and pass all obstacles!
Wish for a skeleton-key and open all doors!
Wizards do not sleep.
You are heading for head-stone for sure.
You are just the kind of bad food some monsters like to digest.
You can always wear an elven cloak.
You can eat what your dog can eat.
You can't leave a shop through the back door: there ain't one!
You cannot ride a long worm.
You cannot trust scrolls of rumour.
You feel greedy and want more gold? Why don't you try digging?
You feel like someone is pulling your leg.
You may have a kick from kicking a little dog.
You might choke on your food by eating fortune cookies.
You might cut yourself on a long sword.
You might trick a shopkeeper if you're invisible.
You need a key in order to open locked doors.
You offend Shai-Hulud by sheathing your crysknife without having drawn blood.
You want to regain strength? Two levels ahead is a guesthouse!
You'll need a spear if you want to attack a Dragon.
You've got to know how to put out a yellow light.
Your dog can buy cheaper than you do.
Zapping a wand of Nothing Happens doesn't harm you a bit.
//E*O*F rumors//

echo x - hack.6
cat > "hack.6" << '//E*O*F hack.6//'
.TH HACK 6 "31 March 1985"
.UC 4
.SH NAME
hack \- Exploring The Dungeons of Doom
.SH SYNOPSIS
.B /usr/games/hack
[
.B \-d
.I directory
]
[
.B \-n
]
[
.B \-u
.I playername
]
.br
.B /usr/games/hack
[
.B \-d
.I directory
]
.B \-s
[
.B \-X
]
[
.I playernames
]
.SH DESCRIPTION
.PP
.I Hack
is a display oriented dungeons & dragons - like game.
Both display and command structure resemble rogue.
(For a game with the same structure but entirely different display -
a real cave instead of dull rectangles - try Quest.)
.PP
To get started you really only need to know two commands.  The command
.B ?
will give you a list of the available commands and the command
.B /
will identify the things you see on the screen.
.PP
To win the game (as opposed to merely playing to beat other people high
scores) you must locate the Amulet of Yendor which is somewhere below
the 20th level of the dungeon and get it out.  Nobody has achieved this
yet and if somebody does, he will probably go down in history as a hero
among heros.
.PP
When the game ends, either by your death, when you quit, or if you escape
from the caves,
.I hack
will give you (a fragment of) the list of top scorers.  The scoring
is based on many aspects of your behaviour but a rough estimate is
obtained by taking the amount of gold you've found in the cave plus four
times your (real) experience. Precious stones may be worth a lot of gold
when brought to the exit.
There is a 10% penalty for getting yourself killed.
.PP
The administration of the game is kept in the directory specified with the
.B \-d
option, or, if no such option is given, in the directory specified by
the environment variable HACKDIR, or, if no such variable exists, in
the current directory. This same directory contains several auxiliary
files such as lockfiles and the list of topscorers and a subdirectory
.I save
where games are saved.
The game administrator may however choose to install hack with a fixed
playing ground, usually /usr/games/lib/hackdir.
.PP
The
.B \-n
option suppresses printing of the news.
.PP
The
.B \-u
.I playername
option supplies the answer to the question "Who are you?".
When
.I playername
has as suffix one of
.B \-T \-S \-K \-F \-C \-W
then this supplies the answer to the question "What kind of character ... ?".
.PP
The
.B \-s
option will print out the list of your scores. It may be followed by arguments
.B \-X
where X is one of the letters C, F, K, S, T, W to print the scores of
Cavemen, Fighters, Knights, Speleologists, Tourists or Wizards.
It may also be followed by one or more player names to print the scores of the
players mentioned.
.SH AUTHORS
Jay Fenlason (+ Kenny Woodland, Mike Thome and Jon Payne) wrote the
original hack, very much like rogue (but full of bugs).
.br
Andries Brouwer continuously deformed their sources into the current
version - in fact an entirely different game.
.SH FILES
.DT
.ta \w'data, rumors\ \ \ 'u
hack	The hack program.
.br
data, rumors	Data files used by hack.
.br
help, hh	Help data files.
.br
record	The list of topscorers.
.br
save	A subdirectory containing the saved
.br
	games.
.br
bones_dd	Descriptions of the ghost and
.br
	belongings of a deceased adventurer.
.SH ENVIRONMENT
.DT
.ta \w'HACKPAGER, PAGER\ \ \ 'u
USER or LOGNAME	Your login name.
.br
HOME		Your home directory.
.br
SHELL		Your shell.
.br
TERM		The type of your terminal.
.br
HACKPAGER, PAGER	Pager used instead of default pager.
.br
MAIL	Mailbox file.
.br
MAILREADER	Reader used instead of default
.br
	(probably /bin/mail or /usr/ucb/mail).
.br
HACKDIR	Playground.
.br
HACKOPTIONS	String predefining several hack options
.br
	(see help file).
.br

Several other environment variables are used in debugging (wizard) mode,
like GENOCIDED, INVENT, MAGIC and SHOPTYPE.
.SH BUGS
.PP
Probably infinite.
Mail complaints to mcvax!aeb .
//E*O*F hack.6//

echo x - hack.sh
cat > "hack.sh" << '//E*O*F hack.sh//'
#!/bin/sh
HACKDIR=/usr/games/lib/hackdir
HACK=$HACKDIR/hack
MAXNROFPLAYERS=4

cd $HACKDIR
case $1 in
	-s*)
		exec $HACK $@
		;;
	*)
		exec $HACK $@ $MAXNROFPLAYERS
		;;
esac
//E*O*F hack.sh//

exit 0