NetHack 2.3 Update Pt. 01 of 12

Skip to first unread message

Mike Stephenson

Apr 9, 1988, 2:45:41 PM4/9/88
Ok, here it comes. This is part 1 of 12 (as the subject line so eloquently
states). I was delayed for a day or so by two things. First, my machine
was yanked out from underneath me. Second, I did some final compatibility
testing with a virgin copy of 2.2 I found lying under a rock somewhere.

As far as compatibility goes, if you have a virgin copy of 2.2, you will get
one and only one rejected patch. This ocurrs on "hack.c" and is non-fatal.
The rejected patch has to do with the "SCCS ID" string included in hack.c for
use with the "what" command. You don't even have to apply the patch by hand,
but I suggest you do so, it's really a simple thing.

Below is part one of the archive. I am posting 01 and 02 of 12 today (53Kb)
and will probably continue at the rate of 50 Kb per day (maybe a little more)
until everything is out. Estimated transmission date for the last packet is
somewhere in the Friday April 15th area.

----------------------------------cut here------------------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# Fixes.2.3
# Hackers.doc
# README.2.3
# This archive created: Mon Apr 4 08:52:21 1988
export PATH; PATH=/bin:$PATH
echo shar: extracting "'Fixes.2.3'" '(5148 characters)'
if test -f 'Fixes.2.3'
echo shar: will not over-write existing file "'Fixes.2.3'"
cat << \SHAR_EOF > 'Fixes.2.3'
NetHack Fixes List Revision 2.3e

New Files:

Fixes.2.3 This file.

Makefile.3B2 A new Makefile for the ATT 3B2. As above - pre nroff -mm

food.tbl Tables for above manual

nansi.doc Documentation for nansi.sys.

hh Fixed improper def of "X" for casting spells.

fight.c Dogname fix for "you hit your dog" line. (Janet Walz)

pri.c Patch for "SCORE_ON_BOTL". (Gary Erickson)

pray.c Null refrence bug fix for Suns. (The Unknown Hacker)

termcap.c null pointer bug fix. (Michael Grenier)

mon.c chameleon shape made dependent on current lev. (RPH)

rnd.c fixed SYSV/BSD problems with random(). (many sources)

shk.c fix to allow compilation with or without HARD option.
(reported by The Unknown Hacker)

termcap.c ospeed fix for SYSV. (reported by Eric Rapin)

unixunix.c fix for NFS sharing of playground. (Paul Meyer)

options.c many misc. bugs while compiling for the PC. (Tom Almy)

mkroom.h Addition of reorganized special-room code.
mkshop.c (Eric S. Raymond)

trap.c Fixed teleport to hell problems caused by rnz().
(reported by Janet Walz)

termcap.c Various fixes to MSDOSCOLOR code. (Tom Almy)

hack.c Fixed typos. (Steve Creps)

config.h Enabled the use of termcap file c:\etc\termcap or
termcap.c .\termcap.cnf for MS Dos (Steve Creps)

eat.c Continued implementation of Soldier code.
makedefs.c Added Barracks code. (Steve Creps)

makedefs.c Added Landmines code. (Steve Creps)

mkroom.h Fixed item / shop probablility code. (Stefan Wrammerfors)
shknam.c Added additional item typ available.

pray.c Randomized time between prayers. (Stefan Wrammerfors)

fight.c Fixed typo. (Stefan Wrammerfors)

mhitu.c Fixed monster special abilities usage bug.
(Stefan Wrammerfors)

objnam.c Randomized max number and max bonus limits on objects
wished for.
Identified cursed items shown as such. (Stefan Wrammerfors)

topten.c Added logfile to allow overall game tuning for balance.
config.h (Stefan Wrammerfors)

mklev.c moved code identifying medusa & wizard levs to eliminate
*main.c garbage on screen. (Izchak Miller)

u_init.c fixed up luck wraparound bug (Izchak Miller)

mon.c fixed null referenced pointer bug. (The Unknown Hacker)

config.h Hawaiian shirt code by Steve Linhart

config.h "THEOLOGY" code addition (The Unknown Hacker)

mklev.c Added typecasts to fix object generation bug on Microport
fountain.c Sys V/AT. (Jerry Lahti)

Makefile.unix Added ${CFLAGS} to makedefs build line. (Jerry Lahti)

pager.c Inventory fix for "things that are here". (Steve Creps)

cmd.c More wizard debugging tools:
^F = level map
^E = find doors & traps (Steve Creps)

apply.c Blindfolded set/unset to "INTRINSIC" (many sources)

lev.c new restmonchn() code. (Tom May)

o_init.c OS independance in init_objects (Tom May)
objclass.h (removal of oc_descr_i)

shk.c declaration of typename() (Tom May)

apply.c declaration of lmonnam() (Tom May)

mklev.c fixes to make medusa and wizard levels dependent on MAXLEVEL
(Richard Hughey as pointed out to him by John Sin)

fountain.c added "coins in fountain" code. (Chris Woodbury)

objects.h bound gem color to type (Janet Walz)

spell.c spell list now displayed in the corner (Bruce Mewborne)

apply.c multiple dragon types. (Bruce Mewborne)
cmd.c wand of lightning.
do.c ring of shock resistance.
do_name.c giant eel replaced by electric eel.
end.c "STOOGES" - three stooges code.
engrave.c Named dagger/short sword "Sting".
fight.c Lamps & Magic Lamps.
makemon.c A Badge - identifies you as a Kop.
config.h ^X option for wizard mode - gives current abilities.
mhitu.c New monster djinni '&' for Magic lamps.
mklev.c #rub command for lamps.
mkobj.c New monster: Gremlin 'G' augments Gnome on lower levels.
mon.c major modifications to buzz() code cleans it up.
monst.c objnam.c polyself.c potion.c
pri.c rip.c shk.c sit.c
u_init.c wizard.c zap.c makedefs.c
monst.h obj.h objects.h permonst.h
you.h *main.c *unix.c

rnd.c fixed portability bug for 16 bit machines (Paul Eggert)

mhitu.c fixed many lint flagged bugs (Izchak Miller)
fight.c mklev.c mkmaze.c mkshop.c
monmove.c shknam.c trap.c wizard.c
zap.c shk.c do_name.c invent.c
unixtty.c pctty.c unixmain.c pcmain.c
do.c options.c termcap.c makemon.c

termcap.c major rewrite *** NOTE: Untested by MRS *** (Kevin Sweet)

do_name.c reversed quantity check for "n blessed +xx items"
(Roland McGrath)

config.h Added Kitchen Sink code (Janet Walz)
decl.c do.c hack.c invent.c
makedefs.c mklev.c options.c pager.c
prisym.c wizard.c zap.c

end.c Fixed "killed by" bugs in endgame code. (Steve Creps)

objects.h Changed weight of a leash to a reasonable value. (Janet Walz)
if test 5148 -ne "`wc -c < 'Fixes.2.3'`"
echo shar: error transmitting "'Fixes.2.3'" '(should have been 5148 characters)'
fi # end of overwriting check
echo shar: extracting "'Hackers.doc'" '(5279 characters)'
if test -f 'Hackers.doc'
echo shar: will not over-write existing file "'Hackers.doc'"
cat << \SHAR_EOF > 'Hackers.doc'
NetHack Programmers' Guidelines

M. Stephenson



This document is intended as a guide for programmers making changes
and additions to the existing NetHack code-base. It outlines (approximately)
my design philosophy and rules for inclusion of additions and changes to
the code. Please read it through and keep the basic concepts in mind when
writing new code for the game.

Bug Fixes:

I'll gladly accept almost ***anything*** in the form of a bug fix.
Please make sure you test your fix out before sending it in, however. Include
in the submission, how it was tested, as well as any side effects you may have
noticed due to or in spite of the changes, as they may indicate deficiencies
in the code to me.


Please remember that this is supposed to be a D&D(tm) type game. Not
a modern day or space type adventure. Not that I will automatically reject
additions to the game of that type. I would simply like them to be presented
in a form similar to that which exists now. You can usually take any concept
for a game like this and modify it into a fantasy setting.

NEVER NEVER NEVER make something hardware dependent. Remember that for
all of those people out there with a beautiful "xyz" 20" 256 color super
terminal there are dozens of poor folk with plain old dumb ttys. Therefore,
make all uses of special characters, graphics and attributes TOTALLY optional.

If you are adding a brand new concept to the game, please try to do so
in a new file (eg. fountains produced fountain.c, spells produced spell.c).

Code Reduction:

Yes, yes, yes... If there is any way you can reduce the code while
maintaining portability and flexibility, please do so. Part of the work I
will be doing on 3.0 will concern three major sets of modifications:

- making some of the "optional" code standard, hence reducing out
other code in #ifdef / #else / #endif sets.

- attempting to merge DOS & Unix code into one routine whenever

- reorganization of routines into more source modules.

Please test your results as completely as possible.

Responses to E-Mail:

I try to respond to E-Mail coming into my account. For any large fix
or fixes requiring two or three separate files, I will usually generate a
response. I don't, however, respond to every bug fix due to time, or some-
times due to the fact that the mail I send back bounces twice or three times
while I am trying to get through. If you don't get a response from me, and
really want one, either indicate it in the mail, or, failing a response, send
a message through My Rnmail usually gets things through.

Additional OS Compatibility:

I am interested in getting NetHack working on as many machines as is
possible. MS-DOS, Unix V Rn and BSD4.n are known supported now. I have the
mods for OS/9 in my posession, and they will be included in 3.0. If you have
mods for any other type of OS, please send them in as soon as possible. Try
to use the existing code as much as possible, and introduce new copies of
existing files only when the alternative is an unreadable mess in the

A Small Wish-List:

Here are some things I would like to see in the game, for 3.0, and if
anyone out there would like to make a stab at programming one of them, please
drop me some mail (my ***NEW*** address is at the bottom of this file) and
I will try to get you in touch with anyone else expressing like interests.

- True curses implementation of the display.
(termcap implementation will have to remain for backward

- More monsters! My initial algorithm is as follows:

- any given letter code will represent a "class" of monster

- modify the generation code to generate stronger monster
types as the dungeon and player level increases.

- optionally, a game difficulty parameter can be introduced
into the code here (using HARD???).

- replace all of those uses of the letter code as monster
designation with a code returned from a single routine
which will determine monster type and a set of equates.

- add a command to "#look" and be told what monsters (and
possibly objects) are in the room with you. This means
you won't have to engage with a monster to find out what
it is.

- Artifacts (including "intelligent" or "aware" weapons). This
could really be a lot of fun; especially if you have talking
artifacts to cause you trouble, wake up sleeping monsters, etc.

- More asynchronous events, especially strange sounds. A real
dungeon would not be deathly silent, except in the area of
a morgue :-). There should be the sounds of various things
going on, like the bubbling of a fountain in the room you
haven't gone into yet, the dripping of water in a swamp, a
low rumble of conversation inside a throne room, etc...

- How about locked doors, locked chests, a "key" tool, and a
"thief" character class?

Mike Stephenson

Mail: Genamation Inc. Phone: (416) 475-9434
351 Steelcase Rd. W
Markham, Ontario. UUCP: uunet!{mnetor,utzoo}!genat!genpyr!mike
Canada L3R 3W1
if test 5279 -ne "`wc -c < 'Hackers.doc'`"
echo shar: error transmitting "'Hackers.doc'" '(should have been 5279 characters)'
fi # end of overwriting check
echo shar: extracting "'MANIFEST.2.3'" '(4264 characters)'
if test -f 'MANIFEST.2.3'
echo shar: will not over-write existing file "'MANIFEST.2.3'"
cat << \SHAR_EOF > 'MANIFEST.2.3'

Update 2.3 Manifest

This file contains a list of all files required to perform an update
of your program. Files in the manifest can be divided into three separate

1) New files which are, of course, included in full.

2) Patches to existing files in cases where the length of the
patch file does not exceed that of the updated source code.

3) Updated source modules in cases where the patch file would
have been longer. These are included in full.

In addition, there is a shell script which will allow you to back up
copies of files in category (3) above to "filename.orig" format files.

New Files Included in this Release:

MANIFEST.2.3 - this file.

Makefile.3B2 (split into .a & .b)

Updates to Existing Files:

Update.2.3 (split into parts .a thru .g)

Makefile.att - patch file (51 lines).
Makefile.unix - patch file (68 lines).
Makefile.xenix - patch file (19 lines).
apply.c - patch file (232 lines).
cmd.c - patch file (434 lines).
config.h - patch file (177 lines).
do.c - patch file (180 lines).
do_name.c - patch file (53 lines).
do_wear.c - patch file (180 lines).
dog.c - patch file (46 lines).
dothrow.c - patch file (102 lines).
eat.c - patch file (33 lines).
end.c - patch file (228 lines).
engrave.c - patch file (90 lines).
fight.c - patch file (250 lines).
fountain.c - patch file (119 lines).
hack.c - patch file (121 lines).
hack.h - patch file (49 lines).
hh - patch file (20 lines).
invent.c - patch file (162 lines).
lev.c - patch file (279 lines).
makedefs.c - patch file (117 lines).
makemon.c - patch file (279 lines).
mhitu.c - patch file (322 lines).
mklev.c - patch file (409 lines).
mkmaze.c - patch file (50 lines).
mkobj.c - patch file (33 lines).
mkshop.c - patch file (312 lines).
mon.c - patch file (341 lines).
monmove.c - patch file (73 lines).
monst.c - patch file (87 lines).
monst.h - patch file (36 lines).
msdos.c - patch file (32 lines).
objclass.h - patch file (34 lines).
objects.h - patch file (266 lines).
objnam.c - patch file (264 lines).
options.c - patch file (108 lines).
pager.c - patch file (248 lines).
pcmain.c - patch file (131 lines).
pctty.c - patch file (44 lines).
polyself.c - patch file (154 lines).
potion.c - patch file (89 lines).
pray.c - patch file (546 lines).
pri.c - patch file (54 lines).
prisym.c - patch file (35 lines).
read.c - patch file (35 lines).
rip.c - patch file (70 lines).
rm.h - patch file (127 lines).
save.c - patch file (277 lines).
shk.c - patch file (206 lines).
shknam.c - patch file (88 lines).
sit.c - patch file (125 lines).
spell.c - patch file (225 lines).
steal.c - patch file (79 lines).
trap.c - patch file (177 lines).
u_init.c - patch file (213 lines).
unixmain.c - patch file (114 lines).
unixtty.c - patch file (32 lines).
unixunix.c - patch file (70 lines).
version.c - patch file (32 lines).
wizard.c - patch file (90 lines).
worn.c - patch file (46 lines).
you.h - patch file (72 lines).
zap.c - patch file (696 lines).

Existing Files Re-released in Full:

decl.c - released in full as
extern.h - released in full as
mkroom.h - released in full as
nethack.cnf - released in full as
o_init.c - released in full as
obj.h - released in full as
permonst.h - released in full as
rnd.c - released in full as
termcap.c - released in full as
topten.c - released in full as
if test 4264 -ne "`wc -c < 'MANIFEST.2.3'`"
echo shar: error transmitting "'MANIFEST.2.3'" '(should have been 4264 characters)'
fi # end of overwriting check
echo shar: extracting "'README.2.3'" '(6694 characters)'
if test -f 'README.2.3'
echo shar: will not over-write existing file "'README.2.3'"
cat << \SHAR_EOF > 'README.2.3'
NetHack V2.3 README

This file contains information on the 2.3 release of NetHack. For
information on previous releases, see the README and README.OLD files. For
a detailed history of the game, see the README.ORIG file, which contains
three separate readme files, dating back to the original release of the game
(then named "hack") by Jay Fenlason.


To install this release, unpack all of the shar kits. You will find
you have a bunch of completely new files, a second bunch of files with a
".new" suffix (these are all files which have been released fully, since the
patch file to update them would have been larger than the file itself), a set
of update patches - context diffs, and finally a shell script to pull every-
thing together.

Next ***BACK EVERYTHING UP***. I don't want to receive irate mail
about missing files due to some finger error.

Read "". This script will be used once - and only once -
to perform the copies and cat's required to make the update. Once it has
been run, all of your ".new" files will be moved onto their corresponding
".c" and ".h" files, and the originals will be backed up with a ".orig"
suffix. All of the files which were shipped in parts will be concatenated
into one file. And finally will be removed.

Next run patch(1) with the file Update.2.3 as it's stdin. This will
patch the remaining files up to 2.3e standard. Gods help you if you've done
any patching on your own. It probably won't work in that case. Best bet is
to start with a virgin 2.2 release.

Finally, copy "Makefile.<whatever>" to "Makefile", modify "config.h"
to suit and run "make". Install it as you wish.

Release Discription

This release of the game contains a large number of bug fixes, as
well as several new features. There has been a large amount of play-testing
done on this release. For a detailed list of bug fixes, and additions look
at the file "Fixes.2.3". I cannot guarantee that every modification done has
been included, but I have done my best to chronicle the changes and fixes
made there. Here are the high points:

1) New flags in "config.h":

SAC Soldiers & barracks code
SHIRT Hawaiian shirt code
THEOLOGY Smarter gods & sacrifices
STOOGES Three wild and crazy guys
SINKS Kitchen Sinks

SCORE_ON_BOTL Score (not exactly # of exp) on the bottom line.

In addition, in an MSDOS enviornment:

TERMLIB enable use of termcap file c:\etc\termcap
or .\termcap.cnf for MSDOS

Of the above, I haven't tested TERMLIB. If you find bugs in these,
send me the reports.

2) New objects:

Hawaiian shirts (sort of armor - especially for tourists).

Kitchen Sinks - for the dropping of rings, of course...

Wand of Lightning

Ring of Shock Resistance (to balance above)

A named weapon (dagger or short sword) "Sting" a la Tolkien.

Lamps and Magic Lamps

A Badge to identify you as an "Officer".

3) New Files:

A new makefile for the ATT 3B2

A "Spoilers" manual in mm format and tables for the manual.

The long-awaited documentation on nansi.sys - nansi.doc.

4) Major game changes:

- Shop generation has been cleaned up. There are now up to four
different types of object inside. There has also been modifications
to room generation to make things cleaner.

- A new type of room, the barracks (a lair for soldiers) has been
added. In addition, the soldier has been made just a little less
deadly to compensate for the large numbers present.

- A new type of trap, the landmine, (which will be renamed to con-
form with a fantasy setting in the future) has been added.

- A change to shopkeepers has them getting angry more easily if you
are wearing a badge, and have robbed them.

- The "dragon" has been split up into several sub-types. They now
have all sorts of breath weapons - NOTE: a slight bug - eating any
of the dead dragon types still gives you intrinsic fire resistance.

- A new wand, and compensating ring have been added (Lightning).

- The "Giant Eel" has been replaced with an "Electric Eel".

- The wand zapping code has been re-written (mostly in buzz()) so
that support for new zap effects will be easier in the future.

- Chameleon shape changes are now dependant on the level for more

- An optional "logfile" has been added for game debugging.

- Some interesting changes to the "pray" code have been added.

- The restmonchn() code has been merged between Unix and MS-DOS.
This results in a fair sized reduction in size and complexity of
that particular module. Please send me any bug reports as I have
only tested it on the Unix side.

- The colour <--> gemstone type code has been fixed so that the
colour of an unknown stone now approximates the gem type.

- For those who like a little fun, three STOOGES have been added
(optionally) to the game. They will show up and fight with each
other, producing more of a disturbance than any serious trouble.

- Lamps have been added. When applied, they will light a room.

- Magic lamps have a djinn inside. Glowing potions may too.

- A new monster, the Gremlin, can multiply in water, and will
potentially steal your hard won inate attributes.

5) Minor game changes:

- The fountain code has been modified to allow coins to fall into or
be recovered from a fountain.

- In wizard mode, the wizard player can now map the level, list all
of his/her attributes, and can do a detect for all traps and doors.

- When wishing, you are no longer limited by the x3/+3 rule. However,
you can't be sure that a "greedy" wish will produce the desired
results, the object might be cursed.

- You can now optionally print your score on the bottom line. The
score printed is close to what would show up on your tombstone.

- A fix to allow multiple machine play via NFS on a shared playground
has been made. This won't affect us single machine players.

- The time between prayers is now random.

- Wizard and Medusa levels are now dependant on the MAXLEVEL param.

- The spell list is now displayed in the corner.

6) Future additions:

See the "Hackers.doc" file. I am going to make the next release
a major modification of the code (3.0). It will include as many alternate
OSs supported as I can get patches for. It will also be constrained towards
a "fantasy" approach to the game.

Mike Stephenson

ps: Sorry this one took so long. I'm going to fix up an alternative
to handle releases in the future.

Mail: Genamation Inc. Phone: (416) 475-9434
351 Steelcase Rd. W
Markham, Ontario. UUCP: uunet!{mnetor,utzoo}!genat!genpyr!mike
Canada L3R 3W1
if test 6694 -ne "`wc -c < 'README.2.3'`"
echo shar: error transmitting "'README.2.3'" '(should have been 6694 characters)'
fi # end of overwriting check
echo shar: extracting "''" '(2106 characters)'
if test -f ''
echo shar: will not over-write existing file "''"
cat << \SHAR_EOF > ''
# - back up all source modules which are to be
# updated, and are being shipped in full.
# - join all source modules split for distribution.

trap "echo 'Very intelligent of you...' ; exit 0" 2
echo "WARNING: If you haven't made a backup of your files, I strongly"
echo "suggest you do so now. I'll give you 15 seconds to interrupt here:"
sleep 15

trap 2
echo "Ok, Here goes the works..."
echo ""

echo 'Joining files split for distribution:'
echo ""

echo 'Joining' Update.2.3
rm -f Update.2.3
cat Update.2.3.* > Update.2.3
echo 'removing split files'
rm -f Update.2.3.*

echo 'Joining'
rm -f
cat* >
echo 'removing split files'
rm -f*

echo ""
echo 'Updating files distributed in full:'
echo ""

echo 'Updating' decl.c
cp decl.c decl.c.orig
mv decl.c

echo 'Updating' extern.h
cp extern.h extern.h.orig
mv extern.h

echo 'Updating' mkroom.h
cp mkroom.h mkroom.h.orig
mv mkroom.h

echo 'Updating' nethack.cnf
cp nethack.cnf nethack.cnf.orig
mv nethack.cnf

echo 'Updating' o_init.c
cp o_init.c o_init.c.orig
mv o_init.c

echo 'Updating' obj.h
cp obj.h obj.h.orig
mv obj.h

echo 'Updating' permonst.h
cp permonst.h permonst.h.orig
mv permonst.h

echo 'Updating' rnd.c
cp rnd.c rnd.c.orig
mv rnd.c

echo 'Updating' termcap.c
cp termcap.c termcap.c.orig
mv termcap.c

echo 'Updating' topten.c
cp topten.c topten.c.orig
mv topten.c

echo ""
echo "If you were wise enough to make a backup of your files, you still"
echo "have this srcipt, the split distribution copies and all of the '.new'"
echo "files so you can repeat this process if you have to. If not you're"
echo "stuck if you run into trouble later. I warned you..."
echo ""
echo "Please run Update.2.3 through patch(1) or (yech) apply the patches"
echo "by hand. Then copy the appropriate version of 'Makefile.???' to"
echo "'Makefile', modify 'config.h' to suit, and type 'make'."
echo ""
echo "--- done ---"
rm -f
exit 0
if test 2106 -ne "`wc -c < ''`"
echo shar: error transmitting "''" '(should have been 2106 characters)'
fi # end of overwriting check
# End of shell archive
exit 0
Mike Stephenson

Mail: Genamation Inc. Phone: (416) 475-9434
351 Steelcase Rd. W
Markham, Ontario. UUCP: uunet!{mnetor,utzoo}!genat!genpyr!mike
Canada L3R 3W1 uunet!{mnetor,utzoo}!genat!mike

Reply all
Reply to author
0 new messages