updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / nethack-combined / nh343jl-combined-full.diff
blobe43b717c5342e0359d18ac363a0c0286076d7a3b
1 diff --git a/Makefile b/Makefile
2 new file mode 100644
3 index 0000000..04b6992
4 --- /dev/null
5 +++ b/Makefile
6 @@ -0,0 +1,266 @@
7 +# NetHack Makefile.
8 +# SCCS Id: @(#)Makefile.top 3.4 1995/01/05
10 +# newer makes predefine $(MAKE) to 'make' and do smarter processing of
11 +# recursive make calls if $(MAKE) is used
12 +# these makes allow $(MAKE) to be overridden by the environment if someone
13 +# wants to (or has to) use something other than the standard make, so we do
14 +# not want to unconditionally set $(MAKE) here
16 +# unfortunately, some older makes do not predefine $(MAKE); if you have one of
17 +# these, uncomment the following line
18 +# (you will know that you have one if you get complaints about unable to
19 +# execute things like 'data' and 'rumors')
20 +# MAKE = make
22 +# make NetHack
23 +PREFIX = /usr
24 +GAME = nethack
25 +# GAME = nethack.prg
26 +GAMEUID = root
27 +GAMEGRP = root
29 +# Permissions - some places use setgid instead of setuid, for instance
30 +# See also the option "SECURE" in include/config.h
31 +GAMEPERM = 04755
32 +FILEPERM = 0644
33 +EXEPERM = 0755
34 +DIRPERM = 0755
36 +# GAMEDIR also appears in config.h as "HACKDIR".
37 +# VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else GAMEDIR
39 +# note that 'make install' believes in creating a nice tidy GAMEDIR for
40 +# installation, free of debris from previous NetHack versions --
41 +# therefore there should not be anything in GAMEDIR that you want to keep
42 +# (if there is, you'll have to do the installation by hand or modify the
43 +# instructions)
44 +GAMEDIR = $(PREFIX)/share/$(GAME)
45 +VARDIR = $(GAMEDIR)
46 +SHELLDIR = $(PREFIX)/bin
48 +# per discussion in Install.X11 and Install.Qt
49 +VARDATND =
50 +# VARDATND = x11tiles NetHack.ad pet_mark.xbm
51 +# VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm
52 +# for Atari/Gem
53 +# VARDATND = nh16.img title.img GEM_RSC.RSC rip.img
54 +# for BeOS
55 +# VARDATND = beostiles
56 +# for Gnome
57 +# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm
59 +VARDATD = data oracles options quest.dat rumors
60 +VARDAT = $(VARDATD) $(VARDATND)
62 +# Some versions of make use the SHELL environment variable as the shell
63 +# for running commands. We need this to be a Bourne shell.
64 +# SHELL = /bin/sh
65 +# for Atari
66 +# SHELL=E:/GEMINI2/MUPFEL.TTP
68 +# Commands for setting the owner and group on files during installation.
69 +# Some systems fail with one or the other when installing over NFS or for
70 +# other permission-related reasons. If that happens, you may want to set the
71 +# command to "true", which is a no-op. Note that disabling chown or chgrp
72 +# will only work if setuid (or setgid) behavior is not desired or required.
73 +CHOWN = chown
74 +CHGRP = chgrp
77 +# end of configuration
80 +DATHELP = help hh cmdhelp history opthelp wizhelp
82 +SPEC_LEVS = asmodeus.lev baalz.lev bigrm-?.lev castle.lev fakewiz?.lev \
83 + juiblex.lev knox.lev medusa-?.lev minend-?.lev minefill.lev \
84 + minetn-?.lev oracle.lev orcus.lev sanctum.lev soko?-?.lev \
85 + tower?.lev valley.lev wizard?.lev \
86 + astral.lev air.lev earth.lev fire.lev water.lev
87 +QUEST_LEVS = ???-goal.lev ???-fil?.lev ???-loca.lev ???-strt.lev
89 +DATNODLB = $(VARDATND) license
90 +DATDLB = $(DATHELP) dungeon $(SPEC_LEVS) $(QUEST_LEVS) $(VARDATD)
91 +DAT = $(DATNODLB) $(DATDLB)
93 +$(GAME):
94 + ( cd src ; $(MAKE) )
96 +all: $(GAME) recover Guidebook $(VARDAT) dungeon spec_levs check-dlb
97 + @echo "Done."
99 +# Note: many of the dependencies below are here to allow parallel make
100 +# to generate valid output
102 +Guidebook:
103 + ( cd doc ; $(MAKE) Guidebook )
105 +manpages:
106 + ( cd doc ; $(MAKE) manpages )
108 +data: $(GAME)
109 + ( cd dat ; $(MAKE) data )
111 +rumors: $(GAME)
112 + ( cd dat ; $(MAKE) rumors )
114 +oracles: $(GAME)
115 + ( cd dat ; $(MAKE) oracles )
117 +# Note: options should have already been made with make, but...
118 +options: $(GAME)
119 + ( cd dat ; $(MAKE) options )
121 +quest.dat: $(GAME)
122 + ( cd dat ; $(MAKE) quest.dat )
124 +spec_levs: dungeon
125 + ( cd util ; $(MAKE) lev_comp )
126 + ( cd dat ; $(MAKE) spec_levs )
127 + ( cd dat ; $(MAKE) quest_levs )
129 +dungeon: $(GAME)
130 + ( cd util ; $(MAKE) dgn_comp )
131 + ( cd dat ; $(MAKE) dungeon )
133 +nhtiles.bmp: $(GAME)
134 + ( cd dat ; $(MAKE) nhtiles.bmp )
136 +x11tiles: $(GAME)
137 + ( cd util ; $(MAKE) tile2x11 )
138 + ( cd dat ; $(MAKE) x11tiles )
140 +beostiles: $(GAME)
141 + ( cd util ; $(MAKE) tile2beos )
142 + ( cd dat ; $(MAKE) beostiles )
144 +NetHack.ad: $(GAME)
145 + ( cd dat ; $(MAKE) NetHack.ad )
147 +pet_mark.xbm:
148 + ( cd dat ; $(MAKE) pet_mark.xbm )
150 +rip.xpm:
151 + ( cd dat ; $(MAKE) rip.xpm )
153 +mapbg.xpm:
154 + (cd dat ; $(MAKE) mapbg.xpm )
156 +nhsplash.xpm:
157 + ( cd dat ; $(MAKE) nhsplash.xpm )
159 +nh16.img: $(GAME)
160 + ( cd util ; $(MAKE) tile2img.ttp )
161 + ( cd dat ; $(MAKE) nh16.img )
163 +rip.img:
164 + ( cd util ; $(MAKE) xpm2img.ttp )
165 + ( cd dat ; $(MAKE) rip.img )
166 +GEM_RSC.RSC:
167 + ( cd dat ; $(MAKE) GEM_RSC.RSC )
169 +title.img:
170 + ( cd dat ; $(MAKE) title.img )
172 +check-dlb: options
173 + @if egrep -s librarian dat/options ; then $(MAKE) dlb ; else true ; fi
175 +dlb:
176 + ( cd util ; $(MAKE) dlb )
177 + ( cd dat ; ../util/dlb cf nhdat $(DATDLB) )
179 +# recover can be used when INSURANCE is defined in include/config.h
180 +# and the checkpoint option is true
181 +recover: $(GAME)
182 + ( cd util ; $(MAKE) recover )
184 +dofiles:
185 + target=`sed -n \
186 + -e '/librarian/{' \
187 + -e 's/.*/dlb/p' \
188 + -e 'q' \
189 + -e '}' \
190 + -e '$$s/.*/nodlb/p' < dat/options` ; \
191 + $(MAKE) dofiles-$${target-nodlb}
192 + cp src/$(GAME) $(GAMEDIR)
193 + cp util/recover $(GAMEDIR)
194 + -rm -f $(SHELLDIR)/$(GAME)
195 + sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
196 + -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
197 + < sys/unix/nethack.sh \
198 + > $(SHELLDIR)/$(GAME)
199 +# set up their permissions
200 + -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \
201 + $(CHGRP) $(GAMEGRP) $(GAME) recover )
202 + chmod $(GAMEPERM) $(GAMEDIR)/$(GAME)
203 + chmod $(EXEPERM) $(GAMEDIR)/recover
204 + -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME)
205 + $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME)
206 + chmod $(EXEPERM) $(SHELLDIR)/$(GAME)
208 +dofiles-dlb: check-dlb
209 + ( cd dat ; cp nhdat $(DATNODLB) $(GAMEDIR) )
210 +# set up their permissions
211 + -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \
212 + $(CHGRP) $(GAMEGRP) nhdat $(DATNODLB) ; \
213 + chmod $(FILEPERM) nhdat $(DATNODLB) )
215 +dofiles-nodlb:
216 +# copy over the game files
217 + ( cd dat ; cp $(DAT) $(GAMEDIR) )
218 +# set up their permissions
219 + -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \
220 + $(CHGRP) $(GAMEGRP) $(DAT) ; \
221 + chmod $(FILEPERM) $(DAT) )
223 +update: $(GAME) recover $(VARDAT) dungeon spec_levs
224 +# (don't yank the old version out from under people who're playing it)
225 + -mv $(GAMEDIR)/$(GAME) $(GAMEDIR)/$(GAME).old
226 +# quest.dat is also kept open and has the same problems over NFS
227 +# (quest.dat may be inside nhdat if dlb is in use)
228 + -mv $(GAMEDIR)/quest.dat $(GAMEDIR)/quest.dat.old
229 + -mv $(GAMEDIR)/nhdat $(GAMEDIR)/nhdat.old
230 +# set up new versions of the game files
231 + ( $(MAKE) dofiles )
232 +# touch time-sensitive files
233 + -touch -c $(VARDIR)/bones* $(VARDIR)/?lock* $(VARDIR)/wizard*
234 + -touch -c $(VARDIR)/save/*
235 + touch $(VARDIR)/perm $(VARDIR)/record
236 +# and a reminder
237 + @echo You may also want to install the man pages via the doc Makefile.
239 +install: $(GAME) recover $(VARDAT) dungeon spec_levs
240 +# set up the directories
241 +# not all mkdirs have -p; those that don't will create a -p directory
242 + -mkdir -p $(SHELLDIR)
243 +# -rm -rf $(GAMEDIR) $(VARDIR)
244 + -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/bones
245 + -rmdir ./-p
246 + -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/bones
247 + $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/bones
248 + chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/bones
249 +# set up the game files
250 + ( $(MAKE) dofiles )
251 +# set up some additional files
252 + touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile
253 + -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
254 + $(CHGRP) $(GAMEGRP) perm record logfile ; \
255 + chmod $(FILEPERM) perm record logfile )
256 +# and a reminder
257 + @echo You may also want to reinstall the man pages via the doc Makefile.
260 +# 'make clean' removes all the .o files, but leaves around all the executables
261 +# and compiled data files
262 +clean:
263 + ( cd src ; $(MAKE) clean )
264 + ( cd util ; $(MAKE) clean )
266 +# 'make spotless' returns the source tree to near-distribution condition.
267 +# it removes .o files, executables, and compiled data files
268 +spotless:
269 + ( cd src ; $(MAKE) spotless )
270 + ( cd util ; $(MAKE) spotless )
271 + ( cd dat ; $(MAKE) spotless )
272 + ( cd doc ; $(MAKE) spotless )
273 diff --git a/README.menucolor b/README.menucolor
274 new file mode 100644
275 index 0000000..071653a
276 --- /dev/null
277 +++ b/README.menucolor
278 @@ -0,0 +1,96 @@
280 + This is version 1.3 of the menucolors patch.
282 + This patch allows the user to define in what color menus are shown.
283 + For example, putting
285 + OPTIONS=menucolors
286 + MENUCOLOR=" blessed "=green
287 + MENUCOLOR=" holy "=green
288 + MENUCOLOR=" cursed "=red
289 + MENUCOLOR=" unholy "=red
290 + MENUCOLOR=" cursed .* (being worn)"=orange&underline
292 + in the configuration file makes all known blessed items
293 + show up in green, all cursed items show up in red and
294 + all cursed worn items show up in orange and underlined
295 + when viewing inventory.
297 + If you do not have GNU regex.h, comment
298 + #define MENU_COLOR_REGEX out from include/config.h
299 + and replace the MENUCOLOR lines in your config file with these:
301 + MENUCOLOR="* blessed *"=green
302 + MENUCOLOR="* holy *"=green
303 + MENUCOLOR="* cursed *"=red
304 + MENUCOLOR="* unholy *"=red
305 + MENUCOLOR="* cursed * (being worn)"=orange&underline
308 + Colors: black, red, green, brown, blue, magenta, cyan, gray, orange,
309 + lightgreen, yellow, lightblue, lightmagenta, lightcyan, white.
310 + Attributes: none, bold, dim, underline, blink, inverse.
312 + Note that the terminal is free to interpret the attributes however
313 + it wants.
316 + TODO/BUGS:
318 + o Only works with TTY
319 + o You can't use '=' or '&' in the match-string.
320 + o Maybe add color-field to tty_menu_item in include/wintty.h
321 + (so there's no need to find the color for the line again)
322 + o Guidebook is not up to date
323 + o Better place to put the functions, colornames[] and attrnames[]?
324 + o Some menus do not need coloring; maybe add new parameter
325 + to process_menu_window()?
328 + FIXES:
330 + v1.3:
331 + o Updated to use 3.4.3 codebase.
332 + o Added a text to #version to show menucolors is compiled in.
334 + v1.2:
335 + o Updated to use 3.4.2 codebase.
337 + v1.1:
338 + o Updated to use 3.4.1 codebase.
339 + o replaced USE_REGEX_MATCH with MENU_COLOR_REGEX
341 + v1.04:
342 + o Oops! 1.03 worked only on *nixes... (GNU regex.h)
343 + o Compile-time option USE_REGEX_MATCH: if it's defined, use regex,
344 + otherwise use globbing. ('?' and '*' wildcards)
346 + v1.03:
348 + o Now using Nethack 3.4.0 codebase
349 + o Compile-time option MENU_COLOR
350 + o Strings match using regular expressions instead of globbing
351 + o You can use attribute with color (attr must come after '&')
352 + o Use ``MENUCOLOR="foo"=color'' instead of ``OPTIONS=menucolor=...''
353 + (Both work, but OPTIONS complains if you define menucolor
354 + more than once)
356 + v1.02:
358 + o Should now work with OS/2, thanks to Jukka Lahtinen
359 + o Strings match now using simple globbing. ('?' and '*' wildcards)
361 + v1.01:
363 + o Moved 'menucolors' boolean option, so now the options-menu
364 + is in alphabetical order.
365 + o Fixed 'menucolor' description in dat/opthelp.
366 + o menu_colorings is now initialized to null in src/decl.c.
368 + v1.0:
370 + o Initial release
373 + Pasi Kallinen
374 + pkalli@cs.joensuu.fi
375 diff --git a/README.nh343jl b/README.nh343jl
376 new file mode 100644
377 index 0000000..a7357ea
378 --- /dev/null
379 +++ b/README.nh343jl
380 @@ -0,0 +1,121 @@
381 +nh343jl.diff is a diff for Nethack 3.4.3, containing the following
382 +patches (better explanations and diffs for most individual patches
383 +available at http://www.netsonic.fi/~walker/nethack.html) :
385 +- Tom Friedetzky's "dump character" patch somewhat modified by me, Darshan
386 + Shaligram and some others (include/decl.h, include/extern.h,
387 + src/botl.c, src/cmd.c, src/decl.c, src/display.c, src/end.c,
388 + src/invent.c, src/options.c, src/spell.c, src/topten.c, src/weapon.c,
389 + win/tty/wintty.c, dat/opthelp, doc/Guidebook.*)
390 +- record the number of moves, and mark wizard/explore mode games in
391 + logfile / record (src/topten.c)
392 +- show extincted monsters among the genocided ones and the numbers of
393 + different monsters born in the "vanquished" list after the numbers killed.
394 + (Wingnut, Jukka Lahtinen)
395 + (include/flag.h, src/cmd.c, src/end.c, src/options.c,
396 + dat/opthelp, dat/wizhelp, doc/Guidebook.*)
397 +- paranoid, by David Damerell, Jonathan Nieder, Jukka Lahtinen and
398 + Stanislav Traykov
399 + (include/flag.h, src/cmd.c, src/do_wear.c, src/end.c, src/options.c,
400 + src/potion.c, src/uhitm.c, dat/opthelp, doc/Guidebook.*)
401 +- Ralph Churchill's colored Hp monitor (src/botl.c)
402 +- Compile-time options for not writing #quit games to the record file
403 + (FORGET_QUITTER) and not writing explore mode games to the logfile
404 + (PROMPT_LOGEXP). (src/end.c, src/topten.c)
405 +- The compile time setting SCORE_ON_BOTL is overriden in the magic number
406 + in the bones and save files, so compatibility with the official binaries
407 + can be kept regardless of that option. (src/version.c)
408 +- Allow definitions for variable playground locations, such as separate
409 + bones and levels directories, for OS/2. Use bones in directory "bones"
410 + under the playground directory in unix systems.
411 + (include/os2conf.h, src/files.c, sys/share/pcunix.c)
412 +- prompt for entering explore mode at death (include/flag.h, src/cmd.c,
413 + src/end.c, src/options.c, dat/opthelp, doc/Guidebook.*)
414 +- Jeroen Demeyer's sortloot patch to optionally sort the pickup lists to
415 + ascending order of descriptions within each item class
416 + (dat/opthelp, doc/Guidebook.*, include/extern.h, include/flag.h,
417 + src/end.c, src/invent.c, src/objnam.c, src/options.c, src/pickup.c)
418 +- Pasi Kallinen's menucolor patch (http://www.cs.joensuu.fi/~pkalli)
419 + (dat/opthelp, include/color.h, include/extern.h, include/flag.h,
420 + src/decl.c, src/files.c, src/options.c, src/save.c,
421 + win/tty/wintty.c)
422 +- Pasi Kallinen's window edge patch, optionally aligning menus and text
423 + windows left instead of right in the tty interface.
424 + http://cs.joensuu.fi/~pkalli/code/nh342-winedge.diff
425 + (doc/Guidebook.*, dat/opthelp, include/flag.h, src/options.c,
426 + win/tty/wintty.c)
427 +- Stanislav Traykov's patch for additional item categories in the menus
428 + http://home.in.tum.de/~traykovs/nethack/
429 + (dat/opthelp, doc/Guidebook.*, include/extern.h, include/flag.h,
430 + include/hack.h, include/objclass.h, include/obj.h, src/do.c,
431 + src/invent.c, src/options.c, src/pickup.c)
432 +- Sam Dennis's patch to allow the #adjust command to split stacks
433 + (src/invent.c)
434 +- Pasi Kallinen's helplessness patch that replaces the "while helpless"
435 + text to be written to the record/logfile with the reason of
436 + helplessness
437 + (include/decl.h, include/extern.h, src/allmain.c, src/apply.c,
438 + src/artifact.c, src/ball.c, src/decl.c, src/detect.c, src/dig.c,
439 + src/dothrow.c, src/do_wear.c, src/eat.c, src/end.c, src/engrave.c,
440 + src/explode.c, src/hack.c, src/mcastu.c, src/mhitu.c, src/mthrowu.c,
441 + src/muse.c, src/pickup.c, src/polyself.c, src/potion.c, src/pray.c,
442 + src/priest.c, src/save.c, src/sounds.c, src/spell.c, src/steal.c,
443 + src/teleport.c, src/timeout.c, src/trap.c, src/uhitm.c, src/vault.c,
444 + src/zap.c)
445 +- Pasi Kallinen's extra status attributes patch that adds statuses like
446 + encuberance, hunger, confusion, food poisoning, illness, blindness,
447 + stun, hallucination and sliming to the minimal enlightenment screen
448 + shown with ^X (http://bilious.homelinux.org/?226)
449 + (include/extern.h, src/botl.c, src/cmd.c)
450 +- Make the f (fire) command prompt for ammuntition to quiver, when used
451 + and nothing is quivered.
452 + (dat/opthelp, doc/Guidebook.mn, doc/Guidebook.tex, doc/Guidebook.txt,
453 + include.flag.h, src/dothrow.c, src/options.c)
454 +- Allow priest role to be played as any race (Haakon Studebaker)
455 + (src/role.c, compile option PRIEST_RACES)
456 +- Patric Mueller's fixes for known bugs C343-100, C343-179, C343-218,
457 + C343-275, C343-276 and C343-324
458 + (include/extern.h, src/apply.c, src/do.c, src/dokick.c, src/dothrow.c,
459 + src/shk.c, src/trap.c, src/worm.c, src/zap.c)
461 +Most of these patches need some #define in include/config.h to get
462 +compiled in. I included a diff for config.h to show them.
464 +On unix systems with the dump patch, it is recommended for security reasons
465 +to define the DUMP_FN in include/config.h to prevent users from defining
466 +the dumpfile name themselves, but here it is commented out because there is
467 +no single directory name that would be good for EVERY patched Nethack
468 +installation to have the dump files in and I try to keep this patch
469 +collection as generic as possible.
471 +If you find any bugs in these patches, please let me know.
472 +For now, you can reach me at jtfjdehf@hotmail.com).
473 +And I read rec.games.roguelike.nethack regularly.
475 +Of course, if you have some other changes made to the same files, you may
476 +need to edit some of the source files to insert some chunks of this diff
477 +manually. Check especially include/config.h for options that you may like
478 +to be set differently from my setup.
480 +Some of the patches also need some options defined in your configuration file
481 +(~/.nethackrc in Linux and other unix-like systems, nethack.cnf in OS/2,
482 +defaults.nh on modern windows platforms, maybe something else on some
483 +other platform) to take effect. To turn all of thse on, set
485 +OPTIONS=dumpfile:%n.nh (for the dump character patch in single user systems)
486 +OPTIONS=showborn (to see the numbers of monsters born)
487 +OPTIONS=paranoid_hit,paranoid_quit,paranoid_remove (for the paranoid patch)
488 +OPTIONS=death_explore (to be prompted for explore mode when you die)
489 +OPTIONS=sortloot:loot (for the sortloot patch)
490 +OPTIONS=win_edge (for the window edge patch)
491 +OPTIONS=quiver_fired (for the quiver fired ammunition patch)
492 +OPTIONS=menucolors (to turn on the menucolor option)
493 +MENUCOLOR="* blessed *"=green (some menucolor definition examples)
494 +MENUCOLOR="* holy *"=green (if you have MENU_COLOR_REGEX defined
495 +MENUCOLOR="* cursed *"=red in config.h, leave the asterisks out from
496 +MENUCOLOR="* unholy *"=red the beginning and ending of the options)
497 +MENUCOLOR="* cursed .* (being worn)*"=orange&underline
500 +Jukka Lahtinen, 3.1.2009
501 +jtfjdehf@hotmail.com
502 diff --git a/dat/Makefile b/dat/Makefile
503 new file mode 100644
504 index 0000000..75a5aa8
505 --- /dev/null
506 +++ b/dat/Makefile
507 @@ -0,0 +1,144 @@
508 +# NetHack Makefile.
509 +# SCCS Id: @(#)Makefile.dat 3.4 1992/09/18
511 +# for Atari
512 +# SHELL=E:/GEMINI2/MUPFEL.TTP
513 +# UUDECODE=uudecode
515 +VARDAT = data rumors quest.dat oracles options
517 +all: $(VARDAT) spec_levs quest_levs dungeon
519 +../util/makedefs:
520 + (cd ../util ; make makedefs)
522 +../util/dgn_comp:
523 + (cd ../util ; make dgn_comp)
525 +../util/lev_comp:
526 + (cd ../util ; make lev_comp)
528 +../util/tile2x11:
529 + (cd ../util ; make tile2x11)
531 +../util/tile2beos:
532 + (cd ../util ; make tile2beos)
534 +../util/tile2bmp:
535 + (cd ../util ; make tile2bmp)
537 +x11tiles: ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \
538 + ../win/share/other.txt
539 + ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \
540 + ../win/share/other.txt
542 +beostiles: ../util/tile2beos ../win/share/monsters.txt ../win/share/objects.txt \
543 + ../win/share/other.txt
544 + ../util/tile2beos ../win/share/monsters.txt ../win/share/objects.txt \
545 + ../win/share/other.txt
547 +nhtiles.bmp: ../util/tile2bmp ../win/share/monsters.txt ../win/share/objects.txt \
548 + ../win/share/other.txt
549 + ../util/tile2bmp $@
551 +NetHack.ad: ../win/X11/NetHack.ad
552 + cp ../win/X11/NetHack.ad NetHack.ad
554 +pet_mark.xbm: ../win/X11/pet_mark.xbm
555 + cp ../win/X11/pet_mark.xbm pet_mark.xbm
557 +rip.xpm: ../win/X11/rip.xpm
558 + cp ../win/X11/rip.xpm rip.xpm
560 +mapbg.xpm: ../win/gnome/mapbg.xpm
561 + cp ../win/gnome/mapbg.xpm mapbg.xpm
563 +nhsplash.xpm: ../win/Qt/nhsplash.xpm
564 + cp ../win/Qt/nhsplash.xpm nhsplash.xpm
566 +nethack.icns: ../win/Qt/nhicns.uu
567 + $(UUDECODE) ../win/Qt/nhicns.uu
569 +Info.plist: ../win/Qt/Info.pli
570 + cp ../win/Qt/Info.pli Info.plist
572 +../util/tile2img.ttp:
573 + (cd ../util ; make tile2img.ttp)
575 +../util/xpm2img.ttp:
576 + (cd ../util ; make xpm2img.ttp)
577 +nh16.img: ../util/tile2img.ttp ../win/share/monsters.txt \
578 + ../win/share/objects.txt ../win/share/other.txt
579 + ../util/tile2img.ttp nh16.img
581 +rip.img: ../util/xpm2img.ttp
582 + ../util/xpm2img.ttp ../win/X11/rip.xpm rip.img
583 +title.img:
584 + # cp ../win/gem/title.img title.img
585 + $(UUDECODE) ../win/gem/title.uu
587 +GEM_RSC.RSC:
588 + # cp ../win/gem/GEM_RSC.RSC GEM_RSC.RSC
589 + $(UUDECODE) ../win/gem/gem_rsc.uu
592 +data: data.base ../util/makedefs
593 + ../util/makedefs -d
595 +rumors: rumors.tru rumors.fal ../util/makedefs
596 + ../util/makedefs -r
598 +quest.dat: quest.txt ../util/makedefs
599 + ../util/makedefs -q
601 +oracles: oracles.txt ../util/makedefs
602 + ../util/makedefs -h
604 +# note: 'options' should have already been made when include/date.h was created
605 +options: ../util/makedefs
606 + ../util/makedefs -v
609 +spec_levs: ../util/lev_comp \
610 + bigroom.des castle.des endgame.des gehennom.des knox.des medusa.des \
611 + mines.des oracle.des sokoban.des tower.des yendor.des
612 + ../util/lev_comp bigroom.des
613 + ../util/lev_comp castle.des
614 + ../util/lev_comp endgame.des
615 + ../util/lev_comp gehennom.des
616 + ../util/lev_comp knox.des
617 + ../util/lev_comp medusa.des
618 + ../util/lev_comp mines.des
619 + ../util/lev_comp oracle.des
620 + ../util/lev_comp sokoban.des
621 + ../util/lev_comp tower.des
622 + ../util/lev_comp yendor.des
623 + touch spec_levs
625 +quest_levs: ../util/lev_comp \
626 + Arch.des Barb.des Caveman.des Healer.des Knight.des Monk.des \
627 + Priest.des Ranger.des Rogue.des Samurai.des Tourist.des Valkyrie.des \
628 + Wizard.des
629 + ../util/lev_comp Arch.des
630 + ../util/lev_comp Barb.des
631 + ../util/lev_comp Caveman.des
632 + ../util/lev_comp Healer.des
633 + ../util/lev_comp Knight.des
634 + ../util/lev_comp Monk.des
635 + ../util/lev_comp Priest.des
636 + ../util/lev_comp Ranger.des
637 + ../util/lev_comp Rogue.des
638 + ../util/lev_comp Samurai.des
639 + ../util/lev_comp Tourist.des
640 + ../util/lev_comp Valkyrie.des
641 + ../util/lev_comp Wizard.des
642 + touch quest_levs
644 +dungeon: dungeon.def ../util/makedefs ../util/dgn_comp
645 + ../util/makedefs -e
646 + ../util/dgn_comp dungeon.pdf
648 +spotless:
649 + -rm -f spec_levs quest_levs *.lev $(VARDAT) dungeon dungeon.pdf
650 + -rm -f nhdat x11tiles beostiles pet_mark.xbm rip.xpm mapbg.xpm
651 + -rm -f rip.img GEM_RSC.RSC title.img nh16.img NetHack.ad
652 diff --git a/dat/opthelp b/dat/opthelp
653 index 4dade58..fdec199 100644
654 --- a/dat/opthelp
655 +++ b/dat/opthelp
656 @@ -51,6 +51,10 @@ verbose print more commentary during the game [TRUE]
658 There are further boolean options controlled by compilation flags.
660 +Boolean option if ITEMCAT was set at compile time:
661 +like_swimming allow category "Items known to be Rustprone" in
662 + selection menus [FALSE]
664 Boolean option if INSURANCE was set at compile time:
665 checkpoint save game state after each level change, for possible [TRUE]
666 recovery after program crash
667 @@ -61,6 +65,9 @@ news print any news from game administrator on startup [TRUE]
668 Boolean option if MFLOPPY was set at compile time:
669 checkspace check free disk space before writing files to disk [TRUE]
671 +Boolean option if DEATH_EXPLORE was set at compile time:
672 +death_explore prompt for changing to explore mode when you die [FALSE]
674 Boolean option if EXP_ON_BOTL was set at compile time:
675 showexp display your accumulated experience points [FALSE]
677 @@ -71,17 +78,41 @@ Boolean options if TEXTCOLOR was set at compile time:
678 color use different colors for objects on screen [TRUE for micros]
679 hilite_pet display pets in a highlighted manner [FALSE]
681 +Boolean option if TEXTCOLOR and MENU_COLOR were set at compile time:
682 +menucolors use different colors for menus [TRUE for micros]
684 +Boolean option if PARANOID was set at compile time:
685 +paranoid_hit ask for explicit 'yes' when hitting peacefuls [FALSE]
687 +Boolean option if PARANOID was set at compile time:
688 +paranoid_quit ask for explicit 'yes' when quitting [FALSE]
690 +Boolean option if PARANOID was set at compile time:
691 +paranoid_remove always show menu with the T and R commands [FALSE]
693 +Boolean option if SHOW_BORN was set at compile time:
694 +showborn show numbers of created monsters after the number
695 + vanquished [FALSE]
697 Boolean option if TIMED_DELAY was set at compile time (tty interface only):
698 timed_delay on unix and VMS, use a timer instead of sending
699 extra screen output when attempting to pause for
700 display effect. on MSDOS without the termcap
701 lib, whether or not to pause for visual effect. [TRUE]
703 +Boolean option if QUIVER_FIRED was set at compile time:
704 +quiver_fired when using the f (fire) command and no ammunition
705 + is quivered, prompt for ammunition to quiver, then
706 + fire it. [FALSE]
708 Boolean option if USE_TILES was set at compile time (MSDOS protected mode only):
709 preload_tiles control whether tiles get pre-loaded into RAM at the
710 start of the game. Doing so enhances performance
711 of the tile graphics, but uses more memory. [TRUE]
713 +Boolean option if WIN_EDGE was set at compile time (tty interface only):
714 +win_edge align menus and text windows left instead of right [FALSE]
716 Any Boolean option can be negated by prefixing it with a '!' or 'no'.
719 @@ -92,6 +123,9 @@ Compound options which can be set during the game are:
720 boulder override the default boulder symbol with another default: [`]
721 disclose the types of information you want offered at the end of the
722 game [ni na nv ng nc]
723 +dumpfile the name of the file where to dump the disclosure information
724 + when the game ends (only if the patch has been compiled in)
725 + [none]
726 fruit the name of a fruit you enjoy eating [slime mold]
727 (basically a whimsy which NetHack uses from time to time).
728 menustyle user interface for selection of multiple objects:
729 @@ -120,6 +154,11 @@ runmode controls how often the map window is updated when performing
730 scores the parts of the score list you wish to see when the game ends
731 You choose a combination of top scores, scores around the top
732 scores, and all of your own scores. [!own/3 top/2 around]
733 +sortloot controls the sortloot patch [none]:
734 + full -- All pickup lists of items are sorted by item description
735 + loot -- When inventory letters are shown, has no effect.
736 + Otherwise sorts by description
737 + none -- Works the traditional way, like without the patch
738 suppress_alert disable various version-specific warnings about changes
739 in game play or the user interface, such as notification given
740 for the 'Q' command that quitting is now done via #quit
741 @@ -169,6 +208,21 @@ gender Your starting gender (gender:male or gender:female).
742 still denote your gender using the "male" and "female"
743 options, the "gender" option will take precedence. [RANDOM]
744 horsename the name of your first horse [NONE]
745 +menucolor Set colors for menus. (menucolor:"regex_string"=color)
746 + If boolean option ``menucolors'' is true, menus will be shown
747 + with different colors.
748 + For example, setting ``menucolor:" blessed "=green'' shows
749 + all lines in a menu with the text " blessed " in green.
750 + The string is matched using regular expressions.
751 + Valid values for the color are black, red, green, brown, blue,
752 + magenta, cyan, gray, orange, lightgreen, yellow, lightblue,
753 + lightmagenta, lightcyan and white.
754 + You can define menucolor as many times as you wish; those
755 + defined later will take precedence.
756 + Instead of using this with OPTIONS, consider using
757 + MENUCOLOR="regex_string"=color in the configuration file.
758 + Setting menucolor has effect only if TEXTCOLOR and MENU_COLOR
759 + were set at compile time. [NONE]
760 menu_* create single character accelerators for menu commands. Below
761 is a list of all commands. Each is followed by a list of window-
762 ports that implement them: 'x' is X11, 't' is tty, 'g' is Gem,
763 diff --git a/dat/options b/dat/options
764 new file mode 100644
765 index 0000000..b1b4231
766 --- /dev/null
767 +++ b/dat/options
768 @@ -0,0 +1,29 @@
770 + NetHack version 3.4.3
772 +Options compiled into this edition:
774 + autopickup_exceptions, color, data file compression, data librarian,
775 + debug mode, Elbereth, experience points on status line,
776 + insurance files for recovering from crashes, Keystone Kops, log file,
777 + mail daemon, news file, redo command, rogue level, saddles and riding,
778 + score on status line, screen clipping, seduction, shell command, sinks,
779 + suspend command, terminal info library, timed wait for display effects,
780 + tourists, walled mazes,
781 + save and bones files accepted from versions 3.4.0 through 3.4.3,
782 + patch: colored Hp monitor, patch: dump game end info,
783 + patch: explore mode at death, patch: extra status attributes,
784 + patch: helplessness reasons, patch: item categories,
785 + patch: log move counter, patch: no record entry for quitting,
786 + patch: paranoid, patch: priests for every race,
787 + patch: prompt explore/wizard mode logging,
788 + patch: quiver with the f command, patch: show extinct monsters,
789 + patch: show monsters born, patch: sortloot, patch: splittable #adjust,
790 + patch: tty menu colors via regular expressions, patch: win_edge,
791 + basic NetHack features.
793 +Supported windowing systems:
795 + traditional tty-based graphics,
796 + with a default of tty.
798 diff --git a/dat/wizhelp b/dat/wizhelp
799 index 6b38bc8..6d3c01b 100644
800 --- a/dat/wizhelp
801 +++ b/dat/wizhelp
802 @@ -16,6 +16,7 @@ Debug-Mode Quick Reference:
803 #panic == panic test
804 #polyself == polymorph self
805 #seenv == show seen vectors
806 +#showkills == show numbers of monsters killed
807 #stats == show memory statistics
808 #timeout == look at timeout queue
809 #vision == show vision array
810 diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn
811 index f67f02f..2e7e48d 100644
812 --- a/doc/Guidebook.mn
813 +++ b/doc/Guidebook.mn
814 @@ -1723,6 +1723,8 @@ new players if it detects some anticipated mistakes (default on).
815 .lp "confirm "
816 Have user confirm attacks on pets, shopkeepers, and other
817 peaceable creatures (default on).
818 +.lp death_explore
819 +Prompt for changing to explore mode when your character dies.
820 .lp DECgraphics
821 Use a predefined selection of characters from the DEC VT-xxx/DEC
822 Rainbow/ANSI line-drawing character set to display the dungeon/effects/traps
823 @@ -1770,6 +1772,12 @@ traps and each other as well as by you.
824 .lp dogname
825 Name your starting dog (ex. ``dogname:Fang'').
826 Cannot be set with the `O' command.
827 +.lp dumpfile
828 +The name of a file where the disclosure information is written when the
829 +game ends. You may use the macro %n that will be replaced with the name
830 +of your player character. The game must have write permissions to the
831 +directory where the file is written. Normally /tmp may be used for unix
832 +systems.
833 .lp dungeon
834 Set the graphics symbols for displaying the dungeon
835 (default \&``\ |--------||.-|++##.##<><>_|\e\e#{}.}..##\ #}'').
836 @@ -1874,6 +1882,8 @@ even if you override the selections with your own graphics strings.
837 Ignore interrupt signals, including breaks (default off).
838 .lp legacy
839 Display an introductory message when starting the game (default on).
840 +.lp like_swimming
841 +Allow category ``Items known to be Rustprone'' in selection menus.
842 .lp lit_corridor
843 Show corridor squares seen by night vision or a light source held by your
844 character as lit (default off).
845 @@ -2027,6 +2037,15 @@ Specify the order to list object types in (default ``")[%?+!=/(*`0_'').
846 The value of this option should be a string containing the
847 symbols for the various object types. Any omitted types are filled in
848 at the end from the previous order.
849 +.lp paranoid_hit
850 +If true, asks you to type the word ``yes'' when hitting any peaceful
851 +monster, not just the letter ``y''.
852 +.lp paranoid_quit
853 +If true, asks you to type the word ``yes'' when quitting or entering
854 +Explore mode, not just the letter ``y''.
855 +.lp paranoid_remove
856 +If true, always show menu with the R and T commands even when there is
857 +only one item to remove or take off.
858 .lp perm_invent
859 If true, always display your current inventory in a window. This only
860 makes sense for windowing system interfaces that implement this feature.
861 @@ -2054,6 +2073,9 @@ Prompt for confirmation before praying (default on).
862 .lp pushweapon
863 Using the `w' (wield) command when already wielding
864 something pushes the old item into your alternate weapon slot (default off).
865 +.lp quiver_fired
866 +Using the 'f' (fire) command when nothing is quivered, prompts for ammunition
867 +to quiver, then fires it (default off).
868 .lp race
869 Selects your race (for example, ``race:human''). Default is random.
870 Cannot be set with the `O' command.
871 @@ -2088,6 +2110,10 @@ Prevent you from (knowingly) attacking your pets (default on).
872 Control what parts of the score list you are shown at the end (ex.
873 ``scores:5 top scores/4 around my score/own scores''). Only the first
874 letter of each category (`t', `a', or `o') is necessary.
875 +.lp showborn
876 +When the game ends, show the number of each monster created
877 +in the "Vanquished creatures" list, if it differs from the
878 +number of those monsters killed.
879 .lp showexp
880 Show your accumulated experience points on bottom line (default off).
881 .lp showrace
882 @@ -2098,6 +2124,18 @@ the appearance of the display, not the way the game treats you.
883 Show your approximate accumulated score on bottom line (default off).
884 .lp "silent "
885 Suppress terminal beeps (default on).
886 +.lp sortloot
887 +Controls the behavior of the sortloot patch that sorts pickup lists for
888 +inventory and #loot commands and some others.
889 +The possible values are:
890 +.sd
891 +.si
892 +full - always sort the lists;
893 +loot - only sort the lists that don't use inventory
894 + letters, like with the #loot and pickup commands;
895 +none - show lists the traditional way without sorting.
896 +.ei
897 +.ed
898 .lp sortpack
899 Sort the pack contents by type when displaying inventory (default on).
900 .lp sound
901 @@ -2157,6 +2195,8 @@ Provide more commentary during the game (default on).
902 Select which windowing system to use, such as ``tty'' or ``X11''
903 (default depends on version).
904 Cannot be set with the `O' command.
905 +.lp win_edge
906 +Align menus and text windows in tty left instead of right. (default off)
907 .hn 2
908 Window Port Customization options
910 diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex
911 index f76398f..7ae6d8b 100644
912 --- a/doc/Guidebook.tex
913 +++ b/doc/Guidebook.tex
914 @@ -2161,6 +2161,9 @@ players if it detects some anticipated mistakes (default on).
915 Have user confirm attacks on pets, shopkeepers, and other
916 peaceable creatures (default on).
917 %.lp
918 +\item[\ib{death_explore}]
919 +Prompt for changing to explore mode when your character dies.
920 +%.lp
921 \item[\ib{DECgraphics}]
922 Use a predefined selection of characters from the DEC VT-xxx/DEC
923 Rainbow/ANSI line-drawing character set to display the dungeon/effects/traps
924 @@ -2209,6 +2212,13 @@ traps and each other as well as by you.
925 Name your starting dog (ex.\ ``{\tt dogname:Fang}'').
926 Cannot be set with the `{\tt O}' command.
927 %.lp
928 +\item[\ib{dumpfile}]
929 +The name of a file where the disclosure information is written when the
930 +game ends. You may use the macro %n that will be replaced with the name
931 +of your player character. The game must have write permissions to the
932 +directory where the file is written. Normally /tmp may be used for unix
933 +systems.
934 +%.lp
935 \item[\ib{dungeon}]
936 Set the graphics symbols for displaying the dungeon (default
937 ``\verb& |--------||.-|++##& \verb&.##<><>_|\\#{}.}..## #}&'').
938 @@ -2321,6 +2331,9 @@ Ignore interrupt signals, including breaks (default off).
939 \item[\ib{legacy}]
940 Display an introductory message when starting the game (default on).
941 %.lp
942 +\item[\ib{like\_swimming}]
943 +Allow category ``Items known to be Rustprone'' in selection menus.
944 +%.lp
945 \item[\ib{lit\_corridor}]
946 Show corridor squares seen by night vision or a light source held by your
947 character as lit (default off).
948 @@ -2486,6 +2499,18 @@ Specify the order to list object types in (default
949 containing the symbols for the various object types. Any omitted types
950 are filled in at the end from the previous order.
951 %.lp
952 +\item[\ib{paranoid\_hit}]
953 +If true, asks you to type the word ``yes'' when hitting any peaceful
954 +monster, not just the letter ``y''.
955 +%.lp
956 +\item[\ib{paranoid\_quit}]
957 +If true, asks you to type the word ``yes'' when quitting or entering
958 +Explore mode, not just the letter ``y''.
959 +%.lp
960 +\item[\ib{paranoid\_remove}]
961 +If true, always show menu with the R and T commands even when there is
962 +only one item to remove or take off.
963 +%.lp
964 \item[\ib{perm\_invent}]
965 If true, always display your current inventory in a window. This only
966 makes sense for windowing system interfaces that implement this feature.
967 @@ -2515,6 +2540,10 @@ Prompt for confirmation before praying (default on).
968 \item[\ib{pushweapon}]
969 Using the `w' (wield) command when already wielding
970 something pushes the old item into your alternate weapon slot (default off).
971 +%.lp
972 +\item[\ib{quiver_fired}]
973 +Using the 'f' (fire) command when nothing is quivered, prompts for ammunition
974 +to quiver, then fires it (default off).
975 %.Ip
976 \item[\ib{race}]
977 Selects your race (for example, ``{\tt race:human}''). Default is random.
978 @@ -2559,6 +2588,11 @@ Control what parts of the score list you are shown at the end (ex.\
979 ``{\tt scores:5top scores/4around my score/own scores}''). Only the first
980 letter of each category (`{\tt t}', `{\tt a}' or `{\tt o}') is necessary.
981 %.lp
982 +\item[\ib{showborn}]
983 +When the game ends, show the number of each monster created
984 +in the ``Vanquished creatures'' list, if it differs from the
985 +number of those monsters killed.
986 +%.lp
987 \item[\ib{showexp}]
988 Show your accumulated experience points on bottom line (default off).
989 %.lp
990 @@ -2573,6 +2607,21 @@ Show your approximate accumulated score on bottom line (default off).
991 \item[\ib{silent}]
992 Suppress terminal beeps (default on).
993 %.lp
994 +\item[\ib{sortloot}]
995 +Controls the behavior of the sortloot patch that sorts pickup lists for
996 +inventory and \#loot commands and some others.
998 +The possible values are:
999 +%.sd
1000 +%.si
1001 +{\tt full} --- always sort the lists;\\
1002 +{\tt loot} --- only sort the lists that don't use inventory
1003 + letters, like with the \#loot and pickup commands;\\
1004 +{\tt none} --- show lists the traditional way without sorting.
1005 +%.ei
1006 +%.ed
1007 +%.lp
1008 +The default is 'none', the way an unpatched game works.
1009 \item[\ib{sortpack}]
1010 Sort the pack contents by type when displaying inventory (default on).
1011 %.lp
1012 @@ -2640,6 +2689,9 @@ Provide more commentary during the game (default on).
1013 Select which windowing system to use, such as ``{\tt tty}'' or ``{\tt X11}''
1014 (default depends on version).
1015 Cannot be set with the `{\tt O}' command.
1016 +%.lp
1017 +\item[\ib{win_edge}]
1018 +Align menus and text windows in tty left instead of right. (default off)
1019 \elist
1021 %.hn 2
1022 diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt
1023 index f0f9f7d..6dd2f98 100644
1024 --- a/doc/Guidebook.txt
1025 +++ b/doc/Guidebook.txt
1026 @@ -2223,6 +2223,9 @@
1027 Have user confirm attacks on pets, shopkeepers, and other
1028 peaceable creatures (default on).
1030 + death_explore
1031 + Prompt for changing to explore mode when your character dies.
1033 DECgraphics
1034 Use a predefined selection of characters from the DEC VT-
1035 xxx/DEC Rainbow/ANSI line-drawing character set to display the
1036 @@ -2274,6 +2277,13 @@
1037 Name your starting dog (ex. ``dogname:Fang''). Cannot be set
1038 with the `O' command.
1040 + dumpfile
1041 + The name of a file where the disclosure information is
1042 + written when the game ends. You may use the macro %n that
1043 + will be replaced with the name of your player character.
1044 + The game must have write permissions to the directory where
1045 + the file is written. Normally /tmp may be used for unixes.
1047 dungeon
1048 Set the graphics symbols for displaying the dungeon (default
1049 `` |--------||.-|++##.##<><>_|\\#{}.}..## #}''). The dungeon
1050 @@ -2413,6 +2423,10 @@
1051 Display an introductory message when starting the game (default
1052 on).
1054 + like_swimming
1055 + Allow category "Items known to be Rustprone" in selection
1056 + menus.
1058 lit_corridor
1059 Show corridor squares seen by night vision or a light source
1060 held by your character as lit (default off).
1061 @@ -2607,6 +2621,18 @@
1062 Any omitted types are filled in at the end from the previous
1063 order.
1065 + paranoid_hit
1066 + If true, asks you to type the word ``yes'' when hitting any
1067 + peaceful monster, not just the letter ``y''.
1069 + paranoid_quit
1070 + If true, asks you to type the word ``yes'' when quitting or
1071 + entering Explore mode, not just the letter ``y''.
1073 + paranoid_remove
1074 + If true, always show menu with the R and T commands even when
1075 + there is only one item to remove or take off.
1077 perm_invent
1078 If true, always display your current inventory in a window.
1079 This only makes sense for windowing system interfaces that im-
1080 @@ -2652,6 +2678,10 @@
1081 pushes the old item into your alternate weapon slot (default
1082 off).
1084 + quiver_fired
1085 + Using the 'f' (fire) command when nothing is quivered, prompts
1086 + for ammunition to quiver, then fires it (default off).
1088 race
1089 Selects your race (for example, ``race:human''). Default is
1090 random. Cannot be set with the `O' command.
1091 @@ -2693,6 +2723,11 @@
1092 Only the first letter of each category (`t', `a', or `o') is
1093 necessary.
1095 + showborn
1096 + When the game ends, show the number of each monster created
1097 + in the "Vanquished creatures" list, if it differs from the
1098 + number of those monsters killed.
1100 showexp
1101 Show your accumulated experience points on bottom line (default
1102 off).
1103 @@ -2723,6 +2758,18 @@
1104 silent
1105 Suppress terminal beeps (default on).
1107 + sortloot
1108 + Controls the behavior of the sortloot patch that sorts
1109 + pickup lists for inventory and #loot commands and some
1110 + others.
1111 + The possible values are:
1113 + full - always sort the lists
1114 + loot - only sort the lists that don't use inventory
1115 + letters, like with the #loot and pickup commands
1116 + none - show lists the traditional way without sorting
1117 + The default is 'none', the way an unpatched game works.
1119 sortpack
1120 Sort the pack contents by type when displaying inventory (de-
1121 fault on).
1122 @@ -2808,6 +2855,10 @@
1123 ``X11'' (default depends on version). Cannot be set with the
1124 `O' command.
1126 + win_edge
1127 + Align menus and text windows in tty left instead of right.
1128 + (default off)
1130 9.5. Window Port Customization options
1132 Here are explanations of the various options that are used
1133 diff --git a/doc/Makefile b/doc/Makefile
1134 new file mode 100644
1135 index 0000000..647e90a
1136 --- /dev/null
1137 +++ b/doc/Makefile
1138 @@ -0,0 +1,95 @@
1139 +# NetHack Makefile.
1140 +# SCCS Id: @(#)Makefile.doc 3.4 1996/03/23
1142 +# for Atari
1143 +# SHELL=E:/GEMINI2/MUPFEL.TTP
1145 +GUIDEBOOK = Guidebook # regular ASCII file
1146 +#GUIDEBOOK = Guidebook.ps # PostScript file
1147 +#GUIDEBOOK = Guidebook.dvi # TeX device-independent file
1149 +# Some versions of col need -x to keep them from converting spaces to tabs;
1150 +# some versions of col don't do the conversion by default and don't
1151 +# recognize the option. Sigh.
1152 +COLCMD = col -bx
1153 +#COLCMD = col -b
1155 +# The command to use to generate a PostScript file
1156 +# PSCMD = ditroff | psdit
1157 +PSCMD = groff
1159 +# Use the "cat" GUIDECMD if nroff and/or tbl and/or col are not installed
1160 +# Not appropriate for creating Guidebook.txt.
1161 +# GUIDECMD = cat Guidebook.txt
1162 +# The following works better with groff-1.18, eg on Linux
1163 +# GUIDECMD = tbl tmac.n Guidebook.mn | nroff -c -Tascii | $(COLCMD)
1164 +GUIDECMD = tbl tmac.n Guidebook.mn | nroff | $(COLCMD)
1166 +# the basic guidebook
1167 +Guidebook: Guidebook.mn
1168 + $(GUIDECMD) > Guidebook
1170 +# Fancier output for those with ditroff, psdit and a PostScript printer.
1171 +Guidebook.ps: Guidebook.mn
1172 + tbl tmac.n Guidebook.mn | $(PSCMD) > Guidebook.ps
1174 +# Guidebook.tex is the same as Guidebook.mn but formatted with LaTeX.
1175 +# - The invocation command for LaTeX may vary in different installations.
1176 +# - To print Guidebook.dvi you need to use a suitable dvi-driver.
1177 +Guidebook.dvi: Guidebook.tex
1178 + latex Guidebook.tex
1181 +GAME = nethack
1182 +MANDIR = /usr/man/man6
1183 +MANEXT = 6
1185 +# manual installation for most BSD-style systems
1186 +GAMEMANCREATE = cp nethack.6
1187 +LEVMANCREATE = cp lev_comp.6
1188 +DGNMANCREATE = cp dgn_comp.6
1189 +RCVRMANCREATE = cp recover.6
1190 +DLBMANCREATE = cp dlb.6
1191 +# manual installation for most SYSV-style systems
1192 +# GAMEMANCREATE = nroff -man nethack.6 >
1193 +# LEVMANCREATE = nroff -man lev_comp.6 >
1194 +# DGNMANCREATE = nroff -man dgn_comp.6 >
1195 +# RCVRMANCREATE = nroff -man recover.6 >
1196 +# DLBMANCREATE = nroff -man dlb.6 >
1198 +manpages:
1199 + -$(GAMEMANCREATE) $(MANDIR)/$(GAME).$(MANEXT)
1200 + -$(LEVMANCREATE) $(MANDIR)/lev_comp.$(MANEXT)
1201 + -$(DGNMANCREATE) $(MANDIR)/dgn_comp.$(MANEXT)
1202 + -$(RCVRMANCREATE) $(MANDIR)/recover.$(MANEXT)
1203 + -$(DLBMANCREATE) $(MANDIR)/dlb.$(MANEXT)
1205 +# manual creation for distribution
1206 +DISTRIB = Guidebook.txt nethack.txt lev_comp.txt dgn_comp.txt recover.txt dlb.txt
1208 +distrib: $(DISTRIB)
1209 + @echo "Plain text documentation is up to date."
1211 +Guidebook.txt : Guidebook.mn tmac.n
1212 + $(GUIDECMD) > Guidebook.txt
1213 +nethack.txt : nethack.6
1214 + nroff -man nethack.6 | $(COLCMD) > nethack.txt
1215 +lev_comp.txt : lev_comp.6
1216 + nroff -man lev_comp.6 | $(COLCMD) > lev_comp.txt
1217 +dgn_comp.txt : dgn_comp.6
1218 + nroff -man dgn_comp.6 | $(COLCMD) > dgn_comp.txt
1219 +recover.txt : recover.6
1220 + nroff -man recover.6 | $(COLCMD) > recover.txt
1221 +dlb.txt : dlb.6
1222 + nroff -man dlb.6 | $(COLCMD) > dlb.txt
1225 +clean:
1226 + -rm -f Guidebook.aux Guidebook.log
1228 +spotless: clean
1229 + -rm -f Guidebook Guidebook.ps Guidebook.dvi
1231 +maintainer-clean: spotless
1232 + -rm -f $(DISTRIB)
1233 +# -rm -f Makefile
1234 diff --git a/include/color.h b/include/color.h
1235 index 2fe85d1..9344977 100644
1236 --- a/include/color.h
1237 +++ b/include/color.h
1238 @@ -5,6 +5,12 @@
1239 #ifndef COLOR_H
1240 #define COLOR_H
1242 +#ifdef MENU_COLOR
1243 +# ifdef MENU_COLOR_REGEX
1244 +# include <regex.h>
1245 +# endif
1246 +#endif
1249 * The color scheme used is tailored for an IBM PC. It consists of the
1250 * standard 8 colors, folowed by their bright counterparts. There are
1251 @@ -49,4 +55,16 @@
1252 #define DRAGON_SILVER CLR_BRIGHT_CYAN
1253 #define HI_ZAP CLR_BRIGHT_BLUE
1255 +#ifdef MENU_COLOR
1256 +struct menucoloring {
1257 +# ifdef MENU_COLOR_REGEX
1258 + struct re_pattern_buffer match;
1259 +# else
1260 + char *match;
1261 +# endif
1262 + int color, attr;
1263 + struct menucoloring *next;
1265 +#endif /* MENU_COLOR */
1267 #endif /* COLOR_H */
1268 diff --git a/include/config.h b/include/config.h
1269 index 3efbfa2..1e3c972 100644
1270 --- a/include/config.h
1271 +++ b/include/config.h
1272 @@ -169,8 +169,8 @@
1274 #ifdef UNIX
1275 /* path and file name extension for compression program */
1276 -#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
1277 -#define COMPRESS_EXTENSION ".Z" /* compress's extension */
1278 +#define COMPRESS "/bin/gzip" /* Lempel-Ziv compression */
1279 +#define COMPRESS_EXTENSION ".gz" /* compress's extension */
1280 /* An example of one alternative you might want to use: */
1281 /* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
1282 /* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
1283 @@ -185,7 +185,7 @@
1284 * a tar-like file, thus making a neater installation. See *conf.h
1285 * for detailed configuration.
1287 -/* #define DLB */ /* not supported on all platforms */
1288 +#define DLB /* not supported on all platforms */
1291 * Defining INSURANCE slows down level changes, but allows games that
1292 @@ -204,7 +204,7 @@
1293 * otherwise it will be the current directory.
1295 # ifndef HACKDIR
1296 -# define HACKDIR "/usr/games/lib/nethackdir"
1297 +# define HACKDIR "/usr/share/nethack"
1298 # endif
1301 @@ -338,7 +338,7 @@ typedef unsigned char uchar;
1302 #endif
1304 #define EXP_ON_BOTL /* Show experience on bottom line */
1305 -/* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */
1306 +#define SCORE_ON_BOTL /* added by Gary Erickson (erickson@ucivax) */
1309 * Section 5: EXPERIMENTAL STUFF
1310 @@ -349,7 +349,36 @@ typedef unsigned char uchar;
1313 /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */
1314 -/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
1315 +#define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */
1316 +#define DUMP_LOG /* Dump game end information to a file */
1317 +/* #define DUMP_FN "/tmp/%n.nh" */ /* Fixed dumpfile name, if you want
1318 + * to prevent definition by users */
1319 +#define DUMPMSGS 20 /* Number of latest messages in the dump file */
1320 +#define LOG_MOVES /* Move count and wiz/exp mode info in logfile */
1321 +#define SHOW_BORN /* Show numbers of each monster created */
1322 +#define SHOW_EXTINCT /* Show extinct species in the genocide list */
1323 +#define SORTLOOT /* Enable alphabetical sorting of pickup lists */
1324 +#define PARANOID /* Require "yes" for quit or switch to explore */
1325 +#ifdef TTY_GRAPHICS
1326 +# define HPMON /* Color hp monitor */
1327 +# define MENU_COLOR
1328 +# define MENU_COLOR_REGEX
1329 +/* if MENU_COLOR_REGEX is defined, use regular expressions (GNU regex.h)
1330 + * otherwise use pmatch() to match menu color lines.
1331 + * pmatch() provides basic globbing: '*' and '?' wildcards.
1332 + */
1333 +# define WIN_EDGE /* windows aligned left&top */
1334 +#endif
1335 +#define FORGET_QUITTER /* No record entry for quitters */
1336 +#define PROMPT_LOGEXP /* Prompt for log entry in wizard or explore mode */
1337 +#define DEATH_EXPLORE /* Prompt for explore mode on death */
1338 +#define ITEMCAT /* Additional item categories */
1339 +#define ITEMCAT_JP /* "just picked" category */
1340 +#define ADJSPLIT /* splittable #adjust command */
1341 +#define HELPLESS /* "while helpless" patch */
1342 +#define ENL_STATS /* extra status attributes patch */
1343 +#define QUIVER_FIRED /* prompt quivering on f command */
1344 +#define PRIEST_RACES /* allow all races for priest role */
1346 /* End of Section 5 */
1348 diff --git a/include/date.h b/include/date.h
1349 new file mode 100644
1350 index 0000000..de58b6b
1351 --- /dev/null
1352 +++ b/include/date.h
1353 @@ -0,0 +1,16 @@
1354 +/* SCCS Id: @(#)date.h 3.4 2002/02/03 */
1356 +/* This source file is generated by 'makedefs'. Do not edit. */
1357 +#define BUILD_DATE "Mon Feb 16 15:27:21 2009"
1358 +#define BUILD_TIME (1234816041L)
1360 +#define VERSION_NUMBER 0x03040300UL
1361 +#define VERSION_FEATURES 0x003e0cc6UL
1362 +#define IGNORED_FEATURES 0x00b20000UL
1363 +#define VERSION_SANITY1 0x211b117eUL
1364 +#define VERSION_SANITY2 0xa48195c8UL
1366 +#define VERSION_STRING "3.4.3"
1367 +#define VERSION_ID \
1368 + "Unix NetHack Version 3.4.3 - last build Mon Feb 16 15:27:21 2009."
1370 diff --git a/include/decl.h b/include/decl.h
1371 index 76f9533..1298c82 100644
1372 --- a/include/decl.h
1373 +++ b/include/decl.h
1374 @@ -27,6 +27,9 @@ E char SAVEP[];
1375 E NEARDATA int bases[MAXOCLASSES];
1377 E NEARDATA int multi;
1378 +#ifdef HELPLESS
1379 +E char multi_txt[BUFSZ];
1380 +#endif
1381 #if 0
1382 E NEARDATA int warnlevel;
1383 #endif
1384 @@ -184,6 +187,9 @@ E const char *delayed_killer;
1385 E long done_money;
1386 #endif
1387 E char killer_buf[BUFSZ];
1388 +#ifdef DUMP_LOG
1389 +E char dump_fn[]; /* dumpfile name (dump patch) */
1390 +#endif
1391 E const char *configfile;
1392 E NEARDATA char plname[PL_NSIZ];
1393 E NEARDATA char dogname[];
1394 diff --git a/include/extern.h b/include/extern.h
1395 index 4e2314d..4a657e5 100644
1396 --- a/include/extern.h
1397 +++ b/include/extern.h
1398 @@ -116,6 +116,10 @@ E void NDECL(drag_down);
1400 /* ### bones.c ### */
1402 +#ifdef ENL_STATS
1403 +E const char *NDECL(encstat);
1404 +E const char *NDECL(hunstat);
1405 +#endif
1406 E boolean NDECL(can_make_bones);
1407 E void FDECL(savebones, (struct obj *));
1408 E int NDECL(getbones);
1409 @@ -131,6 +135,10 @@ E long NDECL(botl_score);
1410 E int FDECL(describe_level, (char *));
1411 E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P));
1412 E void NDECL(bot);
1413 +#ifdef DUMP_LOG
1414 +E void FDECL(bot1str, (char *));
1415 +E void FDECL(bot2str, (char *));
1416 +#endif
1418 /* ### cmd.c ### */
1420 @@ -166,6 +174,10 @@ E int NDECL(doextlist);
1421 E int NDECL(extcmd_via_menu);
1422 E void FDECL(enlightenment, (int));
1423 E void FDECL(show_conduct, (int));
1424 +#ifdef DUMP_LOG
1425 +E void FDECL(dump_enlightenment, (int));
1426 +E void FDECL(dump_conduct, (int));
1427 +#endif
1428 E int FDECL(xytod, (SCHAR_P,SCHAR_P));
1429 E void FDECL(dtoxy, (coord *,int));
1430 E int FDECL(movecmd, (CHAR_P));
1431 @@ -281,6 +293,9 @@ E void NDECL(clear_glyph_buffer);
1432 E void FDECL(row_refresh, (int,int,int));
1433 E void NDECL(cls);
1434 E void FDECL(flush_screen, (int));
1435 +#ifdef DUMP_LOG
1436 +E void NDECL(dump_screen);
1437 +#endif
1438 E int FDECL(back_to_glyph, (XCHAR_P,XCHAR_P));
1439 E int FDECL(zapdir_to_glyph, (int,int,int));
1440 E int FDECL(glyph_at, (XCHAR_P,XCHAR_P));
1441 @@ -553,6 +568,10 @@ E void VDECL(panic, (const char *,...)) PRINTF_F(1,2);
1442 #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)
1443 E void FDECL(done, (int));
1444 E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P));
1445 +#ifdef DUMP_LOG
1446 +E void FDECL(dump, (char *, char *));
1447 +E void FDECL(do_containerconts, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P));
1448 +#endif
1449 E void FDECL(terminate, (int));
1450 E int NDECL(num_genocides);
1452 @@ -694,7 +713,11 @@ E void FDECL(check_special_room, (BOOLEAN_P));
1453 E int NDECL(dopickup);
1454 E void NDECL(lookaround);
1455 E int NDECL(monster_nearby);
1456 +#ifdef HELPLESS
1457 +E void FDECL(nomul, (int, const char *));
1458 +#else
1459 E void FDECL(nomul, (int));
1460 +#endif
1461 E void FDECL(unmul, (const char *));
1462 E void FDECL(losehp, (int,const char *,BOOLEAN_P));
1463 E int NDECL(weight_cap);
1464 @@ -790,6 +813,9 @@ E void FDECL(prinv, (const char *,struct obj *,long));
1465 E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long,long));
1466 E int NDECL(ddoinv);
1467 E char FDECL(display_inventory, (const char *,BOOLEAN_P));
1468 +#ifdef DUMP_LOG
1469 +E char FDECL(dump_inventory, (const char *,BOOLEAN_P,BOOLEAN_P));
1470 +#endif
1471 E int FDECL(display_binventory, (int,int,BOOLEAN_P));
1472 E struct obj *FDECL(display_cinventory,(struct obj *));
1473 E struct obj *FDECL(display_minventory,(struct monst *,int,char *));
1474 @@ -1360,6 +1386,9 @@ E char *FDECL(doname, (struct obj *));
1475 E boolean FDECL(not_fully_identified, (struct obj *));
1476 E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P));
1477 E char *FDECL(cxname, (struct obj *));
1478 +#ifdef SORTLOOT
1479 +E char *FDECL(cxname2, (struct obj *));
1480 +#endif
1481 E char *FDECL(killer_xname, (struct obj *));
1482 E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P)));
1483 E char *FDECL(an, (const char *));
1484 @@ -1405,6 +1434,9 @@ E void FDECL(set_option_mod_status, (const char *,int));
1485 E int FDECL(add_autopickup_exception, (const char *));
1486 E void NDECL(free_autopickup_exceptions);
1487 #endif /* AUTOPICKUP_EXCEPTIONS */
1488 +#ifdef MENU_COLOR
1489 +E boolean FDECL(add_menu_coloring, (char *));
1490 +#endif /* MENU_COLOR */
1492 /* ### pager.c ### */
1494 @@ -1483,6 +1515,9 @@ E int FDECL(ck_bag, (struct obj *));
1495 E int FDECL(in_container, (struct obj *));
1496 E int FDECL(out_container, (struct obj *));
1497 #endif
1498 +#ifdef ITEMCAT_JP
1499 +E void FDECL(jpick_free, (struct obj *));
1500 +#endif
1501 E int FDECL(pickup, (int));
1502 E int FDECL(pickup_object, (struct obj *, long, BOOLEAN_P));
1503 E int FDECL(query_category, (const char *, struct obj *, int,
1504 @@ -2016,7 +2051,7 @@ E void NDECL(float_up);
1505 E void FDECL(fill_pit, (int,int));
1506 E int FDECL(float_down, (long, long));
1507 E int FDECL(fire_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P));
1508 -E void FDECL(water_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P));
1509 +E boolean FDECL(water_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P));
1510 E boolean NDECL(drown);
1511 E void FDECL(drain_en, (int));
1512 E int NDECL(dountrap);
1513 @@ -2237,6 +2272,9 @@ E int FDECL(mon_wield_item, (struct monst *));
1514 E int NDECL(abon);
1515 E int NDECL(dbon);
1516 E int NDECL(enhance_weapon_skill);
1517 +#ifdef DUMP_LOG
1518 +E void NDECL(dump_weapon_skill);
1519 +#endif
1520 E void FDECL(unrestrict_weapon_skill, (int));
1521 E void FDECL(use_skill, (int,int));
1522 E void FDECL(add_weapon_skill, (int));
1523 @@ -2367,7 +2405,7 @@ E const char *FDECL(exclam, (int force));
1524 E void FDECL(hit, (const char *,struct monst *,const char *));
1525 E void FDECL(miss, (const char *,struct monst *));
1526 E struct monst *FDECL(bhit, (int,int,int,int,int (*)(MONST_P,OBJ_P),
1527 - int (*)(OBJ_P,OBJ_P),struct obj *));
1528 + int (*)(OBJ_P,OBJ_P),struct obj *, boolean *));
1529 E struct monst *FDECL(boomhit, (int,int));
1530 E int FDECL(burn_floor_paper, (int,int,BOOLEAN_P,BOOLEAN_P));
1531 E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int));
1532 diff --git a/include/flag.h b/include/flag.h
1533 index 1807a0b..1700deb 100644
1534 --- a/include/flag.h
1535 +++ b/include/flag.h
1536 @@ -155,6 +155,9 @@ struct flag {
1539 struct instance_flags {
1540 +#ifdef ITEMCAT
1541 + boolean like_swimming; /* category r - Items known to be Rustprone */
1542 +#endif /* ITEMCAT */
1543 boolean cbreak; /* in cbreak mode, rogue format */
1544 boolean DECgraphics; /* use DEC VT-xxx extended character set */
1545 boolean echo; /* 1 to echo characters */
1546 @@ -183,6 +186,12 @@ struct instance_flags {
1547 char prevmsg_window; /* type of old message window to use */
1548 boolean extmenu; /* extended commands use menu interface */
1549 #endif
1550 +#ifdef MENU_COLOR
1551 + boolean use_menu_color; /* use color in menus; only if wc_color */
1552 +#endif
1553 +#ifdef WIN_EDGE
1554 + boolean win_edge; /* are the menus aligned left&top */
1555 +#endif
1556 #ifdef MFLOPPY
1557 boolean checkspace; /* check disk space before writing files */
1558 /* (in iflags to allow restore after moving
1559 @@ -216,6 +225,23 @@ struct instance_flags {
1560 boolean lan_mail; /* mail is initialized */
1561 boolean lan_mail_fetched; /* mail is awaiting display */
1562 #endif
1563 +#ifdef SHOW_BORN
1564 + boolean show_born; /* show numbers of created monsters */
1565 +#endif
1566 +#ifdef SORTLOOT
1567 + char sortloot; /* sort items to loot alphabetically */
1568 +#endif
1569 +#ifdef PARANOID
1570 + boolean paranoid_hit; /* Ask for 'yes' when hitting peacefuls */
1571 + boolean paranoid_quit; /* Ask for 'yes' when quitting */
1572 + boolean paranoid_remove; /* Always show menu for 'T' and 'R' */
1573 +#endif
1574 +#ifdef DEATH_EXPLORE
1575 + boolean death_expl; /* prompt for explore mode at death */
1576 +#endif
1577 +#ifdef QUIVER_FIRED
1578 + boolean quiver_fired; /* quiver with f command */
1579 +#endif
1581 * Window capability support.
1583 diff --git a/include/hack.h b/include/hack.h
1584 index b7b5835..e8f528a 100644
1585 --- a/include/hack.h
1586 +++ b/include/hack.h
1587 @@ -169,6 +169,13 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
1588 #define BUC_UNCURSED 0x200
1589 #define BUC_UNKNOWN 0x400
1590 #define BUC_ALLBKNOWN (BUC_BLESSED|BUC_CURSED|BUC_UNCURSED)
1591 +#ifdef ITEMCAT
1592 +#define UNIDENTIFIED 0x800
1593 +#define RUSTPRONE 0x1000
1594 +#endif
1595 +#ifdef ITEMCAT_JP
1596 +#define JUSTPICKED 0x2000
1597 +#endif
1598 #define ALL_TYPES_SELECTED -2
1600 /* Flags to control find_mid() */
1601 diff --git a/include/obj.h b/include/obj.h
1602 index 516fc35..537c88d 100644
1603 --- a/include/obj.h
1604 +++ b/include/obj.h
1605 @@ -303,4 +303,17 @@ struct obj {
1606 #define CONTAINED_TOO 0x1
1607 #define BURIED_TOO 0x2
1609 +#ifdef ITEMCAT
1610 +#ifdef MAIL
1611 +#define BKNOWN(otmp) (otmp->bknown || otmp->otyp == SCR_MAIL)
1612 +#else
1613 +#define BKNOWN(otmp) (otmp->bknown)
1614 +#endif
1616 +/* faster version of not_fully_identified() for item selection
1617 + * (invent.c/pickup.c) */
1618 +#define NOT_FULLY_IDENTIFIED(otmp) (otmp->oclass != COIN_CLASS && !(otmp->known && otmp->dknown && BKNOWN(otmp) && objects[otmp->otyp].oc_name_known) || (otmp->oartifact && undiscovered_artifact(otmp->oartifact)) || (!otmp->rknown && ((otmp->oclass == ARMOR_CLASS || otmp->oclass == WEAPON_CLASS || is_weptool(otmp) || otmp->oclass == BALL_CLASS)) && (is_rustprone(otmp) || is_corrodeable(otmp) || is_flammable(otmp))))
1620 +#endif /* ITEMCAT */
1622 #endif /* OBJ_H */
1623 diff --git a/include/objclass.h b/include/objclass.h
1624 index 0af21a4..c5f224d 100644
1625 --- a/include/objclass.h
1626 +++ b/include/objclass.h
1627 @@ -70,6 +70,14 @@ struct objclass {
1628 /* primary damage: fire/rust/--- */
1629 /* is_flammable(otmp), is_rottable(otmp) in mkobj.c */
1630 #define is_rustprone(otmp) (objects[otmp->otyp].oc_material == IRON)
1631 +#ifdef ITEMCAT
1632 +/* is rustprone, and rust matters (is displayed in inventory listing) */
1633 +#define is_rustprone2(otmp) (is_rustprone(otmp) && (otmp->oclass==WEAPON_CLASS || otmp->oclass==ARMOR_CLASS || otmp->oclass==TOOL_CLASS || otmp->oclass==WAND_CLASS || otmp->oclass==RING_CLASS || otmp->oclass==BALL_CLASS || otmp->oclass==CHAIN_CLASS))
1634 +/* rustproneness should not be immediately visible */
1635 +#define hide_rust(otmp) ((otmp->otyp==GAUNTLETS_OF_POWER || otmp->otyp==KICKING_BOOTS) && !otmp->oeroded)
1636 +/* object is known to be rustprone and is NOT known to be rustproof */
1637 +#define is_known_rustprone(otmp) (is_rustprone2(otmp) && !(otmp->rknown && otmp->oerodeproof) && (!hide_rust(otmp) || objects[otmp->otyp].oc_name_known))
1638 +#endif /* ITEMCAT */
1640 /* secondary damage: rot/acid/acid */
1641 #define is_corrodeable(otmp) (objects[otmp->otyp].oc_material == COPPER || objects[otmp->otyp].oc_material == IRON)
1642 diff --git a/include/onames.h b/include/onames.h
1643 new file mode 100644
1644 index 0000000..7584a9f
1645 --- /dev/null
1646 +++ b/include/onames.h
1647 @@ -0,0 +1,474 @@
1648 +/* SCCS Id: @(#)onames.h 3.4 2002/02/03 */
1650 +/* This source file is generated by 'makedefs'. Do not edit. */
1651 +#ifndef ONAMES_H
1652 +#define ONAMES_H
1654 +#define STRANGE_OBJECT 0
1655 +#define ARROW 1
1656 +#define ELVEN_ARROW 2
1657 +#define ORCISH_ARROW 3
1658 +#define SILVER_ARROW 4
1659 +#define YA 5
1660 +#define CROSSBOW_BOLT 6
1661 +#define DART 7
1662 +#define SHURIKEN 8
1663 +#define BOOMERANG 9
1664 +#define SPEAR 10
1665 +#define ELVEN_SPEAR 11
1666 +#define ORCISH_SPEAR 12
1667 +#define DWARVISH_SPEAR 13
1668 +#define SILVER_SPEAR 14
1669 +#define JAVELIN 15
1670 +#define TRIDENT 16
1671 +#define DAGGER 17
1672 +#define ELVEN_DAGGER 18
1673 +#define ORCISH_DAGGER 19
1674 +#define SILVER_DAGGER 20
1675 +#define ATHAME 21
1676 +#define SCALPEL 22
1677 +#define KNIFE 23
1678 +#define STILETTO 24
1679 +#define WORM_TOOTH 25
1680 +#define CRYSKNIFE 26
1681 +#define AXE 27
1682 +#define BATTLE_AXE 28
1683 +#define SHORT_SWORD 29
1684 +#define ELVEN_SHORT_SWORD 30
1685 +#define ORCISH_SHORT_SWORD 31
1686 +#define DWARVISH_SHORT_SWORD 32
1687 +#define SCIMITAR 33
1688 +#define SILVER_SABER 34
1689 +#define BROADSWORD 35
1690 +#define ELVEN_BROADSWORD 36
1691 +#define LONG_SWORD 37
1692 +#define TWO_HANDED_SWORD 38
1693 +#define KATANA 39
1694 +#define TSURUGI 40
1695 +#define RUNESWORD 41
1696 +#define PARTISAN 42
1697 +#define RANSEUR 43
1698 +#define SPETUM 44
1699 +#define GLAIVE 45
1700 +#define LANCE 46
1701 +#define HALBERD 47
1702 +#define BARDICHE 48
1703 +#define VOULGE 49
1704 +#define DWARVISH_MATTOCK 50
1705 +#define FAUCHARD 51
1706 +#define GUISARME 52
1707 +#define BILL_GUISARME 53
1708 +#define LUCERN_HAMMER 54
1709 +#define BEC_DE_CORBIN 55
1710 +#define MACE 56
1711 +#define MORNING_STAR 57
1712 +#define WAR_HAMMER 58
1713 +#define CLUB 59
1714 +#define RUBBER_HOSE 60
1715 +#define QUARTERSTAFF 61
1716 +#define AKLYS 62
1717 +#define FLAIL 63
1718 +#define BULLWHIP 64
1719 +#define BOW 65
1720 +#define ELVEN_BOW 66
1721 +#define ORCISH_BOW 67
1722 +#define YUMI 68
1723 +#define SLING 69
1724 +#define CROSSBOW 70
1725 +#define ELVEN_LEATHER_HELM 71
1726 +#define ORCISH_HELM 72
1727 +#define DWARVISH_IRON_HELM 73
1728 +#define FEDORA 74
1729 +#define CORNUTHAUM 75
1730 +#define DUNCE_CAP 76
1731 +#define DENTED_POT 77
1732 +#define HELMET 78
1733 +#define HELM_OF_BRILLIANCE 79
1734 +#define HELM_OF_OPPOSITE_ALIGNMENT 80
1735 +#define HELM_OF_TELEPATHY 81
1736 +#define GRAY_DRAGON_SCALE_MAIL 82
1737 +#define SILVER_DRAGON_SCALE_MAIL 83
1738 +#define RED_DRAGON_SCALE_MAIL 84
1739 +#define WHITE_DRAGON_SCALE_MAIL 85
1740 +#define ORANGE_DRAGON_SCALE_MAIL 86
1741 +#define BLACK_DRAGON_SCALE_MAIL 87
1742 +#define BLUE_DRAGON_SCALE_MAIL 88
1743 +#define GREEN_DRAGON_SCALE_MAIL 89
1744 +#define YELLOW_DRAGON_SCALE_MAIL 90
1745 +#define GRAY_DRAGON_SCALES 91
1746 +#define SILVER_DRAGON_SCALES 92
1747 +#define RED_DRAGON_SCALES 93
1748 +#define WHITE_DRAGON_SCALES 94
1749 +#define ORANGE_DRAGON_SCALES 95
1750 +#define BLACK_DRAGON_SCALES 96
1751 +#define BLUE_DRAGON_SCALES 97
1752 +#define GREEN_DRAGON_SCALES 98
1753 +#define YELLOW_DRAGON_SCALES 99
1754 +#define PLATE_MAIL 100
1755 +#define CRYSTAL_PLATE_MAIL 101
1756 +#define BRONZE_PLATE_MAIL 102
1757 +#define SPLINT_MAIL 103
1758 +#define BANDED_MAIL 104
1759 +#define DWARVISH_MITHRIL_COAT 105
1760 +#define ELVEN_MITHRIL_COAT 106
1761 +#define CHAIN_MAIL 107
1762 +#define ORCISH_CHAIN_MAIL 108
1763 +#define SCALE_MAIL 109
1764 +#define STUDDED_LEATHER_ARMOR 110
1765 +#define RING_MAIL 111
1766 +#define ORCISH_RING_MAIL 112
1767 +#define LEATHER_ARMOR 113
1768 +#define LEATHER_JACKET 114
1769 +#define HAWAIIAN_SHIRT 115
1770 +#define T_SHIRT 116
1771 +#define MUMMY_WRAPPING 117
1772 +#define ELVEN_CLOAK 118
1773 +#define ORCISH_CLOAK 119
1774 +#define DWARVISH_CLOAK 120
1775 +#define OILSKIN_CLOAK 121
1776 +#define ROBE 122
1777 +#define ALCHEMY_SMOCK 123
1778 +#define LEATHER_CLOAK 124
1779 +#define CLOAK_OF_PROTECTION 125
1780 +#define CLOAK_OF_INVISIBILITY 126
1781 +#define CLOAK_OF_MAGIC_RESISTANCE 127
1782 +#define CLOAK_OF_DISPLACEMENT 128
1783 +#define SMALL_SHIELD 129
1784 +#define ELVEN_SHIELD 130
1785 +#define URUK_HAI_SHIELD 131
1786 +#define ORCISH_SHIELD 132
1787 +#define LARGE_SHIELD 133
1788 +#define DWARVISH_ROUNDSHIELD 134
1789 +#define SHIELD_OF_REFLECTION 135
1790 +#define LEATHER_GLOVES 136
1791 +#define GAUNTLETS_OF_FUMBLING 137
1792 +#define GAUNTLETS_OF_POWER 138
1793 +#define GAUNTLETS_OF_DEXTERITY 139
1794 +#define LOW_BOOTS 140
1795 +#define IRON_SHOES 141
1796 +#define HIGH_BOOTS 142
1797 +#define SPEED_BOOTS 143
1798 +#define WATER_WALKING_BOOTS 144
1799 +#define JUMPING_BOOTS 145
1800 +#define ELVEN_BOOTS 146
1801 +#define KICKING_BOOTS 147
1802 +#define FUMBLE_BOOTS 148
1803 +#define LEVITATION_BOOTS 149
1804 +#define RIN_ADORNMENT 150
1805 +#define RIN_GAIN_STRENGTH 151
1806 +#define RIN_GAIN_CONSTITUTION 152
1807 +#define RIN_INCREASE_ACCURACY 153
1808 +#define RIN_INCREASE_DAMAGE 154
1809 +#define RIN_PROTECTION 155
1810 +#define RIN_REGENERATION 156
1811 +#define RIN_SEARCHING 157
1812 +#define RIN_STEALTH 158
1813 +#define RIN_SUSTAIN_ABILITY 159
1814 +#define RIN_LEVITATION 160
1815 +#define RIN_HUNGER 161
1816 +#define RIN_AGGRAVATE_MONSTER 162
1817 +#define RIN_CONFLICT 163
1818 +#define RIN_WARNING 164
1819 +#define RIN_POISON_RESISTANCE 165
1820 +#define RIN_FIRE_RESISTANCE 166
1821 +#define RIN_COLD_RESISTANCE 167
1822 +#define RIN_SHOCK_RESISTANCE 168
1823 +#define RIN_FREE_ACTION 169
1824 +#define RIN_SLOW_DIGESTION 170
1825 +#define RIN_TELEPORTATION 171
1826 +#define RIN_TELEPORT_CONTROL 172
1827 +#define RIN_POLYMORPH 173
1828 +#define RIN_POLYMORPH_CONTROL 174
1829 +#define RIN_INVISIBILITY 175
1830 +#define RIN_SEE_INVISIBLE 176
1831 +#define RIN_PROTECTION_FROM_SHAPE_CHAN 177
1832 +#define AMULET_OF_ESP 178
1833 +#define AMULET_OF_LIFE_SAVING 179
1834 +#define AMULET_OF_STRANGULATION 180
1835 +#define AMULET_OF_RESTFUL_SLEEP 181
1836 +#define AMULET_VERSUS_POISON 182
1837 +#define AMULET_OF_CHANGE 183
1838 +#define AMULET_OF_UNCHANGING 184
1839 +#define AMULET_OF_REFLECTION 185
1840 +#define AMULET_OF_MAGICAL_BREATHING 186
1841 +#define FAKE_AMULET_OF_YENDOR 187
1842 +#define AMULET_OF_YENDOR 188
1843 +#define LARGE_BOX 189
1844 +#define CHEST 190
1845 +#define ICE_BOX 191
1846 +#define SACK 192
1847 +#define OILSKIN_SACK 193
1848 +#define BAG_OF_HOLDING 194
1849 +#define BAG_OF_TRICKS 195
1850 +#define SKELETON_KEY 196
1851 +#define LOCK_PICK 197
1852 +#define CREDIT_CARD 198
1853 +#define TALLOW_CANDLE 199
1854 +#define WAX_CANDLE 200
1855 +#define BRASS_LANTERN 201
1856 +#define OIL_LAMP 202
1857 +#define MAGIC_LAMP 203
1858 +#define EXPENSIVE_CAMERA 204
1859 +#define MIRROR 205
1860 +#define CRYSTAL_BALL 206
1861 +#define LENSES 207
1862 +#define BLINDFOLD 208
1863 +#define TOWEL 209
1864 +#define SADDLE 210
1865 +#define LEASH 211
1866 +#define STETHOSCOPE 212
1867 +#define TINNING_KIT 213
1868 +#define TIN_OPENER 214
1869 +#define CAN_OF_GREASE 215
1870 +#define FIGURINE 216
1871 +#define MAGIC_MARKER 217
1872 +#define LAND_MINE 218
1873 +#define BEARTRAP 219
1874 +#define TIN_WHISTLE 220
1875 +#define MAGIC_WHISTLE 221
1876 +#define WOODEN_FLUTE 222
1877 +#define MAGIC_FLUTE 223
1878 +#define TOOLED_HORN 224
1879 +#define FROST_HORN 225
1880 +#define FIRE_HORN 226
1881 +#define HORN_OF_PLENTY 227
1882 +#define WOODEN_HARP 228
1883 +#define MAGIC_HARP 229
1884 +#define BELL 230
1885 +#define BUGLE 231
1886 +#define LEATHER_DRUM 232
1887 +#define DRUM_OF_EARTHQUAKE 233
1888 +#define PICK_AXE 234
1889 +#define GRAPPLING_HOOK 235
1890 +#define UNICORN_HORN 236
1891 +#define CANDELABRUM_OF_INVOCATION 237
1892 +#define BELL_OF_OPENING 238
1893 +#define TRIPE_RATION 239
1894 +#define CORPSE 240
1895 +#define EGG 241
1896 +#define MEATBALL 242
1897 +#define MEAT_STICK 243
1898 +#define HUGE_CHUNK_OF_MEAT 244
1899 +#define MEAT_RING 245
1900 +#define KELP_FROND 246
1901 +#define EUCALYPTUS_LEAF 247
1902 +#define APPLE 248
1903 +#define ORANGE 249
1904 +#define PEAR 250
1905 +#define MELON 251
1906 +#define BANANA 252
1907 +#define CARROT 253
1908 +#define SPRIG_OF_WOLFSBANE 254
1909 +#define CLOVE_OF_GARLIC 255
1910 +#define SLIME_MOLD 256
1911 +#define LUMP_OF_ROYAL_JELLY 257
1912 +#define CREAM_PIE 258
1913 +#define CANDY_BAR 259
1914 +#define FORTUNE_COOKIE 260
1915 +#define PANCAKE 261
1916 +#define LEMBAS_WAFER 262
1917 +#define CRAM_RATION 263
1918 +#define FOOD_RATION 264
1919 +#define K_RATION 265
1920 +#define C_RATION 266
1921 +#define TIN 267
1922 +#define POT_GAIN_ABILITY 268
1923 +#define POT_RESTORE_ABILITY 269
1924 +#define POT_CONFUSION 270
1925 +#define POT_BLINDNESS 271
1926 +#define POT_PARALYSIS 272
1927 +#define POT_SPEED 273
1928 +#define POT_LEVITATION 274
1929 +#define POT_HALLUCINATION 275
1930 +#define POT_INVISIBILITY 276
1931 +#define POT_SEE_INVISIBLE 277
1932 +#define POT_HEALING 278
1933 +#define POT_EXTRA_HEALING 279
1934 +#define POT_GAIN_LEVEL 280
1935 +#define POT_ENLIGHTENMENT 281
1936 +#define POT_MONSTER_DETECTION 282
1937 +#define POT_OBJECT_DETECTION 283
1938 +#define POT_GAIN_ENERGY 284
1939 +#define POT_SLEEPING 285
1940 +#define POT_FULL_HEALING 286
1941 +#define POT_POLYMORPH 287
1942 +#define POT_BOOZE 288
1943 +#define POT_SICKNESS 289
1944 +#define POT_FRUIT_JUICE 290
1945 +#define POT_ACID 291
1946 +#define POT_OIL 292
1947 +#define POT_WATER 293
1948 +#define SCR_ENCHANT_ARMOR 294
1949 +#define SCR_DESTROY_ARMOR 295
1950 +#define SCR_CONFUSE_MONSTER 296
1951 +#define SCR_SCARE_MONSTER 297
1952 +#define SCR_REMOVE_CURSE 298
1953 +#define SCR_ENCHANT_WEAPON 299
1954 +#define SCR_CREATE_MONSTER 300
1955 +#define SCR_TAMING 301
1956 +#define SCR_GENOCIDE 302
1957 +#define SCR_LIGHT 303
1958 +#define SCR_TELEPORTATION 304
1959 +#define SCR_GOLD_DETECTION 305
1960 +#define SCR_FOOD_DETECTION 306
1961 +#define SCR_IDENTIFY 307
1962 +#define SCR_MAGIC_MAPPING 308
1963 +#define SCR_AMNESIA 309
1964 +#define SCR_FIRE 310
1965 +#define SCR_EARTH 311
1966 +#define SCR_PUNISHMENT 312
1967 +#define SCR_CHARGING 313
1968 +#define SCR_STINKING_CLOUD 314
1969 +#define SCR_MAIL 319
1970 +#define SCR_BLANK_PAPER 320
1971 +#define SPE_DIG 321
1972 +#define SPE_MAGIC_MISSILE 322
1973 +#define SPE_FIREBALL 323
1974 +#define SPE_CONE_OF_COLD 324
1975 +#define SPE_SLEEP 325
1976 +#define SPE_FINGER_OF_DEATH 326
1977 +#define SPE_LIGHT 327
1978 +#define SPE_DETECT_MONSTERS 328
1979 +#define SPE_HEALING 329
1980 +#define SPE_KNOCK 330
1981 +#define SPE_FORCE_BOLT 331
1982 +#define SPE_CONFUSE_MONSTER 332
1983 +#define SPE_CURE_BLINDNESS 333
1984 +#define SPE_DRAIN_LIFE 334
1985 +#define SPE_SLOW_MONSTER 335
1986 +#define SPE_WIZARD_LOCK 336
1987 +#define SPE_CREATE_MONSTER 337
1988 +#define SPE_DETECT_FOOD 338
1989 +#define SPE_CAUSE_FEAR 339
1990 +#define SPE_CLAIRVOYANCE 340
1991 +#define SPE_CURE_SICKNESS 341
1992 +#define SPE_CHARM_MONSTER 342
1993 +#define SPE_HASTE_SELF 343
1994 +#define SPE_DETECT_UNSEEN 344
1995 +#define SPE_LEVITATION 345
1996 +#define SPE_EXTRA_HEALING 346
1997 +#define SPE_RESTORE_ABILITY 347
1998 +#define SPE_INVISIBILITY 348
1999 +#define SPE_DETECT_TREASURE 349
2000 +#define SPE_REMOVE_CURSE 350
2001 +#define SPE_MAGIC_MAPPING 351
2002 +#define SPE_IDENTIFY 352
2003 +#define SPE_TURN_UNDEAD 353
2004 +#define SPE_POLYMORPH 354
2005 +#define SPE_TELEPORT_AWAY 355
2006 +#define SPE_CREATE_FAMILIAR 356
2007 +#define SPE_CANCELLATION 357
2008 +#define SPE_PROTECTION 358
2009 +#define SPE_JUMPING 359
2010 +#define SPE_STONE_TO_FLESH 360
2011 +#define SPE_BLANK_PAPER 361
2012 +#define SPE_BOOK_OF_THE_DEAD 362
2013 +#define WAN_LIGHT 363
2014 +#define WAN_SECRET_DOOR_DETECTION 364
2015 +#define WAN_ENLIGHTENMENT 365
2016 +#define WAN_CREATE_MONSTER 366
2017 +#define WAN_WISHING 367
2018 +#define WAN_NOTHING 368
2019 +#define WAN_STRIKING 369
2020 +#define WAN_MAKE_INVISIBLE 370
2021 +#define WAN_SLOW_MONSTER 371
2022 +#define WAN_SPEED_MONSTER 372
2023 +#define WAN_UNDEAD_TURNING 373
2024 +#define WAN_POLYMORPH 374
2025 +#define WAN_CANCELLATION 375
2026 +#define WAN_TELEPORTATION 376
2027 +#define WAN_OPENING 377
2028 +#define WAN_LOCKING 378
2029 +#define WAN_PROBING 379
2030 +#define WAN_DIGGING 380
2031 +#define WAN_MAGIC_MISSILE 381
2032 +#define WAN_FIRE 382
2033 +#define WAN_COLD 383
2034 +#define WAN_SLEEP 384
2035 +#define WAN_DEATH 385
2036 +#define WAN_LIGHTNING 386
2037 +#define GOLD_PIECE 390
2038 +#define DILITHIUM_CRYSTAL 391
2039 +#define DIAMOND 392
2040 +#define RUBY 393
2041 +#define JACINTH 394
2042 +#define SAPPHIRE 395
2043 +#define BLACK_OPAL 396
2044 +#define EMERALD 397
2045 +#define TURQUOISE 398
2046 +#define CITRINE 399
2047 +#define AQUAMARINE 400
2048 +#define AMBER 401
2049 +#define TOPAZ 402
2050 +#define JET 403
2051 +#define OPAL 404
2052 +#define CHRYSOBERYL 405
2053 +#define GARNET 406
2054 +#define AMETHYST 407
2055 +#define JASPER 408
2056 +#define FLUORITE 409
2057 +#define OBSIDIAN 410
2058 +#define AGATE 411
2059 +#define JADE 412
2060 +/* #define WORTHLESS_PIECE_OF_WHITE_GLASS 413 */
2061 +/* #define WORTHLESS_PIECE_OF_BLUE_GLASS 414 */
2062 +/* #define WORTHLESS_PIECE_OF_RED_GLASS 415 */
2063 +/* #define WORTHLESS_PIECE_OF_YELLOWISH_BROWN_GLASS 416 */
2064 +/* #define WORTHLESS_PIECE_OF_ORANGE_GLASS 417 */
2065 +/* #define WORTHLESS_PIECE_OF_YELLOW_GLASS 418 */
2066 +/* #define WORTHLESS_PIECE_OF_BLACK_GLASS 419 */
2067 +/* #define WORTHLESS_PIECE_OF_GREEN_GLASS 420 */
2068 +/* #define WORTHLESS_PIECE_OF_VIOLET_GLASS 421 */
2069 +#define LUCKSTONE 422
2070 +#define LOADSTONE 423
2071 +#define TOUCHSTONE 424
2072 +#define FLINT 425
2073 +#define ROCK 426
2074 +#define BOULDER 427
2075 +#define STATUE 428
2076 +#define HEAVY_IRON_BALL 429
2077 +#define IRON_CHAIN 430
2078 +#define BLINDING_VENOM 431
2079 +#define ACID_VENOM 432
2080 +#define LAST_GEM (JADE)
2081 +#define MAXSPELL 43
2082 +#define NUM_OBJECTS 433
2084 +/* Artifacts (unique objects) */
2086 +#define ART_EXCALIBUR 1
2087 +#define ART_STORMBRINGER 2
2088 +#define ART_MJOLLNIR 3
2089 +#define ART_CLEAVER 4
2090 +#define ART_GRIMTOOTH 5
2091 +#define ART_ORCRIST 6
2092 +#define ART_STING 7
2093 +#define ART_MAGICBANE 8
2094 +#define ART_FROST_BRAND 9
2095 +#define ART_FIRE_BRAND 10
2096 +#define ART_DRAGONBANE 11
2097 +#define ART_DEMONBANE 12
2098 +#define ART_WEREBANE 13
2099 +#define ART_GRAYSWANDIR 14
2100 +#define ART_GIANTSLAYER 15
2101 +#define ART_OGRESMASHER 16
2102 +#define ART_TROLLSBANE 17
2103 +#define ART_VORPAL_BLADE 18
2104 +#define ART_SNICKERSNEE 19
2105 +#define ART_SUNSWORD 20
2106 +#define ART_ORB_OF_DETECTION 21
2107 +#define ART_HEART_OF_AHRIMAN 22
2108 +#define ART_SCEPTRE_OF_MIGHT 23
2109 +#define ART_STAFF_OF_AESCULAPIUS 24
2110 +#define ART_MAGIC_MIRROR_OF_MERLIN 25
2111 +#define ART_EYES_OF_THE_OVERWORLD 26
2112 +#define ART_MITRE_OF_HOLINESS 27
2113 +#define ART_LONGBOW_OF_DIANA 28
2114 +#define ART_MASTER_KEY_OF_THIEVERY 29
2115 +#define ART_TSURUGI_OF_MURAMASA 30
2116 +#define ART_YENDORIAN_EXPRESS_CARD 31
2117 +#define ART_ORB_OF_FATE 32
2118 +#define ART_EYE_OF_THE_AETHIOPICA 33
2119 +#define NROFARTIFACTS 33
2121 +#endif /* ONAMES_H */
2122 diff --git a/include/os2conf.h b/include/os2conf.h
2123 index b706df1..e955c42 100644
2124 --- a/include/os2conf.h
2125 +++ b/include/os2conf.h
2126 @@ -23,12 +23,15 @@
2129 #define OS2_USESYSHEADERS /* use compiler's own system headers */
2130 -/* #define OS2_HPFS /* use OS/2 High Performance File System */
2131 +#define OS2_HPFS /* use OS/2 High Performance File System */
2133 #if defined(OS2_GCC) || defined(OS2_CSET2)
2134 # define OS2_32BITAPI /* enable for compilation in OS/2 2.0 */
2135 #endif
2137 +/* These are needed to allow defining directory names in the config file */
2138 +#define NOCWD_ASSUMPTIONS
2139 +#define PC_LOCKING
2140 +#define HLOCK "NHPERM"
2142 * Other configurable options. Generally no
2143 * reason to touch the defaults, I think.
2144 @@ -41,6 +44,10 @@
2145 #define ANSI_DEFAULT /* allows NetHack to run without termcap file */
2146 #define TEXTCOLOR /* allow color */
2148 +#ifdef TIMED_DELAY
2149 +# define msleep(k) _sleep2(k)
2150 +#endif
2153 * The remaining code shouldn't need modification.
2155 diff --git a/include/pm.h b/include/pm.h
2156 new file mode 100644
2157 index 0000000..8cf7a0c
2158 --- /dev/null
2159 +++ b/include/pm.h
2160 @@ -0,0 +1,393 @@
2161 +/* SCCS Id: @(#)pm.h 3.4 2002/02/03 */
2163 +/* This source file is generated by 'makedefs'. Do not edit. */
2164 +#ifndef PM_H
2165 +#define PM_H
2167 +#define PM_PLAYERMON (-1)
2168 +#define PM_GIANT_ANT 0
2169 +#define PM_KILLER_BEE 1
2170 +#define PM_SOLDIER_ANT 2
2171 +#define PM_FIRE_ANT 3
2172 +#define PM_GIANT_BEETLE 4
2173 +#define PM_QUEEN_BEE 5
2174 +#define PM_ACID_BLOB 6
2175 +#define PM_QUIVERING_BLOB 7
2176 +#define PM_GELATINOUS_CUBE 8
2177 +#define PM_CHICKATRICE 9
2178 +#define PM_COCKATRICE 10
2179 +#define PM_PYROLISK 11
2180 +#define PM_JACKAL 12
2181 +#define PM_FOX 13
2182 +#define PM_COYOTE 14
2183 +#define PM_WEREJACKAL 15
2184 +#define PM_LITTLE_DOG 16
2185 +#define PM_DOG 17
2186 +#define PM_LARGE_DOG 18
2187 +#define PM_DINGO 19
2188 +#define PM_WOLF 20
2189 +#define PM_WEREWOLF 21
2190 +#define PM_WARG 22
2191 +#define PM_WINTER_WOLF_CUB 23
2192 +#define PM_WINTER_WOLF 24
2193 +#define PM_HELL_HOUND_PUP 25
2194 +#define PM_HELL_HOUND 26
2195 +#define PM_GAS_SPORE 27
2196 +#define PM_FLOATING_EYE 28
2197 +#define PM_FREEZING_SPHERE 29
2198 +#define PM_FLAMING_SPHERE 30
2199 +#define PM_SHOCKING_SPHERE 31
2200 +#define PM_KITTEN 32
2201 +#define PM_HOUSECAT 33
2202 +#define PM_JAGUAR 34
2203 +#define PM_LYNX 35
2204 +#define PM_PANTHER 36
2205 +#define PM_LARGE_CAT 37
2206 +#define PM_TIGER 38
2207 +#define PM_GREMLIN 39
2208 +#define PM_GARGOYLE 40
2209 +#define PM_WINGED_GARGOYLE 41
2210 +#define PM_HOBBIT 42
2211 +#define PM_DWARF 43
2212 +#define PM_BUGBEAR 44
2213 +#define PM_DWARF_LORD 45
2214 +#define PM_DWARF_KING 46
2215 +#define PM_MIND_FLAYER 47
2216 +#define PM_MASTER_MIND_FLAYER 48
2217 +#define PM_MANES 49
2218 +#define PM_HOMUNCULUS 50
2219 +#define PM_IMP 51
2220 +#define PM_LEMURE 52
2221 +#define PM_QUASIT 53
2222 +#define PM_TENGU 54
2223 +#define PM_BLUE_JELLY 55
2224 +#define PM_SPOTTED_JELLY 56
2225 +#define PM_OCHRE_JELLY 57
2226 +#define PM_KOBOLD 58
2227 +#define PM_LARGE_KOBOLD 59
2228 +#define PM_KOBOLD_LORD 60
2229 +#define PM_KOBOLD_SHAMAN 61
2230 +#define PM_LEPRECHAUN 62
2231 +#define PM_SMALL_MIMIC 63
2232 +#define PM_LARGE_MIMIC 64
2233 +#define PM_GIANT_MIMIC 65
2234 +#define PM_WOOD_NYMPH 66
2235 +#define PM_WATER_NYMPH 67
2236 +#define PM_MOUNTAIN_NYMPH 68
2237 +#define PM_GOBLIN 69
2238 +#define PM_HOBGOBLIN 70
2239 +#define PM_ORC 71
2240 +#define PM_HILL_ORC 72
2241 +#define PM_MORDOR_ORC 73
2242 +#define PM_URUK_HAI 74
2243 +#define PM_ORC_SHAMAN 75
2244 +#define PM_ORC_CAPTAIN 76
2245 +#define PM_ROCK_PIERCER 77
2246 +#define PM_IRON_PIERCER 78
2247 +#define PM_GLASS_PIERCER 79
2248 +#define PM_ROTHE 80
2249 +#define PM_MUMAK 81
2250 +#define PM_LEOCROTTA 82
2251 +#define PM_WUMPUS 83
2252 +#define PM_TITANOTHERE 84
2253 +#define PM_BALUCHITHERIUM 85
2254 +#define PM_MASTODON 86
2255 +#define PM_SEWER_RAT 87
2256 +#define PM_GIANT_RAT 88
2257 +#define PM_RABID_RAT 89
2258 +#define PM_WERERAT 90
2259 +#define PM_ROCK_MOLE 91
2260 +#define PM_WOODCHUCK 92
2261 +#define PM_CAVE_SPIDER 93
2262 +#define PM_CENTIPEDE 94
2263 +#define PM_GIANT_SPIDER 95
2264 +#define PM_SCORPION 96
2265 +#define PM_LURKER_ABOVE 97
2266 +#define PM_TRAPPER 98
2267 +#define PM_WHITE_UNICORN 99
2268 +#define PM_GRAY_UNICORN 100
2269 +#define PM_BLACK_UNICORN 101
2270 +#define PM_PONY 102
2271 +#define PM_HORSE 103
2272 +#define PM_WARHORSE 104
2273 +#define PM_FOG_CLOUD 105
2274 +#define PM_DUST_VORTEX 106
2275 +#define PM_ICE_VORTEX 107
2276 +#define PM_ENERGY_VORTEX 108
2277 +#define PM_STEAM_VORTEX 109
2278 +#define PM_FIRE_VORTEX 110
2279 +#define PM_BABY_LONG_WORM 111
2280 +#define PM_BABY_PURPLE_WORM 112
2281 +#define PM_LONG_WORM 113
2282 +#define PM_PURPLE_WORM 114
2283 +#define PM_GRID_BUG 115
2284 +#define PM_XAN 116
2285 +#define PM_YELLOW_LIGHT 117
2286 +#define PM_BLACK_LIGHT 118
2287 +#define PM_ZRUTY 119
2288 +#define PM_COUATL 120
2289 +#define PM_ALEAX 121
2290 +#define PM_ANGEL 122
2291 +#define PM_KI_RIN 123
2292 +#define PM_ARCHON 124
2293 +#define PM_BAT 125
2294 +#define PM_GIANT_BAT 126
2295 +#define PM_RAVEN 127
2296 +#define PM_VAMPIRE_BAT 128
2297 +#define PM_PLAINS_CENTAUR 129
2298 +#define PM_FOREST_CENTAUR 130
2299 +#define PM_MOUNTAIN_CENTAUR 131
2300 +#define PM_BABY_GRAY_DRAGON 132
2301 +#define PM_BABY_SILVER_DRAGON 133
2302 +#define PM_BABY_RED_DRAGON 134
2303 +#define PM_BABY_WHITE_DRAGON 135
2304 +#define PM_BABY_ORANGE_DRAGON 136
2305 +#define PM_BABY_BLACK_DRAGON 137
2306 +#define PM_BABY_BLUE_DRAGON 138
2307 +#define PM_BABY_GREEN_DRAGON 139
2308 +#define PM_BABY_YELLOW_DRAGON 140
2309 +#define PM_GRAY_DRAGON 141
2310 +#define PM_SILVER_DRAGON 142
2311 +#define PM_RED_DRAGON 143
2312 +#define PM_WHITE_DRAGON 144
2313 +#define PM_ORANGE_DRAGON 145
2314 +#define PM_BLACK_DRAGON 146
2315 +#define PM_BLUE_DRAGON 147
2316 +#define PM_GREEN_DRAGON 148
2317 +#define PM_YELLOW_DRAGON 149
2318 +#define PM_STALKER 150
2319 +#define PM_AIR_ELEMENTAL 151
2320 +#define PM_FIRE_ELEMENTAL 152
2321 +#define PM_EARTH_ELEMENTAL 153
2322 +#define PM_WATER_ELEMENTAL 154
2323 +#define PM_LICHEN 155
2324 +#define PM_BROWN_MOLD 156
2325 +#define PM_YELLOW_MOLD 157
2326 +#define PM_GREEN_MOLD 158
2327 +#define PM_RED_MOLD 159
2328 +#define PM_SHRIEKER 160
2329 +#define PM_VIOLET_FUNGUS 161
2330 +#define PM_GNOME 162
2331 +#define PM_GNOME_LORD 163
2332 +#define PM_GNOMISH_WIZARD 164
2333 +#define PM_GNOME_KING 165
2334 +#define PM_GIANT 166
2335 +#define PM_STONE_GIANT 167
2336 +#define PM_HILL_GIANT 168
2337 +#define PM_FIRE_GIANT 169
2338 +#define PM_FROST_GIANT 170
2339 +#define PM_STORM_GIANT 171
2340 +#define PM_ETTIN 172
2341 +#define PM_TITAN 173
2342 +#define PM_MINOTAUR 174
2343 +#define PM_JABBERWOCK 175
2344 +#define PM_KEYSTONE_KOP 176
2345 +#define PM_KOP_SERGEANT 177
2346 +#define PM_KOP_LIEUTENANT 178
2347 +#define PM_KOP_KAPTAIN 179
2348 +#define PM_LICH 180
2349 +#define PM_DEMILICH 181
2350 +#define PM_MASTER_LICH 182
2351 +#define PM_ARCH_LICH 183
2352 +#define PM_KOBOLD_MUMMY 184
2353 +#define PM_GNOME_MUMMY 185
2354 +#define PM_ORC_MUMMY 186
2355 +#define PM_DWARF_MUMMY 187
2356 +#define PM_ELF_MUMMY 188
2357 +#define PM_HUMAN_MUMMY 189
2358 +#define PM_ETTIN_MUMMY 190
2359 +#define PM_GIANT_MUMMY 191
2360 +#define PM_RED_NAGA_HATCHLING 192
2361 +#define PM_BLACK_NAGA_HATCHLING 193
2362 +#define PM_GOLDEN_NAGA_HATCHLING 194
2363 +#define PM_GUARDIAN_NAGA_HATCHLING 195
2364 +#define PM_RED_NAGA 196
2365 +#define PM_BLACK_NAGA 197
2366 +#define PM_GOLDEN_NAGA 198
2367 +#define PM_GUARDIAN_NAGA 199
2368 +#define PM_OGRE 200
2369 +#define PM_OGRE_LORD 201
2370 +#define PM_OGRE_KING 202
2371 +#define PM_GRAY_OOZE 203
2372 +#define PM_BROWN_PUDDING 204
2373 +#define PM_BLACK_PUDDING 205
2374 +#define PM_GREEN_SLIME 206
2375 +#define PM_QUANTUM_MECHANIC 207
2376 +#define PM_RUST_MONSTER 208
2377 +#define PM_DISENCHANTER 209
2378 +#define PM_GARTER_SNAKE 210
2379 +#define PM_SNAKE 211
2380 +#define PM_WATER_MOCCASIN 212
2381 +#define PM_PIT_VIPER 213
2382 +#define PM_PYTHON 214
2383 +#define PM_COBRA 215
2384 +#define PM_TROLL 216
2385 +#define PM_ICE_TROLL 217
2386 +#define PM_ROCK_TROLL 218
2387 +#define PM_WATER_TROLL 219
2388 +#define PM_OLOG_HAI 220
2389 +#define PM_UMBER_HULK 221
2390 +#define PM_VAMPIRE 222
2391 +#define PM_VAMPIRE_LORD 223
2392 +#define PM_VLAD_THE_IMPALER 224
2393 +#define PM_BARROW_WIGHT 225
2394 +#define PM_WRAITH 226
2395 +#define PM_NAZGUL 227
2396 +#define PM_XORN 228
2397 +#define PM_MONKEY 229
2398 +#define PM_APE 230
2399 +#define PM_OWLBEAR 231
2400 +#define PM_YETI 232
2401 +#define PM_CARNIVOROUS_APE 233
2402 +#define PM_SASQUATCH 234
2403 +#define PM_KOBOLD_ZOMBIE 235
2404 +#define PM_GNOME_ZOMBIE 236
2405 +#define PM_ORC_ZOMBIE 237
2406 +#define PM_DWARF_ZOMBIE 238
2407 +#define PM_ELF_ZOMBIE 239
2408 +#define PM_HUMAN_ZOMBIE 240
2409 +#define PM_ETTIN_ZOMBIE 241
2410 +#define PM_GIANT_ZOMBIE 242
2411 +#define PM_GHOUL 243
2412 +#define PM_SKELETON 244
2413 +#define PM_STRAW_GOLEM 245
2414 +#define PM_PAPER_GOLEM 246
2415 +#define PM_ROPE_GOLEM 247
2416 +#define PM_GOLD_GOLEM 248
2417 +#define PM_LEATHER_GOLEM 249
2418 +#define PM_WOOD_GOLEM 250
2419 +#define PM_FLESH_GOLEM 251
2420 +#define PM_CLAY_GOLEM 252
2421 +#define PM_STONE_GOLEM 253
2422 +#define PM_GLASS_GOLEM 254
2423 +#define PM_IRON_GOLEM 255
2424 +#define PM_HUMAN 256
2425 +#define PM_HUMAN_WERERAT 257
2426 +#define PM_HUMAN_WEREJACKAL 258
2427 +#define PM_HUMAN_WEREWOLF 259
2428 +#define PM_ELF 260
2429 +#define PM_WOODLAND_ELF 261
2430 +#define PM_GREEN_ELF 262
2431 +#define PM_GREY_ELF 263
2432 +#define PM_ELF_LORD 264
2433 +#define PM_ELVENKING 265
2434 +#define PM_DOPPELGANGER 266
2435 +#define PM_NURSE 267
2436 +#define PM_SHOPKEEPER 268
2437 +#define PM_GUARD 269
2438 +#define PM_PRISONER 270
2439 +#define PM_ORACLE 271
2440 +#define PM_ALIGNED_PRIEST 272
2441 +#define PM_HIGH_PRIEST 273
2442 +#define PM_SOLDIER 274
2443 +#define PM_SERGEANT 275
2444 +#define PM_LIEUTENANT 276
2445 +#define PM_CAPTAIN 277
2446 +#define PM_WATCHMAN 278
2447 +#define PM_WATCH_CAPTAIN 279
2448 +#define PM_MEDUSA 280
2449 +#define PM_WIZARD_OF_YENDOR 281
2450 +#define PM_CROESUS 282
2451 +#define PM_GHOST 283
2452 +#define PM_SHADE 284
2453 +#define PM_WATER_DEMON 285
2454 +#define PM_HORNED_DEVIL 286
2455 +#define PM_SUCCUBUS 287
2456 +#define PM_INCUBUS 288
2457 +#define PM_ERINYS 289
2458 +#define PM_BARBED_DEVIL 290
2459 +#define PM_MARILITH 291
2460 +#define PM_VROCK 292
2461 +#define PM_HEZROU 293
2462 +#define PM_BONE_DEVIL 294
2463 +#define PM_ICE_DEVIL 295
2464 +#define PM_NALFESHNEE 296
2465 +#define PM_PIT_FIEND 297
2466 +#define PM_BALROG 298
2467 +#define PM_JUIBLEX 299
2468 +#define PM_YEENOGHU 300
2469 +#define PM_ORCUS 301
2470 +#define PM_GERYON 302
2471 +#define PM_DISPATER 303
2472 +#define PM_BAALZEBUB 304
2473 +#define PM_ASMODEUS 305
2474 +#define PM_DEMOGORGON 306
2475 +#define PM_DEATH 307
2476 +#define PM_PESTILENCE 308
2477 +#define PM_FAMINE 309
2478 +#define PM_MAIL_DAEMON 310
2479 +#define PM_DJINNI 311
2480 +#define PM_SANDESTIN 312
2481 +#define PM_JELLYFISH 313
2482 +#define PM_PIRANHA 314
2483 +#define PM_SHARK 315
2484 +#define PM_GIANT_EEL 316
2485 +#define PM_ELECTRIC_EEL 317
2486 +#define PM_KRAKEN 318
2487 +#define PM_NEWT 319
2488 +#define PM_GECKO 320
2489 +#define PM_IGUANA 321
2490 +#define PM_BABY_CROCODILE 322
2491 +#define PM_LIZARD 323
2492 +#define PM_CHAMELEON 324
2493 +#define PM_CROCODILE 325
2494 +#define PM_SALAMANDER 326
2495 +#define PM_LONG_WORM_TAIL 327
2496 +#define PM_ARCHEOLOGIST 328
2497 +#define PM_BARBARIAN 329
2498 +#define PM_CAVEMAN 330
2499 +#define PM_CAVEWOMAN 331
2500 +#define PM_HEALER 332
2501 +#define PM_KNIGHT 333
2502 +#define PM_MONK 334
2503 +#define PM_PRIEST 335
2504 +#define PM_PRIESTESS 336
2505 +#define PM_RANGER 337
2506 +#define PM_ROGUE 338
2507 +#define PM_SAMURAI 339
2508 +#define PM_TOURIST 340
2509 +#define PM_VALKYRIE 341
2510 +#define PM_WIZARD 342
2511 +#define PM_LORD_CARNARVON 343
2512 +#define PM_PELIAS 344
2513 +#define PM_SHAMAN_KARNOV 345
2514 +#define PM_HIPPOCRATES 346
2515 +#define PM_KING_ARTHUR 347
2516 +#define PM_GRAND_MASTER 348
2517 +#define PM_ARCH_PRIEST 349
2518 +#define PM_ORION 350
2519 +#define PM_MASTER_OF_THIEVES 351
2520 +#define PM_LORD_SATO 352
2521 +#define PM_TWOFLOWER 353
2522 +#define PM_NORN 354
2523 +#define PM_NEFERET_THE_GREEN 355
2524 +#define PM_MINION_OF_HUHETOTL 356
2525 +#define PM_THOTH_AMON 357
2526 +#define PM_CHROMATIC_DRAGON 358
2527 +#define PM_CYCLOPS 359
2528 +#define PM_IXOTH 360
2529 +#define PM_MASTER_KAEN 361
2530 +#define PM_NALZOK 362
2531 +#define PM_SCORPIUS 363
2532 +#define PM_MASTER_ASSASSIN 364
2533 +#define PM_ASHIKAGA_TAKAUJI 365
2534 +#define PM_LORD_SURTUR 366
2535 +#define PM_DARK_ONE 367
2536 +#define PM_STUDENT 368
2537 +#define PM_CHIEFTAIN 369
2538 +#define PM_NEANDERTHAL 370
2539 +#define PM_ATTENDANT 371
2540 +#define PM_PAGE 372
2541 +#define PM_ABBOT 373
2542 +#define PM_ACOLYTE 374
2543 +#define PM_HUNTER 375
2544 +#define PM_THUG 376
2545 +#define PM_NINJA 377
2546 +#define PM_ROSHI 378
2547 +#define PM_GUIDE 379
2548 +#define PM_WARRIOR 380
2549 +#define PM_APPRENTICE 381
2551 +#define NUMMONS 382
2553 +#endif /* PM_H */
2554 diff --git a/include/unixconf.h b/include/unixconf.h
2555 index fe1b006..4d0cf48 100644
2556 --- a/include/unixconf.h
2557 +++ b/include/unixconf.h
2558 @@ -37,7 +37,7 @@
2559 #define NETWORK /* if running on a networked system */
2560 /* e.g. Suns sharing a playground through NFS */
2561 /* #define SUNOS4 */ /* SunOS 4.x */
2562 -/* #define LINUX */ /* Another Unix clone */
2563 +#define LINUX /* Another Unix clone */
2564 /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */
2565 /* #define GENIX */ /* Yet Another Unix Clone */
2566 /* #define HISX */ /* Bull Unix for XPS Machines */
2567 @@ -132,7 +132,7 @@
2568 * "extra output" method is used, but not all systems provide access to
2569 * a fine-grained timer.
2571 -/* #define TIMED_DELAY */ /* usleep() */
2572 +#define TIMED_DELAY /* usleep() */
2573 #endif
2576 diff --git a/include/vis_tab.h b/include/vis_tab.h
2577 new file mode 100644
2578 index 0000000..6312239
2579 --- /dev/null
2580 +++ b/include/vis_tab.h
2581 @@ -0,0 +1,4 @@
2582 +/* This source file is generated by 'makedefs'. Do not edit. */
2583 +#ifdef VISION_TABLES
2585 +#endif /* VISION_TABLES */
2586 diff --git a/nh343jl/README.nh343jl b/nh343jl/README.nh343jl
2587 new file mode 100644
2588 index 0000000..a7357ea
2589 --- /dev/null
2590 +++ b/nh343jl/README.nh343jl
2591 @@ -0,0 +1,121 @@
2592 +nh343jl.diff is a diff for Nethack 3.4.3, containing the following
2593 +patches (better explanations and diffs for most individual patches
2594 +available at http://www.netsonic.fi/~walker/nethack.html) :
2596 +- Tom Friedetzky's "dump character" patch somewhat modified by me, Darshan
2597 + Shaligram and some others (include/decl.h, include/extern.h,
2598 + src/botl.c, src/cmd.c, src/decl.c, src/display.c, src/end.c,
2599 + src/invent.c, src/options.c, src/spell.c, src/topten.c, src/weapon.c,
2600 + win/tty/wintty.c, dat/opthelp, doc/Guidebook.*)
2601 +- record the number of moves, and mark wizard/explore mode games in
2602 + logfile / record (src/topten.c)
2603 +- show extincted monsters among the genocided ones and the numbers of
2604 + different monsters born in the "vanquished" list after the numbers killed.
2605 + (Wingnut, Jukka Lahtinen)
2606 + (include/flag.h, src/cmd.c, src/end.c, src/options.c,
2607 + dat/opthelp, dat/wizhelp, doc/Guidebook.*)
2608 +- paranoid, by David Damerell, Jonathan Nieder, Jukka Lahtinen and
2609 + Stanislav Traykov
2610 + (include/flag.h, src/cmd.c, src/do_wear.c, src/end.c, src/options.c,
2611 + src/potion.c, src/uhitm.c, dat/opthelp, doc/Guidebook.*)
2612 +- Ralph Churchill's colored Hp monitor (src/botl.c)
2613 +- Compile-time options for not writing #quit games to the record file
2614 + (FORGET_QUITTER) and not writing explore mode games to the logfile
2615 + (PROMPT_LOGEXP). (src/end.c, src/topten.c)
2616 +- The compile time setting SCORE_ON_BOTL is overriden in the magic number
2617 + in the bones and save files, so compatibility with the official binaries
2618 + can be kept regardless of that option. (src/version.c)
2619 +- Allow definitions for variable playground locations, such as separate
2620 + bones and levels directories, for OS/2. Use bones in directory "bones"
2621 + under the playground directory in unix systems.
2622 + (include/os2conf.h, src/files.c, sys/share/pcunix.c)
2623 +- prompt for entering explore mode at death (include/flag.h, src/cmd.c,
2624 + src/end.c, src/options.c, dat/opthelp, doc/Guidebook.*)
2625 +- Jeroen Demeyer's sortloot patch to optionally sort the pickup lists to
2626 + ascending order of descriptions within each item class
2627 + (dat/opthelp, doc/Guidebook.*, include/extern.h, include/flag.h,
2628 + src/end.c, src/invent.c, src/objnam.c, src/options.c, src/pickup.c)
2629 +- Pasi Kallinen's menucolor patch (http://www.cs.joensuu.fi/~pkalli)
2630 + (dat/opthelp, include/color.h, include/extern.h, include/flag.h,
2631 + src/decl.c, src/files.c, src/options.c, src/save.c,
2632 + win/tty/wintty.c)
2633 +- Pasi Kallinen's window edge patch, optionally aligning menus and text
2634 + windows left instead of right in the tty interface.
2635 + http://cs.joensuu.fi/~pkalli/code/nh342-winedge.diff
2636 + (doc/Guidebook.*, dat/opthelp, include/flag.h, src/options.c,
2637 + win/tty/wintty.c)
2638 +- Stanislav Traykov's patch for additional item categories in the menus
2639 + http://home.in.tum.de/~traykovs/nethack/
2640 + (dat/opthelp, doc/Guidebook.*, include/extern.h, include/flag.h,
2641 + include/hack.h, include/objclass.h, include/obj.h, src/do.c,
2642 + src/invent.c, src/options.c, src/pickup.c)
2643 +- Sam Dennis's patch to allow the #adjust command to split stacks
2644 + (src/invent.c)
2645 +- Pasi Kallinen's helplessness patch that replaces the "while helpless"
2646 + text to be written to the record/logfile with the reason of
2647 + helplessness
2648 + (include/decl.h, include/extern.h, src/allmain.c, src/apply.c,
2649 + src/artifact.c, src/ball.c, src/decl.c, src/detect.c, src/dig.c,
2650 + src/dothrow.c, src/do_wear.c, src/eat.c, src/end.c, src/engrave.c,
2651 + src/explode.c, src/hack.c, src/mcastu.c, src/mhitu.c, src/mthrowu.c,
2652 + src/muse.c, src/pickup.c, src/polyself.c, src/potion.c, src/pray.c,
2653 + src/priest.c, src/save.c, src/sounds.c, src/spell.c, src/steal.c,
2654 + src/teleport.c, src/timeout.c, src/trap.c, src/uhitm.c, src/vault.c,
2655 + src/zap.c)
2656 +- Pasi Kallinen's extra status attributes patch that adds statuses like
2657 + encuberance, hunger, confusion, food poisoning, illness, blindness,
2658 + stun, hallucination and sliming to the minimal enlightenment screen
2659 + shown with ^X (http://bilious.homelinux.org/?226)
2660 + (include/extern.h, src/botl.c, src/cmd.c)
2661 +- Make the f (fire) command prompt for ammuntition to quiver, when used
2662 + and nothing is quivered.
2663 + (dat/opthelp, doc/Guidebook.mn, doc/Guidebook.tex, doc/Guidebook.txt,
2664 + include.flag.h, src/dothrow.c, src/options.c)
2665 +- Allow priest role to be played as any race (Haakon Studebaker)
2666 + (src/role.c, compile option PRIEST_RACES)
2667 +- Patric Mueller's fixes for known bugs C343-100, C343-179, C343-218,
2668 + C343-275, C343-276 and C343-324
2669 + (include/extern.h, src/apply.c, src/do.c, src/dokick.c, src/dothrow.c,
2670 + src/shk.c, src/trap.c, src/worm.c, src/zap.c)
2672 +Most of these patches need some #define in include/config.h to get
2673 +compiled in. I included a diff for config.h to show them.
2675 +On unix systems with the dump patch, it is recommended for security reasons
2676 +to define the DUMP_FN in include/config.h to prevent users from defining
2677 +the dumpfile name themselves, but here it is commented out because there is
2678 +no single directory name that would be good for EVERY patched Nethack
2679 +installation to have the dump files in and I try to keep this patch
2680 +collection as generic as possible.
2682 +If you find any bugs in these patches, please let me know.
2683 +For now, you can reach me at jtfjdehf@hotmail.com).
2684 +And I read rec.games.roguelike.nethack regularly.
2686 +Of course, if you have some other changes made to the same files, you may
2687 +need to edit some of the source files to insert some chunks of this diff
2688 +manually. Check especially include/config.h for options that you may like
2689 +to be set differently from my setup.
2691 +Some of the patches also need some options defined in your configuration file
2692 +(~/.nethackrc in Linux and other unix-like systems, nethack.cnf in OS/2,
2693 +defaults.nh on modern windows platforms, maybe something else on some
2694 +other platform) to take effect. To turn all of thse on, set
2696 +OPTIONS=dumpfile:%n.nh (for the dump character patch in single user systems)
2697 +OPTIONS=showborn (to see the numbers of monsters born)
2698 +OPTIONS=paranoid_hit,paranoid_quit,paranoid_remove (for the paranoid patch)
2699 +OPTIONS=death_explore (to be prompted for explore mode when you die)
2700 +OPTIONS=sortloot:loot (for the sortloot patch)
2701 +OPTIONS=win_edge (for the window edge patch)
2702 +OPTIONS=quiver_fired (for the quiver fired ammunition patch)
2703 +OPTIONS=menucolors (to turn on the menucolor option)
2704 +MENUCOLOR="* blessed *"=green (some menucolor definition examples)
2705 +MENUCOLOR="* holy *"=green (if you have MENU_COLOR_REGEX defined
2706 +MENUCOLOR="* cursed *"=red in config.h, leave the asterisks out from
2707 +MENUCOLOR="* unholy *"=red the beginning and ending of the options)
2708 +MENUCOLOR="* cursed .* (being worn)*"=orange&underline
2711 +Jukka Lahtinen, 3.1.2009
2712 +jtfjdehf@hotmail.com
2713 diff --git a/src/Makefile b/src/Makefile
2714 new file mode 100644
2715 index 0000000..bd77fab
2716 --- /dev/null
2717 +++ b/src/Makefile
2718 @@ -0,0 +1,814 @@
2719 +# NetHack Makefile.
2720 +# SCCS Id: @(#)Makefile.src 3.4 2002/03/02
2722 +# newer makes predefine $(MAKE) to 'make' and do smarter processing of
2723 +# recursive make calls if $(MAKE) is used
2724 +# these makes allow $(MAKE) to be overridden by the environment if someone
2725 +# wants to (or has to) use something other than the standard make, so we do
2726 +# not want to unconditionally set $(MAKE) here
2728 +# unfortunately, some older makes do not predefine $(MAKE); if you have one of
2729 +# these, uncomment the following line
2730 +# (you will know that you have one if you get complaints about being unable
2731 +# to find 'makedefs')
2732 +# MAKE = make
2734 +# This makefile replaces the previous Makefile.unix, Makefile.xenix,
2735 +# Makefile.3B2, Makefile.att, and Makefile.tos.
2736 +# Set SYSTEM to one of:
2737 +# 'Sysunix' -- generic UNIX
2738 +# 'Sys3B2' -- AT&T 3B2, 3B5, etc.
2739 +# 'Sysatt' -- AT&T UNIXPC, 7300, 3B1
2740 +# 'SysV-AT' -- Microport 286 UNIX (put -DDUMB in CFLAGS)
2741 +# 'Systos' -- Atari
2742 +# 'SysBe' -- BeOS
2743 +SYSTEM = Sysunix
2746 +# Make sure that your bourne shell is specified here, as you have to spawn
2747 +# some of the commands (eg. depend) in bourne shell for them to work.
2749 +# For Systos users compiling on the ST, you'll either need a bourne shell
2750 +# clone or you'll need to do make depend, etc. by hand. In either case,
2751 +# the line below probably needs changing
2752 +SHELL=/bin/sh
2753 +# for Atari
2754 +# SHELL=E:/GEMINI2/MUPFEL.TTP
2756 +# Normally, the C compiler driver is used for linking:
2757 +LINK=$(CC)
2759 +# Pick the SYSSRC and SYSOBJ lines corresponding to your desired operating
2760 +# system.
2762 +# for UNIX systems
2763 +SYSSRC = ../sys/share/ioctl.c ../sys/share/unixtty.c ../sys/unix/unixmain.c \
2764 + ../sys/unix/unixunix.c ../sys/unix/unixres.c
2765 +SYSOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o
2767 +# for Systos
2768 +# SYSSRC = ../sys/atari/tos.c ../sys/share/pcmain.c ../sys/share/pcsys.c \
2769 +# ../sys/share/pctty.c ../sys/share/pcunix.c
2770 +# SYSOBJ = tos.o pcmain.o pcsys.o pctty.o pcunix.o
2772 +# for BeOS
2773 +#SYSSRC = ../sys/be/bemain.c ../sys/share/unixtty.c ../sys/share/ioctl.c
2774 +#SYSOBJ = bemain.o unixtty.o ioctl.o
2777 +# if you are using gcc as your compiler:
2778 +# uncomment the CC definition below if it's not in your environment
2779 +# if you get setcgtty() warnings during execution, you are feeding gcc
2780 +# a non-ANSI <sys/ioctl.h> -- either run fixincludes on it or use
2781 +# -traditional in CFLAGS
2782 +# CC = gcc
2784 +# For Bull DPX/2 systems at B.O.S. 2.0 or higher use the following:
2786 +# CC = gcc -ansi -D_BULL_SOURCE -D_XOPEN_SOURCE -D_POSIX_SOURCE
2788 +# If you are using GCC 2.2.2 or higher on a DPX/2, just use:
2790 +# CC = gcc -ansi
2792 +# For HP/UX 10.20 with GCC:
2793 +# CC = gcc -D_POSIX_SOURCE
2795 +# For cross-compiling, eg. with gcc on Linux (see also CXX further down):
2796 +# CC = arm-linux-gcc
2799 +# if you're debugging and want gcc to check as much as possible, use:
2800 +# CC = gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
2802 +# flags may have to be changed as required
2803 +# flags for 286 Xenix:
2804 +# CFLAGS = -Ml2t16 -O -LARGE -I../include
2805 +# LFLAGS = -Ml -F 4000 -SEG 512
2807 +# flags for 286 Microport SysV-AT
2808 +# CFLAGS = -DDUMB -Ml -I../include
2809 +# LFLAGS = -Ml
2811 +# flags for Atari gcc (3.2.1)
2812 +# CFLAGS = -O -I../include
2813 +# LFLAGS = -s
2814 +# flags for Atari gcc (3.3)
2815 +# CFLAGS = -mshort -O2 -fomit-frame-pointer -I../include
2816 +# LFLAGS = -mshort -s
2818 +# flags for AIX 3.1 cc on IBM RS/6000 to define
2819 +# a suitable subset of standard libraries
2820 +# (note that there is more info regarding the "-qchars=signed"
2821 +# switch in file Install.unx note 8)
2822 +# CFLAGS = -D_NO_PROTO -D_XOPEN_SOURCE -O -I../include -qchars=signed
2824 +# Some of our subroutines are complex enough that this is required for full
2825 +# optimization under AIX 3.2 (I don't know about 3.1).
2827 +# CFLAGS = -D_NO_PROTO -D_XOPEN_SOURCE -D_ALL_SOURCE -O -I../include -qchars=signed -qmaxmem=5000
2829 +# flags for A/UX 2.01 using native cc or c89
2830 +# gcc predefines AUX so that's not needed there
2831 +# Remember to use -lcurses for WINLIB below !
2832 +# CFLAGS = -ZS -D_POSIX_SOURCE -O -I../include -DAUX
2834 +# flags for IRIX 4.0.x using native cc
2835 +# The include files are __STDC__, but have bugs involving const
2836 +# CFLAGS = -O -I../include -D__STDC__ -Dconst= -woff 100,293
2837 +# LFLAGS = -s
2839 +# flags for BSD/OS 2.0
2840 +# CFLAGS = -O -I../include -I/usr/X11/include
2841 +# LFLAGS = -L/usr/X11/lib
2843 +# flags for Linux
2844 +# compile normally
2845 +# CFLAGS = -O2 -fomit-frame-pointer -I../include
2846 +# LFLAGS = -L/usr/X11R6/lib
2847 +# OR compile backwards compatible a.out format
2848 +# CFLAGS = -O2 -b i486-linuxaout -fomit-frame-pointer -I../include
2849 +# LFLAGS = -b i486-linuxaout -L/usr/X11R6/lib
2851 +# flags for BeOS
2852 +# on a Mac/BeBox:
2853 +#CC = mwcc
2854 +#CFLAGS = -r -I../include
2855 +#LINK = mwld
2856 +#LFLAGS = -map nethack.xMAP
2857 +# on Intel:
2858 +#CFLAGS = -O -I../include
2859 +#LINK = gcc
2860 +#LFLAGS = -Xlinker -soname=_APP_
2862 +# Only used for the Gnome interface.
2863 +# When including the Gnome interface, you need to include gnome specific
2864 +# directories. The ones given below is the usual spot for linux systems.
2865 +# The paths are for glibconfig.h and gnomesupport.h respectively.
2867 +GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
2869 +# flags for debugging:
2870 +# CFLAGS = -g -I../include
2872 +CFLAGS = -O -I../include
2873 +LFLAGS =
2875 +# The Qt and Be window systems are written in C++, while the rest of
2876 +# NetHack is standard C. If using Qt, uncomment the LINK line here to get
2877 +# the C++ libraries linked in.
2878 +CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include
2879 +CXX=g++
2880 +#LINK=g++
2881 +# For cross-compiling, eg. with gcc on Linux (see also CC further up):
2882 +#CXX=arm-linux-g++
2883 +#LINK=arm-linux-gcc
2885 +# Set the WINSRC, WINOBJ, and WINLIB lines to correspond to your desired
2886 +# combination of windowing systems. Also set windowing systems in config.h.
2887 +# Note that if you are including multiple tiled window systems, you don't
2888 +# want two copies of tile.o, so comment out all but the first.
2890 +# files for a straight tty port using no native windowing system
2891 +WINTTYSRC = ../win/tty/getline.c ../win/tty/termcap.c ../win/tty/topl.c \
2892 + ../win/tty/wintty.c
2893 +WINTTYOBJ = getline.o termcap.o topl.o wintty.o
2895 +# files for an X11 port
2896 +# (tile.c is a generated source file)
2897 +WINX11SRC = ../win/X11/Window.c ../win/X11/dialogs.c ../win/X11/winX.c \
2898 + ../win/X11/winmap.c ../win/X11/winmenu.c ../win/X11/winmesg.c \
2899 + ../win/X11/winmisc.c ../win/X11/winstat.c ../win/X11/wintext.c \
2900 + ../win/X11/winval.c tile.c
2901 +WINX11OBJ = Window.o dialogs.o winX.o winmap.o winmenu.o winmesg.o \
2902 + winmisc.o winstat.o wintext.o winval.o tile.o
2904 +# Files for a Qt port
2906 +WINQTSRC = ../win/Qt/qt_win.cpp ../win/Qt/qt_clust.cpp ../win/Qt/qttableview.cpp
2907 +WINQTOBJ = qt_win.o qt_clust.o qttableview.o tile.o
2909 +# Files for a Gnome port
2911 +WINGNOMESRC = ../win/gnome/gnaskstr.c ../win/gnome/gnbind.c \
2912 + ../win/gnome/gnglyph.c ../win/gnome/gnmain.c ../win/gnome/gnmap.c \
2913 + ../win/gnome/gnmenu.c ../win/gnome/gnmesg.c ../win/gnome/gnopts.c \
2914 + ../win/gnome/gnplayer.c ../win/gnome/gnsignal.c \
2915 + ../win/gnome/gnstatus.c ../win/gnome/gntext.c ../win/gnome/gnyesno.c \
2916 + ../win/gnome/gnworn.c
2917 +WINGNOMEOBJ = gnaskstr.o gnbind.o gnglyph.o gnmain.o gnmap.o gnmenu.o \
2918 + gnmesg.o gnopts.o gnplayer.o gnsignal.o gnstatus.o gntext.o \
2919 + gnyesno.o gnworn.o tile.o
2921 +# Files for a Gem port
2922 +WINGEMSRC = ../win/gem/wingem.c ../win/gem/wingem1.c ../win/gem/load_img.c \
2923 + ../win/gem/gr_rect.c tile.c
2924 +WINGEMOBJ = wingem.o wingem1.o load_img.o gr_rect.o tile.o
2926 +# Files for a BeOS InterfaceKit port -- not ready for prime time
2927 +WINBESRC =
2928 +WINBEOBJ =
2929 +#WINBESRC = ../win/BeOS/winbe.cpp ../win/BeOS/NHWindow.cpp \
2930 +# ../win/BeOS/NHMenuWindow.cpp ../win/BeOS/NHMapWindow.cpp tile.c
2931 +#WINBEOBJ = winbe.o NHWindow.o NHMenuWindow.o NHMapWindow.o tile.o
2935 +WINSRC = $(WINTTYSRC)
2936 +WINOBJ = $(WINTTYOBJ)
2938 +# on some systems the termcap library is in -ltermcap or -lcurses
2939 +# on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
2940 +# Sysatt uses shared library in lieu of this option
2941 +# Systos needs -lcurses16 if you use -mshort
2942 +# AIX 3.1 on RS/6000 likes -lcurses if TERMINFO defined in unixconf.h
2943 +# and -ltermcap otherwise
2944 +# Linux uses -lncurses (newer) or -ltermcap (older)
2945 +# Be uses -ltermcap
2947 +# libraries for tty ports
2948 +# WINTTYLIB = -ltermcap
2949 +# WINTTYLIB = -lcurses
2950 +# WINTTYLIB = -lcurses16
2951 +WINTTYLIB = -lncurses
2952 +# WINTTYLIB = -ltermlib
2954 +# libraries for X11
2955 +# If USE_XPM is defined in config.h, you will also need -lXpm here.
2956 +WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
2957 +# WINX11LIB = -lXaw -lXmu -lXt -lX11
2958 +# WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
2959 +# WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0
2961 +# libraries for Qt
2962 +WINQTLIB = -L$(QTDIR)/lib -lqt
2964 +# libraries for KDE (with Qt)
2965 +WINKDELIB = -lkdecore -lkdeui -lXext
2967 +# libraries for Gnome
2968 +WINGNOMELIB = -lgnomeui -lgnome -lart_lgpl -lgtk -lgdk -lpopt
2970 +# libraries for Gem port
2971 +WINGEMLIB = -le_gem -lgem
2973 +# libraries for BeOS
2974 +WINBELIB = -lbe
2976 +WINLIB = $(WINTTYLIB)
2978 +# any other strange libraries your system needs (for Sysunix only -- the more
2979 +# specialized targets should already be right)
2981 +# on HP-UX 8.x, the malloc(3x) routines in libmalloc.a seem to align things
2982 +# better than the malloc(3) ones in libc.a
2983 +# LIBS = -lmalloc
2985 +# DPX/2's also use the malloc(3x) routines. In addition, if you are building
2986 +# for X11, you must include libinet.a.
2987 +# LIBS = -lmalloc -linet
2989 +# Linux NetHack uses some bsd style ioctl functions, thus it is necessary to
2990 +# use the bsd libs. (Only if still compiling as BSD in unixconf.h; recent
2991 +# versions compile fine using SYSV without this.)
2992 +# LIBS = -lbsd
2994 +# for CYGWIN32 aka cygwin 1.1.1
2995 +# LIBS = -lcygwin
2997 +# Solaris 2.x seems to work with the following
2998 +# LIBS = -lsocket -lnsl
3000 +# IRIX 4.0.x needs -lsun if NIS (YP) is being used for passwd file lookup
3001 +# LIBS = -lsun
3003 +LIBS =
3005 +# make NetHack
3006 +GAME = nethack
3007 +# GAME = nethack.prg
3009 +# if you defined RANDOM in unixconf.h/tosconf.h since your system did not come
3010 +# with a reasonable random number generator
3011 +# RANDOBJ = random.o
3012 +RANDOBJ =
3015 +# used by `make depend' to reconstruct this Makefile; you shouldn't need this
3016 +AWK = nawk
3018 +# ----------------------------------------
3020 +# Nothing below this line should have to be changed.
3022 +# Other things that have to be reconfigured are in config.h,
3023 +# {unixconf.h, pcconf.h, tosconf.h}, and possibly system.h
3025 +MAKEDEFS = ../util/makedefs
3027 +# timestamp files to reduce `make' overhead and shorten .o dependency lists
3028 +CONFIG_H = ../src/config.h-t
3029 +HACK_H = ../src/hack.h-t
3031 +# all .c that are part of the main NetHack program and are not operating- or
3032 +# windowing-system specific
3033 +HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \
3034 + botl.c cmd.c dbridge.c decl.c detect.c dig.c display.c dlb.c do.c \
3035 + do_name.c do_wear.c dog.c dogmove.c dokick.c dothrow.c drawing.c \
3036 + dungeon.c eat.c end.c engrave.c exper.c explode.c extralev.c \
3037 + files.c fountain.c hack.c hacklib.c invent.c light.c lock.c \
3038 + mail.c makemon.c mapglyph.c mcastu.c mhitm.c mhitu.c minion.c \
3039 + mklev.c mkmap.c \
3040 + mkmaze.c mkobj.c mkroom.c mon.c mondata.c monmove.c monst.c \
3041 + mplayer.c mthrowu.c muse.c music.c o_init.c objects.c objnam.c \
3042 + options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \
3043 + priest.c quest.c questpgr.c read.c rect.c region.c restore.c rip.c \
3044 + rnd.c role.c rumors.c save.c shk.c shknam.c sit.c sounds.c sp_lev.c \
3045 + spell.c steal.c steed.c teleport.c timeout.c topten.c track.c trap.c \
3046 + u_init.c uhitm.c vault.c version.c vision.c weapon.c were.c wield.c \
3047 + windows.c wizard.c worm.c worn.c write.c zap.c
3049 +# all operating-system-dependent .c (for dependencies and such)
3050 +SYSCSRC = ../sys/atari/tos.c ../sys/share/pcmain.c ../sys/share/pcsys.c \
3051 + ../sys/share/pctty.c ../sys/share/pcunix.c ../sys/share/random.c \
3052 + ../sys/share/ioctl.c ../sys/share/unixtty.c ../sys/unix/unixmain.c \
3053 + ../sys/unix/unixunix.c ../sys/unix/unixres.c ../sys/be/bemain.c
3055 +# generated source files (tile.c is handled separately via WINxxxSRC)
3056 +GENCSRC = monstr.c vis_tab.c #tile.c
3058 +# all windowing-system-dependent .c (for dependencies and such)
3059 +WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
3060 +# all windowing-system-dependent .cpp (for dependencies and such)
3061 +WINCXXSRC = $(WINQTSRC) $(WINBESRC)
3063 +# .c files for this version (for date.h)
3064 +VERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) $(GENCSRC)
3066 +# .c files for all versions using this Makefile (for lint and tags)
3067 +CSOURCES = $(HACKCSRC) $(SYSSRC) $(WINCSRC) $(GENCSRC)
3070 +# all .h files except date.h, onames.h, pm.h, and vis_tab.h which would
3071 +# cause dependency loops if run through "make depend"
3072 +# and dgn_comp.h, dgn_file.h, lev_comp.h, special level & dungeon files.
3074 +HACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h beconf.h color.h \
3075 + config.h config1.h coord.h decl.h def_os2.h display.h dlb.h dungeon.h \
3076 + edog.h emin.h engrave.h epri.h eshk.h extern.h flag.h func_tab.h \
3077 + global.h hack.h lev.h macconf.h mfndpos.h micro.h mkroom.h \
3078 + monattk.h mondata.h monflag.h monst.h monsym.h obj.h objclass.h \
3079 + os2conf.h patchlevel.h pcconf.h permonst.h prop.h rect.h region.h rm.h \
3080 + sp_lev.h spell.h system.h tcap.h timeout.h tosconf.h tradstdc.h \
3081 + trampoli.h trap.h unixconf.h vault.h vision.h vmsconf.h wintty.h \
3082 + winX.h winprocs.h wintype.h you.h youprop.h
3084 +HSOURCES = $(HACKINCL) date.h onames.h pm.h vis_tab.h\
3085 + lev_comp.h dgn_comp.h dgn_file.h
3087 +# the following .o's _must_ be made before any others (for makedefs)
3088 +FIRSTOBJ = monst.o objects.o
3090 +HOBJ = $(FIRSTOBJ) allmain.o alloc.o apply.o artifact.o attrib.o ball.o \
3091 + bones.o botl.o cmd.o dbridge.o decl.o detect.o dig.o display.o dlb.o \
3092 + do.o do_name.o do_wear.o dog.o dogmove.o dokick.o dothrow.o \
3093 + drawing.o dungeon.o eat.o end.o engrave.o exper.o explode.o \
3094 + extralev.o files.o fountain.o hack.o hacklib.o invent.o light.o \
3095 + lock.o mail.o makemon.o mapglyph.o mcastu.o mhitm.o mhitu.o \
3096 + minion.o mklev.o mkmap.o \
3097 + mkmaze.o mkobj.o mkroom.o mon.o mondata.o monmove.o monstr.o \
3098 + mplayer.o mthrowu.o muse.o music.o o_init.o objnam.o options.o \
3099 + pager.o pickup.o pline.o polyself.o potion.o pray.o priest.o \
3100 + quest.o questpgr.o read.o rect.o region.o restore.o rip.o rnd.o \
3101 + role.o rumors.o save.o shk.o shknam.o sit.o sounds.o sp_lev.o spell.o \
3102 + steal.o steed.o teleport.o timeout.o topten.o track.o trap.o u_init.o \
3103 + uhitm.o vault.o vision.o vis_tab.o weapon.o were.o wield.o windows.o \
3104 + wizard.o worm.o worn.o write.o zap.o \
3105 + $(RANDOBJ) $(SYSOBJ) $(WINOBJ) version.o
3106 +# the .o files from the HACKCSRC, SYSSRC, and WINSRC lists
3108 +$(GAME): $(SYSTEM)
3109 + @echo "$(GAME) is up to date."
3111 +Sysunix: $(HOBJ) Makefile
3112 + @echo "Loading ..."
3113 + $(LINK) $(LFLAGS) -o $(GAME) $(HOBJ) $(WINLIB) $(LIBS)
3114 + @touch Sysunix
3116 +Sys3B2: $(HOBJ) Makefile
3117 + @echo "Loading ..."
3118 + @$(LINK) $(LFLAGS) -o $(GAME) $(HOBJ) $(WINLIB) -lmalloc
3119 + @touch Sys3B2
3121 +Sysatt: $(HOBJ) Makefile
3122 + @echo "Loading ..."
3123 + @$(LD) $(LFLAGS) /lib/crt0s.o /lib/shlib.ifile -o $(GAME) $(HOBJ)
3124 + @touch Sysatt
3126 +Systos: $(HOBJ) Makefile
3127 + @echo "Loading ..."
3128 + @$(LINK) $(LFLAGS) -o $(GAME) $(HOBJ) $(WINLIB)
3129 + @touch Systos
3131 +SysV-AT: DUMB.Setup $(HOBJ) Makefile
3132 + @echo "Loading ..."
3133 + @$(LINK) $(LFLAGS) -o $(GAME) $(HOBJ) $(WINLIB)
3134 + @touch SysV-AT
3136 +SysBe: $(HOBJ) Makefile
3137 + @echo "Loading ..."
3138 + @$(LINK) $(LFLAGS) -o $(GAME) $(HOBJ) $(WINLIB) $(LIBS)
3139 + @xres -o $(GAME) ../win/BeOS/nethack.rsrc
3140 + @mimeset -f $(GAME)
3141 + @touch SysBe
3143 +DUMB.Setup: ../include/extern.h
3144 + cp ../include/extern.h ../include/extern.h.BAK
3145 + cat ../include/extern.h | \
3146 + sed -e '/^E\ int\ /!b' \
3147 + -e '/[^;/ ]$$/N' \
3148 + -e '/[(][*]occupation[)]/b' \
3149 + -e '/[(][*]afternmv[)]/b' \
3150 + -e '/float_down/b' \
3151 + -e '/done1/b' \
3152 + -e '/identify/b' \
3153 + -e '/Hear_again/b' \
3154 + -e '/hangup/b' \
3155 + -e 's/^\(.*\)$$/\/\* \1 \/\*\*\//' | \
3156 + sed -e '/^E\ void\ /!b' \
3157 + -e '/[^;/ ]$$/N' \
3158 + -e 's/^\(.*\)$$/\/\* \1 \/\*\*\//' \
3159 + >../include/extern.DUMB
3160 + cp ../include/extern.DUMB ../include/extern.h
3161 + @touch DUMB.Setup
3163 +all: $(GAME)
3166 +# dependencies for makedefs and its outputs, which the util
3167 +# Makefile is responsible for keeping up to date
3170 +# special rules, to force update of makedefs, real dependencies should be
3171 +# below in the 'make depend' output.
3172 +monst.o:
3173 + $(CC) $(CFLAGS) -c monst.c
3174 + @rm -f $(MAKEDEFS)
3176 +objects.o:
3177 + $(CC) $(CFLAGS) -c objects.c
3178 + @rm -f $(MAKEDEFS)
3180 +# Qt windowport meta-object-compiler output
3181 +qt_kde0.moc: ../include/qt_kde0.h
3182 + $(QTDIR)/bin/moc -o qt_kde0.moc ../include/qt_kde0.h
3184 +qt_win.moc: ../include/qt_win.h
3185 + $(QTDIR)/bin/moc -o qt_win.moc ../include/qt_win.h
3187 +qttableview.moc: ../include/qttableview.h
3188 + $(QTDIR)/bin/moc -o qttableview.moc ../include/qttableview.h
3190 +$(MAKEDEFS): ../util/makedefs.c $(CONFIG_H) ../include/permonst.h \
3191 + ../include/objclass.h ../include/monsym.h \
3192 + ../include/artilist.h ../include/dungeon.h ../include/obj.h \
3193 + ../include/monst.h ../include/you.h ../include/flag.h \
3194 + ../include/dlb.h ../include/patchlevel.h ../include/qtext.h
3195 + @( cd ../util ; $(MAKE) makedefs)
3197 +../include/onames.h: $(MAKEDEFS)
3198 + @( cd ../util ; $(MAKE) ../include/onames.h )
3199 +../include/pm.h: $(MAKEDEFS)
3200 + @( cd ../util ; $(MAKE) ../include/pm.h )
3201 +monstr.c: $(MAKEDEFS)
3202 + @( cd ../util ; $(MAKE) ../src/monstr.c )
3203 +../include/vis_tab.h: $(MAKEDEFS)
3204 + @( cd ../util ; $(MAKE) ../include/vis_tab.h )
3205 +# makedefs -z makes both vis_tab.h and vis_tab.c, but writes the .h first
3206 +vis_tab.c: ../include/vis_tab.h
3207 +tile.c: ../win/share/tilemap.c $(HACK_H)
3208 + @( cd ../util ; $(MAKE) ../src/tile.c )
3210 +../win/gnome/gn_rip.h: ../win/X11/rip.xpm
3211 + cp ../win/X11/rip.xpm ../win/gnome/gn_rip.h
3213 +# date.h should be remade any time any of the source or include code
3214 +# is modified. Unfortunately, this would make the contents of this
3215 +# file far more complex. Since "hack.h" depends on most of the include
3216 +# files, we kludge around this by making date.h dependent on hack.h,
3217 +# even though it doesn't include this file.
3219 +# hack.h depends on makedefs' output, so we know makedefs will be
3220 +# up to date before being executed
3221 +../include/date.h: $(VERSOURCES) $(HACK_H)
3222 + ../util/makedefs -v
3225 +lint:
3226 +# lint cannot have -p here because (i) capitals are meaningful:
3227 +# [Ww]izard, (ii) identifiers may coincide in the first six places:
3228 +# doweararm() versus dowearring().
3229 +# _flsbuf comes from <stdio.h>, a bug in the system libraries.
3230 + @echo lint -axbh -DLINT ...
3231 + @lint -axbh -I../include -DLINT $(CSOURCES) | sed '/_flsbuf/d'
3234 +tags: $(CSOURCES)
3235 + @echo ctags -tw ...
3236 + @ctags -tw $(CSOURCES)
3237 + @( cd ../include ; ctags -tw $(HSOURCES) )
3238 + @( cd ../util ; $(MAKE) tags )
3240 +clean:
3241 + -rm -f *.o $(HACK_H) $(CONFIG_H)
3243 +spotless: clean
3244 + -rm -f a.out core $(GAME) Sys*
3245 + -rm -f ../include/date.h ../include/onames.h ../include/pm.h
3246 + -rm -f monstr.c ../include/vis_tab.h vis_tab.c tile.c *.moc
3247 + -rm -f ../win/gnome/gn_rip.h
3250 +depend: ../sys/unix/depend.awk \
3251 + $(SYSCSRC) $(WINCSRC) $(WINCXXSRC) $(GENCSRC) $(HACKCSRC)
3252 + $(AWK) -f ../sys/unix/depend.awk ../include/*.h \
3253 + $(SYSCSRC) $(WINCSRC) $(WINCXXSRC) $(GENCSRC) $(HACKCSRC) >makedep
3254 + @echo '/^# DO NOT DELETE THIS LINE OR CHANGE ANYTHING BEYOND IT/+2,$$d' >eddep
3255 + @echo '$$r makedep' >>eddep
3256 + @echo 'w' >>eddep
3257 + @cp Makefile Makefile.bak
3258 + ed - Makefile < eddep
3259 + @rm -f eddep makedep
3260 + @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
3261 + @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
3262 + @echo '# see make depend above' >> Makefile
3263 + - diff Makefile.bak Makefile
3264 + @rm -f Makefile.bak
3266 +# DO NOT DELETE THIS LINE OR CHANGE ANYTHING BEYOND IT
3268 +# config.h timestamp
3269 +$(CONFIG_H): ../include/config.h ../include/config1.h ../include/tradstdc.h \
3270 + ../include/global.h ../include/coord.h ../include/vmsconf.h \
3271 + ../include/system.h ../include/unixconf.h ../include/os2conf.h \
3272 + ../include/micro.h ../include/pcconf.h ../include/tosconf.h \
3273 + ../include/amiconf.h ../include/macconf.h ../include/beconf.h \
3274 + ../include/wceconf.h ../include/ntconf.h ../include/nhlan.h
3275 + touch $(CONFIG_H)
3276 +# hack.h timestamp
3277 +$(HACK_H): ../include/hack.h $(CONFIG_H) ../include/align.h \
3278 + ../include/dungeon.h ../include/monsym.h ../include/mkroom.h \
3279 + ../include/objclass.h ../include/youprop.h ../include/prop.h \
3280 + ../include/permonst.h ../include/monattk.h \
3281 + ../include/monflag.h ../include/mondata.h ../include/pm.h \
3282 + ../include/wintype.h ../include/decl.h ../include/quest.h \
3283 + ../include/spell.h ../include/color.h ../include/obj.h \
3284 + ../include/you.h ../include/attrib.h ../include/monst.h \
3285 + ../include/skills.h ../include/onames.h ../include/timeout.h \
3286 + ../include/trap.h ../include/flag.h ../include/rm.h \
3287 + ../include/vision.h ../include/display.h ../include/engrave.h \
3288 + ../include/rect.h ../include/region.h ../include/winprocs.h \
3289 + ../include/wintty.h ../include/trampoli.h
3290 + touch $(HACK_H)
3292 +tos.o: ../sys/atari/tos.c $(HACK_H) ../include/tcap.h
3293 + $(CC) $(CFLAGS) -c ../sys/atari/tos.c
3294 +pcmain.o: ../sys/share/pcmain.c $(HACK_H) ../include/dlb.h \
3295 + #../include/win32api.h
3296 + $(CC) $(CFLAGS) -c ../sys/share/pcmain.c
3297 +pcsys.o: ../sys/share/pcsys.c $(HACK_H)
3298 + $(CC) $(CFLAGS) -c ../sys/share/pcsys.c
3299 +pctty.o: ../sys/share/pctty.c $(HACK_H)
3300 + $(CC) $(CFLAGS) -c ../sys/share/pctty.c
3301 +pcunix.o: ../sys/share/pcunix.c $(HACK_H)
3302 + $(CC) $(CFLAGS) -c ../sys/share/pcunix.c
3303 +random.o: ../sys/share/random.c $(HACK_H)
3304 + $(CC) $(CFLAGS) -c ../sys/share/random.c
3305 +ioctl.o: ../sys/share/ioctl.c $(HACK_H) ../include/tcap.h
3306 + $(CC) $(CFLAGS) -c ../sys/share/ioctl.c
3307 +unixtty.o: ../sys/share/unixtty.c $(HACK_H)
3308 + $(CC) $(CFLAGS) -c ../sys/share/unixtty.c
3309 +unixmain.o: ../sys/unix/unixmain.c $(HACK_H) ../include/dlb.h
3310 + $(CC) $(CFLAGS) -c ../sys/unix/unixmain.c
3311 +unixunix.o: ../sys/unix/unixunix.c $(HACK_H)
3312 + $(CC) $(CFLAGS) -c ../sys/unix/unixunix.c
3313 +unixres.o: ../sys/unix/unixres.c $(CONFIG_H)
3314 + $(CC) $(CFLAGS) -c ../sys/unix/unixres.c
3315 +bemain.o: ../sys/be/bemain.c $(HACK_H) ../include/dlb.h
3316 + $(CC) $(CFLAGS) -c ../sys/be/bemain.c
3317 +getline.o: ../win/tty/getline.c $(HACK_H) ../include/func_tab.h
3318 + $(CC) $(CFLAGS) -c ../win/tty/getline.c
3319 +termcap.o: ../win/tty/termcap.c $(HACK_H) ../include/tcap.h
3320 + $(CC) $(CFLAGS) -c ../win/tty/termcap.c
3321 +topl.o: ../win/tty/topl.c $(HACK_H) ../include/tcap.h
3322 + $(CC) $(CFLAGS) -c ../win/tty/topl.c
3323 +wintty.o: ../win/tty/wintty.c $(HACK_H) ../include/dlb.h \
3324 + ../include/patchlevel.h ../include/tcap.h
3325 + $(CC) $(CFLAGS) -c ../win/tty/wintty.c
3326 +Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \
3327 + $(CONFIG_H)
3328 + $(CC) $(CFLAGS) -c ../win/X11/Window.c
3329 +dialogs.o: ../win/X11/dialogs.c $(CONFIG_H)
3330 + $(CC) $(CFLAGS) -c ../win/X11/dialogs.c
3331 +winX.o: ../win/X11/winX.c $(HACK_H) ../include/winX.h ../include/dlb.h \
3332 + ../include/patchlevel.h ../win/X11/nh72icon \
3333 + ../win/X11/nh56icon ../win/X11/nh32icon
3334 + $(CC) $(CFLAGS) -c ../win/X11/winX.c
3335 +winmap.o: ../win/X11/winmap.c ../include/xwindow.h $(HACK_H) ../include/dlb.h \
3336 + ../include/winX.h ../include/tile2x11.h
3337 + $(CC) $(CFLAGS) -c ../win/X11/winmap.c
3338 +winmenu.o: ../win/X11/winmenu.c $(HACK_H) ../include/winX.h
3339 + $(CC) $(CFLAGS) -c ../win/X11/winmenu.c
3340 +winmesg.o: ../win/X11/winmesg.c ../include/xwindow.h $(HACK_H) ../include/winX.h
3341 + $(CC) $(CFLAGS) -c ../win/X11/winmesg.c
3342 +winmisc.o: ../win/X11/winmisc.c $(HACK_H) ../include/func_tab.h \
3343 + ../include/winX.h
3344 + $(CC) $(CFLAGS) -c ../win/X11/winmisc.c
3345 +winstat.o: ../win/X11/winstat.c $(HACK_H) ../include/winX.h
3346 + $(CC) $(CFLAGS) -c ../win/X11/winstat.c
3347 +wintext.o: ../win/X11/wintext.c $(HACK_H) ../include/winX.h ../include/xwindow.h
3348 + $(CC) $(CFLAGS) -c ../win/X11/wintext.c
3349 +winval.o: ../win/X11/winval.c $(HACK_H) ../include/winX.h
3350 + $(CC) $(CFLAGS) -c ../win/X11/winval.c
3351 +tile.o: tile.c $(HACK_H)
3352 +gnaskstr.o: ../win/gnome/gnaskstr.c ../win/gnome/gnaskstr.h \
3353 + ../win/gnome/gnmain.h
3354 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnaskstr.c
3355 +gnbind.o: ../win/gnome/gnbind.c ../win/gnome/gnbind.h ../win/gnome/gnmain.h \
3356 + ../win/gnome/gnmenu.h ../win/gnome/gnaskstr.h \
3357 + ../win/gnome/gnyesno.h
3358 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnbind.c
3359 +gnglyph.o: ../win/gnome/gnglyph.c ../win/gnome/gnglyph.h ../include/tile2x11.h
3360 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnglyph.c
3361 +gnmain.o: ../win/gnome/gnmain.c ../win/gnome/gnmain.h ../win/gnome/gnsignal.h \
3362 + ../win/gnome/gnbind.h ../win/gnome/gnopts.h $(HACK_H) \
3363 + ../include/date.h
3364 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnmain.c
3365 +gnmap.o: ../win/gnome/gnmap.c ../win/gnome/gnmap.h ../win/gnome/gnglyph.h \
3366 + ../win/gnome/gnsignal.h $(HACK_H)
3367 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnmap.c
3368 +gnmenu.o: ../win/gnome/gnmenu.c ../win/gnome/gnmenu.h ../win/gnome/gnmain.h \
3369 + ../win/gnome/gnbind.h ../include/func_tab.h
3370 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnmenu.c
3371 +gnmesg.o: ../win/gnome/gnmesg.c ../win/gnome/gnmesg.h ../win/gnome/gnsignal.h
3372 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnmesg.c
3373 +gnopts.o: ../win/gnome/gnopts.c ../win/gnome/gnopts.h ../win/gnome/gnglyph.h \
3374 + ../win/gnome/gnmain.h ../win/gnome/gnmap.h $(HACK_H)
3375 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnopts.c
3376 +gnplayer.o: ../win/gnome/gnplayer.c ../win/gnome/gnplayer.h \
3377 + ../win/gnome/gnmain.h $(HACK_H)
3378 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnplayer.c
3379 +gnsignal.o: ../win/gnome/gnsignal.c ../win/gnome/gnsignal.h \
3380 + ../win/gnome/gnmain.h
3381 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnsignal.c
3382 +gnstatus.o: ../win/gnome/gnstatus.c ../win/gnome/gnstatus.h \
3383 + ../win/gnome/gnsignal.h ../win/gnome/gn_xpms.h \
3384 + ../win/gnome/gnomeprv.h
3385 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnstatus.c
3386 +gntext.o: ../win/gnome/gntext.c ../win/gnome/gntext.h ../win/gnome/gnmain.h \
3387 + ../win/gnome/gn_rip.h
3388 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gntext.c
3389 +gnyesno.o: ../win/gnome/gnyesno.c ../win/gnome/gnbind.h ../win/gnome/gnyesno.h
3390 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnyesno.c
3391 +gnworn.o: ../win/gnome/gnworn.c ../win/gnome/gnworn.h ../win/gnome/gnglyph.h \
3392 + ../win/gnome/gnsignal.h ../win/gnome/gnomeprv.h
3393 + $(CC) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnworn.c
3394 +wingem.o: ../win/gem/wingem.c $(HACK_H) ../include/func_tab.h ../include/dlb.h \
3395 + ../include/patchlevel.h ../include/wingem.h
3396 + $(CC) $(CFLAGS) -c ../win/gem/wingem.c
3397 +wingem1.o: ../win/gem/wingem1.c ../include/gem_rsc.h ../include/load_img.h \
3398 + ../include/gr_rect.h ../include/wintype.h ../include/wingem.h
3399 + $(CC) $(CFLAGS) -c ../win/gem/wingem1.c
3400 +load_img.o: ../win/gem/load_img.c ../include/load_img.h
3401 + $(CC) $(CFLAGS) -c ../win/gem/load_img.c
3402 +gr_rect.o: ../win/gem/gr_rect.c ../include/gr_rect.h
3403 + $(CC) $(CFLAGS) -c ../win/gem/gr_rect.c
3404 +tile.o: tile.c $(HACK_H)
3405 +qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../include/func_tab.h \
3406 + ../include/dlb.h ../include/patchlevel.h ../include/tile2x11.h \
3407 + ../include/qt_win.h ../include/qt_clust.h ../include/qt_kde0.h \
3408 + ../include/qt_xpms.h qt_win.moc qt_kde0.moc qttableview.moc
3409 + $(CXX) $(CXXFLAGS) -c ../win/Qt/qt_win.cpp
3410 +qt_clust.o: ../win/Qt/qt_clust.cpp ../include/qt_clust.h
3411 + $(CXX) $(CXXFLAGS) -c ../win/Qt/qt_clust.cpp
3412 +qttableview.o: ../win/Qt/qttableview.cpp ../include/qttableview.h
3413 + $(CXX) $(CXXFLAGS) -c ../win/Qt/qttableview.cpp
3414 +monstr.o: monstr.c $(CONFIG_H)
3415 +vis_tab.o: vis_tab.c $(CONFIG_H) ../include/vis_tab.h
3416 +allmain.o: allmain.c $(HACK_H)
3417 +alloc.o: alloc.c $(CONFIG_H)
3418 +apply.o: apply.c $(HACK_H) ../include/edog.h
3419 +artifact.o: artifact.c $(HACK_H) ../include/artifact.h ../include/artilist.h
3420 +attrib.o: attrib.c $(HACK_H)
3421 +ball.o: ball.c $(HACK_H)
3422 +bones.o: bones.c $(HACK_H) ../include/lev.h
3423 +botl.o: botl.c $(HACK_H)
3424 +cmd.o: cmd.c $(HACK_H) ../include/func_tab.h
3425 +dbridge.o: dbridge.c $(HACK_H)
3426 +decl.o: decl.c $(HACK_H)
3427 +detect.o: detect.c $(HACK_H) ../include/artifact.h
3428 +dig.o: dig.c $(HACK_H) ../include/edog.h
3429 +display.o: display.c $(HACK_H)
3430 +dlb.o: dlb.c $(CONFIG_H) ../include/dlb.h
3431 +do.o: do.c $(HACK_H) ../include/lev.h
3432 +do_name.o: do_name.c $(HACK_H)
3433 +do_wear.o: do_wear.c $(HACK_H)
3434 +dog.o: dog.c $(HACK_H) ../include/edog.h
3435 +dogmove.o: dogmove.c $(HACK_H) ../include/mfndpos.h ../include/edog.h
3436 +dokick.o: dokick.c $(HACK_H) ../include/eshk.h
3437 +dothrow.o: dothrow.c $(HACK_H) ../include/edog.h
3438 +drawing.o: drawing.c $(HACK_H) ../include/tcap.h
3439 +dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h
3440 +eat.o: eat.c $(HACK_H)
3441 +end.o: end.c $(HACK_H) ../include/eshk.h ../include/dlb.h
3442 +engrave.o: engrave.c $(HACK_H) ../include/lev.h
3443 +exper.o: exper.c $(HACK_H)
3444 +explode.o: explode.c $(HACK_H)
3445 +extralev.o: extralev.c $(HACK_H)
3446 +files.o: files.c $(HACK_H) ../include/dlb.h
3447 +fountain.o: fountain.c $(HACK_H)
3448 +hack.o: hack.c $(HACK_H)
3449 +hacklib.o: hacklib.c $(HACK_H)
3450 +invent.o: invent.c $(HACK_H)
3451 +light.o: light.c $(HACK_H) ../include/lev.h
3452 +lock.o: lock.c $(HACK_H)
3453 +mail.o: mail.c $(HACK_H) ../include/mail.h
3454 +makemon.o: makemon.c $(HACK_H) ../include/epri.h ../include/emin.h \
3455 + ../include/edog.h
3456 +mapglyph.o: mapglyph.c $(HACK_H)
3457 +mcastu.o: mcastu.c $(HACK_H)
3458 +mhitm.o: mhitm.c $(HACK_H) ../include/artifact.h ../include/edog.h
3459 +mhitu.o: mhitu.c $(HACK_H) ../include/artifact.h ../include/edog.h
3460 +minion.o: minion.c $(HACK_H) ../include/emin.h ../include/epri.h
3461 +mklev.o: mklev.c $(HACK_H)
3462 +mkmap.o: mkmap.c $(HACK_H) ../include/sp_lev.h
3463 +mkmaze.o: mkmaze.c $(HACK_H) ../include/sp_lev.h ../include/lev.h
3464 +mkobj.o: mkobj.c $(HACK_H)
3465 +mkroom.o: mkroom.c $(HACK_H)
3466 +mon.o: mon.c $(HACK_H) ../include/mfndpos.h ../include/edog.h
3467 +mondata.o: mondata.c $(HACK_H) ../include/eshk.h ../include/epri.h
3468 +monmove.o: monmove.c $(HACK_H) ../include/mfndpos.h ../include/artifact.h \
3469 + ../include/epri.h
3470 +monst.o: monst.c $(CONFIG_H) ../include/permonst.h ../include/align.h \
3471 + ../include/monattk.h ../include/monflag.h ../include/monsym.h \
3472 + ../include/dungeon.h ../include/eshk.h ../include/vault.h \
3473 + ../include/epri.h ../include/color.h
3474 +mplayer.o: mplayer.c $(HACK_H)
3475 +mthrowu.o: mthrowu.c $(HACK_H)
3476 +muse.o: muse.c $(HACK_H) ../include/edog.h
3477 +music.o: music.c $(HACK_H) #interp.c
3478 +o_init.o: o_init.c $(HACK_H) ../include/lev.h
3479 +objects.o: objects.c $(CONFIG_H) ../include/obj.h ../include/objclass.h \
3480 + ../include/prop.h ../include/skills.h ../include/color.h
3481 +objnam.o: objnam.c $(HACK_H)
3482 +options.o: options.c $(CONFIG_H) ../include/objclass.h ../include/flag.h \
3483 + $(HACK_H) ../include/tcap.h
3484 +pager.o: pager.c $(HACK_H) ../include/dlb.h
3485 +pickup.o: pickup.c $(HACK_H)
3486 +pline.o: pline.c $(HACK_H) ../include/epri.h ../include/edog.h
3487 +polyself.o: polyself.c $(HACK_H)
3488 +potion.o: potion.c $(HACK_H)
3489 +pray.o: pray.c $(HACK_H) ../include/epri.h
3490 +priest.o: priest.c $(HACK_H) ../include/mfndpos.h ../include/eshk.h \
3491 + ../include/epri.h ../include/emin.h
3492 +quest.o: quest.c $(HACK_H) ../include/qtext.h
3493 +questpgr.o: questpgr.c $(HACK_H) ../include/dlb.h ../include/qtext.h
3494 +read.o: read.c $(HACK_H)
3495 +rect.o: rect.c $(HACK_H)
3496 +region.o: region.c $(HACK_H) ../include/lev.h
3497 +restore.o: restore.c $(HACK_H) ../include/lev.h ../include/tcap.h
3498 +rip.o: rip.c $(HACK_H)
3499 +rnd.o: rnd.c $(HACK_H)
3500 +role.o: role.c $(HACK_H)
3501 +rumors.o: rumors.c $(HACK_H) ../include/lev.h ../include/dlb.h
3502 +save.o: save.c $(HACK_H) ../include/lev.h
3503 +shk.o: shk.c $(HACK_H) ../include/eshk.h
3504 +shknam.o: shknam.c $(HACK_H) ../include/eshk.h
3505 +sit.o: sit.c $(HACK_H) ../include/artifact.h
3506 +sounds.o: sounds.c $(HACK_H) ../include/edog.h
3507 +sp_lev.o: sp_lev.c $(HACK_H) ../include/dlb.h ../include/sp_lev.h
3508 +spell.o: spell.c $(HACK_H)
3509 +steal.o: steal.c $(HACK_H)
3510 +steed.o: steed.c $(HACK_H)
3511 +teleport.o: teleport.c $(HACK_H)
3512 +timeout.o: timeout.c $(HACK_H) ../include/lev.h
3513 +topten.o: topten.c $(HACK_H) ../include/dlb.h ../include/patchlevel.h
3514 +track.o: track.c $(HACK_H)
3515 +trap.o: trap.c $(HACK_H)
3516 +u_init.o: u_init.c $(HACK_H)
3517 +uhitm.o: uhitm.c $(HACK_H)
3518 +vault.o: vault.c $(HACK_H) ../include/vault.h
3519 +version.o: version.c $(HACK_H) ../include/date.h ../include/patchlevel.h
3520 +vision.o: vision.c $(HACK_H) ../include/vis_tab.h
3521 +weapon.o: weapon.c $(HACK_H)
3522 +were.o: were.c $(HACK_H)
3523 +wield.o: wield.c $(HACK_H)
3524 +windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h
3525 +wizard.o: wizard.c $(HACK_H) ../include/qtext.h ../include/epri.h
3526 +worm.o: worm.c $(HACK_H) ../include/lev.h
3527 +worn.o: worn.c $(HACK_H)
3528 +write.o: write.c $(HACK_H)
3529 +zap.o: zap.c $(HACK_H)
3530 +# DEPENDENCIES MUST END AT END OF FILE
3531 +# IF YOU PUT STUFF HERE IT WILL GO AWAY
3532 +# see make depend above
3533 diff --git a/src/Sysunix b/src/Sysunix
3534 new file mode 100644
3535 index 0000000..e69de29
3536 diff --git a/src/allmain.c b/src/allmain.c
3537 index d624a2f..a66c446 100644
3538 --- a/src/allmain.c
3539 +++ b/src/allmain.c
3540 @@ -245,7 +245,11 @@ moveloop()
3541 if (occupation)
3542 stop_occupation();
3543 else
3544 - nomul(0);
3545 + nomul(0
3546 +#ifdef HELPLESS
3547 + , 0
3548 +#endif
3549 + );
3550 if (change == 1) polyself(FALSE);
3551 else you_were();
3552 change = 0;
3553 @@ -438,7 +442,11 @@ stop_occupation()
3554 sync_hunger();
3556 #ifdef REDO
3557 - nomul(0);
3558 + nomul(0
3559 +#ifdef HELPLESS
3560 + , 0
3561 +#endif
3562 + );
3563 pushch(0);
3564 #endif
3566 diff --git a/src/apply.c b/src/apply.c
3567 index f45e196..864c6b1 100644
3568 --- a/src/apply.c
3569 +++ b/src/apply.c
3570 @@ -80,7 +80,7 @@ use_camera(obj)
3571 } else if ((mtmp = bhit(u.dx, u.dy, COLNO, FLASHED_LIGHT,
3572 (int FDECL((*),(MONST_P,OBJ_P)))0,
3573 (int FDECL((*),(OBJ_P,OBJ_P)))0,
3574 - obj)) != 0) {
3575 + obj, NULL)) != 0) {
3576 obj->ox = u.ux, obj->oy = u.uy;
3577 (void) flash_hits_mon(mtmp, obj);
3579 @@ -624,7 +624,11 @@ struct obj *obj;
3580 pline(Hallucination ?
3581 "Yow! The mirror stares back!" :
3582 "Yikes! You've frozen yourself!");
3583 - nomul(-rnd((MAXULEV+6) - u.ulevel));
3584 + nomul(-rnd((MAXULEV+6) - u.ulevel)
3585 +#ifdef HELPLESS
3586 + , "gazing into a mirror"
3587 +#endif
3588 + );
3589 } else You("stiffen momentarily under your gaze.");
3590 } else if (youmonst.data->mlet == S_VAMPIRE)
3591 You("don't have a reflection.");
3592 @@ -670,7 +674,7 @@ struct obj *obj;
3593 mtmp = bhit(u.dx, u.dy, COLNO, INVIS_BEAM,
3594 (int FDECL((*),(MONST_P,OBJ_P)))0,
3595 (int FDECL((*),(OBJ_P,OBJ_P)))0,
3596 - obj);
3597 + obj, NULL);
3598 if (!mtmp || !haseyes(mtmp->data))
3599 return 1;
3601 @@ -788,7 +792,11 @@ struct obj **optr;
3602 break;
3603 case 2: /* no explanation; it just happens... */
3604 nomovemsg = "";
3605 - nomul(-rnd(2));
3606 + nomul(-rnd(2)
3607 +#ifdef HELPLESS
3608 + , 0
3609 +#endif
3610 + );
3611 break;
3614 @@ -1358,7 +1366,11 @@ int magic; /* 0=Physical, otherwise skill level */
3615 change_luck(-1);
3617 teleds(cc.x, cc.y, TRUE);
3618 - nomul(-1);
3619 + nomul(-1
3620 +#ifdef HELPLESS
3621 + , "jumping around"
3622 +#endif
3623 + );
3624 nomovemsg = "";
3625 morehungry(rnd(25));
3626 return 1;
3627 @@ -2750,7 +2762,11 @@ do_break_wand(obj)
3628 current_wand = 0;
3629 if (obj)
3630 delobj(obj);
3631 - nomul(0);
3632 + nomul(0
3633 +#ifdef HELPLESS
3634 + , 0
3635 +#endif
3636 + );
3637 return 1;
3640 @@ -3012,11 +3028,19 @@ doapply()
3642 pline("Sorry, I don't know how to use that.");
3643 xit:
3644 - nomul(0);
3645 + nomul(0
3646 +#ifdef HELPLESS
3647 + , 0
3648 +#endif
3649 + );
3650 return 0;
3652 if (res && obj && obj->oartifact) arti_speak(obj);
3653 - nomul(0);
3654 + nomul(0
3655 +#ifdef HELPLESS
3656 + , 0
3657 +#endif
3658 + );
3659 return res;
3662 diff --git a/src/artifact.c b/src/artifact.c
3663 index ef27bd5..a955795 100644
3664 --- a/src/artifact.c
3665 +++ b/src/artifact.c
3666 @@ -856,7 +856,11 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
3667 if (Antimagic) {
3668 resisted = TRUE;
3669 } else {
3670 - nomul(-3);
3671 + nomul(-3
3672 +#ifdef HELPLESS
3673 + , "being scared stiff"
3674 +#endif
3675 + );
3676 nomovemsg = "";
3677 if (magr && magr == u.ustuck && sticks(youmonst.data)) {
3678 u.ustuck = (struct monst *)0;
3679 diff --git a/src/ball.c b/src/ball.c
3680 index b2a05e0..8dd9596 100644
3681 --- a/src/ball.c
3682 +++ b/src/ball.c
3683 @@ -557,7 +557,11 @@ drag:
3684 if (near_capacity() > SLT_ENCUMBER && dist2(x, y, u.ux, u.uy) <= 2) {
3685 You("cannot %sdrag the heavy iron ball.",
3686 invent ? "carry all that and also " : "");
3687 - nomul(0);
3688 + nomul(0
3689 +#ifdef HELPLESS
3690 + , 0
3691 +#endif
3692 + );
3693 return FALSE;
3696 @@ -595,7 +599,11 @@ drag:
3697 u.uy = uchain->oy;
3698 newsym(u.ux0, u.uy0);
3700 - nomul(0);
3701 + nomul(0
3702 +#ifdef HELPLESS
3703 + , 0
3704 +#endif
3705 + );
3707 *bc_control = BC_BALL;
3708 move_bc(1, *bc_control, *ballx, *bally, *chainx, *chainy);
3709 diff --git a/src/botl.c b/src/botl.c
3710 index 6534ad7..9d50858 100644
3711 --- a/src/botl.c
3712 +++ b/src/botl.c
3713 @@ -3,6 +3,11 @@
3714 /* NetHack may be freely redistributed. See license for details. */
3716 #include "hack.h"
3717 +#if defined(HPMON) && defined(TEXTCOLOR)
3718 +# ifndef WINTTY_H
3719 +# include "wintty.h"
3720 +# endif
3721 +#endif
3723 #ifdef OVL0
3724 extern const char *hu_stat[]; /* defined in eat.c */
3725 @@ -165,10 +170,16 @@ botl_score()
3727 #endif
3729 +#ifdef DUMP_LOG
3730 +void bot1str(char *newbot1)
3731 +#else
3732 STATIC_OVL void
3733 bot1()
3734 +#endif
3736 +#ifndef DUMP_LOG
3737 char newbot1[MAXCO];
3738 +#endif
3739 register char *nb;
3740 register int i,j;
3742 @@ -215,6 +226,15 @@ bot1()
3743 if (flags.showscore)
3744 Sprintf(nb = eos(nb), " S:%ld", botl_score());
3745 #endif
3746 +#ifdef DUMP_LOG
3748 +STATIC_OVL void
3749 +bot1()
3751 + char newbot1[MAXCO];
3753 + bot1str(newbot1);
3754 +#endif
3755 curs(WIN_STATUS, 1, 0);
3756 putstr(WIN_STATUS, 0, newbot1);
3758 @@ -242,12 +262,22 @@ char *buf;
3759 return ret;
3762 +#ifdef DUMP_LOG
3763 +void bot2str(newbot2)
3764 +char* newbot2;
3765 +#else
3766 STATIC_OVL void
3767 bot2()
3768 +#endif
3770 +#ifndef DUMP_LOG
3771 char newbot2[MAXCO];
3772 +#endif
3773 register char *nb;
3774 int hp, hpmax;
3775 +#ifdef HPMON
3776 + int hpcolor, hpattr;
3777 +#endif
3778 int cap = near_capacity();
3780 hp = Upolyd ? u.mh : u.uhp;
3781 @@ -256,6 +286,15 @@ bot2()
3782 if(hp < 0) hp = 0;
3783 (void) describe_level(newbot2);
3784 Sprintf(nb = eos(newbot2),
3785 +#ifdef HPMON
3786 + "%c:%-2ld HP:", oc_syms[COIN_CLASS],
3787 +#ifndef GOLDOBJ
3788 + u.ugold
3789 +#else
3790 + money_cnt(invent)
3791 +#endif
3792 + );
3793 +#else /* HPMON */
3794 "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS],
3795 #ifndef GOLDOBJ
3796 u.ugold,
3797 @@ -263,6 +302,39 @@ bot2()
3798 money_cnt(invent),
3799 #endif
3800 hp, hpmax, u.uen, u.uenmax, u.uac);
3801 +#endif /* HPMON */
3802 +#ifdef HPMON
3803 + curs(WIN_STATUS, 1, 1);
3804 + putstr(WIN_STATUS, 0, newbot2);
3806 + Sprintf(nb = eos(newbot2), "%d(%d)", hp, hpmax);
3807 +#ifdef TEXTCOLOR
3808 + if (iflags.use_color) {
3809 + curs(WIN_STATUS, 1, 1);
3810 + hpattr = ATR_NONE;
3811 + if(hp == hpmax){
3812 + hpcolor = NO_COLOR;
3813 + } else if(hp > (hpmax*2/3)) {
3814 + hpcolor = CLR_GREEN;
3815 + } else if(hp <= (hpmax/3)) {
3816 + hpcolor = CLR_RED;
3817 + if(hp<=(hpmax/10))
3818 + hpattr = ATR_BLINK;
3819 + } else {
3820 + hpcolor = CLR_YELLOW;
3822 + if (hpcolor != NO_COLOR)
3823 + term_start_color(hpcolor);
3824 + if(hpattr!=ATR_NONE)term_start_attr(hpattr);
3825 + putstr(WIN_STATUS, hpattr, newbot2);
3826 + if(hpattr!=ATR_NONE)term_end_attr(hpattr);
3827 + if (hpcolor != NO_COLOR)
3828 + term_end_color();
3830 +#endif /* TEXTCOLOR */
3831 + Sprintf(nb = eos(newbot2), " Pw:%d(%d) AC:%-2d",
3832 + u.uen, u.uenmax, u.uac);
3833 +#endif /* HPMON */
3835 if (Upolyd)
3836 Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);
3837 @@ -292,10 +364,37 @@ bot2()
3838 if(Slimed) Sprintf(nb = eos(nb), " Slime");
3839 if(cap > UNENCUMBERED)
3840 Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
3841 +#ifdef DUMP_LOG
3843 +STATIC_OVL void
3844 +bot2()
3846 + char newbot2[MAXCO];
3847 + bot2str(newbot2);
3848 +#endif
3849 curs(WIN_STATUS, 1, 1);
3850 putstr(WIN_STATUS, 0, newbot2);
3853 +#ifdef ENL_STATS
3854 +const char *
3855 +encstat()
3857 + int cap = near_capacity();
3858 + if(cap > UNENCUMBERED)
3859 + return enc_stat[cap];
3860 + else return "";
3863 +const char *
3864 +hunstat()
3866 + if (strcmp(hu_stat[u.uhs], " "))
3867 + return hu_stat[u.uhs];
3868 + else return "";
3870 +#endif
3872 void
3873 bot()
3875 diff --git a/src/cmd.c b/src/cmd.c
3876 index b12c0e5..f44d805 100644
3877 --- a/src/cmd.c
3878 +++ b/src/cmd.c
3879 @@ -123,6 +123,10 @@ STATIC_PTR int NDECL(wiz_show_seenv);
3880 STATIC_PTR int NDECL(wiz_show_vision);
3881 STATIC_PTR int NDECL(wiz_mon_polycontrol);
3882 STATIC_PTR int NDECL(wiz_show_wmodes);
3883 +STATIC_PTR int NDECL(wiz_showkills); /* showborn patch */
3884 +#ifdef SHOW_BORN
3885 +extern void FDECL(list_vanquished, (int, BOOLEAN_P)); /* showborn patch */
3886 +#endif /* SHOW_BORN */
3887 #if defined(__BORLANDC__) && !defined(_WIN32)
3888 extern void FDECL(show_borlandc_stats, (winid));
3889 #endif
3890 @@ -139,7 +143,7 @@ STATIC_PTR int NDECL(wiz_show_stats);
3891 STATIC_DCL int NDECL(wiz_port_debug);
3892 # endif
3893 # endif
3894 -STATIC_PTR int NDECL(enter_explore_mode);
3895 +int NDECL(enter_explore_mode); /* deathexplore patch */
3896 STATIC_PTR int NDECL(doattributes);
3897 STATIC_PTR int NDECL(doconduct); /**/
3898 STATIC_PTR boolean NDECL(minimal_enlightenment);
3899 @@ -475,12 +479,29 @@ domonability()
3900 return 0;
3903 -STATIC_PTR int
3904 +int /* deathexplore patch */
3905 enter_explore_mode()
3907 +#ifdef PARANOID
3908 + char buf[BUFSZ];
3909 + int really_xplor = FALSE;
3910 +#endif
3911 if(!discover && !wizard) {
3912 pline("Beware! From explore mode there will be no return to normal game.");
3913 +#ifdef PARANOID
3914 + if (iflags.paranoid_quit) {
3915 + getlin ("Do you want to enter explore mode? [yes/no]?",buf);
3916 + (void) lcase (buf);
3917 + if (!(strcmp (buf, "yes"))) really_xplor = TRUE;
3918 + } else {
3919 if (yn("Do you want to enter explore mode?") == 'y') {
3920 + really_xplor = TRUE;
3923 + if (really_xplor) {
3924 +#else
3925 + if (yn("Do you want to enter explore mode?") == 'y') {
3926 +#endif
3927 clear_nhwindow(WIN_MESSAGE);
3928 You("are now in non-scoring explore mode.");
3929 discover = TRUE;
3930 @@ -756,6 +777,13 @@ wiz_show_wmodes()
3931 return 0;
3934 +/* #showkills command */
3935 +STATIC_PTR int wiz_showkills() /* showborn patch */
3937 + list_vanquished('y', FALSE);
3938 + return 0;
3941 #endif /* WIZARD */
3944 @@ -1126,6 +1154,304 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
3945 return;
3948 +#ifdef DUMP_LOG
3949 +void
3950 +dump_enlightenment(final)
3951 +int final;
3953 + int ltmp;
3954 + char buf[BUFSZ];
3955 + char buf2[BUFSZ];
3956 + const char *enc_stat[] = { /* copied from botl.c */
3957 + "",
3958 + "burdened",
3959 + "stressed",
3960 + "strained",
3961 + "overtaxed",
3962 + "overloaded"
3963 + };
3964 + char *youwere = " You were ";
3965 + char *youhave = " You have ";
3966 + char *youhad = " You had ";
3967 + char *youcould = " You could ";
3969 + dump("", "Final attributes");
3971 +#ifdef ELBERETH
3972 + if (u.uevent.uhand_of_elbereth) {
3973 + static const char * const hofe_titles[3] = {
3974 + "the Hand of Elbereth",
3975 + "the Envoy of Balance",
3976 + "the Glory of Arioch"
3977 + };
3978 + dump(youwere,
3979 + (char *)hofe_titles[u.uevent.uhand_of_elbereth - 1]);
3981 +#endif
3983 + if (u.ualign.record >= 20)
3984 + dump(youwere, "piously aligned");
3985 + else if (u.ualign.record > 13)
3986 + dump(youwere, "devoutly aligned");
3987 + else if (u.ualign.record > 8)
3988 + dump(youwere, "fervently aligned");
3989 + else if (u.ualign.record > 3)
3990 + dump(youwere, "stridently aligned");
3991 + else if (u.ualign.record == 3)
3992 + dump(youwere, "aligned");
3993 + else if (u.ualign.record > 0)
3994 + dump(youwere, "haltingly aligned");
3995 + else if (u.ualign.record == 0)
3996 + dump(youwere, "nominally aligned");
3997 + else if (u.ualign.record >= -3) dump(youhave, "strayed");
3998 + else if (u.ualign.record >= -8) dump(youhave, "sinned");
3999 + else dump(" You have ", "transgressed");
4000 + Sprintf(buf, " %d", u.ualign.record);
4001 + dump(" Your alignment was ", buf);
4003 + /*** Resistances to troubles ***/
4004 + if (Fire_resistance) dump(youwere, "fire resistant");
4005 + if (Cold_resistance) dump(youwere, "cold resistant");
4006 + if (Sleep_resistance) dump(youwere, "sleep resistant");
4007 + if (Disint_resistance) dump(youwere, "disintegration-resistant");
4008 + if (Shock_resistance) dump(youwere, "shock resistant");
4009 + if (Poison_resistance) dump(youwere, "poison resistant");
4010 + if (Drain_resistance) dump(youwere, "level-drain resistant");
4011 + if (Sick_resistance) dump(youwere, "immune to sickness");
4012 + if (Antimagic) dump(youwere, "magic-protected");
4013 + if (Acid_resistance) dump(youwere, "acid resistant");
4014 + if (Stone_resistance) dump(youwere, "petrification resistant");
4015 + if (Invulnerable) dump(youwere, "invulnerable");
4016 + if (u.uedibility) dump(youcould, "recognize detrimental food");
4018 + /*** Troubles ***/
4019 + if (Halluc_resistance) dump(" ", "You resisted hallucinations");
4020 + if (Hallucination) dump(youwere, "hallucinating");
4021 + if (Stunned) dump(youwere, "stunned");
4022 + if (Confusion) dump(youwere, "confused");
4023 + if (Blinded) dump(youwere, "blinded");
4024 + if (Sick) {
4025 + if (u.usick_type & SICK_VOMITABLE)
4026 + dump(youwere, "sick from food poisoning");
4027 + if (u.usick_type & SICK_NONVOMITABLE)
4028 + dump(youwere, "sick from illness");
4030 + if (Stoned) dump(youwere, "turning to stone");
4031 + if (Slimed) dump(youwere, "turning into slime");
4032 + if (Strangled)
4033 + dump(youwere, (u.uburied) ? "buried" : "being strangled");
4034 + if (Glib) {
4035 + Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
4036 + dump(youhad, buf);
4038 + if (Fumbling) dump(" ", "You fumbled");
4039 + if (Wounded_legs
4040 +#ifdef STEED
4041 + && !u.usteed
4042 +#endif
4043 + ) {
4044 + Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
4045 + dump(youhad, buf);
4047 +#ifdef STEED
4048 + if (Wounded_legs && u.usteed) {
4049 + Strcpy(buf, x_monnam(u.usteed, ARTICLE_YOUR, (char *)0,
4050 + SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION, FALSE));
4051 + *buf = highc(*buf);
4052 + Strcat(buf, " had wounded legs");
4053 + dump(" ", buf);
4055 +#endif
4056 + if (Sleeping) dump(" ", "You fell asleep");
4057 + if (Hunger) dump(" ", "You hungered rapidly");
4059 + /*** Vision and senses ***/
4060 + if (See_invisible) dump(" ", "You saw invisible");
4061 + if (Blind_telepat) dump(youwere, "telepathic");
4062 + if (Warning) dump(youwere, "warned");
4063 + if (Warn_of_mon && flags.warntype) {
4064 + Sprintf(buf, "aware of the presence of %s",
4065 + (flags.warntype & M2_ORC) ? "orcs" :
4066 + (flags.warntype & M2_DEMON) ? "demons" :
4067 + something);
4068 + dump(youwere, buf);
4070 + if (Undead_warning) dump(youwere, "warned of undead");
4071 + if (Searching) dump(youhad, "automatic searching");
4072 + if (Clairvoyant) dump(youwere, "clairvoyant");
4073 + if (Infravision) dump(youhad, "infravision");
4074 + if (Detect_monsters)
4075 + dump(youwere, "sensing the presence of monsters");
4076 + if (u.umconf) dump(youwere, "going to confuse monsters");
4078 + /*** Appearance and behavior ***/
4079 + if (Adornment) {
4080 + int adorn = 0;
4081 + if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe;
4082 + if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe;
4083 + if (adorn < 0)
4084 + dump(youwere, "poorly adorned");
4085 + else
4086 + dump(youwere, "adorned");
4088 + if (Invisible) dump(youwere, "invisible");
4089 + else if (Invis) dump(youwere, "invisible to others");
4090 + /* ordinarily "visible" is redundant; this is a special case for
4091 + the situation when invisibility would be an expected attribute */
4092 + else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis)
4093 + dump(youwere, "visible");
4094 + if (Displaced) dump(youwere, "displaced");
4095 + if (Stealth) dump(youwere, "stealthy");
4096 + if (Aggravate_monster) dump(" ", "You aggravated monsters");
4097 + if (Conflict) dump(" ", "You caused conflict");
4099 + /*** Transportation ***/
4100 + if (Jumping) dump(youcould, "jump");
4101 + if (Teleportation) dump(youcould, "teleport");
4102 + if (Teleport_control) dump(youhad, "teleport control");
4103 + if (Lev_at_will) dump(youwere, "levitating, at will");
4104 + else if (Levitation)
4105 + dump(youwere, "levitating"); /* without control */
4106 + else if (Flying) dump(youcould, "fly");
4107 + if (Wwalking) dump(youcould, "walk on water");
4108 + if (Swimming) dump(youcould, "swim");
4109 + if (Breathless) dump(youcould, "survive without air");
4110 + else if (Amphibious) dump(youcould, "breathe water");
4111 + if (Passes_walls) dump(youcould, "walk through walls");
4112 +#ifdef STEED
4113 + if (u.usteed && (final < 2 || strcmp(killer, "riding accident"))) {
4114 + Sprintf(buf, "riding %s", y_monnam(u.usteed));
4115 + dump(youwere, buf);
4117 +#endif
4118 + if (u.uswallow) {
4119 + Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck));
4120 +#ifdef WIZARD
4121 + if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim);
4122 +#endif
4123 + dump(youwere, buf);
4124 + } else if (u.ustuck) {
4125 + Sprintf(buf, "%s %s",
4126 + (Upolyd && sticks(youmonst.data)) ? "holding" : "held by",
4127 + a_monnam(u.ustuck));
4128 + dump(youwere, buf);
4131 + /*** Physical attributes ***/
4132 + if (u.uhitinc)
4133 + dump(youhad,
4134 + enlght_combatinc("to hit", u.uhitinc, final, buf));
4135 + if (u.udaminc)
4136 + dump(youhad,
4137 + enlght_combatinc("damage", u.udaminc, final, buf));
4138 + if (Slow_digestion) dump(youhad, "slower digestion");
4139 + if (Regeneration) dump(" ", "You regenerated");
4140 + if (u.uspellprot || Protection) {
4141 + int prot = 0;
4143 + if(uleft && uleft->otyp == RIN_PROTECTION) prot += uleft->spe;
4144 + if(uright && uright->otyp == RIN_PROTECTION) prot += uright->spe;
4145 + if (HProtection & INTRINSIC) prot += u.ublessed;
4146 + prot += u.uspellprot;
4148 + if (prot < 0)
4149 + dump(youwere, "ineffectively protected");
4150 + else
4151 + dump(youwere, "protected");
4153 + if (Protection_from_shape_changers)
4154 + dump(youwere, "protected from shape changers");
4155 + if (Polymorph) dump(youwere, "polymorphing");
4156 + if (Polymorph_control) dump(youhad, "polymorph control");
4157 + if (u.ulycn >= LOW_PM) {
4158 + Strcpy(buf, an(mons[u.ulycn].mname));
4159 + dump(youwere, buf);
4161 + if (Upolyd) {
4162 + if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
4163 + else Sprintf(buf, "polymorphed into %s",
4164 + an(youmonst.data->mname));
4165 +#ifdef WIZARD
4166 + if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
4167 +#endif
4168 + dump(youwere, buf);
4170 + if (Unchanging)
4171 + dump(youcould, "not change from your current form");
4172 + if (Fast) dump(youwere, Very_fast ? "very fast" : "fast");
4173 + if (Reflecting) dump(youhad, "reflection");
4174 + if (Free_action) dump(youhad, "free action");
4175 + if (Fixed_abil) dump(youhad, "fixed abilities");
4176 + if (Lifesaved)
4177 + dump(" ", "Your life would have been saved");
4178 + if (u.twoweap) dump(youwere, "wielding two weapons at once");
4180 + /*** Miscellany ***/
4181 + if (Luck) {
4182 + ltmp = abs((int)Luck);
4183 + Sprintf(buf, "%s%slucky (%d)",
4184 + ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "",
4185 + Luck < 0 ? "un" : "", Luck);
4186 + dump(youwere, buf);
4188 +#ifdef WIZARD
4189 + else if (wizard) dump(" ", "Your luck was zero");
4190 +#endif
4191 + if (u.moreluck > 0) dump(youhad, "extra luck");
4192 + else if (u.moreluck < 0) dump(youhad, "reduced luck");
4193 + if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
4194 + ltmp = stone_luck(FALSE);
4195 + if (ltmp <= 0)
4196 + dump(" ", "Bad luck did not time out for you");
4197 + if (ltmp >= 0)
4198 + dump(" ", "Good luck did not time out for you");
4201 + if (u.ugangr) {
4202 + Sprintf(buf, " %sangry with you",
4203 + u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : "");
4204 +#ifdef WIZARD
4205 + if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr);
4206 +#endif
4207 + Sprintf(buf2, "%s was %s", u_gname(), buf);
4208 + dump(" ", buf2);
4212 + const char *p;
4214 + buf[0] = '\0';
4215 + if (final < 2) { /* quit/escaped/ascended */
4216 + p = "survived after being killed ";
4217 + switch (u.umortality) {
4218 + case 0: p = "survived"; break;
4219 + case 1: Strcpy(buf, "once"); break;
4220 + case 2: Strcpy(buf, "twice"); break;
4221 + case 3: Strcpy(buf, "thrice"); break;
4222 + default: Sprintf(buf, "%d times", u.umortality);
4223 + break;
4225 + } else { /* game ended in character's death */
4226 + p = "are dead";
4227 + switch (u.umortality) {
4228 + case 0: impossible("dead without dying?");
4229 + case 1: break; /* just "are dead" */
4230 + default: Sprintf(buf, " (%d%s time!)", u.umortality,
4231 + ordin(u.umortality));
4232 + break;
4235 + if (p) {
4236 + Sprintf(buf2, "You %s %s", p, buf);
4237 + dump(" ", buf2);
4240 + dump("", "");
4241 + return;
4243 +} /* dump_enlightenment */
4244 +#endif
4247 * Courtesy function for non-debug, non-explorer mode players
4248 * to help refresh them about who/what they are.
4249 @@ -1145,6 +1471,9 @@ minimal_enlightenment()
4250 static const char tabbed_deity_fmtstr[] = "%s\t%s";
4251 static const char *fmtstr;
4252 static const char *deity_fmtstr;
4253 +#ifdef ENL_STATS
4254 + boolean stats = FALSE;
4255 +#endif
4257 fmtstr = iflags.menu_tab_sep ? tabbed_fmtstr : untabbed_fmtstr;
4258 deity_fmtstr = iflags.menu_tab_sep ?
4259 @@ -1224,6 +1553,48 @@ minimal_enlightenment()
4260 Sprintf(buf, fmtstr, "Lawful", buf2);
4261 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
4263 +#ifdef ENL_STATS
4264 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
4265 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Status", FALSE);
4266 + if (strcmp(hunstat(), "")) {
4267 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, hunstat(), FALSE);
4268 + stats = TRUE;
4270 + if (near_capacity() > UNENCUMBERED) {
4271 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, encstat(), FALSE);
4272 + stats = TRUE;
4274 + if (Confusion) {
4275 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Confused", FALSE); stats = TRUE;
4277 + if (Sick) {
4278 + if (u.usick_type & SICK_VOMITABLE) {
4279 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Dying from food poisoning", FALSE);
4280 + stats = TRUE;
4282 + if (u.usick_type & SICK_NONVOMITABLE) {
4283 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Dying from illness", FALSE);
4284 + stats = TRUE;
4287 + if (Blind) {
4288 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Blind", FALSE);
4289 + stats = TRUE;
4291 + if (Stunned) {
4292 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Stunned", FALSE); stats = TRUE;
4294 + if (Hallucination) {
4295 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Hallucinating", FALSE);
4296 + stats = TRUE;
4298 + if (Slimed) {
4299 + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Slimed", FALSE);
4300 + stats = TRUE;
4302 + if (!stats) add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "None", FALSE);
4303 +#endif
4305 end_menu(tmpwin, "Base Attributes");
4306 n = select_menu(tmpwin, PICK_NONE, &selected);
4307 destroy_nhwindow(tmpwin);
4308 @@ -1341,6 +1712,99 @@ int final;
4309 destroy_nhwindow(en_win);
4312 +#ifdef DUMP_LOG
4313 +void
4314 +dump_conduct(final)
4315 +int final;
4317 + char buf[BUFSZ];
4318 + int ngenocided;
4320 + dump("", "Voluntary challenges");
4322 + if (!u.uconduct.food)
4323 + dump("", " You went without food");
4324 + /* But beverages are okay */
4325 + else if (!u.uconduct.unvegan)
4326 + dump("", " You followed a strict vegan diet");
4327 + else if (!u.uconduct.unvegetarian)
4328 + dump("", " You were a vegetarian");
4329 + else if (Role_if(PM_MONK) && u.uconduct.unvegetarian < 10) {
4330 + sprintf(buf, " You ate non-vegetarian food %ld time%s.",
4331 + u.uconduct.unvegetarian, plur(u.uconduct.unvegetarian));
4332 + dump("", buf);
4335 + if (!u.uconduct.gnostic)
4336 + dump("", " You were an atheist");
4338 + if (!u.uconduct.weaphit)
4339 + dump("", " You never hit with a wielded weapon");
4340 + else if (Role_if(PM_MONK) && u.uconduct.weaphit < 10) {
4341 + Sprintf(buf, " You hit with a wielded weapon %ld time%s",
4342 + u.uconduct.weaphit, plur(u.uconduct.weaphit));
4343 + dump("", buf);
4345 +#ifdef WIZARD
4346 + else if (wizard) {
4347 + Sprintf(buf, "hit with a wielded weapon %ld time%s",
4348 + u.uconduct.weaphit, plur(u.uconduct.weaphit));
4349 + dump(" You ", buf);
4351 +#endif
4352 + if (!u.uconduct.killer)
4353 + dump("", " You were a pacifist");
4355 + if (!u.uconduct.literate)
4356 + dump("", " You were illiterate");
4357 +#ifdef WIZARD
4358 + else if (wizard) {
4359 + Sprintf(buf, "read items or engraved %ld time%s",
4360 + u.uconduct.literate, plur(u.uconduct.literate));
4361 + dump(" You ", buf);
4363 +#endif
4365 + ngenocided = num_genocides();
4366 + if (ngenocided == 0) {
4367 + dump("", " You never genocided any monsters");
4368 + } else {
4369 + Sprintf(buf, "genocided %d type%s of monster%s",
4370 + ngenocided, plur(ngenocided), plur(ngenocided));
4371 + dump(" You ", buf);
4374 + if (!u.uconduct.polypiles)
4375 + dump("", " You never polymorphed an object");
4376 + else {
4377 + Sprintf(buf, "polymorphed %ld item%s",
4378 + u.uconduct.polypiles, plur(u.uconduct.polypiles));
4379 + dump(" You ", buf);
4382 + if (!u.uconduct.polyselfs)
4383 + dump("", " You never changed form");
4384 + else {
4385 + Sprintf(buf, "changed form %ld time%s",
4386 + u.uconduct.polyselfs, plur(u.uconduct.polyselfs));
4387 + dump(" You ", buf);
4390 + if (!u.uconduct.wishes)
4391 + dump("", " You used no wishes");
4392 + else {
4393 + Sprintf(buf, "used %ld wish%s",
4394 + u.uconduct.wishes, (u.uconduct.wishes > 1L) ? "es" : "");
4395 + dump(" You ", buf);
4397 + if (!u.uconduct.wisharti)
4398 + dump("", " You did not wish for any artifacts");
4401 + dump("", "");
4403 +#endif /* DUMP_LOG */
4405 #endif /* OVLB */
4406 #ifdef OVL1
4408 @@ -1519,6 +1983,7 @@ struct ext_func_tab extcmdlist[] = {
4409 {(char *)0, (char *)0, donull, TRUE},
4410 #endif
4411 {(char *)0, (char *)0, donull, TRUE},
4412 + {(char *)0, (char *)0, donull, TRUE}, /* showkills (showborn patch) */
4413 {(char *)0, (char *)0, donull, TRUE},
4414 {(char *)0, (char *)0, donull, TRUE},
4415 {(char *)0, (char *)0, donull, TRUE},
4416 @@ -1544,6 +2009,7 @@ static const struct ext_func_tab debug_extcmdlist[] = {
4417 {"portdebug", "wizard port debug command", wiz_port_debug, TRUE},
4418 #endif
4419 {"seenv", "show seen vectors", wiz_show_seenv, TRUE},
4420 + {"showkills", "show list of monsters killed", wiz_showkills, TRUE},
4421 {"stats", "show memory statistics", wiz_show_stats, TRUE},
4422 {"timeout", "look at timeout queue", wiz_timeout_queue, TRUE},
4423 {"vision", "show vision array", wiz_show_vision, TRUE},
4424 diff --git a/src/decl.c b/src/decl.c
4425 index 4dd460e..58cfb25 100644
4426 --- a/src/decl.c
4427 +++ b/src/decl.c
4428 @@ -20,6 +20,9 @@ char *catmore = 0; /* default pager */
4429 NEARDATA int bases[MAXOCLASSES] = DUMMY;
4431 NEARDATA int multi = 0;
4432 +#ifdef HELPLESS
4433 +char multi_txt[BUFSZ] = DUMMY;
4434 +#endif
4435 #if 0
4436 NEARDATA int warnlevel = 0; /* used by movemon and dochugw */
4437 #endif
4438 @@ -209,6 +212,15 @@ NEARDATA struct monst *migrating_mons = (struct monst *)0;
4440 NEARDATA struct mvitals mvitals[NUMMONS];
4442 +/* originally from end.c */
4443 +#ifdef DUMP_LOG
4444 +#ifdef DUMP_FN
4445 +char dump_fn[] = DUMP_FN;
4446 +#else
4447 +char dump_fn[PL_PSIZ] = DUMMY;
4448 +#endif
4449 +#endif /* DUMP_LOG */
4451 NEARDATA struct c_color_names c_color_names = {
4452 "black", "amber", "golden",
4453 "light blue", "red", "green",
4454 @@ -235,6 +247,10 @@ const char *c_obj_colors[] = {
4455 "white", /* CLR_WHITE */
4458 +#ifdef MENU_COLOR
4459 +struct menucoloring *menu_colorings = 0;
4460 +#endif
4462 struct c_common_strings c_common_strings = {
4463 "Nothing happens.", "That's enough tries!",
4464 "That is a silly thing to %s.", "shudder for a moment.",
4465 diff --git a/src/detect.c b/src/detect.c
4466 index 5da025f..b0f873c 100644
4467 --- a/src/detect.c
4468 +++ b/src/detect.c
4469 @@ -861,7 +861,11 @@ struct obj *obj;
4470 return;
4472 You("peer into %s...", the(xname(obj)));
4473 - nomul(-rnd(10));
4474 + nomul(-rnd(10)
4475 +#ifdef HELPLESS
4476 + , "gazing into a crystal ball"
4477 +#endif
4478 + );
4479 nomovemsg = "";
4480 if (obj->spe <= 0)
4481 pline_The("vision is unclear.");
4482 @@ -1191,7 +1195,11 @@ register int aflag;
4483 if(rnl(7-fund)) continue;
4484 cvt_sdoor_to_door(&levl[x][y]); /* .typ = DOOR */
4485 exercise(A_WIS, TRUE);
4486 - nomul(0);
4487 + nomul(0
4488 +#ifdef HELPLESS
4489 + , 0
4490 +#endif
4491 + );
4492 if (Blind && !aflag)
4493 feel_location(x,y); /* make sure it shows up */
4494 else
4495 @@ -1201,7 +1209,11 @@ register int aflag;
4496 levl[x][y].typ = CORR;
4497 unblock_point(x,y); /* vision */
4498 exercise(A_WIS, TRUE);
4499 - nomul(0);
4500 + nomul(0
4501 +#ifdef HELPLESS
4502 + , 0
4503 +#endif
4504 + );
4505 newsym(x,y);
4506 } else {
4507 /* Be careful not to find anything in an SCORR or SDOOR */
4508 @@ -1246,7 +1258,11 @@ register int aflag;
4511 if ((trap = t_at(x,y)) && !trap->tseen && !rnl(8)) {
4512 - nomul(0);
4513 + nomul(0
4514 +#ifdef HELPLESS
4515 + , 0
4516 +#endif
4517 + );
4519 if (trap->ttyp == STATUE_TRAP) {
4520 if (activate_statue_trap(trap, x, y, FALSE))
4521 diff --git a/src/dig.c b/src/dig.c
4522 index 4c40a59..d5f765e 100644
4523 --- a/src/dig.c
4524 +++ b/src/dig.c
4525 @@ -916,7 +916,11 @@ struct obj *obj;
4526 aobjnam(obj, "become"));
4527 /* you ought to be able to let go; tough luck */
4528 /* (maybe `move_into_trap()' would be better) */
4529 - nomul(-d(2,2));
4530 + nomul(-d(2,2)
4531 +#ifdef HELPLESS
4532 + , "stuck in a spider web"
4533 +#endif
4534 + );
4535 nomovemsg = "You pull free.";
4536 } else if (lev->typ == IRONBARS) {
4537 pline("Clang!");
4538 diff --git a/src/display.c b/src/display.c
4539 index 2c9e9ae..0582b5d 100644
4540 --- a/src/display.c
4541 +++ b/src/display.c
4542 @@ -1370,6 +1370,106 @@ flush_screen(cursor_on_u)
4544 /* ========================================================================= */
4546 +#ifdef DUMP_LOG
4547 +/* D: Added to dump screen to output file */
4548 +STATIC_PTR uchar get_glyph_char(glyph)
4549 +int glyph;
4551 + uchar ch;
4552 + register int offset;
4554 + if (glyph >= NO_GLYPH)
4555 + return ' ';
4557 + /*
4558 + * Map the glyph back to a character.
4560 + * Warning: For speed, this makes an assumption on the order of
4561 + * offsets. The order is set in display.h.
4562 + */
4563 + if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */
4564 + ch = def_warnsyms[offset].sym;
4565 + } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */
4566 + /* see swallow_to_glyph() in display.c */
4567 + ch = (uchar) defsyms[S_sw_tl + (offset & 0x7)].sym;
4568 + } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */
4569 + /* see zapdir_to_glyph() in display.c */
4570 + ch = defsyms[S_vbeam + (offset & 0x3)].sym;
4571 + } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */
4572 + ch = defsyms[offset].sym;
4573 + } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) { /* object */
4574 + ch = def_oc_syms[(int)objects[offset].oc_class];
4575 + } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */
4576 + ch = def_monsyms[(int)mons[offset].mlet];
4577 + } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */
4578 + ch = def_oc_syms[(int)objects[CORPSE].oc_class];
4579 + } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */
4580 + ch = def_monsyms[(int)mons[offset].mlet];
4581 + } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */
4582 + ch = DEF_INVISIBLE;
4583 + } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */
4584 + ch = def_monsyms[(int)mons[offset].mlet];
4585 + } else { /* a monster */
4586 + ch = monsyms[(int)mons[glyph].mlet];
4588 + return ch;
4591 +#ifdef TTY_GRAPHICS
4592 +extern const char * FDECL(compress_str, (const char *));
4593 +#else
4594 +const char*
4595 +compress_str(str) /* copied from win/tty/wintty.c */
4596 +const char *str;
4598 + static char cbuf[BUFSZ];
4599 + /* compress in case line too long */
4600 + if((int)strlen(str) >= 80) {
4601 + register const char *bp0 = str;
4602 + register char *bp1 = cbuf;
4604 + do {
4605 + if(*bp0 != ' ' || bp0[1] != ' ')
4606 + *bp1++ = *bp0;
4607 + } while(*bp0++);
4608 + } else
4609 + return str;
4610 + return cbuf;
4612 +#endif /* TTY_GRAPHICS */
4614 +/* Take a screen dump */
4615 +void dump_screen()
4617 + register int x,y;
4618 + int lastc;
4619 + /* D: botl.c has a closer approximation to the size, but we'll go with
4620 + * this */
4621 + char buf[300], *ptr;
4623 + for (y = 0; y < ROWNO; y++) {
4624 + lastc = 0;
4625 + ptr = buf;
4626 + for (x = 1; x < COLNO; x++) {
4627 + uchar c = get_glyph_char(gbuf[y][x].glyph);
4628 + *ptr++ = c;
4629 + if (c != ' ')
4630 + lastc = x;
4632 + buf[lastc] = '\0';
4633 + dump("", buf);
4635 + dump("", "");
4636 + bot1str(buf);
4637 + ptr = (char *) compress_str((const char *) buf);
4638 + dump("", ptr);
4639 + bot2str(buf);
4640 + dump("", buf);
4641 + dump("", "");
4642 + dump("", "");
4644 +#endif /* DUMP_LOG */
4647 * back_to_glyph()
4649 diff --git a/src/do.c b/src/do.c
4650 index 858777f..5ee4141 100644
4651 --- a/src/do.c
4652 +++ b/src/do.c
4653 @@ -208,7 +208,7 @@ const char *verb;
4654 map_background(x, y, 0);
4655 newsym(x, y);
4657 - water_damage(obj, FALSE, FALSE);
4658 + return water_damage(obj, FALSE, FALSE);
4659 } else if (u.ux == x && u.uy == y &&
4660 (!u.utrap || u.utraptype != TT_PIT) &&
4661 (t = t_at(x,y)) != 0 && t->tseen &&
4662 @@ -667,8 +667,14 @@ int retry;
4663 all_categories = FALSE;
4664 n = query_category("Drop what type of items?",
4665 invent,
4666 - UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL |
4667 - BUC_BLESSED | BUC_CURSED | BUC_UNCURSED | BUC_UNKNOWN,
4668 + UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL
4669 +#ifdef ITEMCAT_JP
4670 + | JUSTPICKED
4671 +#endif
4672 +#ifdef ITEMCAT
4673 + | UNIDENTIFIED | RUSTPRONE
4674 +#endif
4675 + | BUC_BLESSED | BUC_CURSED | BUC_UNCURSED | BUC_UNKNOWN,
4676 &pick_list, PICK_ANY);
4677 if (!n) goto drop_done;
4678 for (i = 0; i < n; i++) {
4679 diff --git a/src/do_wear.c b/src/do_wear.c
4680 index c197c1b..dc4c7ba 100644
4681 --- a/src/do_wear.c
4682 +++ b/src/do_wear.c
4683 @@ -1078,7 +1078,11 @@ dotakeoff()
4684 " Use 'R' command to remove accessories." : "");
4685 return 0;
4687 - if (armorpieces > 1)
4688 + if (armorpieces > 1
4689 +#ifdef PARANOID
4690 + || iflags.paranoid_remove
4691 +#endif
4693 otmp = getobj(clothes, "take off");
4694 if (otmp == 0) return(0);
4695 if (!(otmp->owornmask & W_ARMOR)) {
4696 @@ -1128,7 +1132,11 @@ doremring()
4697 " Use 'T' command to take off armor." : "");
4698 return(0);
4700 - if (Accessories != 1) otmp = getobj(accessories, "remove");
4701 + if (Accessories != 1
4702 +#ifdef PARANOID
4703 + || iflags.paranoid_remove
4704 +#endif
4705 + ) otmp = getobj(accessories, "remove");
4706 if(!otmp) return(0);
4707 if(!(otmp->owornmask & (W_RING | W_AMUL | W_TOOL))) {
4708 You("are not wearing that.");
4709 @@ -1184,7 +1192,11 @@ register struct obj *otmp;
4711 if(cursed(otmp)) return(0);
4712 if(delay) {
4713 - nomul(delay);
4714 + nomul(delay
4715 +#ifdef HELPLESS
4716 + , "disrobing"
4717 +#endif
4718 + );
4719 if (is_helmet(otmp)) {
4720 nomovemsg = "You finish taking off your helmet.";
4721 afternmv = Helmet_off;
4722 @@ -1441,7 +1453,11 @@ dowear()
4723 setworn(otmp, mask);
4724 delay = -objects[otmp->otyp].oc_delay;
4725 if(delay){
4726 - nomul(delay);
4727 + nomul(delay
4728 +#ifdef HELPLESS
4729 + , "dressing up"
4730 +#endif
4731 + );
4732 if(is_boots(otmp)) afternmv = Boots_on;
4733 if(is_helmet(otmp)) afternmv = Helmet_on;
4734 if(is_gloves(otmp)) afternmv = Gloves_on;
4735 diff --git a/src/dokick.c b/src/dokick.c
4736 index f390414..8c7871c 100644
4737 --- a/src/dokick.c
4738 +++ b/src/dokick.c
4739 @@ -553,7 +553,7 @@ xchar x, y;
4740 mon = bhit(u.dx, u.dy, range, KICKED_WEAPON,
4741 (int FDECL((*),(MONST_P,OBJ_P)))0,
4742 (int FDECL((*),(OBJ_P,OBJ_P)))0,
4743 - kickobj);
4744 + kickobj, NULL);
4746 if(mon) {
4747 if (mon->isshk &&
4748 diff --git a/src/dothrow.c b/src/dothrow.c
4749 index 2c4389a..5c39186 100644
4750 --- a/src/dothrow.c
4751 +++ b/src/dothrow.c
4752 @@ -300,8 +300,16 @@ dofire()
4753 if (!flags.autoquiver) {
4754 /* Don't automatically fill the quiver */
4755 You("have no ammunition readied!");
4756 +#ifdef QUIVER_FIRED
4757 + if (iflags.quiver_fired)
4758 + dowieldquiver(); /* quiver_fired */
4759 + if (!uquiver)
4760 +#endif
4761 return(dothrow());
4763 +#ifdef QUIVER_FIRED
4764 + else { /* quiver_fired */
4765 +#endif
4766 autoquiver();
4767 if (!uquiver) {
4768 You("have nothing appropriate for your quiver!");
4769 @@ -310,6 +318,9 @@ dofire()
4770 You("fill your quiver:");
4771 prinv((char *)0, uquiver, 0L);
4773 +#ifdef QUIVER_FIRED
4774 + } /* quiver_fired */
4775 +#endif
4779 @@ -608,13 +619,21 @@ hurtle(dx, dy, range, verbose)
4781 if(Punished && !carried(uball)) {
4782 You_feel("a tug from the iron ball.");
4783 - nomul(0);
4784 + nomul(0
4785 +#ifdef HELPLESS
4786 + , 0
4787 +#endif
4788 + );
4789 return;
4790 } else if (u.utrap) {
4791 You("are anchored by the %s.",
4792 u.utraptype == TT_WEB ? "web" : u.utraptype == TT_LAVA ? "lava" :
4793 u.utraptype == TT_INFLOOR ? surface(u.ux,u.uy) : "trap");
4794 - nomul(0);
4795 + nomul(0
4796 +#ifdef HELPLESS
4797 + , 0
4798 +#endif
4799 + );
4800 return;
4803 @@ -624,7 +643,11 @@ hurtle(dx, dy, range, verbose)
4805 if(!range || (!dx && !dy) || u.ustuck) return; /* paranoia */
4807 - nomul(-range);
4808 + nomul(-range
4809 +#ifdef HELPLESS
4810 + , "moving through the air"
4811 +#endif
4812 + );
4813 if (verbose)
4814 You("%s in the opposite direction.", range > 1 ? "hurtle" : "float");
4815 /* if we're in the midst of shooting multiple projectiles, stop */
4816 @@ -980,14 +1003,17 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
4818 if (Underwater) range = 1;
4820 + boolean obj_destroyed = FALSE;
4821 mon = bhit(u.dx, u.dy, range, THROWN_WEAPON,
4822 (int FDECL((*),(MONST_P,OBJ_P)))0,
4823 (int FDECL((*),(OBJ_P,OBJ_P)))0,
4824 - obj);
4825 + obj, &obj_destroyed);
4827 /* have to do this after bhit() so u.ux & u.uy are correct */
4828 if(Is_airlevel(&u.uz) || Levitation)
4829 hurtle(-u.dx, -u.dy, urange, TRUE);
4831 + if (obj_destroyed) return; /* fixes C343-100 */
4834 if (mon) {
4835 @@ -1748,7 +1774,7 @@ struct obj *obj;
4836 mon = bhit(u.dx, u.dy, range, THROWN_WEAPON,
4837 (int FDECL((*),(MONST_P,OBJ_P)))0,
4838 (int FDECL((*),(OBJ_P,OBJ_P)))0,
4839 - obj);
4840 + obj, NULL);
4841 if(mon) {
4842 if (ghitm(mon, obj)) /* was it caught? */
4843 return 1;
4844 diff --git a/src/eat.c b/src/eat.c
4845 index 12e8d9b..f8a64fa 100644
4846 --- a/src/eat.c
4847 +++ b/src/eat.c
4848 @@ -862,7 +862,11 @@ register int pm;
4849 /* A pile of gold can't ride. */
4850 if (u.usteed) dismount_steed(DISMOUNT_FELL);
4851 #endif
4852 - nomul(-tmp);
4853 + nomul(-tmp
4854 +#ifdef HELPLESS
4855 + , "pretending to be a pile of gold"
4856 +#endif
4857 + );
4858 Sprintf(buf, Hallucination ?
4859 "You suddenly dread being peeled and mimic %s again!" :
4860 "You now prefer mimicking %s again.",
4861 @@ -1224,7 +1228,11 @@ struct obj *obj;
4862 surface(u.ux,u.uy);
4863 pline_The("world spins and %s %s.", what, where);
4864 flags.soundok = 0;
4865 - nomul(-rnd(10));
4866 + nomul(-rnd(10)
4867 +#ifdef HELPLESS
4868 + , "unconscious from rotten food"
4869 +#endif
4870 + );
4871 nomovemsg = "You are conscious again.";
4872 afternmv = Hear_again;
4873 return(1);
4874 @@ -2244,7 +2252,11 @@ is_fainted()
4875 void
4876 reset_faint() /* call when a faint must be prematurely terminated */
4878 - if(is_fainted()) nomul(0);
4879 + if(is_fainted()) nomul(0
4880 +#ifdef HELPLESS
4881 + , 0
4882 +#endif
4883 + );
4886 #if 0
4887 @@ -2255,7 +2267,11 @@ sync_hunger()
4888 if(is_fainted()) {
4890 flags.soundok = 0;
4891 - nomul(-10+(u.uhunger/10));
4892 + nomul(-10+(u.uhunger/10)
4893 +#ifdef HELPLESS
4894 + , "fainted from lack of food"
4895 +#endif
4896 + );
4897 nomovemsg = "You regain consciousness.";
4898 afternmv = unfaint;
4900 @@ -2320,7 +2336,11 @@ boolean incr;
4901 stop_occupation();
4902 You("faint from lack of food.");
4903 flags.soundok = 0;
4904 - nomul(-10+(u.uhunger/10));
4905 + nomul(-10+(u.uhunger/10)
4906 +#ifdef HELPLESS
4907 + , "fainted from lack of food"
4908 +#endif
4909 + );
4910 nomovemsg = "You regain consciousness.";
4911 afternmv = unfaint;
4912 newhs = FAINTED;
4913 @@ -2489,7 +2509,11 @@ void
4914 vomit() /* A good idea from David Neves */
4916 make_sick(0L, (char *) 0, TRUE, SICK_VOMITABLE);
4917 - nomul(-2);
4918 + nomul(-2
4919 +#ifdef HELPLESS
4920 + , "vomiting"
4921 +#endif
4922 + );
4926 diff --git a/src/end.c b/src/end.c
4927 index 58d47e0..1a171df 100644
4928 --- a/src/end.c
4929 +++ b/src/end.c
4930 @@ -10,6 +10,9 @@
4931 #include <signal.h>
4932 #endif
4933 #include "dlb.h"
4934 +#ifdef DEATH_EXPLORE
4935 +extern int NDECL(enter_explore_mode);
4936 +#endif
4938 /* these probably ought to be generated by makedefs, like LAST_GEM */
4939 #define FIRST_GEM DILITHIUM_CRYSTAL
4940 @@ -39,8 +42,16 @@ STATIC_DCL void FDECL(get_valuables, (struct obj *));
4941 STATIC_DCL void FDECL(sort_valuables, (struct valuable_data *,int));
4942 STATIC_DCL void FDECL(artifact_score, (struct obj *,BOOLEAN_P,winid));
4943 STATIC_DCL void FDECL(savelife, (int));
4944 -STATIC_DCL void FDECL(list_vanquished, (CHAR_P,BOOLEAN_P));
4945 +void FDECL(list_vanquished, (CHAR_P,BOOLEAN_P));
4946 +#ifdef DUMP_LOG
4947 +extern char msgs[][BUFSZ];
4948 +extern int lastmsg;
4949 +extern void NDECL(dump_spells);
4950 +void FDECL(do_vanquished, (int, BOOLEAN_P, BOOLEAN_P));
4951 +STATIC_DCL void FDECL(list_genocided, (int, BOOLEAN_P, BOOLEAN_P));
4952 +#else
4953 STATIC_DCL void FDECL(list_genocided, (CHAR_P,BOOLEAN_P));
4954 +#endif /* DUMP_LOG */
4955 STATIC_DCL boolean FDECL(should_query_disclose_option, (int,char *));
4957 #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2)
4958 @@ -86,6 +97,62 @@ static NEARDATA const char *ends[] = { /* "when you..." */
4960 extern const char * const killed_by_prefix[]; /* from topten.c */
4962 +#ifdef DUMP_LOG
4963 +FILE *dump_fp = (FILE *)0; /* file pointer for dumps */
4964 +/* functions dump_init, dump_exit and dump are from the dump patch */
4966 +void
4967 +dump_init ()
4969 + if (dump_fn[0]) {
4970 + char *p = (char *) strstr(dump_fn, "%n");
4971 + if (p) {
4972 + int new_dump_fn_len = strlen(dump_fn)+strlen(plname)-2; /* %n */
4973 + char *new_dump_fn = (char *) alloc((unsigned)(new_dump_fn_len+1));
4974 + char *q = new_dump_fn;
4975 + strncpy(q, dump_fn, p-dump_fn);
4976 + q += p-dump_fn;
4977 + strncpy(q, plname, strlen(plname) + 1);
4978 + regularize(q);
4979 + q[strlen(plname)] = '\0';
4980 + q += strlen(q);
4981 + p += 2; /* skip "%n" */
4982 + strncpy(q, p, strlen(p));
4983 + new_dump_fn[new_dump_fn_len] = '\0';
4985 + dump_fp = fopen(new_dump_fn, "w");
4986 + if (!dump_fp) {
4987 + pline("Can't open %s for output.", new_dump_fn);
4988 + pline("Dump file not created.");
4990 + free(new_dump_fn);
4992 + } else {
4993 + dump_fp = fopen (dump_fn, "w");
4995 + if (!dump_fp) {
4996 + pline("Can't open %s for output.", dump_fn);
4997 + pline("Dump file not created.");
5003 +void
5004 +dump_exit ()
5006 + if (dump_fp)
5007 + fclose (dump_fp);
5010 +void dump (pre, str)
5011 + char *pre, *str;
5013 + if (dump_fp)
5014 + fprintf (dump_fp, "%s%s\n", pre, str);
5016 +#endif /* DUMP_LOG */
5018 /*ARGSUSED*/
5019 void
5020 done1(sig_unused) /* called as signal() handler, so sent at least one arg */
5021 @@ -101,7 +168,11 @@ int sig_unused;
5022 clear_nhwindow(WIN_MESSAGE);
5023 curs_on_u();
5024 wait_synch();
5025 - if(multi > 0) nomul(0);
5026 + if(multi > 0) nomul(0
5027 +#ifdef HELPLESS
5028 + , 0
5029 +#endif
5030 + );
5031 } else {
5032 (void)done2();
5034 @@ -112,14 +183,32 @@ int sig_unused;
5036 done2()
5038 +#ifdef PARANOID
5039 + char buf[BUFSZ];
5040 + int really_quit = FALSE;
5042 + if (iflags.paranoid_quit) {
5043 + getlin ("Really quit [yes/no]?",buf);
5044 + (void) lcase (buf);
5045 + if (!(strcmp (buf, "yes"))) really_quit = TRUE;
5046 + } else {
5047 + if(yn("Really quit?") == 'y') really_quit = TRUE;
5049 + if (!really_quit) {
5050 +#else /* PARANOID */
5051 if(yn("Really quit?") == 'n') {
5052 +#endif /* PARANOID */
5053 #ifndef NO_SIGNAL
5054 (void) signal(SIGINT, (SIG_RET_TYPE) done1);
5055 #endif
5056 clear_nhwindow(WIN_MESSAGE);
5057 curs_on_u();
5058 wait_synch();
5059 - if(multi > 0) nomul(0);
5060 + if(multi > 0) nomul(0
5061 +#ifdef HELPLESS
5062 + , 0
5063 +#endif
5064 + );
5065 if(multi == 0) {
5066 u.uinvulnerable = FALSE; /* avoid ctrl-C bug -dlc */
5067 u.usleep = 0;
5068 @@ -224,7 +313,14 @@ register struct monst *mtmp;
5069 Sprintf(eos(buf), " called %s", NAME(mtmp));
5072 - if (multi) Strcat(buf, ", while helpless");
5073 + if (multi) {
5074 +#ifdef HELPLESS
5075 + if (strlen(multi_txt) > 0)
5076 + Sprintf(eos(buf), ", while %s", multi_txt);
5077 + else
5078 +#endif
5079 + Strcat(buf, ", while helpless");
5081 killer = buf;
5082 if (mtmp->data->mlet == S_WRAITH)
5083 u.ugrave_arise = PM_WRAITH;
5084 @@ -366,18 +462,30 @@ boolean taken;
5085 ask = should_query_disclose_option('i', &defquery);
5086 if (!done_stopprint) {
5087 c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery;
5088 - if (c == 'y') {
5089 + } else {
5090 + c = 'n';
5093 +#ifdef DUMP_LOG
5094 + boolean want_disp = (c == 'y')? TRUE: FALSE;
5095 +#endif
5096 struct obj *obj;
5098 for (obj = invent; obj; obj = obj->nobj) {
5099 makeknown(obj->otyp);
5100 obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
5102 +#ifdef DUMP_LOG
5103 + (void) dump_inventory((char *)0, TRUE, want_disp);
5104 + do_containerconts(invent, TRUE, TRUE, TRUE, want_disp);
5105 +#else
5106 + if (c == 'y') {
5107 (void) display_inventory((char *)0, TRUE);
5108 container_contents(invent, TRUE, TRUE);
5110 - if (c == 'q') done_stopprint++;
5111 +#endif /* DUMP_LOG */
5113 + if (c == 'q') done_stopprint++;
5116 ask = should_query_disclose_option('a', &defquery);
5117 @@ -388,14 +496,28 @@ boolean taken;
5118 enlightenment(how >= PANICKED ? 1 : 2); /* final */
5119 if (c == 'q') done_stopprint++;
5121 +#ifdef DUMP_LOG
5122 + if (dump_fp) {
5123 + dump_enlightenment((int) (how >= PANICKED ? 1 : 2));
5124 + dump_spells();
5126 +#endif
5128 ask = should_query_disclose_option('v', &defquery);
5129 +#ifdef DUMP_LOG
5130 + do_vanquished(defquery, ask, TRUE);
5131 +#else
5132 if (!done_stopprint)
5133 list_vanquished(defquery, ask);
5134 +#endif
5136 ask = should_query_disclose_option('g', &defquery);
5137 if (!done_stopprint)
5138 +#ifdef DUMP_LOG
5139 + list_genocided(defquery, ask,TRUE);
5140 +#else
5141 list_genocided(defquery, ask);
5142 +#endif
5144 ask = should_query_disclose_option('c', &defquery);
5145 if (!done_stopprint) {
5146 @@ -405,6 +527,12 @@ boolean taken;
5147 show_conduct(how >= PANICKED ? 1 : 2);
5148 if (c == 'q') done_stopprint++;
5150 +#ifdef DUMP_LOG
5151 + if (dump_fp) {
5152 + dump_conduct(how >= PANICKED ? 1 : 2);
5153 + dump_weapon_skill();
5155 +#endif
5158 /* try to get the player back in a viable state after being killed */
5159 @@ -523,6 +651,11 @@ winid endwin;
5160 otmp->oartifact ? artifact_name(xname(otmp), &dummy) :
5161 OBJ_NAME(objects[otmp->otyp]),
5162 value, currency(value), points);
5163 +#ifdef DUMP_LOG
5164 + if (dump_fp)
5165 + dump("", pbuf);
5166 + if (endwin != WIN_ERR)
5167 +#endif
5168 putstr(endwin, 0, pbuf);
5171 @@ -536,12 +669,23 @@ void
5172 done(how)
5173 int how;
5175 +#if defined(WIZARD) && defined(PARANOID)
5176 + char paranoid_buf[BUFSZ];
5177 + int really_bon = TRUE;
5178 +#endif
5179 boolean taken;
5180 +#ifdef DEATH_EXPLORE
5181 + boolean goexplore = FALSE;
5182 +#endif
5183 char kilbuf[BUFSZ], pbuf[BUFSZ];
5184 winid endwin = WIN_ERR;
5185 boolean bones_ok, have_windows = iflags.window_inited;
5186 +#ifdef PROMPT_LOGEXP
5187 + boolean update_log;
5188 +#endif
5189 struct obj *corpse = (struct obj *)0;
5190 long umoney;
5191 + int i;
5193 if (how == TRICKED) {
5194 if (killer) {
5195 @@ -591,6 +735,7 @@ int how;
5196 return;
5199 + bones_ok = (how < GENOCIDED) && can_make_bones(); /* dthexpl patch */
5200 if ((
5201 #ifdef WIZARD
5202 wizard ||
5203 @@ -605,15 +750,63 @@ int how;
5204 killer_format = 0;
5205 return;
5207 +#ifdef DEATH_EXPLORE
5208 + else if (iflags.death_expl && how <= GENOCIDED && !bones_ok &&
5209 +#ifdef WIZARD
5210 + !wizard &&
5211 +#endif
5212 + !discover) {
5213 + if(yn("Continue in explore mode?") == 'y') {
5214 + enter_explore_mode();
5215 + if (discover) goexplore = TRUE;
5218 +#endif /* DEATH_EXPLORE */
5221 * The game is now over...
5224 die:
5225 +#ifdef DEATH_EXPLORE
5226 + if (!goexplore) {
5227 +#endif
5228 program_state.gameover = 1;
5229 /* in case of a subsequent panic(), there's no point trying to save */
5230 program_state.something_worth_saving = 0;
5231 +#ifdef DUMP_LOG
5232 + /* D: Grab screen dump right here */
5233 + if (dump_fn[0]) {
5234 + dump_init();
5235 + Sprintf(pbuf, "%s, %s %s %s %s", plname,
5236 + aligns[1 - u.ualign.type].adj,
5237 + genders[flags.female].adj,
5238 + urace.adj,
5239 + (flags.female && urole.name.f)?
5240 + urole.name.f : urole.name.m);
5241 + dump("", pbuf);
5242 +# ifdef DUMPMSGS
5243 + if (lastmsg >= 0) {
5244 + dump ("","");
5245 + dump ("", "Latest messages");
5246 + for (i = lastmsg + 1; i < DUMPMSGS; i++) {
5247 + if (msgs[i] && strcmp(msgs[i], "") )
5248 + dump (" ", msgs[i]);
5249 + }
5250 + for (i = 0; i <= lastmsg; i++) {
5251 + if (msgs[i] && strcmp(msgs[i], "") )
5252 + dump (" ", msgs[i]);
5253 + }
5255 +# endif /* DUMPMSGS */
5256 + /* D: Add a line for clearance from the screen dump */
5257 + dump("", "");
5258 + dump_screen();
5260 +#endif /* DUMP_LOG */
5261 +#ifdef DEATH_EXPLORE
5263 +#endif
5264 /* render vision subsystem inoperative */
5265 iflags.vision_inited = 0;
5266 /* might have been killed while using a disposable item, so make sure
5267 @@ -628,6 +821,9 @@ die:
5268 pline("Do not pass go. Do not collect 200 %s.", currency(200L));
5270 if (have_windows) wait_synch(); /* flush screen output */
5271 +#ifdef DEATH_EXPLORE
5272 + if (!goexplore) {
5273 +#endif
5274 #ifndef NO_SIGNAL
5275 (void) signal(SIGINT, (SIG_RET_TYPE) done_intr);
5276 # if defined(UNIX) || defined(VMS) || defined (__EMX__)
5277 @@ -636,7 +832,7 @@ die:
5278 # endif
5279 #endif /* NO_SIGNAL */
5281 - bones_ok = (how < GENOCIDED) && can_make_bones();
5282 + /* bones_ok = (how < GENOCIDED) && can_make_bones(); moved up */
5284 if (how == TURNED_SLIME)
5285 u.ugrave_arise = PM_GREEN_SLIME;
5286 @@ -668,6 +864,9 @@ die:
5287 make_grave(u.ux, u.uy, pbuf);
5290 +#ifdef DEATH_EXPLORE
5291 + } /* if (!goexplore) */
5292 +#endif
5294 if (how == QUIT) {
5295 killer_format = NO_KILLER_PREFIX;
5296 @@ -688,14 +887,21 @@ die:
5297 clearpriests();
5298 } else taken = FALSE; /* lint; assert( !bones_ok ); */
5300 +#ifdef DEATH_EXPLORE
5301 + if (!goexplore) {
5302 +#endif
5303 clearlocks();
5305 if (have_windows) display_nhwindow(WIN_MESSAGE, FALSE);
5307 - if (strcmp(flags.end_disclose, "none") && how != PANICKED)
5308 + if (strcmp(flags.end_disclose, "none") && how != PANICKED) {
5309 disclose(how, taken);
5311 /* finish_paybill should be called after disclosure but before bones */
5312 if (bones_ok && taken) finish_paybill();
5313 +#ifdef DEATH_EXPLORE
5315 +#endif
5317 /* calculate score, before creating bones [container gold] */
5319 @@ -721,18 +927,53 @@ die:
5320 if (deepest > 20)
5321 u.urexp += 1000L * (long)((deepest > 30) ? 10 : deepest - 20);
5322 if (how == ASCENDED) u.urexp *= 2L;
5323 +#ifdef DEATH_EXPLORE
5324 + if (goexplore) {
5325 + discover = FALSE; /* a kludge to fool the topten function.. */
5326 + topten(how);
5327 + /* undo some things that were done for score calculation */
5328 + /* this branch is not entered when you ascend, escape or quit */
5329 + discover = TRUE;
5330 + umoney -= hidden_gold();
5331 + u.urexp -= tmp;
5332 + u.urexp -= 50L * (long)(deepest - 1);
5333 + /* now do what is done when you refuse to die in explore mode */
5334 + if (u.uhpmax <= 0) u.uhpmax = u.ulevel * 8;
5335 + savelife(how);
5336 + killer = 0;
5337 + killer_format = 0;
5338 + vision_reset();
5339 + return;
5341 +#endif
5344 if (bones_ok) {
5345 #ifdef WIZARD
5346 +# ifdef PARANOID
5347 + if(wizard) {
5348 + getlin("Save WIZARD MODE bones? [no/yes]", paranoid_buf);
5349 + (void) lcase (paranoid_buf);
5350 + if (strcmp (paranoid_buf, "yes"))
5351 + really_bon = FALSE;
5353 + if(really_bon)
5354 +# else
5355 if (!wizard || yn("Save bones?") == 'y')
5356 -#endif
5357 +# endif /* PARANOID */
5358 +#endif /* WIZARD */
5359 savebones(corpse);
5360 /* corpse may be invalid pointer now so
5361 ensure that it isn't used again */
5362 corpse = (struct obj *)0;
5365 +#ifdef PROMPT_LOGEXP
5366 + if (wizard || discover) {
5367 + update_log = (yn("Update logfile?") == 'y');
5368 + } else {
5369 + update_log = TRUE;
5371 +#endif
5372 /* update gold for the rip output, which can't use hidden_gold()
5373 (containers will be gone by then if bones just got saved...) */
5374 #ifndef GOLDOBJ
5375 @@ -770,15 +1011,18 @@ die:
5376 /* don't bother counting to see whether it should be plural */
5379 - if (!done_stopprint) {
5380 Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname,
5381 how != ASCENDED ?
5382 (const char *) ((flags.female && urole.name.f) ?
5383 urole.name.f : urole.name.m) :
5384 (const char *) (flags.female ? "Demigoddess" : "Demigod"));
5385 + if (!done_stopprint) {
5386 putstr(endwin, 0, pbuf);
5387 putstr(endwin, 0, "");
5389 +#ifdef DUMP_LOG
5390 + if (dump_fp) dump("", pbuf);
5391 +#endif
5393 if (how == ESCAPED || how == ASCENDED) {
5394 register struct monst *mtmp;
5395 @@ -805,31 +1049,39 @@ die:
5396 keepdogs(TRUE);
5397 viz_array[0][0] |= IN_SIGHT; /* need visibility for naming */
5398 mtmp = mydogs;
5399 - if (!done_stopprint) Strcpy(pbuf, "You");
5400 + Strcpy(pbuf, "You");
5401 if (mtmp) {
5402 while (mtmp) {
5403 - if (!done_stopprint)
5404 Sprintf(eos(pbuf), " and %s", mon_nam(mtmp));
5405 if (mtmp->mtame)
5406 u.urexp += mtmp->mhp;
5407 mtmp = mtmp->nmon;
5409 if (!done_stopprint) putstr(endwin, 0, pbuf);
5410 +#ifdef DUMP_LOG
5411 + if (dump_fp) dump("", pbuf);
5412 +#endif
5413 pbuf[0] = '\0';
5414 } else {
5415 if (!done_stopprint) Strcat(pbuf, " ");
5417 - if (!done_stopprint) {
5418 Sprintf(eos(pbuf), "%s with %ld point%s,",
5419 how==ASCENDED ? "went to your reward" :
5420 "escaped from the dungeon",
5421 u.urexp, plur(u.urexp));
5422 +#ifdef DUMP_LOG
5423 + if (dump_fp) dump("", pbuf);
5424 +#endif
5425 + if (!done_stopprint) {
5426 putstr(endwin, 0, pbuf);
5429 if (!done_stopprint)
5430 artifact_score(invent, FALSE, endwin); /* list artifacts */
5432 +#ifdef DUMP_LOG
5433 + else if (dump_fp)
5434 + artifact_score(invent, FALSE, WIN_ERR); /* only to dumpfile */
5435 +#endif
5436 /* list valuables here */
5437 for (val = valuables; val->list; val++) {
5438 sort_valuables(val->list, val->size);
5439 @@ -855,10 +1107,13 @@ die:
5440 count, plur(count));
5442 putstr(endwin, 0, pbuf);
5443 +#ifdef DUMP_LOG
5444 + if (dump_fp) dump("", pbuf);
5445 +#endif
5449 - } else if (!done_stopprint) {
5450 + } else {
5451 /* did not escape or ascend */
5452 if (u.uz.dnum == 0 && u.uz.dlevel <= 0) {
5453 /* level teleported out of the dungeon; `how' is DIED,
5454 @@ -878,21 +1133,32 @@ die:
5456 Sprintf(eos(pbuf), " with %ld point%s,",
5457 u.urexp, plur(u.urexp));
5458 - putstr(endwin, 0, pbuf);
5459 + if (!done_stopprint) putstr(endwin, 0, pbuf);
5460 +#ifdef DUMP_LOG
5461 + if (dump_fp) dump("", pbuf);
5462 +#endif
5465 - if (!done_stopprint) {
5466 Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.",
5467 umoney, plur(umoney), moves, plur(moves));
5468 - putstr(endwin, 0, pbuf);
5469 + if (!done_stopprint) putstr(endwin, 0, pbuf);
5470 +#ifdef DUMP_LOG
5471 + if (dump_fp) {
5472 + dump("", pbuf);
5473 + Sprintf(pbuf, "Killer: %s", killer);
5474 + dump("", pbuf);
5476 - if (!done_stopprint) {
5477 +#endif
5478 Sprintf(pbuf,
5479 "You were level %d with a maximum of %d hit point%s when you %s.",
5480 u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]);
5481 + if (!done_stopprint) {
5482 putstr(endwin, 0, pbuf);
5483 putstr(endwin, 0, "");
5485 +#ifdef DUMP_LOG
5486 + if (dump_fp) dump("", pbuf);
5487 +#endif
5488 if (!done_stopprint)
5489 display_nhwindow(endwin, TRUE);
5490 if (endwin != WIN_ERR)
5491 @@ -901,14 +1167,23 @@ die:
5492 /* "So when I die, the first thing I will see in Heaven is a
5493 * score list?" */
5494 if (flags.toptenwin) {
5495 +#ifdef PROMPT_LOGEXP
5496 + if (update_log)
5497 +#endif
5498 topten(how);
5499 if (have_windows)
5500 exit_nhwindows((char *)0);
5501 } else {
5502 if (have_windows)
5503 exit_nhwindows((char *)0);
5504 +#ifdef PROMPT_LOGEXP
5505 + if (update_log)
5506 +#endif
5507 topten(how);
5509 +#ifdef DUMP_LOG
5510 + if (dump_fp) dump_exit();
5511 +#endif
5513 if(done_stopprint) { raw_print(""); raw_print(""); }
5514 terminate(EXIT_SUCCESS);
5515 @@ -919,8 +1194,23 @@ void
5516 container_contents(list, identified, all_containers)
5517 struct obj *list;
5518 boolean identified, all_containers;
5519 +#ifdef DUMP_LOG
5521 + do_containerconts(list, identified, all_containers, FALSE, TRUE);
5524 +void do_containerconts(list, identified, all_containers, want_dump, want_disp)
5525 +struct obj *list;
5526 +boolean identified, all_containers, want_dump, want_disp;
5527 +#endif
5528 +/* The original container_contents function */
5530 register struct obj *box, *obj;
5531 +#ifdef SORTLOOT
5532 + struct obj **oarray;
5533 + int i,j,n;
5534 + char *invlet;
5535 +#endif /* SORTLOOT */
5536 char buf[BUFSZ];
5538 for (box = list; box; box = box->nobj) {
5539 @@ -928,25 +1218,101 @@ boolean identified, all_containers;
5540 if (box->otyp == BAG_OF_TRICKS) {
5541 continue; /* wrong type of container */
5542 } else if (box->cobj) {
5543 - winid tmpwin = create_nhwindow(NHW_MENU);
5544 + winid tmpwin;
5545 +#ifdef DUMP_LOG
5546 + if (want_disp)
5547 +#endif
5548 + tmpwin = create_nhwindow(NHW_MENU);
5549 +#ifdef SORTLOOT
5550 + /* count the number of items */
5551 + for (n = 0, obj = box->cobj; obj; obj = obj->nobj) n++;
5552 + /* Make a temporary array to store the objects sorted */
5553 + oarray = (struct obj **) alloc(n*sizeof(struct obj*));
5555 + /* Add objects to the array */
5556 + i = 0;
5557 + invlet = flags.inv_order;
5558 + nextclass:
5559 + for (obj = box->cobj; obj; obj = obj->nobj) {
5560 + if (!flags.sortpack || obj->oclass == *invlet) {
5561 + if (iflags.sortloot == 'f'
5562 + || iflags.sortloot == 'l') {
5563 + /* Insert object at correct index */
5564 + for (j = i; j; j--) {
5565 + if (strcmpi(cxname2(obj), cxname2(oarray[j-1]))>0
5566 + || (flags.sortpack &&
5567 + oarray[j-1]->oclass != obj->oclass))
5568 + break;
5569 + oarray[j] = oarray[j-1];
5571 + oarray[j] = obj;
5572 + i++;
5573 + } else {
5574 + /* Just add it to the array */
5575 + oarray[i++] = obj;
5578 + } /* for loop */
5579 + if (flags.sortpack) {
5580 + if (*++invlet) goto nextclass;
5582 +#endif /* SORTLOOT */
5583 Sprintf(buf, "Contents of %s:", the(xname(box)));
5584 +#ifdef DUMP_LOG
5585 + if (want_disp) {
5586 +#endif
5587 putstr(tmpwin, 0, buf);
5588 putstr(tmpwin, 0, "");
5589 +#ifdef DUMP_LOG
5591 + if (dump_fp) dump("", buf);
5592 +#endif
5593 +#ifdef SORTLOOT
5594 + for (i = 0; i < n; i++) {
5595 + obj = oarray[i];
5596 +#else
5597 for (obj = box->cobj; obj; obj = obj->nobj) {
5598 +#endif
5599 if (identified) {
5600 makeknown(obj->otyp);
5601 obj->known = obj->bknown =
5602 obj->dknown = obj->rknown = 1;
5604 +#ifdef DUMP_LOG
5605 + if (want_dump) dump(" ", doname(obj));
5606 + if (want_disp)
5607 +#endif
5608 putstr(tmpwin, 0, doname(obj));
5610 +#ifdef DUMP_LOG
5611 + if (want_dump) dump("","");
5612 + if (want_disp) {
5613 +#endif
5614 display_nhwindow(tmpwin, TRUE);
5615 destroy_nhwindow(tmpwin);
5616 - if (all_containers)
5617 +#ifdef DUMP_LOG
5619 + if (all_containers) {
5620 + do_containerconts(box->cobj, identified, TRUE,
5621 + want_dump, want_disp);
5622 +#else
5623 + if (all_containers) {
5624 container_contents(box->cobj, identified, TRUE);
5625 +#endif /* DUMP_LOG */
5627 } else {
5628 +#ifdef DUMP_LOG
5629 + if (want_disp) {
5630 +#endif
5631 pline("%s empty.", Tobjnam(box, "are"));
5632 display_nhwindow(WIN_MESSAGE, FALSE);
5633 +#ifdef DUMP_LOG
5635 + if (want_dump) {
5636 + dump(The(xname(box)), " is empty.");
5637 + dump("", "");
5639 +#endif
5642 if (!all_containers)
5643 @@ -973,10 +1339,21 @@ int status;
5644 nethack_exit(status);
5647 -STATIC_OVL void
5648 +void /* showborn patch */
5649 list_vanquished(defquery, ask)
5650 char defquery;
5651 boolean ask;
5652 +#ifdef DUMP_LOG
5654 + do_vanquished(defquery, ask, FALSE);
5657 +void
5658 +do_vanquished(defquery, ask, want_dump)
5659 +int defquery;
5660 +boolean ask;
5661 +boolean want_dump;
5662 +#endif
5664 register int i, lev;
5665 int ntypes = 0, max_lev = 0, nkilled;
5666 @@ -996,13 +1373,22 @@ boolean ask;
5667 * includes all dead monsters, not just those killed by the player
5669 if (ntypes != 0) {
5670 - c = ask ? yn_function("Do you want an account of creatures vanquished?",
5671 +#ifdef DUMP_LOG
5672 + c = done_stopprint ? 'n': ask ?
5673 +#else
5674 + c = ask ?
5675 +#endif
5676 + yn_function("Do you want an account of creatures vanquished?",
5677 ynqchars, defquery) : defquery;
5678 if (c == 'q') done_stopprint++;
5679 if (c == 'y') {
5680 klwin = create_nhwindow(NHW_MENU);
5681 putstr(klwin, 0, "Vanquished creatures:");
5682 putstr(klwin, 0, "");
5683 +#ifdef DUMP_LOG
5684 + } /* the original end of block removed by the patch */
5685 + if (want_dump) dump("", "Vanquished creatures");
5686 +#endif
5688 /* countdown by monster "toughness" */
5689 for (lev = max_lev; lev >= 0; lev--)
5690 @@ -1029,21 +1415,38 @@ boolean ask;
5691 else
5692 Sprintf(buf, "%d %s",
5693 nkilled, makeplural(mons[i].mname));
5694 +#ifdef SHOW_BORN
5695 + if (iflags.show_born && nkilled != mvitals[i].born)
5696 + Sprintf(buf + strlen(buf), " (%d created)",
5697 + (int) mvitals[i].born);
5698 +#endif
5700 - putstr(klwin, 0, buf);
5701 + if (c == 'y') putstr(klwin, 0, buf);
5702 +#ifdef DUMP_LOG
5703 + if (want_dump) dump(" ", buf);
5704 +#endif
5707 * if (Hallucination)
5708 * putstr(klwin, 0, "and a partridge in a pear tree");
5710 if (ntypes > 1) {
5711 - putstr(klwin, 0, "");
5712 + if (c == 'y') putstr(klwin, 0, "");
5713 Sprintf(buf, "%ld creatures vanquished.", total_killed);
5714 - putstr(klwin, 0, buf);
5715 + if (c == 'y') putstr(klwin, 0, buf);
5716 +#ifdef DUMP_LOG
5717 + if (want_dump) dump(" ", buf);
5718 +#endif
5720 + if (c == 'y') {
5721 display_nhwindow(klwin, TRUE);
5722 destroy_nhwindow(klwin);
5724 +#ifdef DUMP_LOG
5725 + if (want_dump) dump("", "");
5726 +#else
5727 + } /* the original end of if (c == 'y') */
5728 +#endif
5732 @@ -1059,43 +1462,112 @@ num_genocides()
5733 return n;
5736 +#ifdef DUMP_LOG
5737 +STATIC_OVL void
5738 +list_genocided(defquery, ask, want_dump)
5739 +int defquery;
5740 +boolean ask;
5741 +boolean want_dump;
5742 +#else
5743 STATIC_OVL void
5744 list_genocided(defquery, ask)
5745 char defquery;
5746 boolean ask;
5747 +#endif
5749 register int i;
5750 - int ngenocided;
5751 + int ngenocided=0;
5752 +#ifdef SHOW_EXTINCT
5753 + int nextincted=0;
5754 +#endif
5755 char c;
5756 winid klwin;
5757 char buf[BUFSZ];
5759 + /* get totals first */
5760 +#ifdef SHOW_EXTINCT
5761 + for (i = LOW_PM; i < NUMMONS; i++) {
5762 + if (mvitals[i].mvflags & G_GENOD)
5763 + ngenocided++;
5764 + else if ( (mvitals[i].mvflags & G_GONE) && !(mons[i].geno & G_UNIQ) )
5765 + nextincted++;
5767 ngenocided = num_genocides();
5768 +#endif
5770 /* genocided species list */
5771 - if (ngenocided != 0) {
5772 + if (ngenocided != 0
5773 +#ifdef SHOW_EXTINCT
5774 + || nextincted != 0
5775 +#endif
5776 + ) {
5777 +#ifdef SHOW_EXTINCT
5778 + if (nextincted != 0)
5779 + c = ask ?
5780 + yn_function("Do you want a list of species genocided or extincted?",
5781 + ynqchars, defquery) : defquery;
5782 + else
5783 +#endif
5784 c = ask ? yn_function("Do you want a list of species genocided?",
5785 ynqchars, defquery) : defquery;
5786 if (c == 'q') done_stopprint++;
5787 if (c == 'y') {
5788 klwin = create_nhwindow(NHW_MENU);
5789 - putstr(klwin, 0, "Genocided species:");
5790 +#ifdef SHOW_EXTINCT
5791 + Sprintf(buf, "Genocided or extinct species:");
5792 +#else
5793 + Sprintf(buf, "Genocided species:");
5794 +#endif
5795 + putstr(klwin, 0, buf);
5796 putstr(klwin, 0, "");
5797 +#ifdef DUMP_LOG
5798 + if (want_dump) dump("", buf);
5799 +#endif
5801 for (i = LOW_PM; i < NUMMONS; i++)
5802 +#ifdef SHOW_EXTINCT
5803 + if (mvitals[i].mvflags & G_GONE && !(mons[i].geno & G_UNIQ) ){
5804 +#else
5805 if (mvitals[i].mvflags & G_GENOD) {
5806 +#endif
5807 if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST)
5808 Sprintf(buf, "%s%s",
5809 !type_is_pname(&mons[i]) ? "" : "the ",
5810 mons[i].mname);
5811 else
5812 Strcpy(buf, makeplural(mons[i].mname));
5813 +#ifdef SHOW_EXTINCT
5814 + if( !(mvitals[i].mvflags & G_GENOD) )
5815 + Strcat(buf, " (extinct)");
5816 +#endif
5817 putstr(klwin, 0, buf);
5818 +#ifdef DUMP_LOG
5819 + if (want_dump) dump(" ", buf);
5820 +#endif
5823 putstr(klwin, 0, "");
5824 +#ifdef SHOW_EXTINCT
5825 + if (ngenocided>0) {
5826 +#endif
5827 Sprintf(buf, "%d species genocided.", ngenocided);
5828 putstr(klwin, 0, buf);
5829 +#ifdef DUMP_LOG
5830 + if (want_dump) dump(" ", buf);
5831 +#endif
5832 +#ifdef SHOW_EXTINCT
5834 + if (nextincted>0) {
5835 + Sprintf(buf, "%d species extinct.", nextincted);
5836 + putstr(klwin, 0, buf);
5837 +#ifdef DUMP_LOG
5838 + if (want_dump) dump(" ", buf);
5839 +#endif
5841 +#endif /* SHOW_EXTINCT */
5842 +#ifdef DUMP_LOG
5843 + if (want_dump) dump("", "");
5844 +#endif
5846 display_nhwindow(klwin, TRUE);
5847 destroy_nhwindow(klwin);
5848 diff --git a/src/engrave.c b/src/engrave.c
5849 index fe09b4f..c05f327 100644
5850 --- a/src/engrave.c
5851 +++ b/src/engrave.c
5852 @@ -343,7 +343,11 @@ register int x,y;
5853 et = ep->engr_txt;
5854 You("%s: \"%s\".",
5855 (Blind) ? "feel the words" : "read", et);
5856 - if(flags.run > 1) nomul(0);
5857 + if(flags.run > 1) nomul(0
5858 +#ifdef HELPLESS
5859 + , 0
5860 +#endif
5861 + );
5865 diff --git a/src/explode.c b/src/explode.c
5866 index 8671a2c..6b02c24 100644
5867 --- a/src/explode.c
5868 +++ b/src/explode.c
5869 @@ -513,7 +513,11 @@ struct obj *obj; /* only scatter this obj */
5870 if (scflags & MAY_HITYOU) {
5871 int hitvalu, hitu;
5873 - if (multi) nomul(0);
5874 + if (multi) nomul(0
5875 +#ifdef HELPLESS
5876 + , 0
5877 +#endif
5878 + );
5879 hitvalu = 8 + stmp->obj->spe;
5880 if (bigmonst(youmonst.data)) hitvalu++;
5881 hitu = thitu(hitvalu,
5882 diff --git a/src/files.c b/src/files.c
5883 index 023546b..bf30ff1 100644
5884 --- a/src/files.c
5885 +++ b/src/files.c
5886 @@ -57,7 +57,7 @@ static char fqn_filename_buffer[FQN_NUMBUF][FQN_MAX_FILENAME];
5887 #endif
5889 #if !defined(MFLOPPY) && !defined(VMS) && !defined(WIN32)
5890 -char bones[] = "bonesnn.xxx";
5891 +char bones[] = "bones/bonesnn.xxx";
5892 char lock[PL_NSIZ+14] = "1lock"; /* long enough for uid+name+.99 */
5893 #else
5894 # if defined(MFLOPPY)
5895 @@ -614,8 +614,13 @@ d_level *lev;
5896 s_level *sptr;
5897 char *dptr;
5899 +#ifdef UNIX
5900 + Sprintf(file, "bones/bon%c%s", dungeons[lev->dnum].boneid,
5901 + In_quest(lev) ? urole.filecode : "0");
5902 +#else
5903 Sprintf(file, "bon%c%s", dungeons[lev->dnum].boneid,
5904 In_quest(lev) ? urole.filecode : "0");
5905 +#endif
5906 dptr = eos(file);
5907 if ((sptr = Is_special(lev)) != 0)
5908 Sprintf(dptr, ".%c", sptr->boneid);
5909 @@ -1794,6 +1799,10 @@ char *tmp_levels;
5910 } else if (match_varname(buf, "BOULDER", 3)) {
5911 (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE,
5912 1, "BOULDER");
5913 + } else if (match_varname(buf, "MENUCOLOR", 9)) {
5914 +#ifdef MENU_COLOR
5915 + (void) add_menu_coloring(bufp);
5916 +#endif
5917 } else if (match_varname(buf, "GRAPHICS", 4)) {
5918 len = get_uchars(fp, buf, bufp, translate, FALSE,
5919 MAXPCHARS, "GRAPHICS");
5920 diff --git a/src/hack.c b/src/hack.c
5921 index 0e89c3b..4c3aabb 100644
5922 --- a/src/hack.c
5923 +++ b/src/hack.c
5924 @@ -72,7 +72,11 @@ moverock()
5926 rx = u.ux + 2 * u.dx; /* boulder destination position */
5927 ry = u.uy + 2 * u.dy;
5928 - nomul(0);
5929 + nomul(0
5930 +#ifdef HELPLESS
5931 + , 0
5932 +#endif
5933 + );
5934 if (Levitation || Is_airlevel(&u.uz)) {
5935 if (Blind) feel_location(sx, sy);
5936 You("don't have enough leverage to push %s.", the(xname(otmp)));
5937 @@ -323,7 +327,11 @@ still_chewing(x,y)
5938 if (!boulder && IS_ROCK(lev->typ) && !may_dig(x,y)) {
5939 You("hurt your teeth on the %s.",
5940 IS_TREE(lev->typ) ? "tree" : "hard stone");
5941 - nomul(0);
5942 + nomul(0
5943 +#ifdef HELPLESS
5944 + , 0
5945 +#endif
5946 + );
5947 return 1;
5948 } else if (digging.pos.x != x || digging.pos.y != y ||
5949 !on_level(&digging.level, &u.uz)) {
5950 @@ -719,7 +727,11 @@ boolean guess;
5951 if (test_move(u.ux, u.uy, u.tx-u.ux, u.ty-u.uy, TEST_MOVE)) {
5952 u.dx = u.tx-u.ux;
5953 u.dy = u.ty-u.uy;
5954 - nomul(0);
5955 + nomul(0
5956 +#ifdef HELPLESS
5957 + , 0
5958 +#endif
5959 + );
5960 iflags.travelcc.x = iflags.travelcc.y = -1;
5961 return TRUE;
5963 @@ -785,7 +797,11 @@ boolean guess;
5964 u.dx = x-ux;
5965 u.dy = y-uy;
5966 if (x == u.tx && y == u.ty) {
5967 - nomul(0);
5968 + nomul(0
5969 +#ifdef HELPLESS
5970 + , 0
5971 +#endif
5972 + );
5973 /* reset run so domove run checks work */
5974 flags.run = 8;
5975 iflags.travelcc.x = iflags.travelcc.y = -1;
5976 @@ -855,7 +871,11 @@ boolean guess;
5977 found:
5978 u.dx = 0;
5979 u.dy = 0;
5980 - nomul(0);
5981 + nomul(0
5982 +#ifdef HELPLESS
5983 + , 0
5984 +#endif
5985 + );
5986 return FALSE;
5989 @@ -891,7 +911,11 @@ domove()
5990 exercise(A_CON, FALSE);
5991 } else
5992 You("collapse under your load.");
5993 - nomul(0);
5994 + nomul(0
5995 +#ifdef HELPLESS
5996 + , 0
5997 +#endif
5998 + );
5999 return;
6001 if(u.uswallow) {
6002 @@ -943,7 +967,11 @@ domove()
6004 do {
6005 if(tries++ > 50) {
6006 - nomul(0);
6007 + nomul(0
6008 +#ifdef HELPLESS
6009 + , 0
6010 +#endif
6011 + );
6012 return;
6014 confdir();
6015 @@ -955,14 +983,22 @@ domove()
6016 if (u.uinwater) {
6017 water_friction();
6018 if (!u.dx && !u.dy) {
6019 - nomul(0);
6020 + nomul(0
6021 +#ifdef HELPLESS
6022 + , 0
6023 +#endif
6024 + );
6025 return;
6027 x = u.ux + u.dx;
6028 y = u.uy + u.dy;
6030 if(!isok(x, y)) {
6031 - nomul(0);
6032 + nomul(0
6033 +#ifdef HELPLESS
6034 + , 0
6035 +#endif
6036 + );
6037 return;
6039 if (((trap = t_at(x, y)) && trap->tseen) ||
6040 @@ -970,11 +1006,19 @@ domove()
6041 !is_clinger(youmonst.data) &&
6042 (is_pool(x, y) || is_lava(x, y)) && levl[x][y].seenv)) {
6043 if(flags.run >= 2) {
6044 - nomul(0);
6045 + nomul(0
6046 +#ifdef HELPLESS
6047 + , 0
6048 +#endif
6049 + );
6050 flags.move = 0;
6051 return;
6052 } else
6053 - nomul(0);
6054 + nomul(0
6055 +#ifdef HELPLESS
6056 + , 0
6057 +#endif
6058 + );
6061 if (u.ustuck && (x != u.ustuck->mx || y != u.ustuck->my)) {
6062 @@ -1015,7 +1059,11 @@ domove()
6063 !Conflict && !u.ustuck->mconf)
6064 goto pull_free;
6065 You("cannot escape from %s!", mon_nam(u.ustuck));
6066 - nomul(0);
6067 + nomul(0
6068 +#ifdef HELPLESS
6069 + , 0
6070 +#endif
6071 + );
6072 return;
6075 @@ -1031,7 +1079,11 @@ domove()
6076 mtmp->m_ap_type != M_AP_OBJECT) ||
6077 Protection_from_shape_changers)) ||
6078 sensemon(mtmp))) {
6079 - nomul(0);
6080 + nomul(0
6081 +#ifdef HELPLESS
6082 + , 0
6083 +#endif
6084 + );
6085 flags.move = 0;
6086 return;
6088 @@ -1046,7 +1098,11 @@ domove()
6090 /* attack monster */
6091 if(mtmp) {
6092 - nomul(0);
6093 + nomul(0
6094 +#ifdef HELPLESS
6095 + , 0
6096 +#endif
6097 + );
6098 /* only attack if we know it's there */
6099 /* or if we used the 'F' command to fight blindly */
6100 /* or if it hides_under, in which case we call attack() to print
6101 @@ -1108,7 +1164,11 @@ domove()
6102 is_pool(x,y) ? "empty water" : buf);
6103 unmap_object(x, y); /* known empty -- remove 'I' if present */
6104 newsym(x, y);
6105 - nomul(0);
6106 + nomul(0
6107 +#ifdef HELPLESS
6108 + , 0
6109 +#endif
6110 + );
6111 if (expl) {
6112 u.mh = -1; /* dead in the current form */
6113 rehumanize();
6114 @@ -1123,7 +1183,11 @@ domove()
6115 #ifdef STEED
6116 if (u.usteed && !u.usteed->mcanmove && (u.dx || u.dy)) {
6117 pline("%s won't move!", upstart(y_monnam(u.usteed)));
6118 - nomul(0);
6119 + nomul(0
6120 +#ifdef HELPLESS
6121 + , 0
6122 +#endif
6123 + );
6124 return;
6125 } else
6126 #endif
6127 @@ -1131,7 +1195,11 @@ domove()
6128 You("are rooted %s.",
6129 Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz) ?
6130 "in place" : "to the ground");
6131 - nomul(0);
6132 + nomul(0
6133 +#ifdef HELPLESS
6134 + , 0
6135 +#endif
6136 + );
6137 return;
6139 if(u.utrap) {
6140 @@ -1254,7 +1322,11 @@ domove()
6142 if (!test_move(u.ux, u.uy, x-u.ux, y-u.uy, DO_MOVE)) {
6143 flags.move = 0;
6144 - nomul(0);
6145 + nomul(0
6146 +#ifdef HELPLESS
6147 + , 0
6148 +#endif
6149 + );
6150 return;
6153 @@ -1370,7 +1442,11 @@ domove()
6154 if ( flags.run < 8 )
6155 if (IS_DOOR(tmpr->typ) || IS_ROCK(tmpr->typ) ||
6156 IS_FURNITURE(tmpr->typ))
6157 - nomul(0);
6158 + nomul(0
6159 +#ifdef HELPLESS
6160 + , 0
6161 +#endif
6162 + );
6165 if (hides_under(youmonst.data))
6166 @@ -1408,7 +1484,11 @@ domove()
6167 /* delay next move because of ball dragging */
6168 /* must come after we finished picking up, in spoteffects() */
6169 if (cause_delay) {
6170 - nomul(-2);
6171 + nomul(-2
6172 +#ifdef HELPLESS
6173 + , "dragging an iron ball"
6174 +#endif
6175 + );
6176 nomovemsg = "";
6179 @@ -1436,7 +1516,11 @@ invocation_message()
6180 char buf[BUFSZ];
6181 struct obj *otmp = carrying(CANDELABRUM_OF_INVOCATION);
6183 - nomul(0); /* stop running or travelling */
6184 + nomul(0
6185 +#ifdef HELPLESS
6186 + , 0
6187 +#endif
6188 + ); /* stop running or travelling */
6189 #ifdef STEED
6190 if (u.usteed) Sprintf(buf, "beneath %s", y_monnam(u.usteed));
6191 else
6192 @@ -1924,7 +2008,11 @@ lookaround()
6193 /* Grid bugs stop if trying to move diagonal, even if blind. Maybe */
6194 /* they polymorphed while in the middle of a long move. */
6195 if (u.umonnum == PM_GRID_BUG && u.dx && u.dy) {
6196 - nomul(0);
6197 + nomul(0
6198 +#ifdef HELPLESS
6199 + , 0
6200 +#endif
6201 + );
6202 return;
6205 @@ -2001,7 +2089,11 @@ bcorr:
6206 continue;
6208 stop:
6209 - nomul(0);
6210 + nomul(0
6211 +#ifdef HELPLESS
6212 + , 0
6213 +#endif
6214 + );
6215 return;
6216 } /* end for loops */
6218 @@ -2063,14 +2155,27 @@ monster_nearby()
6219 return(0);
6222 +#ifdef HELPLESS
6223 +void
6224 +nomul(nval, txt)
6225 + register int nval;
6226 + const char *txt;
6227 +#else
6228 void
6229 nomul(nval)
6230 register int nval;
6231 +#endif
6233 if(multi < nval) return; /* This is a bug fix by ab@unido */
6234 u.uinvulnerable = FALSE; /* Kludge to avoid ctrl-C bug -dlc */
6235 u.usleep = 0;
6236 multi = nval;
6237 +#ifdef HELPLESS
6238 + if (txt && txt[0])
6239 + (void) strncpy(multi_txt, txt, BUFSZ);
6240 + else
6241 + (void) memset(multi_txt, 0, BUFSZ);
6242 +#endif
6243 flags.travel = iflags.travel1 = flags.mv = flags.run = 0;
6246 @@ -2080,6 +2185,9 @@ unmul(msg_override)
6247 const char *msg_override;
6249 multi = 0; /* caller will usually have done this already */
6250 +#ifdef HELPLESS
6251 + (void) memset(multi_txt, 0, BUFSZ);
6252 +#endif
6253 if (msg_override) nomovemsg = msg_override;
6254 else if (!nomovemsg) nomovemsg = You_can_move_again;
6255 if (*nomovemsg) pline(nomovemsg);
6256 diff --git a/src/invent.c b/src/invent.c
6257 index b9a3683..5d4de17 100644
6258 --- a/src/invent.c
6259 +++ b/src/invent.c
6260 @@ -19,7 +19,12 @@ STATIC_DCL boolean FDECL(taking_off, (const char *));
6261 STATIC_DCL boolean FDECL(putting_on, (const char *));
6262 STATIC_PTR int FDECL(ckunpaid,(struct obj *));
6263 STATIC_PTR int FDECL(ckvalidcat,(struct obj *));
6264 +#ifdef DUMP_LOG
6265 +static char FDECL(display_pickinv,
6266 + (const char *,BOOLEAN_P, long *, BOOLEAN_P, BOOLEAN_P));
6267 +#else
6268 static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *));
6269 +#endif /* DUMP_LOG */
6270 #ifdef OVLB
6271 STATIC_DCL boolean FDECL(this_type_only, (struct obj *));
6272 STATIC_DCL void NDECL(dounpaid);
6273 @@ -532,6 +537,11 @@ void
6274 freeinv(obj)
6275 register struct obj *obj;
6277 +#ifdef ITEMCAT_JP
6278 +/* this is a very uncritical thing so we do it here. if the jpicklist was
6279 + * persistent, this should have been in extract_nobj() itself */
6280 + jpick_free(obj);
6281 +#endif /* ITEMCAT_JP */
6282 extract_nobj(obj, &invent);
6283 freeinv_core(obj);
6284 update_inventory();
6285 @@ -1017,7 +1027,11 @@ register const char *let,*word;
6286 if (ilet == '?' && !*lets && *altlets)
6287 allowed_choices = altlets;
6288 ilet = display_pickinv(allowed_choices, TRUE,
6289 - allowcnt ? &ctmp : (long *)0);
6290 + allowcnt ? &ctmp : (long *)0
6291 +#ifdef DUMP_LOG
6292 + , FALSE, TRUE
6293 +#endif
6294 + );
6295 if(!ilet) continue;
6296 if (allowcnt && ctmp >= 0) {
6297 cnt = ctmp;
6298 @@ -1689,13 +1703,27 @@ find_unpaid(list, last_found)
6299 * inventory and return a count as well as a letter. If out_cnt is not null,
6300 * any count returned from the menu selection is placed here.
6302 +#ifdef DUMP_LOG
6303 +static char
6304 +display_pickinv(lets, want_reply, out_cnt, want_dump, want_disp)
6305 +register const char *lets;
6306 +boolean want_reply;
6307 +long* out_cnt;
6308 +boolean want_dump;
6309 +boolean want_disp;
6310 +#else
6311 static char
6312 display_pickinv(lets, want_reply, out_cnt)
6313 register const char *lets;
6314 boolean want_reply;
6315 long* out_cnt;
6316 +#endif
6318 struct obj *otmp;
6319 +#ifdef SORTLOOT
6320 + struct obj **oarray;
6321 + int i, j;
6322 +#endif
6323 char ilet, ret;
6324 char *invlet = flags.inv_order;
6325 int n, classcount;
6326 @@ -1704,6 +1732,9 @@ long* out_cnt;
6327 anything any;
6328 menu_item *selected;
6330 +#ifdef DUMP_LOG
6331 + if (want_disp) {
6332 +#endif
6333 /* overriden by global flag */
6334 if (flags.perm_invent) {
6335 win = (lets && *lets) ? local_win : WIN_INVEN;
6336 @@ -1713,6 +1744,11 @@ long* out_cnt;
6337 } else
6338 win = WIN_INVEN;
6340 +#ifdef DUMP_LOG
6342 + if (want_dump) dump("", "Your inventory");
6343 +#endif
6346 Exit early if no inventory -- but keep going if we are doing
6347 a permanent inventory update. We need to keep going so the
6348 @@ -1725,11 +1761,24 @@ long* out_cnt;
6349 to here is short circuited away.
6351 if (!invent && !(flags.perm_invent && !lets && !want_reply)) {
6352 +#ifdef DUMP_LOG
6353 + if (want_disp) {
6354 +#endif
6355 #ifndef GOLDOBJ
6356 pline("Not carrying anything%s.", u.ugold ? " except gold" : "");
6357 #else
6358 pline("Not carrying anything.");
6359 #endif
6360 +#ifdef DUMP_LOG
6362 + if (want_dump) {
6363 +#ifdef GOLDOBJ
6364 + dump(" ", "Not carrying anything");
6365 +#else
6366 + dump(" Not carrying anything", u.ugold ? " except gold." : ".");
6367 +#endif
6369 +#endif
6370 return 0;
6373 @@ -1743,37 +1792,124 @@ long* out_cnt;
6374 ret = '\0';
6375 for (otmp = invent; otmp; otmp = otmp->nobj) {
6376 if (otmp->invlet == lets[0]) {
6377 +#ifdef DUMP_LOG
6378 + if (want_disp) {
6379 +#endif
6380 ret = message_menu(lets[0],
6381 want_reply ? PICK_ONE : PICK_NONE,
6382 xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
6383 if (out_cnt) *out_cnt = -1L; /* select all */
6384 +#ifdef DUMP_LOG
6386 + if (want_dump) {
6387 + char letbuf[7];
6388 + sprintf(letbuf, " %c - ", lets[0]);
6389 + dump(letbuf,
6390 + xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
6392 +#endif
6393 break;
6396 return ret;
6399 +#ifdef SORTLOOT
6400 + /* count the number of items */
6401 + for (n = 0, otmp = invent; otmp; otmp = otmp->nobj)
6402 + if(!lets || !*lets || index(lets, otmp->invlet)) n++;
6404 + /* Make a temporary array to store the objects sorted */
6405 + oarray = (struct obj **)alloc(n*sizeof(struct obj*));
6407 + /* Add objects to the array */
6408 + i = 0;
6409 + for(otmp = invent; otmp; otmp = otmp->nobj)
6410 + if(!lets || !*lets || index(lets, otmp->invlet)) {
6411 + if (iflags.sortloot == 'f') {
6412 + /* Insert object at correct index */
6413 + for (j = i; j; j--) {
6414 + if (strcmpi(cxname2(otmp), cxname2(oarray[j-1]))>0) break;
6415 + oarray[j] = oarray[j-1];
6417 + oarray[j] = otmp;
6418 + i++;
6419 + } else {
6420 + /* Just add it to the array */
6421 + oarray[i++] = otmp;
6424 +#endif /* SORTLOOT */
6426 +#ifdef DUMP_LOG
6427 + if (want_disp)
6428 +#endif
6429 start_menu(win);
6430 nextclass:
6431 classcount = 0;
6432 any.a_void = 0; /* set all bits to zero */
6433 +#ifdef SORTLOOT
6434 + for(i = 0; i < n; i++) {
6435 + otmp = oarray[i];
6436 + ilet = otmp->invlet;
6437 + if (!flags.sortpack || otmp->oclass == *invlet) {
6438 + if (flags.sortpack && !classcount) {
6439 + any.a_void = 0; /* zero */
6440 +#ifdef DUMP_LOG
6441 + if (want_dump)
6442 + dump(" ", let_to_name(*invlet, FALSE));
6443 + if (want_disp)
6444 +#endif
6445 + add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
6446 + let_to_name(*invlet, FALSE), MENU_UNSELECTED);
6447 + classcount++;
6449 + any.a_char = ilet;
6450 +#ifdef DUMP_LOG
6451 + if (want_dump) {
6452 + char letbuf[7];
6453 + sprintf(letbuf, " %c - ", ilet);
6454 + dump(letbuf, doname(otmp));
6456 + if (want_disp)
6457 +#endif
6458 + add_menu(win, obj_to_glyph(otmp),
6459 + &any, ilet, 0, ATR_NONE, doname(otmp),
6460 + MENU_UNSELECTED);
6463 +#else /* SORTLOOT */
6464 for(otmp = invent; otmp; otmp = otmp->nobj) {
6465 ilet = otmp->invlet;
6466 if(!lets || !*lets || index(lets, ilet)) {
6467 if (!flags.sortpack || otmp->oclass == *invlet) {
6468 if (flags.sortpack && !classcount) {
6469 any.a_void = 0; /* zero */
6470 +#ifdef DUMP_LOG
6471 + if (want_dump)
6472 + dump(" ", let_to_name(*invlet, FALSE));
6473 + if (want_disp)
6474 +#endif
6475 add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
6476 let_to_name(*invlet, FALSE), MENU_UNSELECTED);
6477 classcount++;
6479 any.a_char = ilet;
6480 +#ifdef DUMP_LOG
6481 + if (want_dump) {
6482 + char letbuf[7];
6483 + sprintf(letbuf, " %c - ", ilet);
6484 + dump(letbuf, doname(otmp));
6486 + if (want_disp)
6487 +#endif
6488 add_menu(win, obj_to_glyph(otmp),
6489 &any, ilet, 0, ATR_NONE, doname(otmp),
6490 MENU_UNSELECTED);
6494 +#endif /* SORTLOOT */
6495 if (flags.sortpack) {
6496 if (*++invlet) goto nextclass;
6497 #ifdef WIZARD
6498 @@ -1783,6 +1919,12 @@ nextclass:
6500 #endif
6502 +#ifdef SORTLOOT
6503 + free(oarray);
6504 +#endif
6505 +#ifdef DUMP_LOG
6506 + if (want_disp) {
6507 +#endif
6508 end_menu(win, (char *) 0);
6510 n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected);
6511 @@ -1792,6 +1934,10 @@ nextclass:
6512 free((genericptr_t)selected);
6513 } else
6514 ret = !n ? '\0' : '\033'; /* cancelled */
6515 +#ifdef DUMP_LOG
6516 + } /* want_disp */
6517 + if (want_dump) dump("", "");
6518 +#endif
6520 return ret;
6522 @@ -1808,9 +1954,24 @@ display_inventory(lets, want_reply)
6523 register const char *lets;
6524 boolean want_reply;
6526 - return display_pickinv(lets, want_reply, (long *)0);
6527 + return display_pickinv(lets, want_reply, (long *)0
6528 +#ifdef DUMP_LOG
6529 + , FALSE , TRUE
6530 +#endif
6531 + );
6534 +#ifdef DUMP_LOG
6535 +/* See display_inventory. This is the same thing WITH dumpfile creation */
6536 +char
6537 +dump_inventory(lets, want_reply, want_disp)
6538 +register const char *lets;
6539 +boolean want_reply, want_disp;
6541 + return display_pickinv(lets, want_reply, (long *)0, TRUE, want_disp);
6543 +#endif
6546 * Returns the number of unpaid items within the given list. This includes
6547 * contained objects.
6548 @@ -1861,6 +2022,16 @@ count_buc(list, type)
6549 if (list->oclass != COIN_CLASS && !list->bknown)
6550 count++;
6551 break;
6552 +#ifdef ITEMCAT
6553 + case UNIDENTIFIED:
6554 + if (NOT_FULLY_IDENTIFIED(list))
6555 + count++;
6556 + break;
6557 + case RUSTPRONE:
6558 + if (list->oclass != COIN_CLASS && is_known_rustprone(list))
6559 + count++;
6560 + break;
6561 +#endif /* ITEMCAT */
6562 default:
6563 impossible("need count of curse status %d?", type);
6564 return 0;
6565 @@ -2650,13 +2821,23 @@ doorganize() /* inventory organizer by Del Lamb */
6566 register char let;
6567 char alphabet[52+1], buf[52+1];
6568 char qbuf[QBUFSZ];
6569 +#ifdef ADJSPLIT
6570 + char allowallcnt[3];
6571 +#else
6572 char allowall[2];
6573 +#endif
6574 const char *adj_type;
6576 if (!flags.invlet_constant) reassign();
6577 /* get a pointer to the object the user wants to organize */
6578 +#ifdef ADJSPLIT
6579 + allowallcnt[0] = ALLOW_COUNT; allowallcnt[1] = ALL_CLASSES;
6580 + allowallcnt[2] = '\0';
6581 + if (!(obj = getobj(allowallcnt,"adjust"))) return(0);
6582 +#else
6583 allowall[0] = ALL_CLASSES; allowall[1] = '\0';
6584 if (!(obj = getobj(allowall,"adjust"))) return(0);
6585 +#endif
6587 /* initialize the list with all upper and lower case letters */
6588 for (let = 'a', ix = 0; let <= 'z';) alphabet[ix++] = let++;
6589 @@ -2685,7 +2866,11 @@ doorganize() /* inventory organizer by Del Lamb */
6590 let = yn_function(qbuf, (char *)0, '\0');
6591 if(index(quitchars,let)) {
6592 pline(Never_mind);
6593 +#ifdef ADJSPLIT
6594 + goto cleansplit;
6595 +#else
6596 return(0);
6597 +#endif
6599 if (let == '@' || !letter(let))
6600 pline("Select an inventory slot letter.");
6601 @@ -2694,7 +2879,9 @@ doorganize() /* inventory organizer by Del Lamb */
6604 /* change the inventory and print the resulting item */
6605 +#ifndef ADJSPLIT
6606 adj_type = "Moving:";
6607 +#endif
6610 * don't use freeinv/addinv to avoid double-touching artifacts,
6611 @@ -2702,19 +2889,56 @@ doorganize() /* inventory organizer by Del Lamb */
6613 extract_nobj(obj, &invent);
6615 +#ifdef ADJSPLIT
6616 + for (otmp = invent; otmp && otmp->invlet != let;)
6617 + otmp = otmp->nobj;
6618 + if (!otmp)
6619 + adj_type = "Moving:";
6620 + else if (merged(&otmp,&obj)) {
6621 +#else
6622 for (otmp = invent; otmp;)
6623 if (merged(&otmp,&obj)) {
6624 +#endif
6625 adj_type = "Merging:";
6626 obj = otmp;
6627 +#ifndef ADJSPLIT
6628 otmp = otmp->nobj;
6629 +#endif
6630 extract_nobj(obj, &invent);
6631 } else {
6632 +#ifdef ADJSPLIT
6633 + struct obj *otmp2;
6634 + for (otmp2 = invent; otmp2
6635 + && otmp2->invlet != obj->invlet;)
6636 + otmp2 = otmp2->nobj;
6638 + if (otmp2) {
6639 + char oldlet = obj->invlet;
6641 + adj_type = "Displacing:";
6643 + /* Here be a nasty hack; solutions that don't
6644 + * require duplication of assigninvlet's code
6645 + * here are welcome.
6646 + */
6647 + assigninvlet(obj);
6649 + if (obj->invlet == NOINVSYM) {
6650 + pline("There's nowhere to put that.");
6651 + obj->invlet = oldlet;
6652 + goto cleansplit;
6654 + } else
6655 +#else
6656 if (otmp->invlet == let) {
6657 +#endif
6658 adj_type = "Swapping:";
6659 otmp->invlet = obj->invlet;
6661 +#ifndef ADJSPLIT
6662 otmp = otmp->nobj;
6664 +#endif
6666 /* inline addinv (assuming flags.invlet_constant and !merged) */
6667 obj->invlet = let;
6668 @@ -2726,6 +2950,14 @@ doorganize() /* inventory organizer by Del Lamb */
6669 prinv(adj_type, obj, 0L);
6670 update_inventory();
6671 return(0);
6672 +#ifdef ADJSPLIT
6673 +cleansplit:
6674 + for (otmp = invent; otmp; otmp = otmp->nobj)
6675 + if (otmp != obj && otmp->invlet == obj->invlet)
6676 + merged( &otmp, &obj );
6678 + return 0;
6679 +#endif
6682 /* common to display_minventory and display_cinventory */
6683 diff --git a/src/mcastu.c b/src/mcastu.c
6684 index 93d3b8d..2dc0555 100644
6685 --- a/src/mcastu.c
6686 +++ b/src/mcastu.c
6687 @@ -228,7 +228,11 @@ castmu(mtmp, mattk, thinks_it_foundyou, foundyou)
6688 return(0);
6691 - nomul(0);
6692 + nomul(0
6693 +#ifdef HELPLESS
6694 + , 0
6695 +#endif
6696 + );
6697 if(rn2(ml*10) < (mtmp->mconf ? 100 : 20)) { /* fumbled attack */
6698 if (canseemon(mtmp) && flags.soundok)
6699 pline_The("air crackles around %s.", mon_nam(mtmp));
6700 @@ -600,13 +604,21 @@ int spellnum;
6701 shieldeff(u.ux, u.uy);
6702 if (multi >= 0)
6703 You("stiffen briefly.");
6704 - nomul(-1);
6705 + nomul(-1
6706 +#ifdef HELPLESS
6707 + , "paralyzed by a monster"
6708 +#endif
6709 + );
6710 } else {
6711 if (multi >= 0)
6712 You("are frozen in place!");
6713 dmg = 4 + (int)mtmp->m_lev;
6714 if (Half_spell_damage) dmg = (dmg + 1) / 2;
6715 - nomul(-dmg);
6716 + nomul(-dmg
6717 +#ifdef HELPLESS
6718 + , "paralyzed by a monster"
6719 +#endif
6720 + );
6722 dmg = 0;
6723 break;
6724 @@ -771,7 +783,11 @@ buzzmu(mtmp, mattk) /* monster uses spell (ranged) */
6725 return(0);
6727 if(lined_up(mtmp) && rn2(3)) {
6728 - nomul(0);
6729 + nomul(0
6730 +#ifdef HELPLESS
6731 + , 0
6732 +#endif
6733 + );
6734 if(mattk->adtyp && (mattk->adtyp < 11)) { /* no cf unsigned >0 */
6735 if(canseemon(mtmp))
6736 pline("%s zaps you with a %s!", Monnam(mtmp),
6737 diff --git a/src/mhitu.c b/src/mhitu.c
6738 index c0711fc..4772470 100644
6739 --- a/src/mhitu.c
6740 +++ b/src/mhitu.c
6741 @@ -317,7 +317,11 @@ mattacku(mtmp)
6742 * invisible, or you might be blind....
6745 - if(!ranged) nomul(0);
6746 + if(!ranged) nomul(0
6747 +#ifdef HELPLESS
6748 + , 0
6749 +#endif
6750 + );
6751 if(mtmp->mhp <= 0 || (Underwater && !is_swimmer(mtmp->data)))
6752 return(0);
6754 @@ -1122,7 +1126,11 @@ dopois:
6755 if (Blind) You("are frozen!");
6756 else You("are frozen by %s!", mon_nam(mtmp));
6757 nomovemsg = 0; /* default: "you can move again" */
6758 - nomul(-rnd(10));
6759 + nomul(-rnd(10)
6760 +#ifdef HELPLESS
6761 + , "paralyzed by a monster"
6762 +#endif
6763 + );
6764 exercise(A_DEX, FALSE);
6767 diff --git a/src/monstr.c b/src/monstr.c
6768 new file mode 100644
6769 index 0000000..edf9b42
6770 --- /dev/null
6771 +++ b/src/monstr.c
6772 @@ -0,0 +1,39 @@
6773 +/* This source file is generated by 'makedefs'. Do not edit. */
6774 +#include "config.h"
6776 +const int monstr[] = {
6777 + 4, 5, 6, 6, 6, 12, 2, 6, 8, 7, 8, 8, 1, 1, 2, 4,
6778 + 3, 5, 7, 5, 6, 7, 8, 7, 9, 9, 14, 2, 3, 8, 8, 8,
6779 + 3, 5, 6, 7, 7, 7, 8, 8, 8, 11, 2, 4, 5, 6, 8, 13,
6780 +19, 3, 3, 4, 5, 7, 7, 5, 6, 8, 1, 2, 3, 4, 4, 8,
6781 + 9, 11, 5, 5, 5, 1, 3, 3, 4, 5, 5, 5, 7, 4, 6, 9,
6782 + 4, 7, 8, 9, 13, 15, 22, 1, 2, 4, 4, 4, 4, 3, 4, 7,
6783 + 8, 12, 14, 6, 6, 6, 4, 7, 9, 4, 6, 7, 9, 9, 10, 9,
6784 + 9, 9, 17, 1, 9, 5, 7, 11, 11, 12, 19, 21, 26, 2, 3, 6,
6785 + 7, 6, 8, 9, 13, 13, 13, 13, 13, 13, 13, 13, 13, 20, 20, 20,
6786 +20, 20, 20, 20, 20, 20, 9, 10, 10, 10, 10, 1, 2, 2, 2, 2,
6787 + 2, 5, 3, 4, 5, 6, 8, 8, 10, 11, 13, 19, 13, 20, 17, 18,
6788 + 3, 4, 5, 6, 14, 18, 21, 29, 4, 5, 6, 6, 7, 7, 8, 10,
6789 + 4, 4, 4, 4, 8, 10, 13, 16, 7, 9, 11, 4, 6, 12, 8, 9,
6790 + 8, 14, 3, 6, 7, 9, 8, 10, 9, 12, 12, 13, 16, 12, 12, 14,
6791 +18, 7, 8, 17, 11, 4, 6, 7, 7, 8, 9, 1, 2, 3, 3, 4,
6792 + 5, 7, 9, 5, 14, 4, 4, 6, 6, 7, 8, 10, 12, 15, 18, 22,
6793 + 2, 3, 3, 6, 12, 6, 7, 8, 11, 11, 11, 13, 15, 14, 14, 13,
6794 +15, 30, 8, 10, 12, 14, 8, 12, 25, 34, 22, 12, 14, 11, 9, 8,
6795 + 8, 10, 10, 11, 11, 12, 13, 14, 15, 16, 20, 26, 31, 36, 36, 40,
6796 +45, 53, 57, 34, 34, 34, 26, 8, 15, 5, 6, 9, 7, 10, 22, 1,
6797 + 2, 3, 4, 6, 7, 7, 12, 1, 12, 12, 12, 12, 12, 12, 11, 12,
6798 +12, 12, 12, 12, 12, 12, 12, 22, 22, 22, 22, 23, 30, 30, 22, 24,
6799 +23, 22, 23, 23, 23, 22, 23, 23, 22, 31, 23, 17, 20, 19, 19, 20,
6800 + 7, 7, 7, 7, 7, 8, 8, 7, 7, 7, 7, 8, 7, 8,
6803 +void NDECL(monstr_init);
6805 +void
6806 +monstr_init()
6808 + return;
6811 +/*monstr.c*/
6812 diff --git a/src/mthrowu.c b/src/mthrowu.c
6813 index 3038ced..a22a55c 100644
6814 --- a/src/mthrowu.c
6815 +++ b/src/mthrowu.c
6816 @@ -324,7 +324,11 @@ m_throw(mon, x, y, dx, dy, range, obj)
6817 if (ohitmon(mtmp, singleobj, range, TRUE))
6818 break;
6819 } else if (bhitpos.x == u.ux && bhitpos.y == u.uy) {
6820 - if (multi) nomul(0);
6821 + if (multi) nomul(0
6822 +#ifdef HELPLESS
6823 + , 0
6824 +#endif
6825 + );
6827 if (singleobj->oclass == GEM_CLASS &&
6828 singleobj->otyp <= LAST_GEM+9 /* 9 glass colors */
6829 @@ -608,7 +612,11 @@ struct monst *mtmp;
6830 m_shot.o = STRANGE_OBJECT;
6831 m_shot.s = FALSE;
6833 - nomul(0);
6834 + nomul(0
6835 +#ifdef HELPLESS
6836 + , 0
6837 +#endif
6838 + );
6841 #endif /* OVL1 */
6842 @@ -646,7 +654,11 @@ register struct attack *mattk;
6843 pline("%s spits venom!", Monnam(mtmp));
6844 m_throw(mtmp, mtmp->mx, mtmp->my, sgn(tbx), sgn(tby),
6845 distmin(mtmp->mx,mtmp->my,mtmp->mux,mtmp->muy), otmp);
6846 - nomul(0);
6847 + nomul(0
6848 +#ifdef HELPLESS
6849 + , 0
6850 +#endif
6851 + );
6852 return 0;
6855 @@ -684,7 +696,11 @@ breamu(mtmp, mattk) /* monster breathes at you (ranged) */
6856 breathwep[typ-1]);
6857 buzz((int) (-20 - (typ-1)), (int)mattk->damn,
6858 mtmp->mx, mtmp->my, sgn(tbx), sgn(tby));
6859 - nomul(0);
6860 + nomul(0
6861 +#ifdef HELPLESS
6862 + , 0
6863 +#endif
6864 + );
6865 /* breath runs out sometimes. Also, give monster some
6866 * cunning; don't breath if the player fell asleep.
6868 diff --git a/src/muse.c b/src/muse.c
6869 index 86044e5..7cf1db4 100644
6870 --- a/src/muse.c
6871 +++ b/src/muse.c
6872 @@ -1121,7 +1121,11 @@ register struct obj *otmp;
6873 losehp(tmp, "wand", KILLED_BY_AN);
6874 } else pline_The("wand misses you.");
6875 stop_occupation();
6876 - nomul(0);
6877 + nomul(0
6878 +#ifdef HELPLESS
6879 + , 0
6880 +#endif
6881 + );
6882 } else if (resists_magm(mtmp)) {
6883 shieldeff(mtmp->mx, mtmp->my);
6884 pline("Boing!");
6885 diff --git a/src/objnam.c b/src/objnam.c
6886 index 2130432..94b5040 100644
6887 --- a/src/objnam.c
6888 +++ b/src/objnam.c
6889 @@ -15,6 +15,9 @@ static boolean FDECL(wishymatch, (const char *,const char *,BOOLEAN_P));
6890 #endif
6891 static char *NDECL(nextobuf);
6892 static void FDECL(add_erosion_words, (struct obj *, char *));
6893 +#ifdef SORTLOOT
6894 +char * FDECL(xname2, (struct obj *, boolean));
6895 +#endif
6897 struct Jitem {
6898 int item;
6899 @@ -233,6 +236,15 @@ boolean juice; /* whether or not to append " juice" to the name */
6900 char *
6901 xname(obj)
6902 register struct obj *obj;
6903 +#ifdef SORTLOOT
6905 + return xname2(obj, FALSE);
6907 +char *
6908 +xname2(obj, ignore_oquan)
6909 +register struct obj *obj;
6910 +boolean ignore_oquan;
6911 +#endif
6913 register char *buf;
6914 register int typ = obj->otyp;
6915 @@ -469,6 +481,9 @@ register struct obj *obj;
6916 default:
6917 Sprintf(buf,"glorkum %d %d %d", obj->oclass, typ, obj->spe);
6919 +#ifdef SORTLOOT
6920 + if (!ignore_oquan)
6921 +#endif
6922 if (obj->quan != 1L) Strcpy(buf, makeplural(buf));
6924 if (obj->onamelth && obj->dknown) {
6925 @@ -853,6 +868,16 @@ struct obj *obj;
6926 return corpse_xname(obj, FALSE);
6927 return xname(obj);
6929 +#ifdef SORTLOOT
6930 +char *
6931 +cxname2(obj)
6932 +struct obj *obj;
6934 + if (obj->otyp == CORPSE)
6935 + return corpse_xname(obj, TRUE);
6936 + return xname2(obj, TRUE);
6938 +#endif /* SORTLOOT */
6940 /* treat an object as fully ID'd when it might be used as reason for death */
6941 char *
6942 diff --git a/src/options.c b/src/options.c
6943 index dfb8006..9da3ea1 100644
6944 --- a/src/options.c
6945 +++ b/src/options.c
6946 @@ -75,6 +75,9 @@ static struct Bool_Opt
6947 {"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/
6948 # endif
6949 {"confirm",&flags.confirm, TRUE, SET_IN_GAME},
6950 +#ifdef DEATH_EXPLORE
6951 + {"death_explore", &iflags.death_expl, FALSE, SET_IN_GAME},
6952 +#endif
6953 #if defined(TERMLIB) && !defined(MAC_GRAPHICS_ENV)
6954 {"DECgraphics", &iflags.DECgraphics, FALSE, SET_IN_GAME},
6955 #else
6956 @@ -113,6 +116,9 @@ static struct Bool_Opt
6957 #endif
6958 {"large_font", &iflags.obsolete, FALSE, SET_IN_FILE}, /* OBSOLETE */
6959 {"legacy", &flags.legacy, TRUE, DISP_IN_GAME},
6960 +#ifdef ITEMCAT
6961 + {"like_swimming", &iflags.like_swimming, FALSE, SET_IN_GAME},
6962 +#endif /* ITEMCAT */
6963 {"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME},
6964 {"lootabc", &iflags.lootabc, FALSE, SET_IN_GAME},
6965 #ifdef MAC_GRAPHICS_ENV
6966 @@ -125,6 +131,15 @@ static struct Bool_Opt
6967 #else
6968 {"mail", (boolean *)0, TRUE, SET_IN_FILE},
6969 #endif
6970 +#ifdef MENU_COLOR
6971 +# ifdef MICRO
6972 + {"menucolors", &iflags.use_menu_color, TRUE, SET_IN_GAME},
6973 +# else
6974 + {"menucolors", &iflags.use_menu_color, FALSE, SET_IN_GAME},
6975 +# endif
6976 +#else
6977 + {"menucolors", (boolean *)0, FALSE, SET_IN_GAME},
6978 +#endif
6979 #ifdef WIZARD
6980 /* for menu debugging only*/
6981 {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME},
6982 @@ -143,11 +158,19 @@ static struct Bool_Opt
6983 #else
6984 {"page_wait", (boolean *)0, FALSE, SET_IN_FILE},
6985 #endif
6986 +#ifdef PARANOID
6987 + {"paranoid_hit", &iflags.paranoid_hit, FALSE, SET_IN_GAME},
6988 + {"paranoid_quit", &iflags.paranoid_quit, FALSE, SET_IN_GAME},
6989 + {"paranoid_remove", &iflags.paranoid_remove, FALSE, SET_IN_GAME},
6990 +#endif
6991 {"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME},
6992 {"popup_dialog", &iflags.wc_popup_dialog, FALSE, SET_IN_GAME}, /*WC*/
6993 {"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME},
6994 {"preload_tiles", &iflags.wc_preload_tiles, TRUE, DISP_IN_GAME}, /*WC*/
6995 {"pushweapon", &flags.pushweapon, FALSE, SET_IN_GAME},
6996 +#ifdef QUIVER_FIRED
6997 + {"quiver_fired", &iflags.quiver_fired, FALSE, SET_IN_GAME},
6998 +#endif
6999 #if defined(MICRO) && !defined(AMIGA)
7000 {"rawio", &iflags.rawio, FALSE, DISP_IN_GAME},
7001 #else
7002 @@ -160,6 +183,9 @@ static struct Bool_Opt
7003 #else
7004 {"sanity_check", (boolean *)0, FALSE, SET_IN_FILE},
7005 #endif
7006 +#ifdef SHOW_BORN
7007 + {"showborn", &iflags.show_born, FALSE, SET_IN_GAME},
7008 +#endif
7009 #ifdef EXP_ON_BOTL
7010 {"showexp", &flags.showexp, FALSE, SET_IN_GAME},
7011 #else
7012 @@ -193,6 +219,11 @@ static struct Bool_Opt
7013 #else
7014 {"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/
7015 #endif
7016 +#ifdef WIN_EDGE
7017 + {"win_edge", &iflags.win_edge, FALSE, SET_IN_GAME},
7018 +#else
7019 + {"win_edge", (boolean *)0, TRUE, SET_IN_FILE},
7020 +#endif
7021 {"verbose", &flags.verbose, TRUE, SET_IN_GAME},
7022 {"wraptext", &iflags.wc2_wraptext, FALSE, SET_IN_GAME},
7023 {(char *)0, (boolean *)0, FALSE, 0}
7024 @@ -224,6 +255,14 @@ static struct Comp_Opt
7025 SET_IN_GAME },
7026 { "dogname", "the name of your (first) dog (e.g., dogname:Fang)",
7027 PL_PSIZ, DISP_IN_GAME },
7028 +#ifdef DUMP_LOG
7029 + { "dumpfile", "where to dump data (e.g., dumpfile:/tmp/dump.nh)",
7030 +#ifdef DUMP_FN
7031 + PL_PSIZ, DISP_IN_GAME },
7032 +#else
7033 + PL_PSIZ, SET_IN_GAME },
7034 +#endif
7035 +#endif
7036 { "dungeon", "the symbols to use in drawing the dungeon map",
7037 MAXDCHARS+1, SET_IN_FILE },
7038 { "effects", "the symbols to use in drawing special effects",
7039 @@ -246,6 +285,9 @@ static struct Comp_Opt
7040 { "horsename", "the name of your (first) horse (e.g., horsename:Silver)",
7041 PL_PSIZ, DISP_IN_GAME },
7042 { "map_mode", "map display mode under Windows", 20, DISP_IN_GAME }, /*WC*/
7043 +#ifdef MENU_COLOR
7044 + { "menucolor", "set menu colors", PL_PSIZ, SET_IN_FILE },
7045 +#endif
7046 { "menustyle", "user interface for object selection",
7047 MENUTYPELEN, SET_IN_GAME },
7048 { "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE },
7049 @@ -306,6 +348,9 @@ static struct Comp_Opt
7050 { "scroll_amount", "amount to scroll map when scroll_margin is reached",
7051 20, DISP_IN_GAME }, /*WC*/
7052 { "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/
7053 +#ifdef SORTLOOT
7054 + { "sortloot", "sort object selection lists by description", 4, SET_IN_GAME },
7055 +#endif
7056 #ifdef MSDOS
7057 { "soundcard", "type of sound card to use", 20, SET_IN_FILE },
7058 #endif
7059 @@ -532,6 +577,10 @@ initoptions()
7060 flags.warnlevel = 1;
7061 flags.warntype = 0L;
7063 +#ifdef SORTLOOT
7064 + iflags.sortloot = 'n';
7065 +#endif
7067 /* assert( sizeof flags.inv_order == sizeof def_inv_order ); */
7068 (void)memcpy((genericptr_t)flags.inv_order,
7069 (genericptr_t)def_inv_order, sizeof flags.inv_order);
7070 @@ -964,6 +1013,120 @@ int bool_or_comp; /* 0 == boolean option, 1 == compound */
7074 +#ifdef MENU_COLOR
7075 +extern struct menucoloring *menu_colorings;
7077 +static const struct {
7078 + const char *name;
7079 + const int color;
7080 +} colornames[] = {
7081 + {"black", CLR_BLACK},
7082 + {"red", CLR_RED},
7083 + {"green", CLR_GREEN},
7084 + {"brown", CLR_BROWN},
7085 + {"blue", CLR_BLUE},
7086 + {"magenta", CLR_MAGENTA},
7087 + {"cyan", CLR_CYAN},
7088 + {"gray", CLR_GRAY},
7089 + {"orange", CLR_ORANGE},
7090 + {"lightgreen", CLR_BRIGHT_GREEN},
7091 + {"yellow", CLR_YELLOW},
7092 + {"lightblue", CLR_BRIGHT_BLUE},
7093 + {"lightmagenta", CLR_BRIGHT_MAGENTA},
7094 + {"lightcyan", CLR_BRIGHT_CYAN},
7095 + {"white", CLR_WHITE}
7098 +static const struct {
7099 + const char *name;
7100 + const int attr;
7101 +} attrnames[] = {
7102 + {"none", ATR_NONE},
7103 + {"bold", ATR_BOLD},
7104 + {"dim", ATR_DIM},
7105 + {"underline", ATR_ULINE},
7106 + {"blink", ATR_BLINK},
7107 + {"inverse", ATR_INVERSE}
7111 +/* parse '"regex_string"=color&attr' and add it to menucoloring */
7112 +boolean
7113 +add_menu_coloring(str)
7114 +char *str;
7116 + int i, c = NO_COLOR, a = ATR_NONE;
7117 + struct menucoloring *tmp;
7118 + char *tmps, *cs = strchr(str, '=');
7119 + const char *err = (char *)0;
7121 + if (!cs || !str) return FALSE;
7123 + tmps = cs;
7124 + tmps++;
7125 + while (*tmps && isspace(*tmps)) tmps++;
7127 + for (i = 0; i < SIZE(colornames); i++)
7128 + if (strstri(tmps, colornames[i].name) == tmps) {
7129 + c = colornames[i].color;
7130 + break;
7132 + if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9'))
7133 + c = atoi(tmps);
7135 + if (c > 15) return FALSE;
7137 + tmps = strchr(str, '&');
7138 + if (tmps) {
7139 + tmps++;
7140 + while (*tmps && isspace(*tmps)) tmps++;
7141 + for (i = 0; i < SIZE(attrnames); i++)
7142 + if (strstri(tmps, attrnames[i].name) == tmps) {
7143 + a = attrnames[i].attr;
7144 + break;
7146 + if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9'))
7147 + a = atoi(tmps);
7150 + *cs = '\0';
7151 + tmps = str;
7152 + if ((*tmps == '"') || (*tmps == '\'')) {
7153 + cs--;
7154 + while (isspace(*cs)) cs--;
7155 + if (*cs == *tmps) {
7156 + *cs = '\0';
7157 + tmps++;
7161 + tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring));
7162 +#ifdef MENU_COLOR_REGEX
7163 + tmp->match.translate = 0;
7164 + tmp->match.fastmap = 0;
7165 + tmp->match.buffer = 0;
7166 + tmp->match.allocated = 0;
7167 + tmp->match.regs_allocated = REGS_FIXED;
7168 + err = re_compile_pattern(tmps, strlen(tmps), &tmp->match);
7169 +#else
7170 + tmp->match = (char *)alloc(strlen(tmps)+1);
7171 + (void) memcpy((genericptr_t)tmp->match, (genericptr_t)tmps, strlen(tmps)+1);
7172 +#endif
7173 + if (err) {
7174 + raw_printf("\nMenucolor regex error: %s\n", err);
7175 + wait_synch();
7176 + free(tmp);
7177 + return FALSE;
7178 + } else {
7179 + tmp->next = menu_colorings;
7180 + tmp->color = c;
7181 + tmp->attr = a;
7182 + menu_colorings = tmp;
7183 + return TRUE;
7186 +#endif /* MENU_COLOR */
7188 void
7189 parseoptions(opts, tinitial, tfrom_file)
7190 register char *opts;
7191 @@ -1077,6 +1240,19 @@ boolean tinitial, tfrom_file;
7192 return;
7195 +#ifdef DUMP_LOG
7196 + fullname = "dumpfile";
7197 + if (match_optname(opts, fullname, 3, TRUE)) {
7198 +#ifndef DUMP_FN
7199 + if (negated) bad_negation(fullname, FALSE);
7200 + else if ((op = string_for_opt(opts, !tfrom_file)) != 0
7201 + && strlen(op) > 1)
7202 + nmcpy(dump_fn, op, PL_PSIZ);
7203 +#endif
7204 + return;
7206 +#endif
7208 fullname = "horsename";
7209 if (match_optname(opts, fullname, 5, TRUE)) {
7210 if (negated) bad_negation(fullname, FALSE);
7211 @@ -1133,6 +1309,18 @@ boolean tinitial, tfrom_file;
7212 return;
7215 + /* menucolor:"regex_string"=color */
7216 + fullname = "menucolor";
7217 + if (match_optname(opts, fullname, 9, TRUE)) {
7218 +#ifdef MENU_COLOR
7219 + if (negated) bad_negation(fullname, FALSE);
7220 + else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
7221 + if (!add_menu_coloring(op))
7222 + badoption(opts);
7223 +#endif
7224 + return;
7227 fullname = "msghistory";
7228 if (match_optname(opts, fullname, 3, TRUE)) {
7229 op = string_for_env_opt(fullname, opts, negated);
7230 @@ -1839,6 +2027,24 @@ goodfruit:
7231 return;
7234 +#ifdef SORTLOOT
7235 + fullname = "sortloot";
7236 + if (match_optname(opts, fullname, 4, TRUE)) {
7237 + op = string_for_env_opt(fullname, opts, FALSE);
7238 + if (op) {
7239 + switch (tolower(*op)) {
7240 + case 'n':
7241 + case 'l':
7242 + case 'f': iflags.sortloot = tolower(*op);
7243 + break;
7244 + default: badoption(opts);
7245 + return;
7248 + return;
7250 +#endif /* SORTLOOT */
7252 fullname = "suppress_alert";
7253 if (match_optname(opts, fullname, 4, TRUE)) {
7254 op = string_for_opt(opts, negated);
7255 @@ -2263,6 +2469,12 @@ static NEARDATA const char *runmodes[] = {
7256 "teleport", "run", "walk", "crawl"
7259 +#ifdef SORTLOOT
7260 +static NEARDATA const char *sortltype[] = {
7261 + "none", "loot", "full"
7263 +#endif
7266 * Convert the given string of object classes to a string of default object
7267 * symbols.
7268 @@ -2540,7 +2752,7 @@ boolean setinitial,setfromfile;
7269 boolean retval = FALSE;
7271 /* Special handling of menustyle, pickup_burden, pickup_types,
7272 - * disclose, runmode, msg_window, menu_headings, and number_pad options.
7273 + * disclose, runmode, msg_window, menu_headings, number_pad and sortloot
7274 #ifdef AUTOPICKUP_EXCEPTIONS
7275 * Also takes care of interactive autopickup_exception_handling changes.
7276 #endif
7277 @@ -2761,6 +2973,26 @@ boolean setinitial,setfromfile;
7279 destroy_nhwindow(tmpwin);
7280 retval = TRUE;
7281 +#ifdef SORTLOOT
7282 + } else if (!strcmp("sortloot", optname)) {
7283 + const char *sortl_name;
7284 + menu_item *sortl_pick = (menu_item *)0;
7285 + tmpwin = create_nhwindow(NHW_MENU);
7286 + start_menu(tmpwin);
7287 + for (i = 0; i < SIZE(sortltype); i++) {
7288 + sortl_name = sortltype[i];
7289 + any.a_char = *sortl_name;
7290 + add_menu(tmpwin, NO_GLYPH, &any, *sortl_name, 0,
7291 + ATR_NONE, sortl_name, MENU_UNSELECTED);
7293 + end_menu(tmpwin, "Select loot sorting type:");
7294 + if (select_menu(tmpwin, PICK_ONE, &sortl_pick) > 0) {
7295 + iflags.sortloot = sortl_pick->item.a_char;
7296 + free((genericptr_t)sortl_pick);
7298 + destroy_nhwindow(tmpwin);
7299 + retval = TRUE;
7300 +#endif /* SORTLOOT */
7301 } else if (!strcmp("menu_headings", optname)) {
7302 static const char *mhchoices[3] = {"bold", "inverse", "underline"};
7303 const char *npletters = "biu";
7304 @@ -2933,6 +3165,10 @@ char *buf;
7306 else if (!strcmp(optname, "dogname"))
7307 Sprintf(buf, "%s", dogname[0] ? dogname : none );
7308 +#ifdef DUMP_LOG
7309 + else if (!strcmp(optname, "dumpfile"))
7310 + Sprintf(buf, "%s", dump_fn[0] ? dump_fn: none );
7311 +#endif
7312 else if (!strcmp(optname, "dungeon"))
7313 Sprintf(buf, "%s", to_be_done);
7314 else if (!strcmp(optname, "effects"))
7315 @@ -3072,6 +3308,17 @@ char *buf;
7316 if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin);
7317 else Strcpy(buf, defopt);
7319 +#ifdef SORTLOOT
7320 + else if (!strcmp(optname, "sortloot")) {
7321 + char *sortname = (char *)NULL;
7322 + for (i=0; i < SIZE(sortltype) && sortname==(char *)NULL; i++) {
7323 + if (iflags.sortloot == sortltype[i][0])
7324 + sortname = (char *)sortltype[i];
7326 + if (sortname != (char *)NULL)
7327 + Sprintf(buf, "%s", sortname);
7329 +#endif /* SORTLOOT */
7330 else if (!strcmp(optname, "player_selection"))
7331 Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
7332 #ifdef MSDOS
7333 diff --git a/src/pickup.c b/src/pickup.c
7334 index 07be607..aa312d2 100644
7335 --- a/src/pickup.c
7336 +++ b/src/pickup.c
7337 @@ -39,6 +39,14 @@ STATIC_DCL int FDECL(container_at, (int, int, BOOLEAN_P));
7338 STATIC_DCL boolean FDECL(able_to_loot, (int, int));
7339 STATIC_DCL boolean FDECL(mon_beside, (int, int));
7341 +#ifdef ITEMCAT_JP
7342 +char *ctg_justpicked="Items just Picked up";
7343 +char *ctg_justremoved="Items just taken out";
7344 +char **jpick_ctg=&ctg_justpicked;
7345 +STATIC_PTR int FDECL(is_justpicked,(struct obj *));
7346 +#define DESTROY_JPICK(j) while(*(j)) { struct jpick *next=(*(j))->next_pick; free((genericptr_t) *(j)); *(j)=next; }
7347 +#endif
7349 /* define for query_objlist() and autopickup() */
7350 #define FOLLOW(curr, flags) \
7351 (((flags) & BY_NEXTHERE) ? (curr)->nexthere : (curr)->nobj)
7352 @@ -87,6 +95,44 @@ boolean here; /* flag for type of obj list linkage */
7356 +#ifdef ITEMCAT_JP
7357 +/* just picked items llist */
7358 +struct jpick {
7359 + struct obj *o;
7360 + struct jpick *next_pick;
7362 +static NEARDATA struct jpick *jpick_head=(struct jpick *)0;
7363 +STATIC_PTR int
7364 +is_justpicked(obj)
7365 +register struct obj *obj;
7367 + struct jpick *list=jpick_head;
7368 + while(list) {
7369 + if(obj==list->o)
7370 + return 1;
7371 + list=list->next_pick;
7373 + return 0;
7375 +void
7376 +jpick_free(obj)
7377 +register struct obj *obj;
7379 + struct jpick **p=&jpick_head;
7380 + struct jpick *next;
7382 + while(*p) {
7383 + next=(*p)->next_pick;
7384 + if(obj==(*p)->o) {
7385 + free((genericptr_t) *p);
7386 + *p=next;
7387 + break;
7389 + p=&(*p)->next_pick;
7392 +#endif /* ITEMCAT_JP */
7394 #ifndef GOLDOBJ
7396 collect_obj_classes(ilets, otmp, here, incl_gold, filter, itemcount)
7397 @@ -267,7 +313,13 @@ boolean picked_some;
7399 /* If there are objects here, take a look. */
7400 if (ct) {
7401 - if (flags.run) nomul(0);
7402 + if (flags.run) {
7403 + nomul(0
7404 +#ifdef HELPLESS
7405 + , 0
7406 +#endif
7407 + );
7409 flush_screen(1);
7410 (void) look_here(ct, picked_some);
7411 } else {
7412 @@ -340,6 +392,19 @@ struct obj *obj;
7413 else if (((index(valid_menu_classes,'X') != (char *)0) &&
7414 (obj->oclass != COIN_CLASS && !obj->bknown)))
7415 return TRUE;
7416 +#ifdef ITEMCAT
7417 + else if (((index(valid_menu_classes,'I') != (char *)0) &&
7418 + NOT_FULLY_IDENTIFIED(obj)))
7419 + return TRUE;
7420 + else if (((index(valid_menu_classes,'r') != (char *)0) &&
7421 + (obj->oclass != COIN_CLASS && is_known_rustprone(obj))))
7422 + return TRUE;
7423 +#endif /* ITEMCAT */
7424 +#ifdef ITEMCAT_JP
7425 + else if (((index(valid_menu_classes,'P') != (char *)0) &&
7426 + (is_justpicked(obj))))
7427 + return TRUE;
7428 +#endif
7429 else
7430 return FALSE;
7432 @@ -390,6 +455,9 @@ int what; /* should be a long */
7433 boolean autopickup = what > 0;
7434 struct obj *objchain;
7435 int traverse_how;
7436 +#ifdef ITEMCAT_JP
7437 + struct jpick *jtmp=jpick_head;
7438 +#endif
7440 if (what < 0) /* pick N of something */
7441 count = -what;
7442 @@ -440,9 +508,20 @@ int what; /* should be a long */
7445 /* if there's anything here, stop running */
7446 - if (OBJ_AT(u.ux,u.uy) && flags.run && flags.run != 8 && !flags.nopick) nomul(0);
7447 + if (OBJ_AT(u.ux,u.uy) && flags.run
7448 + && flags.run != 8 && !flags.nopick) {
7449 + nomul(0
7450 +#ifdef HELPLESS
7451 + , 0
7452 +#endif
7453 + );
7457 +#ifdef ITEMCAT_JP
7458 + jpick_head=(struct jpick *) 0;
7459 +#endif
7461 add_valid_menu_class(0); /* reset */
7462 if (!u.uswallow) {
7463 objchain = level.objects[u.ux][u.uy];
7464 @@ -528,7 +607,19 @@ menu_pickup:
7465 FALSE,
7466 #endif
7467 &via_menu)) {
7468 - if (!via_menu) return (0);
7469 + if (!via_menu)
7470 +#ifdef ITEMCAT_JP
7472 + if(jpick_head) {
7473 + jpick_ctg=&ctg_justpicked;
7474 + DESTROY_JPICK(&jtmp)
7475 + } else
7476 + jpick_head=jtmp;
7477 + return (0);
7479 +#else
7480 + return (0);
7481 +#endif /* ITEMCAT_JP */
7482 n = query_objlist("Pick up what?",
7483 objchain,
7484 traverse_how|(selective ? 0 : INVORDER_SORT),
7485 @@ -592,6 +683,13 @@ end_query:
7486 /* see whether there's anything else here, after auto-pickup is done */
7487 if (autopickup) check_here(n_picked > 0);
7489 +#ifdef ITEMCAT_JP
7490 + if(jpick_head) {
7491 + jpick_ctg=&ctg_justpicked;
7492 + DESTROY_JPICK(&jtmp)
7493 + } else
7494 + jpick_head=jtmp;
7495 +#endif
7496 return (n_tried > 0);
7499 @@ -690,9 +788,15 @@ menu_item **pick_list; /* return list of items picked */
7500 int how; /* type of query */
7501 boolean FDECL((*allow), (OBJ_P));/* allow function */
7503 +#ifdef SORTLOOT
7504 + int i, j;
7505 +#endif
7506 int n;
7507 winid win;
7508 struct obj *curr, *last;
7509 +#ifdef SORTLOOT
7510 + struct obj **oarray;
7511 +#endif
7512 char *pack;
7513 anything any;
7514 boolean printed_type_name;
7515 @@ -717,6 +821,33 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
7516 return 1;
7519 +#ifdef SORTLOOT
7520 + /* Make a temporary array to store the objects sorted */
7521 + oarray = (struct obj **)alloc(n*sizeof(struct obj*));
7523 + /* Add objects to the array */
7524 + i = 0;
7525 + for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
7526 + if ((*allow)(curr)) {
7527 + if (iflags.sortloot == 'f' ||
7528 + (iflags.sortloot == 'l' && !(qflags & USE_INVLET)))
7530 + /* Insert object at correct index */
7531 + for (j = i; j; j--)
7533 + if (strcmpi(cxname2(curr), cxname2(oarray[j-1]))>0) break;
7534 + oarray[j] = oarray[j-1];
7536 + oarray[j] = curr;
7537 + i++;
7538 + } else {
7539 + /* Just add it to the array */
7540 + oarray[i++] = curr;
7544 +#endif /* SORTLOOT */
7546 win = create_nhwindow(NHW_MENU);
7547 start_menu(win);
7548 any.a_obj = (struct obj *) 0;
7549 @@ -730,7 +861,12 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
7550 pack = flags.inv_order;
7551 do {
7552 printed_type_name = FALSE;
7553 +#ifdef SORTLOOT
7554 + for (i = 0; i < n; i++) {
7555 + curr = oarray[i];
7556 +#else /* SORTLOOT */
7557 for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
7558 +#endif /* SORTLOOT */
7559 if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE &&
7560 will_feel_cockatrice(curr, FALSE)) {
7561 destroy_nhwindow(win); /* stop the menu and revert */
7562 @@ -758,6 +894,9 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
7563 pack++;
7564 } while (qflags & INVORDER_SORT && *pack);
7566 +#ifdef SORTLOOT
7567 + free(oarray);
7568 +#endif
7569 end_menu(win, qstr);
7570 n = select_menu(win, how, pick_list);
7571 destroy_nhwindow(win);
7572 @@ -796,6 +935,13 @@ int how; /* type of query */
7573 boolean collected_type_name;
7574 char invlet;
7575 int ccount;
7576 +#ifdef ITEMCAT
7577 + boolean do_unident = FALSE;
7578 + boolean do_rustprone = FALSE;
7579 +#endif
7580 +#ifdef ITEMCAT_JP
7581 + boolean do_justpicked = FALSE;
7582 +#endif
7583 boolean do_unpaid = FALSE;
7584 boolean do_blessed = FALSE, do_cursed = FALSE, do_uncursed = FALSE,
7585 do_buc_unknown = FALSE;
7586 @@ -821,6 +967,19 @@ int how; /* type of query */
7587 num_buc_types++;
7590 +#ifdef ITEMCAT
7591 + if ((qflags & UNIDENTIFIED) && count_buc(olist, UNIDENTIFIED))
7592 + do_unident = TRUE;
7594 + if (iflags.like_swimming && (qflags & RUSTPRONE) && count_buc(olist, RUSTPRONE))
7595 + do_rustprone = TRUE;
7597 +#endif
7598 +#ifdef ITEMCAT_JP
7599 + if ((qflags & JUSTPICKED) && jpick_head!=(struct jpick *) 0)
7600 + do_justpicked = TRUE;
7601 +#endif
7603 ccount = count_categories(olist, qflags);
7604 /* no point in actually showing a menu for a single category */
7605 if (ccount == 1 && !do_unpaid && num_buc_types <= 1 && !(qflags & BILLED_TYPES)) {
7606 @@ -905,6 +1064,26 @@ int how; /* type of query */
7607 "Auto-select every item being worn" :
7608 "Auto-select every item", MENU_UNSELECTED);
7610 +#ifdef ITEMCAT_JP
7611 + if (do_justpicked) {
7612 + invlet = 'P';
7613 + any.a_void = 0;
7614 + any.a_int = 'P';
7615 + add_menu(win, NO_GLYPH, &any, invlet, 0, ATR_NONE,
7616 + *jpick_ctg,
7617 + MENU_UNSELECTED);
7619 +#endif /*ITEMCAT_JP*/
7620 +#ifdef ITEMCAT
7621 + if (do_unident) {
7622 + invlet = 'I';
7623 + any.a_void = 0;
7624 + any.a_int = 'I';
7625 + add_menu(win, NO_GLYPH, &any, invlet, 0, ATR_NONE,
7626 + "Unidentified Items",
7627 + MENU_UNSELECTED);
7629 +#endif /* ITEMCAT */
7630 /* items with b/u/c/unknown if there are any */
7631 if (do_blessed) {
7632 invlet = 'B';
7633 @@ -935,6 +1114,16 @@ int how; /* type of query */
7634 "Items of unknown B/C/U status",
7635 MENU_UNSELECTED);
7637 +#ifdef ITEMCAT
7638 + if (iflags.like_swimming && do_rustprone) {
7639 + invlet = 'r';
7640 + any.a_void = 0;
7641 + any.a_int = 'r';
7642 + add_menu(win, NO_GLYPH, &any, invlet, 0, ATR_NONE,
7643 + "Items known to be Rustprone",
7644 + MENU_UNSELECTED);
7646 +#endif /* ITEMCAT */
7647 end_menu(win, qstr);
7648 n = select_menu(win, how, pick_list);
7649 destroy_nhwindow(win);
7650 @@ -1301,7 +1490,13 @@ boolean telekinesis; /* not picking it up directly by hand */
7651 obj->quan -= count;
7653 flags.botl = 1;
7654 - if (flags.run) nomul(0);
7655 + if (flags.run) {
7656 + nomul(0
7657 +#ifdef HELPLESS
7658 + , 0
7659 +#endif
7660 + );
7662 return 1;
7663 #endif
7664 } else if (obj->otyp == CORPSE) {
7665 @@ -1373,6 +1568,9 @@ struct obj *
7666 pick_obj(otmp)
7667 struct obj *otmp;
7669 +#ifdef ITEMCAT_JP
7670 + struct jpick *pick;
7671 +#endif
7672 obj_extract_self(otmp);
7673 if (!u.uswallow && otmp != uball && costly_spot(otmp->ox, otmp->oy)) {
7674 char saveushops[5], fakeshop[2];
7675 @@ -1394,7 +1592,18 @@ struct obj *otmp;
7676 if (otmp->no_charge) /* only applies to objects outside invent */
7677 otmp->no_charge = 0;
7678 newsym(otmp->ox, otmp->oy);
7679 - return addinv(otmp); /* might merge it with other objects */
7680 +#ifdef ITEMCAT_JP
7681 + otmp=addinv(otmp); /* might merge it with other objects */
7682 + if(otmp->oclass!=COIN_CLASS) {
7683 + pick=(struct jpick *) alloc(sizeof(struct jpick));
7684 + pick->next_pick=jpick_head;
7685 + pick->o=otmp;
7686 + jpick_head=pick;
7688 + return otmp;
7689 +#else
7690 + return addinv(otmp);
7691 +#endif /* ITEMCAT_JP */
7695 @@ -1931,6 +2140,9 @@ register struct obj *obj;
7696 boolean is_gold = (obj->oclass == COIN_CLASS);
7697 int res, loadlev;
7698 long count;
7699 +#ifdef ITEMCAT_JP
7700 + struct jpick *pick;
7701 +#endif
7703 if (!current_container) {
7704 impossible("<out> no current_container?");
7705 @@ -1985,6 +2197,14 @@ register struct obj *obj;
7706 verbalize("You sneaky cad! Get out of here with that pick!");
7708 otmp = addinv(obj);
7709 +#ifdef ITEMCAT_JP
7710 + if(!is_gold) {
7711 + pick=(struct jpick *) alloc(sizeof(struct jpick));
7712 + pick->next_pick=jpick_head;
7713 + pick->o=otmp;
7714 + jpick_head=pick;
7716 +#endif
7717 loadlev = near_capacity();
7718 prinv(loadlev ?
7719 (loadlev < MOD_ENCUMBER ?
7720 @@ -2101,7 +2321,11 @@ register int held;
7721 (void) chest_trap(obj, HAND, FALSE);
7722 /* even if the trap fails, you've used up this turn */
7723 if (multi >= 0) { /* in case we didn't become paralyzed */
7724 - nomul(-1);
7725 + nomul(-1
7726 +#ifdef HELPLESS
7727 + , "opening a container"
7728 +#endif
7729 + );
7730 nomovemsg = "";
7732 return 1;
7733 @@ -2186,6 +2410,14 @@ ask_again2:
7734 FALSE,
7735 #endif
7736 &menu_on_request)) {
7737 +#ifdef ITEMCAT_JP
7738 + /* normally one wouldn't use traditional + itemcat_jp,
7739 + * so we don't make extra checks whether something
7740 + * relevant was in fact picked up, just destroy the
7741 + * list for consistency. */
7742 + jpick_ctg=&ctg_justremoved;
7743 + DESTROY_JPICK(&jpick_head)
7744 +#endif
7745 if (askchain((struct obj **)&current_container->cobj,
7746 (one_by_one ? (char *)0 : select),
7747 allflag, out_container,
7748 @@ -2311,14 +2543,27 @@ boolean put_in;
7749 menu_item *pick_list;
7750 int mflags, res;
7751 long count;
7752 +#ifdef ITEMCAT_JP
7753 + struct jpick *jtmp;
7754 +#endif
7756 if (retry) {
7757 all_categories = (retry == -2);
7758 } else if (flags.menu_style == MENU_FULL) {
7759 all_categories = FALSE;
7760 Sprintf(buf,"%s what type of objects?", put_in ? putin : takeout);
7761 - mflags = put_in ? ALL_TYPES | BUC_ALLBKNOWN | BUC_UNKNOWN :
7762 - ALL_TYPES | CHOOSE_ALL | BUC_ALLBKNOWN | BUC_UNKNOWN;
7763 + mflags = put_in ? ALL_TYPES | BUC_ALLBKNOWN | BUC_UNKNOWN
7764 +#ifdef ITEMCAT_JP
7765 + | JUSTPICKED
7766 +#endif
7767 +#ifdef ITEMCAT
7768 + | UNIDENTIFIED | RUSTPRONE
7769 +#endif
7770 + : ALL_TYPES | CHOOSE_ALL | BUC_ALLBKNOWN | BUC_UNKNOWN
7771 +#ifdef ITEMCAT
7772 + | UNIDENTIFIED | RUSTPRONE
7773 +#endif
7775 n = query_category(buf, put_in ? invent : container->cobj,
7776 mflags, &pick_list, PICK_ANY);
7777 if (!n) return 0;
7778 @@ -2334,11 +2579,22 @@ boolean put_in;
7781 if (loot_everything) {
7782 +#ifdef ITEMCAT_JP
7783 + jtmp=jpick_head;
7784 + jpick_head=(struct jpick *) 0;
7785 +#endif
7786 for (otmp = container->cobj; otmp; otmp = otmp2) {
7787 otmp2 = otmp->nobj;
7788 res = out_container(otmp);
7789 if (res < 0) break;
7791 +#ifdef ITEMCAT_JP
7792 + if(jpick_head) {
7793 + jpick_ctg=&ctg_justremoved;
7794 + DESTROY_JPICK(&jtmp)
7795 + } else
7796 + jpick_head=jtmp;
7797 +#endif
7798 } else {
7799 mflags = INVORDER_SORT;
7800 if (put_in && flags.invlet_constant) mflags |= USE_INVLET;
7801 @@ -2348,6 +2604,12 @@ boolean put_in;
7802 all_categories ? allow_all : allow_category);
7803 if (n) {
7804 n_looted = n;
7805 +#ifdef ITEMCAT_JP
7806 + if(!put_in) {
7807 + jtmp=jpick_head;
7808 + jpick_head=(struct jpick *) 0;
7810 +#endif
7811 for (i = 0; i < n; i++) {
7812 otmp = pick_list[i].item.a_obj;
7813 count = pick_list[i].count;
7814 @@ -2364,6 +2626,15 @@ boolean put_in;
7815 break;
7818 +#ifdef ITEMCAT_JP
7819 + if(!put_in) {
7820 + if(jpick_head) {
7821 + jpick_ctg=&ctg_justremoved;
7822 + DESTROY_JPICK(&jtmp)
7823 + } else
7824 + jpick_head=jtmp;
7826 +#endif
7827 free((genericptr_t)pick_list);
7830 diff --git a/src/pline.c b/src/pline.c
7831 index 8210f8d..9a29931 100644
7832 --- a/src/pline.c
7833 +++ b/src/pline.c
7834 @@ -15,6 +15,11 @@ static boolean no_repeat = FALSE;
7836 static char *FDECL(You_buf, (int));
7838 +#if defined(DUMP_LOG) && defined(DUMPMSGS)
7839 +char msgs[DUMPMSGS][BUFSZ];
7840 +int lastmsg = -1;
7841 +#endif
7843 /*VARARGS1*/
7844 /* Note that these declarations rely on knowledge of the internals
7845 * of the variable argument handling stuff in "tradstdc.h"
7846 @@ -55,6 +60,12 @@ pline VA_DECL(const char *, line)
7847 Vsprintf(pbuf,line,VA_ARGS);
7848 line = pbuf;
7850 +#if defined(DUMP_LOG) && defined(DUMPMSGS)
7851 + if (DUMPMSGS > 0 && !program_state.gameover) {
7852 + lastmsg = (lastmsg + 1) % DUMPMSGS;
7853 + strncpy(msgs[lastmsg], line, BUFSZ);
7855 +#endif
7856 if (!iflags.window_inited) {
7857 raw_print(line);
7858 return;
7859 diff --git a/src/polyself.c b/src/polyself.c
7860 index b051acb..64939fb 100644
7861 --- a/src/polyself.c
7862 +++ b/src/polyself.c
7863 @@ -729,7 +729,11 @@ rehumanize()
7864 done(DIED);
7866 if (!uarmg) selftouch("No longer petrify-resistant, you");
7867 - nomul(0);
7868 + nomul(0
7869 +#ifdef HELPLESS
7870 + , 0
7871 +#endif
7872 + );
7874 flags.botl = 1;
7875 vision_full_recalc = 1;
7876 @@ -1019,7 +1023,11 @@ dogaze()
7877 nomul((u.ulevel > 6 || rn2(4)) ?
7878 -d((int)mtmp->m_lev+1,
7879 (int)mtmp->data->mattk[0].damd)
7880 - : -200);
7881 + : -200
7882 +#ifdef HELPLESS
7883 + , "frozen by a monster's gaze"
7884 +#endif
7885 + );
7886 return 1;
7887 } else
7888 You("stiffen momentarily under %s gaze.",
7889 diff --git a/src/potion.c b/src/potion.c
7890 index 04abd41..2163443 100644
7891 --- a/src/potion.c
7892 +++ b/src/potion.c
7893 @@ -316,7 +316,11 @@ ghost_from_bottle()
7894 Hallucination ? rndmonnam() : (const char *)"ghost");
7895 if(flags.verbose)
7896 You("are frightened to death, and unable to move.");
7897 - nomul(-3);
7898 + nomul(-3
7899 +#ifdef HELPLESS
7900 + , "being frightened to death"
7901 +#endif
7902 + );
7903 nomovemsg = "You regain your composure.";
7906 @@ -603,7 +607,11 @@ peffects(otmp)
7907 else
7908 Your("%s are frozen to the %s!",
7909 makeplural(body_part(FOOT)), surface(u.ux, u.uy));
7910 - nomul(-(rn1(10, 25 - 12*bcsign(otmp))));
7911 + nomul(-(rn1(10, 25 - 12*bcsign(otmp)))
7912 +#ifdef HELPLESS
7913 + , "frozen by a potion"
7914 +#endif
7915 + );
7916 nomovemsg = You_can_move_again;
7917 exercise(A_DEX, FALSE);
7919 @@ -1255,7 +1263,11 @@ register struct obj *obj;
7920 kn++;
7921 if (!Free_action) {
7922 pline("%s seems to be holding you.", Something);
7923 - nomul(-rnd(5));
7924 + nomul(-rnd(5)
7925 +#ifdef HELPLESS
7926 + , "frozen by a potion"
7927 +#endif
7928 + );
7929 nomovemsg = You_can_move_again;
7930 exercise(A_DEX, FALSE);
7931 } else You("stiffen momentarily.");
7932 @@ -1264,7 +1276,11 @@ register struct obj *obj;
7933 kn++;
7934 if (!Free_action && !Sleep_resistance) {
7935 You_feel("rather tired.");
7936 - nomul(-rnd(5));
7937 + nomul(-rnd(5)
7938 +#ifdef HELPLESS
7939 + , "sleeping off a magical draught"
7940 +#endif
7941 + );
7942 nomovemsg = You_can_move_again;
7943 exercise(A_DEX, FALSE);
7944 } else You("yawn.");
7945 @@ -1539,13 +1555,22 @@ dodip()
7946 here = levl[u.ux][u.uy].typ;
7947 /* Is there a fountain to dip into here? */
7948 if (IS_FOUNTAIN(here)) {
7949 +#ifdef PARANOID
7950 + Sprintf(qbuf, "Dip %s into the fountain?", the(xname(obj)));
7951 + if(yn(qbuf) == 'y') {
7952 +#else
7953 if(yn("Dip it into the fountain?") == 'y') {
7954 +#endif
7955 dipfountain(obj);
7956 return(1);
7958 } else if (is_pool(u.ux,u.uy)) {
7959 tmp = waterbody_name(u.ux,u.uy);
7960 +#ifdef PARANOID
7961 + Sprintf(qbuf, "Dip %s into the %s?", the(xname(obj)), tmp);
7962 +#else
7963 Sprintf(qbuf, "Dip it into the %s?", tmp);
7964 +#endif
7965 if (yn(qbuf) == 'y') {
7966 if (Levitation) {
7967 floating_above(tmp);
7968 @@ -1562,7 +1587,12 @@ dodip()
7972 +#ifdef PARANOID
7973 + Sprintf(qbuf, "dip %s into", the(xname(obj)));
7974 + if(!(potion = getobj(beverages, qbuf)))
7975 +#else
7976 if(!(potion = getobj(beverages, "dip into")))
7977 +#endif
7978 return(0);
7979 if (potion == obj && potion->quan == 1L) {
7980 pline("That is a potion bottle, not a Klein bottle!");
7981 diff --git a/src/pray.c b/src/pray.c
7982 index 0df2855..449ab8c 100644
7983 --- a/src/pray.c
7984 +++ b/src/pray.c
7985 @@ -1206,7 +1206,11 @@ dosacrifice()
7986 if (sgn(u.ualign.type) == sgn(dmon->data->maligntyp))
7987 dmon->mpeaceful = TRUE;
7988 You("are terrified, and unable to move.");
7989 - nomul(-3);
7990 + nomul(-3
7991 +#ifdef HELPLESS
7992 + , "being terrified of a demon"
7993 +#endif
7994 + );
7995 } else pline_The("%s.", demonless_msg);
7998 @@ -1579,7 +1583,11 @@ dopray()
8001 #endif
8002 - nomul(-3);
8003 + nomul(-3
8004 +#ifdef HELPLESS
8005 + , "praying"
8006 +#endif
8007 + );
8008 nomovemsg = "You finish your prayer.";
8009 afternmv = prayer_done;
8011 @@ -1739,7 +1747,11 @@ doturn()
8015 - nomul(-5);
8016 + nomul(-5
8017 +#ifdef HELPLESS
8018 + , "trying to turn the monsters"
8019 +#endif
8020 + );
8021 return(1);
8024 diff --git a/src/priest.c b/src/priest.c
8025 index 5681930..d8c2e50 100644
8026 --- a/src/priest.c
8027 +++ b/src/priest.c
8028 @@ -393,7 +393,11 @@ register int roomno;
8029 set_malign(mtmp);
8030 if(flags.verbose)
8031 You("are frightened to death, and unable to move.");
8032 - nomul(-3);
8033 + nomul(-3
8034 +#ifdef HELPLESS
8035 + , "frightened to death"
8036 +#endif
8037 + );
8038 nomovemsg = "You regain your composure.";
8041 diff --git a/src/role.c b/src/role.c
8042 index c751d10..8ea9eaa 100644
8043 --- a/src/role.c
8044 +++ b/src/role.c
8045 @@ -196,7 +196,11 @@ const struct Role roles[] = {
8046 PM_ARCH_PRIEST, PM_ACOLYTE, PM_NALZOK,
8047 PM_HUMAN_ZOMBIE, PM_WRAITH, S_ZOMBIE, S_WRAITH,
8048 ART_MITRE_OF_HOLINESS,
8049 +#ifdef PRIEST_RACES
8050 + MH_HUMAN|MH_ORC|MH_GNOME|MH_DWARF|MH_ELF | ROLE_MALE|ROLE_FEMALE |
8051 +#else
8052 MH_HUMAN|MH_ELF | ROLE_MALE|ROLE_FEMALE |
8053 +#endif
8054 ROLE_LAWFUL|ROLE_NEUTRAL|ROLE_CHAOTIC,
8055 /* Str Int Wis Dex Con Cha */
8056 { 7, 7, 10, 7, 7, 7 },
8057 diff --git a/src/save.c b/src/save.c
8058 index 9291eb9..2c9a5dc 100644
8059 --- a/src/save.c
8060 +++ b/src/save.c
8061 @@ -48,6 +48,10 @@ static long nulls[10];
8062 #define HUP
8063 #endif
8065 +#ifdef MENU_COLOR
8066 +extern struct menucoloring *menu_colorings;
8067 +#endif
8069 /* need to preserve these during save to avoid accessing freed memory */
8070 static unsigned ustuck_id = 0, usteed_id = 0;
8072 @@ -57,7 +61,11 @@ dosave()
8073 clear_nhwindow(WIN_MESSAGE);
8074 if(yn("Really save?") == 'n') {
8075 clear_nhwindow(WIN_MESSAGE);
8076 - if(multi > 0) nomul(0);
8077 + if(multi > 0) nomul(0
8078 +#ifdef HELPLESS
8079 + , 0
8080 +#endif
8081 + );
8082 } else {
8083 clear_nhwindow(WIN_MESSAGE);
8084 pline("Saving...");
8085 @@ -953,12 +961,34 @@ free_dungeons()
8086 return;
8089 +#ifdef MENU_COLOR
8090 +void
8091 +free_menu_coloring()
8093 + struct menucoloring *tmp = menu_colorings;
8095 + while (tmp) {
8096 + struct menucoloring *tmp2 = tmp->next;
8097 +# ifdef MENU_COLOR_REGEX
8098 + (void) regfree(&tmp->match);
8099 +# else
8100 + free(tmp->match);
8101 +# endif
8102 + free(tmp);
8103 + tmp = tmp2;
8106 +#endif /* MENU_COLOR */
8108 void
8109 freedynamicdata()
8111 unload_qtlist();
8112 free_invbuf(); /* let_to_name (invent.c) */
8113 free_youbuf(); /* You_buf,&c (pline.c) */
8114 +#ifdef MENU_COLOR
8115 + free_menu_coloring();
8116 +#endif
8117 tmp_at(DISP_FREEMEM, 0); /* temporary display effects */
8118 #ifdef FREE_ALL_MEMORY
8119 # define freeobjchn(X) (saveobjchn(0, X, FREE_SAVE), X = 0)
8120 diff --git a/src/shk.c b/src/shk.c
8121 index 53c868b..296d43f 100644
8122 --- a/src/shk.c
8123 +++ b/src/shk.c
8124 @@ -833,6 +833,12 @@ register struct obj *obj, *merge;
8125 #endif
8129 + /* fix for C343-218, C343-275 and C343-276 */
8130 + if (obj == uwep) uwepgone();
8131 + if (obj == uswapwep) uswapwepgone();
8132 + if (obj == uquiver) uqwepgone();
8134 dealloc_obj(obj);
8136 #endif /* OVLB */
8137 diff --git a/src/sounds.c b/src/sounds.c
8138 index ebd51aa..7e9ff7e 100644
8139 --- a/src/sounds.c
8140 +++ b/src/sounds.c
8141 @@ -325,7 +325,11 @@ register struct monst *mtmp;
8142 growl_verb = growl_sound(mtmp);
8143 if (growl_verb) {
8144 pline("%s %s!", Monnam(mtmp), vtense((char *)0, growl_verb));
8145 - if(flags.run) nomul(0);
8146 + if(flags.run) nomul(0
8147 +#ifdef HELPLESS
8148 + , 0
8149 +#endif
8150 + );
8151 wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 18);
8154 @@ -366,7 +370,11 @@ register struct monst *mtmp;
8156 if (yelp_verb) {
8157 pline("%s %s!", Monnam(mtmp), vtense((char *)0, yelp_verb));
8158 - if(flags.run) nomul(0);
8159 + if(flags.run) nomul(0
8160 +#ifdef HELPLESS
8161 + , 0
8162 +#endif
8163 + );
8164 wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 12);
8167 @@ -398,7 +406,11 @@ register struct monst *mtmp;
8169 if (whimper_verb) {
8170 pline("%s %s.", Monnam(mtmp), vtense((char *)0, whimper_verb));
8171 - if(flags.run) nomul(0);
8172 + if(flags.run) nomul(0
8173 +#ifdef HELPLESS
8174 + , 0
8175 +#endif
8176 + );
8177 wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 6);
8180 @@ -627,7 +639,11 @@ register struct monst *mtmp;
8181 case MS_BONES:
8182 pline("%s rattles noisily.", Monnam(mtmp));
8183 You("freeze for a moment.");
8184 - nomul(-2);
8185 + nomul(-2
8186 +#ifdef HELPLESS
8187 + , "scared by rattling"
8188 +#endif
8189 + );
8190 break;
8191 case MS_LAUGH:
8193 diff --git a/src/spell.c b/src/spell.c
8194 index 4659cfa..c0f478b 100644
8195 --- a/src/spell.c
8196 +++ b/src/spell.c
8197 @@ -325,7 +325,11 @@ learn()
8198 if (Confusion) { /* became confused while learning */
8199 (void) confused_book(book);
8200 book = 0; /* no longer studying */
8201 - nomul(delay); /* remaining delay is uninterrupted */
8202 + nomul(delay
8203 +#ifdef HELPLESS
8204 + , "reading a book"
8205 +#endif
8206 + ); /* remaining delay is uninterrupted */
8207 delay = 0;
8208 return(0);
8210 @@ -463,7 +467,11 @@ register struct obj *spellbook;
8211 if (too_hard) {
8212 boolean gone = cursed_book(spellbook);
8214 - nomul(delay); /* study time */
8215 + nomul(delay
8216 +#ifdef HELPLESS
8217 + , "reading a book"
8218 +#endif
8219 + ); /* study time */
8220 delay = 0;
8221 if(gone || !rn2(3)) {
8222 if (!gone) pline_The("spellbook crumbles to dust!");
8223 @@ -478,7 +486,11 @@ register struct obj *spellbook;
8224 if (!confused_book(spellbook)) {
8225 spellbook->in_use = FALSE;
8227 - nomul(delay);
8228 + nomul(delay
8229 +#ifdef HELPLESS
8230 + , "reading a book"
8231 +#endif
8232 + );
8233 delay = 0;
8234 return(1);
8236 @@ -1114,6 +1126,35 @@ int *spell_no;
8237 return FALSE;
8240 +#ifdef DUMP_LOG
8241 +void
8242 +dump_spells()
8244 + int i;
8245 + char buf[BUFSZ];
8247 + if (spellid(0) == NO_SPELL) {
8248 + dump("", "You didn't know any spells.");
8249 + dump("", "");
8250 + return;
8252 + dump("", "Spells known in the end");
8254 + Sprintf(buf, "%-20s Level %-12s Fail", " Name", "Category");
8255 + dump(" ",buf);
8256 + for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) {
8257 + Sprintf(buf, "%c - %-20s %2d%s %-12s %3d%%",
8258 + spellet(i), spellname(i), spellev(i),
8259 + spellknow(i) ? " " : "*",
8260 + spelltypemnemonic(spell_skilltype(spellid(i))),
8261 + 100 - percent_success(i));
8262 + dump(" ", buf);
8264 + dump("","");
8266 +} /* dump_spells */
8267 +#endif
8269 /* Integer square root function without using floating point. */
8270 STATIC_OVL int
8271 isqrt(val)
8272 diff --git a/src/steal.c b/src/steal.c
8273 index 1feed77..0a55c22 100644
8274 --- a/src/steal.c
8275 +++ b/src/steal.c
8276 @@ -382,7 +382,11 @@ gotobj:
8277 equipname(otmp));
8278 named++;
8279 /* the following is to set multi for later on */
8280 - nomul(-armordelay);
8281 + nomul(-armordelay
8282 +#ifdef HELPLESS
8283 + , "taking off clothes"
8284 +#endif
8285 + );
8286 remove_worn_item(otmp, TRUE);
8287 otmp->cursed = curssv;
8288 if(multi < 0){
8289 diff --git a/src/teleport.c b/src/teleport.c
8290 index c913e3c..219c8af 100644
8291 --- a/src/teleport.c
8292 +++ b/src/teleport.c
8293 @@ -326,7 +326,11 @@ boolean allow_drag;
8294 newsym(u.ux0,u.uy0);
8295 see_monsters();
8296 vision_full_recalc = 1;
8297 - nomul(0);
8298 + nomul(0
8299 +#ifdef HELPLESS
8300 + , 0
8301 +#endif
8302 + );
8303 vision_recalc(0); /* vision before effects */
8304 spoteffects(TRUE);
8305 invocation_message();
8306 diff --git a/src/timeout.c b/src/timeout.c
8307 index 6a336d6..13eb4eb 100644
8308 --- a/src/timeout.c
8309 +++ b/src/timeout.c
8310 @@ -35,7 +35,11 @@ stoned_dialogue()
8311 if (i == 5L)
8312 HFast = 0L;
8313 if (i == 3L)
8314 - nomul(-3);
8315 + nomul(-3
8316 +#ifdef HELPLESS
8317 + , "getting stoned"
8318 +#endif
8319 + );
8320 exercise(A_DEX, FALSE);
8323 @@ -137,7 +141,11 @@ slime_dialogue()
8324 if (i == 3L) { /* limbs becoming oozy */
8325 HFast = 0L; /* lose intrinsic speed */
8326 stop_occupation();
8327 - if (multi > 0) nomul(0);
8328 + if (multi > 0) nomul(0
8329 +#ifdef HELPLESS
8330 + , 0
8331 +#endif
8332 + );
8334 exercise(A_DEX, FALSE);
8336 @@ -327,7 +335,11 @@ nh_timeout()
8337 /* otherwise handle fumbling msgs locally. */
8338 if (u.umoved && !Levitation) {
8339 slip_or_trip();
8340 - nomul(-2);
8341 + nomul(-2
8342 +#ifdef HELPLESS
8343 + , "fumbling"
8344 +#endif
8345 + );
8346 nomovemsg = "";
8347 /* The more you are carrying the more likely you
8348 * are to make noise when you fumble. Adjustments
8349 @@ -362,7 +374,11 @@ int how_long;
8350 boolean wakeup_msg;
8352 stop_occupation();
8353 - nomul(how_long);
8354 + nomul(how_long
8355 +#ifdef HELPLESS
8356 + , "sleeping"
8357 +#endif
8358 + );
8359 /* generally don't notice sounds while sleeping */
8360 if (wakeup_msg && multi == how_long) {
8361 /* caller can follow with a direct call to Hear_again() if
8362 @@ -1220,7 +1236,11 @@ do_storms()
8363 pline("Kaboom!!! Boom!! Boom!!");
8364 if(!u.uinvulnerable) {
8365 stop_occupation();
8366 - nomul(-3);
8367 + nomul(-3
8368 +#ifdef HELPLESS
8369 + , "hiding from thunderstorm"
8370 +#endif
8371 + );
8373 } else
8374 You_hear("a rumbling noise.");
8375 diff --git a/src/topten.c b/src/topten.c
8376 index 19a0488..0627461 100644
8377 --- a/src/topten.c
8378 +++ b/src/topten.c
8379 @@ -31,14 +31,14 @@ static long final_fpos;
8380 #define newttentry() (struct toptenentry *) alloc(sizeof(struct toptenentry))
8381 #define dealloc_ttentry(ttent) free((genericptr_t) (ttent))
8382 #define NAMSZ 10
8383 -#define DTHSZ 100
8384 +#define DTHSZ 132
8385 #define ROLESZ 3
8386 #define PERSMAX 3 /* entries per name/uid per char. allowed */
8387 #define POINTSMIN 1 /* must be > 0 */
8388 #define ENTRYMAX 100 /* must be >= 10 */
8390 #if !defined(MICRO) && !defined(MAC) && !defined(WIN32)
8391 -#define PERS_IS_UID /* delete for PERSMAX per name; now per uid */
8392 +/*#define PERS_IS_UID*/ /* delete for PERSMAX per name; now per uid */
8393 #endif
8394 struct toptenentry {
8395 struct toptenentry *tt_next;
8396 @@ -252,6 +252,7 @@ int how;
8397 FILE *rfile;
8398 register int flg = 0;
8399 boolean t0_used;
8400 + char buf[15];
8401 #ifdef LOGFILE
8402 FILE *lfile;
8403 #endif /* LOGFILE */
8404 @@ -331,6 +332,16 @@ int how;
8405 (void) strncat(t0->death, killer, DTHSZ);
8406 break;
8408 +#ifdef LOG_MOVES
8409 + /* jl 08.2000 - 09.2003 */
8410 + sprintf(buf," {%ld}",moves);
8411 + if (strlen(t0->death) + strlen(buf) < DTHSZ)
8412 + Strcat(t0->death, buf);
8413 + if (wizard && strlen(t0->death) < DTHSZ - 6)
8414 + Strcat(t0->death, " {wiz}");
8415 + if (discover && strlen(t0->death) < DTHSZ - 6)
8416 + Strcat(t0->death, " {exp}");
8417 +#endif
8418 t0->birthdate = yyyymmdd(u.ubirthday);
8419 t0->deathdate = yyyymmdd((time_t)0L);
8420 t0->tt_next = 0;
8421 @@ -358,9 +369,29 @@ int how;
8422 "Since you were in %s mode, the score list will not be checked.",
8423 wizard ? "wizard" : "discover");
8424 topten_print(pbuf);
8425 +#ifdef DUMP_LOG
8426 + if (dump_fn[0]) {
8427 + dump("", pbuf);
8428 + dump("", "");
8430 +#endif
8432 goto showwin;
8434 +#ifdef FORGET_QUITTER
8435 + if (how == QUIT) {
8436 + char pbuf[]="Since you quit, the score list will not be checked.";
8437 + topten_print("");
8438 + topten_print(pbuf);
8439 +#ifdef DUMP_LOG
8440 + if (dump_fn) {
8441 + dump("", "");
8442 + dump("", pbuf);
8444 +#endif
8445 + goto showwin;
8447 +#endif
8449 if (!lock_file(RECORD, SCOREPREFIX, 60))
8450 goto destroywin;
8451 @@ -378,6 +409,9 @@ int how;
8454 HUP topten_print("");
8455 +#ifdef DUMP_LOG
8456 + dump("", "");
8457 +#endif
8459 /* assure minimum number of points */
8460 if(t0->points < POINTSMIN) t0->points = 0;
8461 @@ -422,6 +456,10 @@ int how;
8462 t1->points);
8463 topten_print(pbuf);
8464 topten_print("");
8465 +#ifdef DUMP_LOG
8466 + dump("", pbuf);
8467 + dump("", "");
8468 +#endif
8471 if(occ_cnt < 0) {
8472 @@ -452,17 +490,27 @@ int how;
8473 goto destroywin;
8475 #endif /* UPDATE_RECORD_IN_PLACE */
8476 - if(!done_stopprint) if(rank0 > 0){
8477 - if(rank0 <= 10)
8478 + if(rank0 > 0){
8479 + if(rank0 <= 10) {
8480 + if(!done_stopprint)
8481 topten_print("You made the top ten list!");
8482 - else {
8483 +#ifdef DUMP_LOG
8484 + dump("", "You made the top ten list!");
8485 +#endif
8486 + } else {
8487 char pbuf[BUFSZ];
8488 Sprintf(pbuf,
8489 "You reached the %d%s place on the top %d list.",
8490 rank0, ordin(rank0), ENTRYMAX);
8491 - topten_print(pbuf);
8492 + if(!done_stopprint) topten_print(pbuf);
8493 +#ifdef DUMP_LOG
8494 + dump("", pbuf);
8495 +#endif
8497 - topten_print("");
8498 + if(!done_stopprint) topten_print("");
8499 +#ifdef DUMP_LOG
8500 + dump("", "");
8501 +#endif
8504 if(rank0 == 0) rank0 = rank1;
8505 @@ -475,7 +523,7 @@ int how;
8506 && rank >= rank0
8507 #endif
8508 ) writeentry(rfile, t1);
8509 - if (done_stopprint) continue;
8510 + /* if (done_stopprint) continue; */
8511 if (rank > flags.end_top &&
8512 (rank < rank0 - flags.end_around ||
8513 rank > rank0 + flags.end_around) &&
8514 @@ -488,8 +536,12 @@ int how;
8515 )) continue;
8516 if (rank == rank0 - flags.end_around &&
8517 rank0 > flags.end_top + flags.end_around + 1 &&
8518 - !flags.end_own)
8519 - topten_print("");
8520 + !flags.end_own) {
8521 + if(!done_stopprint) topten_print("");
8522 +#ifdef DUMP_LOG
8523 + dump("", "");
8524 +#endif
8526 if(rank != rank0)
8527 outentry(rank, t1, FALSE);
8528 else if(!rank1)
8529 @@ -546,7 +598,10 @@ outheader()
8530 bp = eos(linebuf);
8531 while(bp < linebuf + COLNO - 9) *bp++ = ' ';
8532 Strcpy(bp, "Hp [max]");
8533 - topten_print(linebuf);
8534 + if(!done_stopprint) topten_print(linebuf);
8535 +#ifdef DUMP_LOG
8536 + dump("", linebuf);
8537 +#endif
8540 /* so>0: standout line; so=0: ordinary line */
8541 @@ -664,9 +719,16 @@ boolean so;
8542 if (so) {
8543 while (bp < linebuf + (COLNO-1)) *bp++ = ' ';
8544 *bp = 0;
8545 - topten_print_bold(linebuf);
8546 - } else
8547 - topten_print(linebuf);
8548 + if(!done_stopprint) topten_print_bold(linebuf);
8549 +#ifdef DUMP_LOG
8550 + dump("*", linebuf[0]==' '? linebuf+1: linebuf);
8551 +#endif
8552 + } else {
8553 + if(!done_stopprint) topten_print(linebuf);
8554 +#ifdef DUMP_LOG
8555 + dump(" ", linebuf[0]==' '? linebuf+1: linebuf);
8556 +#endif
8558 Sprintf(linebuf, "%15s %s", "", linebuf3);
8559 lngr = strlen(linebuf);
8561 @@ -688,9 +750,12 @@ boolean so;
8562 if (so >= COLNO) so = COLNO-1;
8563 while (bp < linebuf + so) *bp++ = ' ';
8564 *bp = 0;
8565 - topten_print_bold(linebuf);
8566 + if(!done_stopprint) topten_print_bold(linebuf);
8567 } else
8568 - topten_print(linebuf);
8569 + if(!done_stopprint) topten_print(linebuf);
8570 +#ifdef DUMP_LOG
8571 + dump(" ", linebuf[0]==' '? linebuf+1: linebuf);
8572 +#endif
8575 STATIC_OVL int
8576 diff --git a/src/trap.c b/src/trap.c
8577 index d336276..0f55bf6 100644
8578 --- a/src/trap.c
8579 +++ b/src/trap.c
8580 @@ -591,7 +591,11 @@ unsigned trflags;
8581 boolean webmsgok = (!(trflags & NOWEBMSG));
8582 boolean forcebungle = (trflags & FORCEBUNGLE);
8584 - nomul(0);
8585 + nomul(0
8586 +#ifdef HELPLESS
8587 + , 0
8588 +#endif
8589 + );
8591 /* KMH -- You can't escape the Sokoban level traps */
8592 if (In_sokoban(&u.uz) &&
8593 @@ -1415,7 +1419,11 @@ int style;
8594 break;
8596 } else if (bhitpos.x == u.ux && bhitpos.y == u.uy) {
8597 - if (multi) nomul(0);
8598 + if (multi) nomul(0
8599 +#ifdef HELPLESS
8600 + , 0
8601 +#endif
8602 + );
8603 if (thitu(9 + singleobj->spe,
8604 dmgval(singleobj, &youmonst),
8605 singleobj, (char *)0))
8606 @@ -2678,12 +2686,15 @@ xchar x, y;
8607 return retval;
8610 -void
8611 +/* returns TRUE if obj is destroyed */
8612 +boolean
8613 water_damage(obj, force, here)
8614 register struct obj *obj;
8615 register boolean force, here;
8617 struct obj *otmp;
8618 + struct obj *obj_original = obj;
8619 + boolean obj_destroyed = FALSE;
8621 /* Scrolls, spellbooks, potions, weapons and
8622 pieces of armor may get affected by the water */
8623 @@ -2724,6 +2735,7 @@ register boolean force, here;
8624 /* damage player/monster? */
8625 pline("A potion explodes!");
8626 delobj(obj);
8627 + obj_destroyed = (obj == obj_original);
8628 continue;
8629 } else if (obj->odiluted) {
8630 obj->otyp = POT_WATER;
8631 @@ -2740,7 +2752,9 @@ register boolean force, here;
8632 (uarmc->cursed && !rn2(3)))
8633 obj->oeroded++;
8635 + obj_destroyed = FALSE;
8637 + return obj_destroyed;
8641 @@ -3741,7 +3755,11 @@ boolean disarm;
8642 case 3:
8643 if (!Free_action) {
8644 pline("Suddenly you are frozen in place!");
8645 - nomul(-d(5, 6));
8646 + nomul(-d(5, 6)
8647 +#ifdef HELPLESS
8648 + , "frozen by a trap"
8649 +#endif
8650 + );
8651 exercise(A_DEX, FALSE);
8652 nomovemsg = You_can_move_again;
8653 } else You("momentarily stiffen.");
8654 diff --git a/src/uhitm.c b/src/uhitm.c
8655 index 3dd028a..ce9501f 100644
8656 --- a/src/uhitm.c
8657 +++ b/src/uhitm.c
8658 @@ -99,6 +99,9 @@ register struct monst *mtmp;
8659 struct obj *wep; /* uwep for attack(), null for kick_monster() */
8661 char qbuf[QBUFSZ];
8662 +#ifdef PARANOID
8663 + char buf[BUFSZ];
8664 +#endif
8666 /* if you're close enough to attack, alert any waiting monster */
8667 mtmp->mstrategy &= ~STRAT_WAITMASK;
8668 @@ -199,11 +202,26 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
8669 return(FALSE);
8671 if (canspotmon(mtmp)) {
8672 +#ifdef PARANOID
8673 + Sprintf(qbuf, "Really attack %s? [no/yes]",
8674 + mon_nam(mtmp));
8675 + if (iflags.paranoid_hit) {
8676 + getlin (qbuf, buf);
8677 + (void) lcase (buf);
8678 + if (strcmp (buf, "yes")) {
8679 + flags.move = 0;
8680 + return(TRUE);
8682 + } else {
8683 +#endif
8684 Sprintf(qbuf, "Really attack %s?", mon_nam(mtmp));
8685 if (yn(qbuf) != 'y') {
8686 flags.move = 0;
8687 return(TRUE);
8689 +#ifdef PARANOID
8691 +#endif
8695 @@ -1813,7 +1831,11 @@ register struct attack *mattk;
8697 You("digest %s.", mon_nam(mdef));
8698 if (Slow_digestion) tmp *= 2;
8699 - nomul(-tmp);
8700 + nomul(-tmp
8701 +#ifdef HELPLESS
8702 + , "digesting something"
8703 +#endif
8704 + );
8705 nomovemsg = msgbuf;
8706 } else pline("%s", msgbuf);
8707 if (mdef->data == &mons[PM_GREEN_SLIME]) {
8708 @@ -2267,7 +2289,11 @@ uchar aatyp;
8709 else {
8710 You("are frozen by %s gaze!",
8711 s_suffix(mon_nam(mon)));
8712 - nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127);
8713 + nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127
8714 +#ifdef HELPLESS
8715 + , "frozen by a monster's gaze"
8716 +#endif
8717 + );
8719 } else {
8720 pline("%s cannot defend itself.",
8721 @@ -2279,7 +2305,11 @@ uchar aatyp;
8722 } else { /* gelatinous cube */
8723 You("are frozen by %s!", mon_nam(mon));
8724 nomovemsg = 0; /* default: "you can move again" */
8725 - nomul(-tmp);
8726 + nomul(-tmp
8727 +#ifdef HELPLESS
8728 + , "frozen by a monster"
8729 +#endif
8730 + );
8731 exercise(A_DEX, FALSE);
8733 break;
8734 diff --git a/src/vault.c b/src/vault.c
8735 index 8f8b27e..5fdd2c4 100644
8736 --- a/src/vault.c
8737 +++ b/src/vault.c
8738 @@ -260,7 +260,14 @@ fnd:
8741 stop_occupation(); /* if occupied, stop it *now* */
8742 - if (multi > 0) { nomul(0); unmul((char *)0); }
8743 + if (multi > 0) {
8744 + nomul(0
8745 +#ifdef HELPLESS
8746 + , 0
8747 +#endif
8748 + );
8749 + unmul((char *)0);
8751 trycount = 5;
8752 do {
8753 getlin("\"Hello stranger, who are you?\" -", buf);
8754 diff --git a/src/version.c b/src/version.c
8755 index b35475c..181a192 100644
8756 --- a/src/version.c
8757 +++ b/src/version.c
8758 @@ -16,6 +16,9 @@
8760 /* #define BETA_INFO "" */ /* "[ beta n]" */
8762 +/* Don't store SCORE_ON_BOTL option in save file or bones */
8763 +#define HIDDEN_FEATURES (1L << 21)
8765 /* fill buffer with short version (so caller can avoid including date.h) */
8766 char *
8767 version_string(buf)
8768 @@ -70,6 +73,11 @@ struct version_info *version_data;
8769 const char *filename;
8770 boolean complain;
8772 + boolean check=TRUE;
8773 +#ifdef HIDDEN_FEATURES
8774 + unsigned long true_features = version_data->feature_set;
8775 + version_data->feature_set &= ~HIDDEN_FEATURES;
8776 +#endif
8777 if (
8778 #ifdef VERSION_COMPATIBILITY
8779 version_data->incarnation < VERSION_COMPATIBILITY ||
8780 @@ -80,7 +88,7 @@ boolean complain;
8782 if (complain)
8783 pline("Version mismatch for file \"%s\".", filename);
8784 - return FALSE;
8785 + check = FALSE;
8786 } else if (
8787 #ifndef IGNORED_FEATURES
8788 version_data->feature_set != VERSION_FEATURES ||
8789 @@ -93,9 +101,12 @@ boolean complain;
8790 if (complain)
8791 pline("Configuration incompatibility for file \"%s\".",
8792 filename);
8793 - return FALSE;
8794 + check = FALSE;
8796 - return TRUE;
8797 +#ifdef HIDDEN_FEATURES
8798 + version_data->feature_set = true_features;
8799 +#endif
8800 + return check;
8803 /* this used to be based on file date and somewhat OS-dependant,
8804 @@ -130,7 +141,11 @@ store_version(fd)
8805 int fd;
8807 const static struct version_info version_data = {
8808 +#ifdef HIDDEN_FEATURES
8809 + VERSION_NUMBER, VERSION_FEATURES & ~HIDDEN_FEATURES,
8810 +#else
8811 VERSION_NUMBER, VERSION_FEATURES,
8812 +#endif
8813 VERSION_SANITY1, VERSION_SANITY2
8816 diff --git a/src/vis_tab.c b/src/vis_tab.c
8817 new file mode 100644
8818 index 0000000..2721e88
8819 --- /dev/null
8820 +++ b/src/vis_tab.c
8821 @@ -0,0 +1,8 @@
8822 +/* This source file is generated by 'makedefs'. Do not edit. */
8823 +#include "config.h"
8824 +#ifdef VISION_TABLES
8825 +#include "vis_tab.h"
8827 +#endif /* VISION_TABLES */
8829 +/*vis_tab.c*/
8830 diff --git a/src/weapon.c b/src/weapon.c
8831 index a595df7..c314893 100644
8832 --- a/src/weapon.c
8833 +++ b/src/weapon.c
8834 @@ -9,6 +9,10 @@
8836 #include "hack.h"
8838 +#ifdef DUMP_LOG
8839 +STATIC_DCL int FDECL(enhance_skill, (boolean));
8840 +#endif
8842 /* Categories whose names don't come from OBJ_NAME(objects[type])
8844 #define PN_BARE_HANDED (-1) /* includes martial arts */
8845 @@ -851,6 +855,23 @@ const static struct skill_range {
8848 enhance_weapon_skill()
8849 +#ifdef DUMP_LOG
8851 + return enhance_skill(FALSE);
8854 +void dump_weapon_skill()
8856 + enhance_skill(TRUE);
8859 +int enhance_skill(boolean want_dump)
8860 +/* This is the original enhance_weapon_skill() function slightly modified
8861 + * to write the skills to the dump file. I added the wrapper functions just
8862 + * because it looked like the easiest way to add a parameter to the
8863 + * function call. - Jukka Lahtinen, August 2001
8864 + */
8865 +#endif
8867 int pass, i, n, len, longest,
8868 to_advance, eventually_advance, maxxed_cnt;
8869 @@ -860,8 +881,15 @@ enhance_weapon_skill()
8870 anything any;
8871 winid win;
8872 boolean speedy = FALSE;
8873 +#ifdef DUMP_LOG
8874 + char buf2[BUFSZ];
8875 + boolean logged;
8876 +#endif
8878 #ifdef WIZARD
8879 +#ifdef DUMP_LOG
8880 + if (!want_dump)
8881 +#endif
8882 if (wizard && yn("Advance skills without practice?") == 'y')
8883 speedy = TRUE;
8884 #endif
8885 @@ -878,6 +906,11 @@ enhance_weapon_skill()
8886 else if (peaked_skill(i)) maxxed_cnt++;
8889 +#ifdef DUMP_LOG
8890 + if (want_dump)
8891 + dump("","Your skills at the end");
8892 + else {
8893 +#endif
8894 win = create_nhwindow(NHW_MENU);
8895 start_menu(win);
8897 @@ -905,6 +938,9 @@ enhance_weapon_skill()
8898 add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
8899 "", MENU_UNSELECTED);
8901 +#ifdef DUMP_LOG
8902 + } /* want_dump or not */
8903 +#endif
8905 /* List the skills, making ones that could be advanced
8906 selectable. List the miscellaneous skills first.
8907 @@ -916,8 +952,26 @@ enhance_weapon_skill()
8908 /* Print headings for skill types */
8909 any.a_void = 0;
8910 if (i == skill_ranges[pass].first)
8911 +#ifdef DUMP_LOG
8912 + if (want_dump) {
8913 + dump(" ",(char *)skill_ranges[pass].name);
8914 + logged=FALSE;
8915 + } else
8916 +#endif
8917 add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
8918 skill_ranges[pass].name, MENU_UNSELECTED);
8919 +#ifdef DUMP_LOG
8920 + if (want_dump) {
8921 + if (P_SKILL(i) > P_UNSKILLED) {
8922 + Sprintf(buf2,"%-*s [%s]",
8923 + longest, P_NAME(i),skill_level_name(i, buf));
8924 + dump(" ",buf2);
8925 + logged=TRUE;
8926 + } else if (i == skill_ranges[pass].last && !logged) {
8927 + dump(" ","(none)");
8929 + } else {
8930 +#endif
8932 if (P_RESTRICTED(i)) continue;
8934 @@ -962,6 +1016,9 @@ enhance_weapon_skill()
8935 any.a_int = can_advance(i, speedy) ? i+1 : 0;
8936 add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
8937 buf, MENU_UNSELECTED);
8938 +#ifdef DUMP_LOG
8939 + } /* !want_dump */
8940 +#endif
8943 Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" :
8944 @@ -971,6 +1028,12 @@ enhance_weapon_skill()
8945 Sprintf(eos(buf), " (%d slot%s available)",
8946 u.weapon_slots, plur(u.weapon_slots));
8947 #endif
8948 +#ifdef DUMP_LOG
8949 + if (want_dump) {
8950 + dump("","");
8951 + n=0;
8952 + } else {
8953 +#endif
8954 end_menu(win, buf);
8955 n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected);
8956 destroy_nhwindow(win);
8957 @@ -987,6 +1050,9 @@ enhance_weapon_skill()
8961 +#ifdef DUMP_LOG
8963 +#endif
8964 } while (speedy && n > 0);
8965 return 0;
8967 diff --git a/src/worm.c b/src/worm.c
8968 index 0380e3f..ecab99a 100644
8969 --- a/src/worm.c
8970 +++ b/src/worm.c
8971 @@ -303,6 +303,23 @@ wormhitu(worm)
8972 (void) mattacku(worm);
8975 +/* cutoff()
8977 + * Remove the tail of a worm and adjust the hp of the worm.
8978 + */
8979 +void
8980 +cutoff(worm, tail)
8981 + struct monst *worm;
8982 + struct wseg *tail;
8984 + if (flags.mon_moving)
8985 + pline("Part of the tail of %s is cut off.", mon_nam(worm));
8986 + else
8987 + You("cut part of the tail off of %s.", mon_nam(worm));
8988 + toss_wsegs(tail, TRUE);
8989 + if (worm->mhp > 1) worm->mhp /= 2;
8992 /* cutworm()
8994 * Check for mon->wormno before calling this function!
8995 @@ -368,17 +385,15 @@ cutworm(worm, x, y, weap)
8997 /* Sometimes the tail end dies. */
8998 if (rn2(3) || !(new_wnum = get_wormno())) {
8999 - if (flags.mon_moving)
9000 - pline("Part of the tail of %s is cut off.", mon_nam(worm));
9001 - else
9002 - You("cut part of the tail off of %s.", mon_nam(worm));
9003 - toss_wsegs(new_tail, TRUE);
9004 - if (worm->mhp > 1) worm->mhp /= 2;
9005 + cutoff(worm, new_tail);
9006 return;
9009 remove_monster(x, y); /* clone_mon puts new head here */
9010 - new_worm = clone_mon(worm, x, y);
9011 + if (!(new_worm = clone_mon(worm, x, y))) {
9012 + cutoff(worm, new_tail);
9013 + return;
9015 new_worm->wormno = new_wnum; /* affix new worm number */
9017 /* Devalue the monster level of both halves of the worm. */
9018 diff --git a/src/zap.c b/src/zap.c
9019 index 991c429..d6ab6c9 100644
9020 --- a/src/zap.c
9021 +++ b/src/zap.c
9022 @@ -2467,7 +2467,7 @@ register struct obj *obj;
9023 } else if (u.dz) {
9024 disclose = zap_updown(obj);
9025 } else {
9026 - (void) bhit(u.dx,u.dy, rn1(8,6),ZAPPED_WAND, bhitm,bhito, obj);
9027 + (void) bhit(u.dx,u.dy, rn1(8,6),ZAPPED_WAND, bhitm,bhito, obj, NULL);
9029 /* give a clue if obj_zapped */
9030 if (obj_zapped)
9031 @@ -2615,16 +2615,18 @@ register struct monst *mtmp;
9032 * one is revealed for a weapon, but if not a weapon is left up to fhitm().
9034 struct monst *
9035 -bhit(ddx,ddy,range,weapon,fhitm,fhito,obj)
9036 +bhit(ddx,ddy,range,weapon,fhitm,fhito,obj,obj_destroyed)
9037 register int ddx,ddy,range; /* direction and range */
9038 int weapon; /* see values in hack.h */
9039 int FDECL((*fhitm), (MONST_P, OBJ_P)), /* fns called when mon/obj hit */
9040 FDECL((*fhito), (OBJ_P, OBJ_P));
9041 struct obj *obj; /* object tossed/used */
9042 +boolean *obj_destroyed; /* has object been deallocated? Pointer to boolean, may be NULL */
9044 struct monst *mtmp;
9045 uchar typ;
9046 boolean shopdoor = FALSE, point_blank = TRUE;
9047 + if (obj_destroyed) { *obj_destroyed = FALSE; }
9049 if (weapon == KICKED_WEAPON) {
9050 /* object starts one square in front of player */
9051 @@ -2668,6 +2670,7 @@ struct obj *obj; /* object tossed/used */
9052 hits_bars(&obj, x - ddx, y - ddy,
9053 point_blank ? 0 : !rn2(5), 1)) {
9054 /* caveat: obj might now be null... */
9055 + if (obj == NULL && obj_destroyed) { *obj_destroyed = TRUE; }
9056 bhitpos.x -= ddx;
9057 bhitpos.y -= ddy;
9058 break;
9059 @@ -3436,7 +3439,11 @@ register int dx,dy;
9060 miss(fltxt,mon);
9062 } else if (sx == u.ux && sy == u.uy && range >= 0) {
9063 - nomul(0);
9064 + nomul(0
9065 +#ifdef HELPLESS
9066 + , 0
9067 +#endif
9068 + );
9069 #ifdef STEED
9070 if (u.usteed && !rn2(3) && !mon_reflects(u.usteed, (char *)0)) {
9071 mon = u.usteed;
9072 @@ -3466,7 +3473,11 @@ register int dx,dy;
9073 if (!Blind) Your(vision_clears);
9075 stop_occupation();
9076 - nomul(0);
9077 + nomul(0
9078 +#ifdef HELPLESS
9079 + , 0
9080 +#endif
9081 + );
9084 if(!ZAP_POS(lev->typ) || (closed_door(sx, sy) && (range >= 0))) {
9085 diff --git a/sys/share/pcunix.c b/sys/share/pcunix.c
9086 index 1f1149e..e6cf9fe 100644
9087 --- a/sys/share/pcunix.c
9088 +++ b/sys/share/pcunix.c
9089 @@ -8,11 +8,11 @@
9090 #include "wintty.h"
9092 #include <sys/stat.h>
9093 -#if defined(WIN32) || defined(MSDOS)
9094 +#if defined(WIN32) || defined(MSDOS) || defined(PC_LOCKING)
9095 #include <errno.h>
9096 #endif
9098 -#if defined(WIN32) || defined(MSDOS)
9099 +#if defined(WIN32) || defined(MSDOS) || defined(PC_LOCKING)
9100 extern char orgdir[];
9101 # ifdef WIN32
9102 extern void NDECL(backsp);
9103 diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top
9104 index 2f11c35..450ff65 100644
9105 --- a/sys/unix/Makefile.top
9106 +++ b/sys/unix/Makefile.top
9107 @@ -234,12 +234,12 @@ install: $(GAME) recover $(VARDAT) dungeon spec_levs
9108 # set up the directories
9109 # not all mkdirs have -p; those that don't will create a -p directory
9110 -mkdir -p $(SHELLDIR)
9111 - -rm -rf $(GAMEDIR) $(VARDIR)
9112 - -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save
9113 +# -rm -rf $(GAMEDIR) $(VARDIR)
9114 + -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/bones
9115 -rmdir ./-p
9116 - -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
9117 - $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
9118 - chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
9119 + -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/bones
9120 + $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/bones
9121 + chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/bones
9122 # set up the game files
9123 ( $(MAKE) dofiles )
9124 # set up some additional files
9125 diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh
9126 index 600e1da..575edba 100644
9127 --- a/sys/unix/nethack.sh
9128 +++ b/sys/unix/nethack.sh
9129 @@ -63,6 +63,14 @@ case $1 in
9130 exec $HACK "$@"
9133 - exec $HACK "$@" $MAXNROFPLAYERS
9134 +# Alt key as 'meta'
9135 + if [ "$TERM" == "linux" ]
9136 + then setmetamode meta > /dev/null
9137 + fi
9138 + $HACK "$@" $MAXNROFPLAYERS
9139 +# Change alt key back
9140 + if [ "$TERM" == "linux" ]
9141 + then setmetamode esc > /dev/null
9142 + fi
9144 esac
9145 diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c
9146 index a13514f..ba2588b 100644
9147 --- a/sys/unix/unixmain.c
9148 +++ b/sys/unix/unixmain.c
9149 @@ -262,6 +262,7 @@ char *argv[];
9150 #endif
9151 check_special_room(FALSE);
9152 wd_message();
9153 + save_currentstate();
9155 if (discover || wizard) {
9156 if(yn("Do you want to keep the save file?") == 'n')
9157 diff --git a/util/Makefile b/util/Makefile
9158 new file mode 100644
9159 index 0000000..e2936a8
9160 --- /dev/null
9161 +++ b/util/Makefile
9162 @@ -0,0 +1,403 @@
9163 +# Makefile for NetHack's utility programs.
9164 +# SCCS Id: @(#)Makefile.utl 3.4 1997/04/19
9166 +# newer makes predefine $(MAKE) to 'make' and do smarter processing of
9167 +# recursive make calls if $(MAKE) is used
9168 +# these makes allow $(MAKE) to be overridden by the environment if someone
9169 +# wants to (or has to) use something other than the standard make, so we do
9170 +# not want to unconditionally set $(MAKE) here
9172 +# unfortunately, some older makes do not predefine $(MAKE); if you have one of
9173 +# these, uncomment the following line
9174 +# (you will know that you have one if you get complaints about unable to
9175 +# execute things like 'foo.o')
9176 +# MAKE = make
9178 +# if you are using gcc as your compiler,
9179 +# uncomment the CC definition below if it's not in your environment
9180 +# CC = gcc
9182 +# For Bull DPX/2 systems at B.O.S. 2.0 or higher use the following:
9184 +# CC = gcc -ansi -D_BULL_SOURCE -D_XOPEN_SOURCE -D_POSIX_SOURCE
9186 +# If you are using GCC 2.2.2 or higher on a DPX/2, just use:
9188 +# CC = gcc -ansi
9190 +# For HP/UX 10.20 with GCC:
9191 +# CC = gcc -D_POSIX_SOURCE
9193 +# if your make doesn't define a default SHELL properly, you may need
9194 +# the line below (Atari users will need a bourne work-alike)
9195 +# SHELL = /bin/sh
9196 +# for Atari
9197 +# SHELL=E:/GEMINI2/MUPFEL.TTP
9199 +# flags may have to be changed as required
9200 +# flags for 286 Xenix:
9201 +# CFLAGS = -Ml2t16 -O -LARGE -I../include
9202 +# LFLAGS = -Ml -F 4000 -SEG 512
9204 +# flags for 286 Microport SysV-AT
9205 +# CFLAGS = -DDUMB -Ml -I../include
9206 +# LFLAGS = -Ml
9208 +# flags for Atari GCC (3.2.1)
9209 +# CFLAGS = -O -I../include
9210 +# LFLAGS = -s
9211 +# flags for Atari GCC (3.3)
9212 +# CFLAGS = -mshort -O2 -I../include
9213 +# LFLAGS = -mshort -s
9215 +# flags for Apollos using their native cc
9216 +# (as long as it claims to be __STDC__ but isn't)
9217 +# CFLAGS = -DAPOLLO -O -I../include
9219 +# flags for AIX 3.1 cc on IBM RS/6000 to define
9220 +# a suitable subset of standard libraries
9221 +# (note that there is more info regarding the "-qchars=signed"
9222 +# switch in file Install.unx note 8)
9223 +# CFLAGS = -D_NO_PROTO -D_XOPEN_SOURCE -O -I../include -qchars=signed
9224 +# and for AIX 3.2:
9225 +# CFLAGS = -D_NO_PROTO -D_XOPEN_SOURCE -D_ALL_SOURCE -O -I../include -qchars=signed
9227 +# flags for A/UX 2.01 using native cc or c89
9228 +# gcc predefines AUX so that's not needed there
9229 +# CFLAGS = -ZS -D_POSIX_SOURCE -O -I../include -DAUX
9231 +# flags for IRIX 4.0.x using native cc
9232 +# SGI cc 3.10 will fail to compile makedefs with -O
9233 +# CFLAGS = -I../include -D__STDC__ -woff 100,293
9235 +# flags for Linux
9236 +# compile normally
9237 +# CFLAGS = -O2 -fomit-frame-pointer -I../include
9238 +# LFLAGS = -L/usr/X11R6/lib
9239 +# OR compile backwards compatible a.out format
9240 +# CFLAGS = -O2 -b i486-linuxaout -fomit-frame-pointer -I../include
9241 +# LFLAGS = -b i486-linuxaout -L/usr/X11R6/lib
9243 +# flags for BeOS using the command line
9244 +# remember to uncomment flex and bison below
9245 +# BeOS on a Mac/BeBox:
9246 +#CC = mwcc
9247 +#CFLAGS = -I../include
9248 +# BeOS on Intel:
9249 +# the default values are fine
9251 +# flags for debugging:
9252 +# CFLAGS = -g -I../include
9254 +CFLAGS = -O -I../include
9255 +LFLAGS =
9257 +LIBS =
9259 +# If you are cross-compiling, you must use this:
9260 +#OBJDIR = .
9261 +# otherwise, you can save a little bit of disk space with this:
9262 +OBJDIR = ../src
9264 +# yacc/lex programs to use to generate *_comp.h, *_lex.c, and *_yacc.c.
9265 +# if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
9266 +YACC = yacc
9267 +LEX = lex
9268 +# YACC = bison -y
9269 +# YACC = byacc
9270 +# LEX = flex
9272 +# these are the names of the output files from YACC/LEX. Under MS-DOS
9273 +# and similar systems, they may differ
9274 +YTABC = y.tab.c
9275 +YTABH = y.tab.h
9276 +LEXYYC = lex.yy.c
9277 +# YTABC = y_tab.c
9278 +# YTABH = y_tab.h
9279 +# LEXYYC = lexyy.c
9283 +# ----------------------------------------
9285 +# Nothing below this line should have to be changed.
9287 +# timestamps for primary header files, matching src/Makefile
9288 +CONFIG_H = ../src/config.h-t
9289 +HACK_H = ../src/hack.h-t
9291 +# utility .c files
9292 +MAKESRC = makedefs.c
9293 +SPLEVSRC = lev_yacc.c lev_lex.c lev_main.c
9294 +DGNCOMPSRC = dgn_yacc.c dgn_lex.c dgn_main.c
9295 +RECOVSRC = recover.c
9296 +DLBSRC = dlb_main.c
9297 +UTILSRCS = $(MAKESRC) panic.c $(SPLEVSRC) $(DGNCOMPSRC) $(RECOVSRC) $(DLBSRC)
9299 +# files that define all monsters and objects
9300 +CMONOBJ = ../src/monst.c ../src/objects.c
9301 +OMONOBJ = $(OBJDIR)/monst.o $(OBJDIR)/objects.o
9302 +# files that provide access to NetHack's names
9303 +CNAMING = ../src/drawing.c ../src/decl.c $(CMONOBJ)
9304 +ONAMING = $(OBJDIR)/drawing.o $(OBJDIR)/decl.o $(OMONOBJ)
9305 +# dynamic memory allocation
9306 +CALLOC = ../src/alloc.c panic.c
9307 +OALLOC = $(OBJDIR)/alloc.o panic.o
9309 +# object files for makedefs
9310 +MAKEOBJS = makedefs.o $(OMONOBJ)
9312 +# object files for special levels compiler
9313 +SPLEVOBJS = lev_yacc.o lev_lex.o lev_main.o $(OALLOC) $(ONAMING)
9315 +# object files for dungeon compiler
9316 +DGNCOMPOBJS = dgn_yacc.o dgn_lex.o dgn_main.o $(OALLOC)
9318 +# object files for recovery utility
9319 +RECOVOBJS = recover.o
9321 +# object files for the data librarian
9322 +DLBOBJS = dlb_main.o $(OBJDIR)/dlb.o $(OALLOC)
9324 +# flags for creating distribution versions of sys/share/*_lex.c, using
9325 +# a more portable flex skeleton, which is not included in the distribution.
9326 +# hopefully keeping this out of the section to be edited will keep too
9327 +# many people from being confused by it...
9328 +# FLEXDIST = -L -S../sys/share/flexhack.skl
9329 +FLEXDIST =
9331 +# flags for creating distribution versions of sys/share/*_yacc.c, without
9332 +# line numbers so patches from version to version are practical
9333 +# YACCDIST = -l
9334 +YACCDIST =
9337 +# dependencies for makedefs
9339 +makedefs: $(MAKEOBJS)
9340 + $(CC) $(LFLAGS) -o makedefs $(MAKEOBJS)
9342 +makedefs.o: makedefs.c $(CONFIG_H) ../include/permonst.h \
9343 + ../include/objclass.h ../include/monsym.h \
9344 + ../include/artilist.h ../include/dungeon.h ../include/obj.h \
9345 + ../include/monst.h ../include/you.h ../include/flag.h \
9346 + ../include/dlb.h ../include/patchlevel.h ../include/qtext.h
9348 +../include/onames.h: makedefs
9349 + ./makedefs -o
9350 +../include/pm.h: makedefs
9351 + ./makedefs -p
9352 +../src/monstr.c: makedefs
9353 + ./makedefs -m
9354 +../include/vis_tab.h: makedefs
9355 + ./makedefs -z
9356 +# makedefs -z makes both vis_tab.h and vis_tab.c, but writes the .h first
9357 +../src/vis_tab.c: ../include/vis_tab.h
9359 +lintdefs:
9360 + @lint -axbh -I../include -DLINT $(MAKESRC) $(CMONOBJ) | sed '/_flsbuf/d'
9363 +# we defer this makedefs call to the src Makefile, since it knows all about
9364 +# the main src and include files date.h is a timestamp for
9365 +../include/date.h::
9366 + @( cd ../src ; $(MAKE) ../include/date.h )
9368 +# support code used by several of the utility programs (but not makedefs)
9369 +panic.o: panic.c $(CONFIG_H)
9372 +# dependencies for lev_comp
9374 +lev_comp: $(SPLEVOBJS)
9375 + $(CC) $(LFLAGS) -o lev_comp $(SPLEVOBJS) $(LIBS)
9377 +lev_yacc.o: lev_yacc.c $(HACK_H) ../include/sp_lev.h
9378 +lev_main.o: lev_main.c $(HACK_H) ../include/sp_lev.h ../include/tcap.h \
9379 + ../include/date.h
9381 +# see lev_comp.l for WEIRD_LEX discussion
9382 +# egrep will return failure if it doesn't find anything, but we know there
9383 +# is one "_cplusplus" inside a comment
9384 +lev_lex.o: lev_lex.c $(HACK_H) ../include/lev_comp.h ../include/sp_lev.h
9385 + @echo $(CC) -c $(CFLAGS) lev_lex.c
9386 + @$(CC) -c $(CFLAGS) -DWEIRD_LEX=`egrep -c _cplusplus lev_lex.c` lev_lex.c
9388 +../include/lev_comp.h: lev_yacc.c
9390 +lev_yacc.c: lev_comp.y
9391 + $(YACC) $(YACCDIST) -d lev_comp.y
9392 + mv $(YTABC) lev_yacc.c
9393 + mv $(YTABH) ../include/lev_comp.h
9395 +lev_lex.c: lev_comp.l
9396 + $(LEX) $(FLEXDIST) lev_comp.l
9397 + mv $(LEXYYC) lev_lex.c
9399 +# with all of extern.h's functions to complain about, we drown in
9400 +# 'defined but not used' without -u
9401 +lintlev:
9402 + @lint -axhu -I../include -DLINT $(SPLEVSRC) $(CALLOC) $(CNAMING) | sed '/_flsbuf/d'
9405 +# dependencies for dgn_comp
9407 +dgn_comp: $(DGNCOMPOBJS)
9408 + $(CC) $(LFLAGS) -o dgn_comp $(DGNCOMPOBJS) $(LIBS)
9410 +dgn_yacc.o: dgn_yacc.c $(CONFIG_H) ../include/dgn_file.h ../include/date.h
9411 +dgn_main.o: dgn_main.c $(CONFIG_H) ../include/dlb.h
9413 +# see dgn_comp.l for WEIRD_LEX discussion
9414 +dgn_lex.o: dgn_lex.c $(CONFIG.H) ../include/dgn_comp.h ../include/dgn_file.h
9415 + @echo $(CC) -c $(CFLAGS) dgn_lex.c
9416 + @$(CC) -c $(CFLAGS) -DWEIRD_LEX=`egrep -c _cplusplus dgn_lex.c` dgn_lex.c
9419 +../include/dgn_comp.h: dgn_yacc.c
9421 +dgn_yacc.c: dgn_comp.y
9422 + $(YACC) $(YACCDIST) -d dgn_comp.y
9423 + mv $(YTABC) dgn_yacc.c
9424 + mv $(YTABH) ../include/dgn_comp.h
9426 +dgn_lex.c: dgn_comp.l
9427 + $(LEX) $(FLEXDIST) dgn_comp.l
9428 + mv $(LEXYYC) dgn_lex.c
9430 +# with all of extern.h's functions to complain about, we drown in
9431 +# 'defined but not used' without -u
9432 +lintdgn:
9433 + @lint -axhu -I../include -DLINT $(DGNCOMPSRC) $(CALLOC) | sed '/_flsbuf/d'
9436 +# dependencies for recover
9438 +recover: $(RECOVOBJS)
9439 + $(CC) $(LFLAGS) -o recover $(RECOVOBJS) $(LIBS)
9441 +recover.o: recover.c $(CONFIG_H) ../include/date.h
9444 +# dependencies for dlb
9446 +dlb: $(DLBOBJS)
9447 + $(CC) $(LFLAGS) -o dlb $(DLBOBJS) $(LIBS)
9449 +dlb_main.o: dlb_main.c $(CONFIG_H) ../include/dlb.h ../include/date.h
9450 + $(CC) $(CFLAGS) -c dlb_main.c
9454 +# dependencies for tile utilities
9456 +TEXT_IO = tiletext.o tiletxt.o $(ONAMING)
9457 +GIFREADERS = gifread.o $(OALLOC)
9458 +PPMWRITERS = ppmwrite.o $(OALLOC)
9460 +tileutils: tilemap gif2txt txt2ppm tile2x11
9462 +gif2txt: $(GIFREADERS) $(TEXT_IO)
9463 + $(CC) $(LFLAGS) -o gif2txt $(GIFREADERS) $(TEXT_IO) $(LIBS)
9464 +txt2ppm: $(PPMWRITERS) $(TEXT_IO)
9465 + $(CC) $(LFLAGS) -o txt2ppm $(PPMWRITERS) $(TEXT_IO) $(LIBS)
9467 +tile2x11: tile2x11.o $(TEXT_IO)
9468 + $(CC) $(LFLAGS) -o tile2x11 tile2x11.o $(TEXT_IO) $(LIBS)
9470 +tile2img.ttp: tile2img.o bitmfile.o $(TEXT_IO)
9471 + $(CC) $(LFLAGS) -o tile2img.ttp tile2img.o bitmfile.o $(TEXT_IO) $(LIBS)
9473 +tile2bmp: tile2bmp.o $(TEXT_IO)
9474 + $(CC) $(LFLAGS) -o tile2bmp tile2bmp.o $(TEXT_IO)
9476 +xpm2img.ttp: xpm2img.o bitmfile.o
9477 + $(CC) $(LFLAGS) -o xpm2img.ttp xpm2img.o bitmfile.o $(LIBS)
9479 +tile2beos: tile2beos.o $(TEXT_IO)
9480 + $(CC) $(LFLAGS) -o tile2beos tile2beos.o $(TEXT_IO) -lbe
9482 +tilemap: ../win/share/tilemap.c $(HACK_H)
9483 + $(CC) $(CFLAGS) $(LFLAGS) -o tilemap ../win/share/tilemap.c $(LIBS)
9484 +../src/tile.c: tilemap
9485 + ./tilemap
9487 +../include/tile.h: ../win/share/tile.h
9488 + cp ../win/share/tile.h ../include/tile.h
9489 +tiletext.o: ../win/share/tiletext.c $(CONFIG_H) ../include/tile.h
9490 + $(CC) $(CFLAGS) -c ../win/share/tiletext.c
9491 +tiletxt.o: ../win/share/tilemap.c $(HACK_H)
9492 + $(CC) $(CFLAGS) -c -DTILETEXT ../win/share/tilemap.c
9493 + mv tilemap.o tiletxt.o
9495 +gifread.o: ../win/share/gifread.c $(CONFIG_H) ../include/tile.h
9496 + $(CC) $(CFLAGS) -c ../win/share/gifread.c
9497 +ppmwrite.o: ../win/share/ppmwrite.c $(CONFIG_H) ../include/tile.h
9498 + $(CC) $(CFLAGS) -c ../win/share/ppmwrite.c
9500 +tile2bmp.o: ../win/share/tile2bmp.c $(HACK_H) ../include/tile.h
9501 + $(CC) $(CFLAGS) -c ../win/share/tile2bmp.c
9503 +tile2x11.o: ../win/X11/tile2x11.c $(HACK_H) ../include/tile.h \
9504 + ../include/tile2x11.h
9505 + $(CC) $(CFLAGS) -c ../win/X11/tile2x11.c
9507 +tile2img.o: ../win/gem/tile2img.c $(HACK_H) ../include/tile.h \
9508 + ../include/bitmfile.h
9509 + $(CC) $(CFLAGS) -c ../win/gem/tile2img.c
9510 +xpm2img.o: ../win/gem/xpm2img.c $(HACK_H) ../include/bitmfile.h
9511 + $(CC) $(CFLAGS) -c ../win/gem/xpm2img.c
9512 +bitmfile.o: ../win/gem/bitmfile.c ../include/bitmfile.h
9513 + $(CC) $(CFLAGS) -c ../win/gem/bitmfile.c
9515 +tile2beos.o: ../win/BeOS/tile2beos.cpp $(HACK_H) ../include/tile.h
9516 + $(CXX) $(CFLAGS) -c ../win/BeOS/tile2beos.cpp
9518 +# using dependencies like
9519 +# ../src/foo::
9520 +# @( cd ../src ; $(MAKE) foo )
9521 +# would always force foo to be up-to-date according to the src Makefile
9522 +# when it's needed here. unfortunately, some makes believe this syntax
9523 +# means foo always changes, instead of foo should always be checked.
9524 +# therefore, approximate via config.h dependencies, and hope that anybody
9525 +# changing anything other than basic configuration also knows when not
9526 +# to improvise things not in the instructions, like 'make makedefs' here
9527 +# in util...
9529 +# make sure object files from src are available when needed
9531 +$(OBJDIR)/alloc.o: ../src/alloc.c $(CONFIG_H)
9532 + $(CC) $(CFLAGS) -c ../src/alloc.c -o $@
9533 +$(OBJDIR)/drawing.o: ../src/drawing.c $(CONFIG_H)
9534 + $(CC) $(CFLAGS) -c ../src/drawing.c -o $@
9535 +$(OBJDIR)/decl.o: ../src/decl.c $(CONFIG_H)
9536 + $(CC) $(CFLAGS) -c ../src/decl.c -o $@
9537 +$(OBJDIR)/monst.o: ../src/monst.c $(CONFIG_H)
9538 + $(CC) $(CFLAGS) -c ../src/monst.c -o $@
9539 +$(OBJDIR)/objects.o: ../src/objects.c $(CONFIG_H)
9540 + $(CC) $(CFLAGS) -c ../src/objects.c -o $@
9541 +$(OBJDIR)/dlb.o: ../src/dlb.c $(HACK_H) ../include/dlb.h
9542 + $(CC) $(CFLAGS) -c ../src/dlb.c -o $@
9544 +# make sure hack.h dependencies get transitive information
9545 +$(HACK_H): $(CONFIG_H)
9546 + @( cd ../src ; $(MAKE) $(HACK_H) )
9547 +$(CONFIG_H): ../include/config.h
9548 + @( cd ../src ; $(MAKE) $(CONFIG_H) )
9550 +tags: $(UTILSRCS)
9551 + @ctags -tw $(UTILSRCS)
9553 +clean:
9554 + -rm -f *.o
9556 +spotless: clean
9557 + -rm -f lev_lex.c lev_yacc.c dgn_lex.c dgn_yacc.c
9558 + -rm -f ../include/lev_comp.h ../include/dgn_comp.h
9559 + -rm -f ../include/tile.h
9560 + -rm -f makedefs lev_comp dgn_comp recover dlb
9561 + -rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp tilemap
9563 +tileedit: tileedit.cpp $(TEXT_IO)
9564 + $(QTDIR)/bin/moc -o tileedit.moc tileedit.h
9565 + $(CC) -o tileedit -I../include -I$(QTDIR)/include -L$(QTDIR)/lib tileedit.cpp $(TEXT_IO) -lqt
9566 diff --git a/util/makedefs b/util/makedefs
9567 new file mode 100755
9568 index 0000000..0021e10
9569 Binary files /dev/null and b/util/makedefs differ
9570 diff --git a/util/makedefs.c b/util/makedefs.c
9571 index 23dace2..94c28ef 100644
9572 --- a/util/makedefs.c
9573 +++ b/util/makedefs.c
9574 @@ -417,6 +417,9 @@ do_rumors()
9575 * This should go away in the next version update.
9577 #define IGNORED_FEATURES ( 0L \
9578 + | (1L << 17) /* TEXTCOLOR */ \
9579 + | (1L << 20) /* EXP_ON_BOTL */ \
9580 + | (1L << 21) /* SCORE_ON_BOTL */ \
9581 | (1L << 23) /* TIMED_DELAY */ \
9584 @@ -775,6 +778,82 @@ static const char *build_opts[] = {
9585 "zero-compressed save files",
9586 #endif
9587 save_bones_compat_buf,
9588 +#ifdef AOY_CONTAINER
9589 + "patch: baggable special items",
9590 +#endif
9591 +#ifdef HPMON
9592 + "patch: colored Hp monitor",
9593 +#endif
9594 +#ifdef DUMP_LOG
9595 + "patch: dump game end info",
9596 +#endif
9597 +#ifdef DYNKEY
9598 + "patch: dynamic keybinding",
9599 +#endif
9600 +#ifdef DEATH_EXPLORE
9601 + "patch: explore mode at death",
9602 +#endif
9603 +#ifdef ENL_STATS
9604 + "patch: extra status attributes",
9605 +#endif
9606 +#ifdef GERMANKB
9607 + "patch: german keyboard (hardcoded)",
9608 +#endif
9609 +#ifdef HELPLESS
9610 + "patch: helplessness reasons",
9611 +#endif
9612 +#if defined(ITEMCAT) || defined(ITEMCAT_JP)
9613 + "patch: item categories",
9614 +#endif
9615 +#ifdef LOG_MOVES
9616 + "patch: log move counter",
9617 +#endif
9618 +#ifdef FORGET_QUITTER
9619 + "patch: no record entry for quitting",
9620 +#endif
9621 +#ifdef SHOP_CREDIT
9622 + "patch: no shop credit",
9623 +#endif
9624 +#ifdef QWERTZ
9625 + "patch: optionally change y/z commands",
9626 +#endif
9627 +#ifdef ARTI_WITH_OWNER
9628 + "patch: owned artifacts",
9629 +#endif
9630 +#ifdef PARANOID
9631 + "patch: paranoid",
9632 +#endif
9633 +#ifdef PRIEST_RACES
9634 + "patch: priests for every race",
9635 +#endif
9636 +#ifdef PROMPT_LOGEXP
9637 + "patch: prompt explore/wizard mode logging",
9638 +#endif
9639 +#ifdef QUIVER_FIRED
9640 + "patch: quiver with the f command",
9641 +#endif
9642 +#ifdef SHOW_EXTINCT
9643 + "patch: show extinct monsters",
9644 +#endif
9645 +#ifdef SHOW_BORN
9646 + "patch: show monsters born",
9647 +#endif
9648 +#ifdef SORTLOOT
9649 + "patch: sortloot",
9650 +#endif
9651 +#ifdef ADJSPLIT
9652 + "patch: splittable #adjust",
9653 +#endif
9654 +#ifdef MENU_COLOR
9655 +# ifdef MENU_COLOR_REGEX
9656 + "patch: tty menu colors via regular expressions",
9657 +# else
9658 + "patch: tty menu colors via pmatch",
9659 +# endif
9660 +#endif
9661 +#ifdef WIN_EDGE
9662 + "patch: win_edge",
9663 +#endif
9664 "basic NetHack features"
9667 diff --git a/win/tty/wintty.c b/win/tty/wintty.c
9668 index 9cba7d7..7b45844 100644
9669 --- a/win/tty/wintty.c
9670 +++ b/win/tty/wintty.c
9671 @@ -125,6 +125,10 @@ static char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */
9672 static char winpanicstr[] = "Bad window id %d";
9673 char defmorestr[] = "--More--";
9675 +#ifdef MENU_COLOR
9676 +extern struct menucoloring *menu_colorings;
9677 +#endif
9679 #ifdef CLIPPING
9680 # if defined(USE_TILES) && defined(MSDOS)
9681 boolean clipping = FALSE; /* clipping on? */
9682 @@ -162,7 +166,7 @@ STATIC_DCL void FDECL(invert_all, (winid,tty_menu_item *,tty_menu_item *, CHAR_P
9683 STATIC_DCL void FDECL(process_menu_window, (winid,struct WinDesc *));
9684 STATIC_DCL void FDECL(process_text_window, (winid,struct WinDesc *));
9685 STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *));
9686 -STATIC_DCL const char * FDECL(compress_str, (const char *));
9687 +const char * FDECL(compress_str, (const char *));
9688 STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P));
9689 static char *FDECL(copy_of, (const char *));
9690 STATIC_DCL void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */
9691 @@ -1128,6 +1132,28 @@ invert_all(window, page_start, page_end, acc)
9695 +#ifdef MENU_COLOR
9696 +STATIC_OVL boolean
9697 +get_menu_coloring(str, color, attr)
9698 +char *str;
9699 +int *color, *attr;
9701 + struct menucoloring *tmpmc;
9702 + if (iflags.use_menu_color)
9703 + for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next)
9704 +# ifdef MENU_COLOR_REGEX
9705 + if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) {
9706 +# else
9707 + if (pmatch(tmpmc->match, str)) {
9708 +# endif
9709 + *color = tmpmc->color;
9710 + *attr = tmpmc->attr;
9711 + return TRUE;
9713 + return FALSE;
9715 +#endif /* MENU_COLOR */
9717 STATIC_OVL void
9718 process_menu_window(window, cw)
9719 winid window;
9720 @@ -1204,6 +1230,10 @@ struct WinDesc *cw;
9721 for (page_lines = 0, curr = page_start;
9722 curr != page_end;
9723 page_lines++, curr = curr->next) {
9724 +#ifdef MENU_COLOR
9725 + int color = NO_COLOR, attr = ATR_NONE;
9726 + boolean menucolr = FALSE;
9727 +#endif
9728 if (curr->selector)
9729 *rp++ = curr->selector;
9731 @@ -1219,6 +1249,13 @@ struct WinDesc *cw;
9732 * actually output the character. We're faster doing
9733 * this.
9735 +#ifdef MENU_COLOR
9736 + if (iflags.use_menu_color &&
9737 + (menucolr = get_menu_coloring(curr->str, &color,&attr))) {
9738 + term_start_attr(attr);
9739 + if (color != NO_COLOR) term_start_color(color);
9740 + } else
9741 +#endif
9742 term_start_attr(curr->attr);
9743 for (n = 0, cp = curr->str;
9744 #ifndef WIN32CON
9745 @@ -1236,6 +1273,12 @@ struct WinDesc *cw;
9746 (void) putchar('#'); /* count selected */
9747 } else
9748 (void) putchar(*cp);
9749 +#ifdef MENU_COLOR
9750 + if (iflags.use_menu_color && menucolr) {
9751 + if (color != NO_COLOR) term_end_color();
9752 + term_end_attr(attr);
9753 + } else
9754 +#endif
9755 term_end_attr(curr->attr);
9757 } else {
9758 @@ -1529,11 +1572,19 @@ tty_display_nhwindow(window, blocking)
9759 /* avoid converting to uchar before calculations are finished */
9760 cw->offx = (uchar) (int)
9761 max((int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1));
9762 - if(cw->type == NHW_MENU)
9763 + if(cw->type == NHW_MENU
9764 +#ifdef WIN_EDGE
9765 + || iflags.win_edge
9766 +#endif
9768 cw->offy = 0;
9769 if(ttyDisplay->toplin == 1)
9770 tty_display_nhwindow(WIN_MESSAGE, TRUE);
9771 - if(cw->offx == 10 || cw->maxrow >= (int) ttyDisplay->rows) {
9772 + if(cw->offx == 10 || cw->maxrow >= (int) ttyDisplay->rows
9773 +#ifdef WIN_EDGE
9774 + || iflags.win_edge
9775 +#endif
9776 + ) {
9777 cw->offx = 0;
9778 if(cw->offy) {
9779 tty_curs(window, 1, 0);
9780 @@ -1722,7 +1773,7 @@ tty_putsym(window, x, y, ch)
9784 -STATIC_OVL const char*
9785 +const char*
9786 compress_str(str)
9787 const char *str;