--- nh343orig/README.nh343jl 1970-01-01 02:00:00.000000000 +0200 +++ nh343jl/README.nh343jl 2007-08-06 09:28:47.000000000 +0300 @@ -0,0 +1,115 @@ +nh343jl.diff is a diff for Nethack 3.4.3, containing the following +patches (better explanations and diffs for most individual patches +available at http://www.netsonic.fi/~walker/nethack.html) : + +- Tom Friedetzky's "dump character" patch somewhat modified by me, Darshan + Shaligram and some others (include/decl.h, include/extern.h, + src/botl.c, src/cmd.c, src/decl.c, src/display.c, src/end.c, + src/invent.c, src/options.c, src/spell.c, src/topten.c, src/weapon.c, + win/tty/wintty.c, dat/opthelp, doc/Guidebook.*) +- record the number of moves, and mark wizard/explore mode games in + logfile / record (src/topten.c) +- show extincted monsters among the genocided ones and the numbers of + different monsters born in the "vanquished" list after the numbers killed. + (Wingnut, Jukka Lahtinen) + (include/flag.h, src/cmd.c, src/end.c, src/options.c, + dat/opthelp, dat/wizhelp, doc/Guidebook.*) +- paranoid, by David Damerell, Jonathan Nieder, Jukka Lahtinen and + Stanislav Traykov + (include/flag.h, src/cmd.c, src/do_wear.c, src/end.c, src/options.c, + src/potion.c, src/uhitm.c, dat/opthelp, doc/Guidebook.*) +- Ralph Churchill's colored Hp monitor (src/botl.c) +- Compile-time options for not writing #quit games to the record file + (FORGET_QUITTER) and not writing explore mode games to the logfile + (PROMPT_LOGEXP). (src/end.c, src/topten.c) +- The compile time setting SCORE_ON_BOTL is overriden in the magic number + in the bones and save files, so compatibility with the official binaries + can be kept regardless of that option. (src/version.c) +- Allow definitions for variable playground locations, such as separate + bones and levels directories, for OS/2. Use bones in directory "bones" + under the playground directory in unix systems. + (include/os2conf.h, src/files.c, sys/share/pcunix.c) +- prompt for entering explore mode at death (include/flag.h, src/cmd.c, + src/end.c, src/options.c, dat/opthelp, doc/Guidebook.*) +- Jeroen Demeyer's sortloot patch to optionally sort the pickup lists to + ascending order of descriptions within each item class + (dat/opthelp, doc/Guidebook.*, include/extern.h, include/flag.h, + src/end.c, src/invent.c, src/objnam.c, src/options.c, src/pickup.c) +- Pasi Kallinen's menucolor patch (http://www.cs.joensuu.fi/~pkalli) + (dat/opthelp, include/color.h, include/extern.h, include/flag.h, + src/decl.c, src/files.c, src/options.c, src/save.c, + win/tty/wintty.c) +- Pasi Kallinen's window edge patch, optionally aligning menus and text + windows left instead of right in the tty interface. + http://cs.joensuu.fi/~pkalli/code/nh342-winedge.diff + (doc/Guidebook.*, dat/opthelp, include/flag.h, src/options.c, + win/tty/wintty.c) +- Stanislav Traykov's patch for additional item categories in the menus + http://home.in.tum.de/~traykovs/nethack/ + (dat/opthelp, doc/Guidebook.*, include/extern.h, include/flag.h, + include/hack.h, include/objclass.h, include/obj.h, src/do.c, + src/invent.c, src/options.c, src/pickup.c) +- Sam Dennis's patch to allow the #adjust command to split stacks + (src/invent.c) +- Pasi Kallinen's helplessness patch that replaces the "while helpless" + text to be written to the record/logfile with the reason of + helplessness + (include/decl.h, include/extern.h, src/allmain.c, src/apply.c, + src/artifact.c, src/ball.c, src/decl.c, src/detect.c, src/dig.c, + src/dothrow.c, src/do_wear.c, src/eat.c, src/end.c, src/engrave.c, + src/explode.c, src/hack.c, src/mcastu.c, src/mhitu.c, src/mthrowu.c, + src/muse.c, src/pickup.c, src/polyself.c, src/potion.c, src/pray.c, + src/priest.c, src/save.c, src/sounds.c, src/spell.c, src/steal.c, + src/teleport.c, src/timeout.c, src/trap.c, src/uhitm.c, src/vault.c, + src/zap.c) +- Pasi Kallinen's extra status attributes patch that adds statuses like + encuberance, hunger, confusion, food poisoning, illness, blindness, + stun, hallucination and sliming to the minimal enlightenment screen + shown with ^X (http://bilious.homelinux.org/?226) + (include/extern.h, src/botl.c, src/cmd.c) +- Make the f (fire) command prompt for ammuntition to quiver, when used + and nothing is quivered. + (dat/opthelp, doc/Guidebook.mn, doc/Guidebook.tex, doc/Guidebook.txt, + include.flag.h, src/dothrow.c, src/options.c) + +Most of these patches need some #define in include/config.h to get +compiled in. I included a diff for config.h to show them. + +On unix systems with the dump patch, it is recommended for security reasons +to define the DUMP_FN in include/config.h to prevent users from defining +the dumpfile name themselves, but here it is commented out because there is +no single directory name that would be good for EVERY patched Nethack +installation to have the dump files in and I try to keep this patch +collection generic. + +If you find any bugs in these patches, please let me know. +For now, you can reach me at jtfjdehf@hotmail.com). +And I read rec.games.roguelike.nethack regularly. + +Of course, if you have some other changes made to the same files, you may +need to edit some of the source files to insert some chunks of this diff +manually. Check especially include/config.h for options that you may like +to be set differently from my setup. + +Some of the patches also need some options defined in your configuration file +(~/.nethackrc in Linux and other unix-like systems, nethack.cnf in OS/2, +defaults.nh in NT, maybe something else on some other platforms) to take +effect. To turn all of thse on, set + +OPTIONS=dumpfile:%n.nh (for the dump character patch in single user systems) +OPTIONS=showborn (to see the numbers of monsters born) +OPTIONS=paranoid_hit,paranoid_quit,paranoid_remove (for the paranoid patch) +OPTIONS=death_explore (to be prompted for explore mode when you die) +OPTIONS=sortloot:loot (for the sortloot patch) +OPTIONS=win_edge (for the window edge patch) +OPTIONS=quiver_fired (for the quiver fired ammunition patch) +OPTIONS=menucolors (to turn on the menucolor option) +MENUCOLOR="* blessed *"=green (some menucolor definition examples) +MENUCOLOR="* holy *"=green (if you have MENU_COLOR_REGEX defined +MENUCOLOR="* cursed *"=red in config.h, leave the asterisks out from +MENUCOLOR="* unholy *"=red the beginning and ending of the options) +MENUCOLOR="* cursed .* (being worn)*"=orange&underline + +-- +Jukka Lahtinen, 6.8.2007 +jtfjdehf@hotmail.com diff -bNurdX diff_ign.txt nh343orig/README.menucolor nh343jl/README.menucolor --- nh343orig/README.menucolor 1970-01-01 02:00:00.000000000 +0200 +++ nh343jl/README.menucolor 2003-12-14 21:06:10.000000000 +0200 @@ -0,0 +1,96 @@ + + This is version 1.3 of the menucolors patch. + + This patch allows the user to define in what color menus are shown. + For example, putting + + OPTIONS=menucolors + MENUCOLOR=" blessed "=green + MENUCOLOR=" holy "=green + MENUCOLOR=" cursed "=red + MENUCOLOR=" unholy "=red + MENUCOLOR=" cursed .* (being worn)"=orange&underline + + in the configuration file makes all known blessed items + show up in green, all cursed items show up in red and + all cursed worn items show up in orange and underlined + when viewing inventory. + + If you do not have GNU regex.h, comment + #define MENU_COLOR_REGEX out from include/config.h + and replace the MENUCOLOR lines in your config file with these: + + MENUCOLOR="* blessed *"=green + MENUCOLOR="* holy *"=green + MENUCOLOR="* cursed *"=red + MENUCOLOR="* unholy *"=red + MENUCOLOR="* cursed * (being worn)"=orange&underline + + + Colors: black, red, green, brown, blue, magenta, cyan, gray, orange, + lightgreen, yellow, lightblue, lightmagenta, lightcyan, white. + Attributes: none, bold, dim, underline, blink, inverse. + + Note that the terminal is free to interpret the attributes however + it wants. + + + TODO/BUGS: + + o Only works with TTY + o You can't use '=' or '&' in the match-string. + o Maybe add color-field to tty_menu_item in include/wintty.h + (so there's no need to find the color for the line again) + o Guidebook is not up to date + o Better place to put the functions, colornames[] and attrnames[]? + o Some menus do not need coloring; maybe add new parameter + to process_menu_window()? + + + FIXES: + + v1.3: + o Updated to use 3.4.3 codebase. + o Added a text to #version to show menucolors is compiled in. + + v1.2: + o Updated to use 3.4.2 codebase. + + v1.1: + o Updated to use 3.4.1 codebase. + o replaced USE_REGEX_MATCH with MENU_COLOR_REGEX + + v1.04: + o Oops! 1.03 worked only on *nixes... (GNU regex.h) + o Compile-time option USE_REGEX_MATCH: if it's defined, use regex, + otherwise use globbing. ('?' and '*' wildcards) + + v1.03: + + o Now using Nethack 3.4.0 codebase + o Compile-time option MENU_COLOR + o Strings match using regular expressions instead of globbing + o You can use attribute with color (attr must come after '&') + o Use ``MENUCOLOR="foo"=color'' instead of ``OPTIONS=menucolor=...'' + (Both work, but OPTIONS complains if you define menucolor + more than once) + + v1.02: + + o Should now work with OS/2, thanks to Jukka Lahtinen + o Strings match now using simple globbing. ('?' and '*' wildcards) + + v1.01: + + o Moved 'menucolors' boolean option, so now the options-menu + is in alphabetical order. + o Fixed 'menucolor' description in dat/opthelp. + o menu_colorings is now initialized to null in src/decl.c. + + v1.0: + + o Initial release + +-- + Pasi Kallinen + pkalli@cs.joensuu.fi diff -bNurdX diff_ign.txt nh343orig/dat/opthelp nh343jl/dat/opthelp --- nh343orig/dat/opthelp 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/dat/opthelp 2007-04-23 23:16:47.000000000 +0300 @@ -51,6 +51,10 @@ There are further boolean options controlled by compilation flags. +Boolean option if ITEMCAT was set at compile time: +like_swimming allow category "Items known to be Rustprone" in + selection menus [FALSE] + Boolean option if INSURANCE was set at compile time: checkpoint save game state after each level change, for possible [TRUE] recovery after program crash @@ -61,6 +65,9 @@ Boolean option if MFLOPPY was set at compile time: checkspace check free disk space before writing files to disk [TRUE] +Boolean option if DEATH_EXPLORE was set at compile time: +death_explore prompt for changing to explore mode when you die [FALSE] + Boolean option if EXP_ON_BOTL was set at compile time: showexp display your accumulated experience points [FALSE] @@ -71,17 +78,41 @@ color use different colors for objects on screen [TRUE for micros] hilite_pet display pets in a highlighted manner [FALSE] +Boolean option if TEXTCOLOR and MENU_COLOR were set at compile time: +menucolors use different colors for menus [TRUE for micros] + +Boolean option if PARANOID was set at compile time: +paranoid_hit ask for explicit 'yes' when hitting peacefuls [FALSE] + +Boolean option if PARANOID was set at compile time: +paranoid_quit ask for explicit 'yes' when quitting [FALSE] + +Boolean option if PARANOID was set at compile time: +paranoid_remove always show menu with the T and R commands [FALSE] + +Boolean option if SHOW_BORN was set at compile time: +showborn show numbers of created monsters after the number + vanquished [FALSE] + Boolean option if TIMED_DELAY was set at compile time (tty interface only): timed_delay on unix and VMS, use a timer instead of sending extra screen output when attempting to pause for display effect. on MSDOS without the termcap lib, whether or not to pause for visual effect. [TRUE] +Boolean option if QUIVER_FIRED was set at compile time: +quiver_fired when using the f (fire) command and no ammunition + is quivered, prompt for ammunition to quiver, then + fire it. [FALSE] + Boolean option if USE_TILES was set at compile time (MSDOS protected mode only): preload_tiles control whether tiles get pre-loaded into RAM at the start of the game. Doing so enhances performance of the tile graphics, but uses more memory. [TRUE] +Boolean option if WIN_EDGE was set at compile time (tty interface only): +win_edge align menus and text windows left instead of right [FALSE] + Any Boolean option can be negated by prefixing it with a '!' or 'no'. @@ -92,6 +123,9 @@ boulder override the default boulder symbol with another default: [`] disclose the types of information you want offered at the end of the game [ni na nv ng nc] +dumpfile the name of the file where to dump the disclosure information + when the game ends (only if the patch has been compiled in) + [none] fruit the name of a fruit you enjoy eating [slime mold] (basically a whimsy which NetHack uses from time to time). menustyle user interface for selection of multiple objects: @@ -120,6 +154,11 @@ scores the parts of the score list you wish to see when the game ends You choose a combination of top scores, scores around the top scores, and all of your own scores. [!own/3 top/2 around] +sortloot controls the sortloot patch [none]: + full -- All pickup lists of items are sorted by item description + loot -- When inventory letters are shown, has no effect. + Otherwise sorts by description + none -- Works the traditional way, like without the patch suppress_alert disable various version-specific warnings about changes in game play or the user interface, such as notification given for the 'Q' command that quitting is now done via #quit @@ -169,6 +208,21 @@ still denote your gender using the "male" and "female" options, the "gender" option will take precedence. [RANDOM] horsename the name of your first horse [NONE] +menucolor Set colors for menus. (menucolor:"regex_string"=color) + If boolean option ``menucolors'' is true, menus will be shown + with different colors. + For example, setting ``menucolor:" blessed "=green'' shows + all lines in a menu with the text " blessed " in green. + The string is matched using regular expressions. + Valid values for the color are black, red, green, brown, blue, + magenta, cyan, gray, orange, lightgreen, yellow, lightblue, + lightmagenta, lightcyan and white. + You can define menucolor as many times as you wish; those + defined later will take precedence. + Instead of using this with OPTIONS, consider using + MENUCOLOR="regex_string"=color in the configuration file. + Setting menucolor has effect only if TEXTCOLOR and MENU_COLOR + were set at compile time. [NONE] menu_* create single character accelerators for menu commands. Below is a list of all commands. Each is followed by a list of window- ports that implement them: 'x' is X11, 't' is tty, 'g' is Gem, diff -bNurdX diff_ign.txt nh343orig/dat/wizhelp nh343jl/dat/wizhelp --- nh343orig/dat/wizhelp 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/dat/wizhelp 2003-12-14 21:06:10.000000000 +0200 @@ -16,6 +16,7 @@ #panic == panic test #polyself == polymorph self #seenv == show seen vectors +#showkills == show numbers of monsters killed #stats == show memory statistics #timeout == look at timeout queue #vision == show vision array diff -bNurdX diff_ign.txt nh343orig/doc/Guidebook.mn nh343jl/doc/Guidebook.mn --- nh343orig/doc/Guidebook.mn 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/doc/Guidebook.mn 2007-04-23 23:27:22.000000000 +0300 @@ -1723,6 +1723,8 @@ .lp "confirm " Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). +.lp death_explore +Prompt for changing to explore mode when your character dies. .lp DECgraphics Use a predefined selection of characters from the DEC VT-xxx/DEC Rainbow/ANSI line-drawing character set to display the dungeon/effects/traps @@ -1770,6 +1772,12 @@ .lp dogname Name your starting dog (ex. ``dogname:Fang''). Cannot be set with the `O' command. +.lp dumpfile +The name of a file where the disclosure information is written when the +game ends. You may use the macro %n that will be replaced with the name +of your player character. The game must have write permissions to the +directory where the file is written. Normally /tmp may be used for unix +systems. .lp dungeon Set the graphics symbols for displaying the dungeon (default \&``\ |--------||.-|++##.##<><>_|\e\e#{}.}..##\ #}''). @@ -1874,6 +1882,8 @@ Ignore interrupt signals, including breaks (default off). .lp legacy Display an introductory message when starting the game (default on). +.lp like_swimming +Allow category ``Items known to be Rustprone'' in selection menus. .lp lit_corridor Show corridor squares seen by night vision or a light source held by your character as lit (default off). @@ -2027,6 +2037,15 @@ The value of this option should be a string containing the symbols for the various object types. Any omitted types are filled in at the end from the previous order. +.lp paranoid_hit +If true, asks you to type the word ``yes'' when hitting any peaceful +monster, not just the letter ``y''. +.lp paranoid_quit +If true, asks you to type the word ``yes'' when quitting or entering +Explore mode, not just the letter ``y''. +.lp paranoid_remove +If true, always show menu with the R and T commands even when there is +only one item to remove or take off. .lp perm_invent If true, always display your current inventory in a window. This only makes sense for windowing system interfaces that implement this feature. @@ -2054,6 +2073,9 @@ .lp pushweapon Using the `w' (wield) command when already wielding something pushes the old item into your alternate weapon slot (default off). +.lp quiver_fired +Using the 'f' (fire) command when nothing is quivered, prompts for ammunition +to quiver, then fires it (default off). .lp race Selects your race (for example, ``race:human''). Default is random. Cannot be set with the `O' command. @@ -2088,6 +2110,10 @@ Control what parts of the score list you are shown at the end (ex. ``scores:5 top scores/4 around my score/own scores''). Only the first letter of each category (`t', `a', or `o') is necessary. +.lp showborn +When the game ends, show the number of each monster created +in the "Vanquished creatures" list, if it differs from the +number of those monsters killed. .lp showexp Show your accumulated experience points on bottom line (default off). .lp showrace @@ -2098,6 +2124,18 @@ Show your approximate accumulated score on bottom line (default off). .lp "silent " Suppress terminal beeps (default on). +.lp sortloot +Controls the behavior of the sortloot patch that sorts pickup lists for +inventory and #loot commands and some others. +The possible values are: +.sd +.si +full - always sort the lists; +loot - only sort the lists that don't use inventory + letters, like with the #loot and pickup commands; +none - show lists the traditional way without sorting. +.ei +.ed .lp sortpack Sort the pack contents by type when displaying inventory (default on). .lp sound @@ -2157,6 +2195,8 @@ Select which windowing system to use, such as ``tty'' or ``X11'' (default depends on version). Cannot be set with the `O' command. +.lp win_edge +Align menus and text windows in tty left instead of right. (default off) .hn 2 Window Port Customization options .pg diff -bNurdX diff_ign.txt nh343orig/doc/Guidebook.tex nh343jl/doc/Guidebook.tex --- nh343orig/doc/Guidebook.tex 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/doc/Guidebook.tex 2007-04-23 23:30:18.000000000 +0300 @@ -2161,6 +2161,9 @@ Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). %.lp +\item[\ib{death_explore}] +Prompt for changing to explore mode when your character dies. +%.lp \item[\ib{DECgraphics}] Use a predefined selection of characters from the DEC VT-xxx/DEC Rainbow/ANSI line-drawing character set to display the dungeon/effects/traps @@ -2209,6 +2212,13 @@ Name your starting dog (ex.\ ``{\tt dogname:Fang}''). Cannot be set with the `{\tt O}' command. %.lp +\item[\ib{dumpfile}] +The name of a file where the disclosure information is written when the +game ends. You may use the macro %n that will be replaced with the name +of your player character. The game must have write permissions to the +directory where the file is written. Normally /tmp may be used for unix +systems. +%.lp \item[\ib{dungeon}] Set the graphics symbols for displaying the dungeon (default ``\verb& |--------||.-|++##& \verb&.##<><>_|\\#{}.}..## #}&''). @@ -2321,6 +2331,9 @@ \item[\ib{legacy}] Display an introductory message when starting the game (default on). %.lp +\item[\ib{like\_swimming}] +Allow category ``Items known to be Rustprone'' in selection menus. +%.lp \item[\ib{lit\_corridor}] Show corridor squares seen by night vision or a light source held by your character as lit (default off). @@ -2486,6 +2499,18 @@ containing the symbols for the various object types. Any omitted types are filled in at the end from the previous order. %.lp +\item[\ib{paranoid\_hit}] +If true, asks you to type the word ``yes'' when hitting any peaceful +monster, not just the letter ``y''. +%.lp +\item[\ib{paranoid\_quit}] +If true, asks you to type the word ``yes'' when quitting or entering +Explore mode, not just the letter ``y''. +%.lp +\item[\ib{paranoid\_remove}] +If true, always show menu with the R and T commands even when there is +only one item to remove or take off. +%.lp \item[\ib{perm\_invent}] If true, always display your current inventory in a window. This only makes sense for windowing system interfaces that implement this feature. @@ -2515,6 +2540,10 @@ \item[\ib{pushweapon}] Using the `w' (wield) command when already wielding something pushes the old item into your alternate weapon slot (default off). +%.lp +\item[\ib{quiver_fired}] +Using the 'f' (fire) command when nothing is quivered, prompts for ammunition +to quiver, then fires it (default off). %.Ip \item[\ib{race}] Selects your race (for example, ``{\tt race:human}''). Default is random. @@ -2559,6 +2588,11 @@ ``{\tt scores:5top scores/4around my score/own scores}''). Only the first letter of each category (`{\tt t}', `{\tt a}' or `{\tt o}') is necessary. %.lp +\item[\ib{showborn}] +When the game ends, show the number of each monster created +in the ``Vanquished creatures'' list, if it differs from the +number of those monsters killed. +%.lp \item[\ib{showexp}] Show your accumulated experience points on bottom line (default off). %.lp @@ -2573,6 +2607,21 @@ \item[\ib{silent}] Suppress terminal beeps (default on). %.lp +\item[\ib{sortloot}] +Controls the behavior of the sortloot patch that sorts pickup lists for +inventory and \#loot commands and some others. + +The possible values are: +%.sd +%.si +{\tt full} --- always sort the lists;\\ +{\tt loot} --- only sort the lists that don't use inventory + letters, like with the \#loot and pickup commands;\\ +{\tt none} --- show lists the traditional way without sorting. +%.ei +%.ed +%.lp +The default is 'none', the way an unpatched game works. \item[\ib{sortpack}] Sort the pack contents by type when displaying inventory (default on). %.lp @@ -2640,6 +2689,9 @@ Select which windowing system to use, such as ``{\tt tty}'' or ``{\tt X11}'' (default depends on version). Cannot be set with the `{\tt O}' command. +%.lp +\item[\ib{win_edge}] +Align menus and text windows in tty left instead of right. (default off) \elist %.hn 2 diff -bNurdX diff_ign.txt nh343orig/doc/Guidebook.txt nh343jl/doc/Guidebook.txt --- nh343orig/doc/Guidebook.txt 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/doc/Guidebook.txt 2007-04-23 23:20:58.000000000 +0300 @@ -2223,6 +2223,9 @@ Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). + death_explore + Prompt for changing to explore mode when your character dies. + DECgraphics Use a predefined selection of characters from the DEC VT- xxx/DEC Rainbow/ANSI line-drawing character set to display the @@ -2274,6 +2277,13 @@ Name your starting dog (ex. ``dogname:Fang''). Cannot be set with the `O' command. + dumpfile + The name of a file where the disclosure information is + written when the game ends. You may use the macro %n that + will be replaced with the name of your player character. + The game must have write permissions to the directory where + the file is written. Normally /tmp may be used for unixes. + dungeon Set the graphics symbols for displaying the dungeon (default `` |--------||.-|++##.##<><>_|\\#{}.}..## #}''). The dungeon @@ -2413,6 +2423,10 @@ Display an introductory message when starting the game (default on). + like_swimming + Allow category "Items known to be Rustprone" in selection + menus. + lit_corridor Show corridor squares seen by night vision or a light source held by your character as lit (default off). @@ -2607,6 +2621,18 @@ Any omitted types are filled in at the end from the previous order. + paranoid_hit + If true, asks you to type the word ``yes'' when hitting any + peaceful monster, not just the letter ``y''. + + paranoid_quit + If true, asks you to type the word ``yes'' when quitting or + entering Explore mode, not just the letter ``y''. + + paranoid_remove + If true, always show menu with the R and T commands even when + there is only one item to remove or take off. + perm_invent If true, always display your current inventory in a window. This only makes sense for windowing system interfaces that im- @@ -2652,6 +2678,10 @@ pushes the old item into your alternate weapon slot (default off). + quiver_fired + Using the 'f' (fire) command when nothing is quivered, prompts + for ammunition to quiver, then fires it (default off). + race Selects your race (for example, ``race:human''). Default is random. Cannot be set with the `O' command. @@ -2693,6 +2723,11 @@ Only the first letter of each category (`t', `a', or `o') is necessary. + showborn + When the game ends, show the number of each monster created + in the "Vanquished creatures" list, if it differs from the + number of those monsters killed. + showexp Show your accumulated experience points on bottom line (default off). @@ -2723,6 +2758,18 @@ silent Suppress terminal beeps (default on). + sortloot + Controls the behavior of the sortloot patch that sorts + pickup lists for inventory and #loot commands and some + others. + The possible values are: + + full - always sort the lists + loot - only sort the lists that don't use inventory + letters, like with the #loot and pickup commands + none - show lists the traditional way without sorting + The default is 'none', the way an unpatched game works. + sortpack Sort the pack contents by type when displaying inventory (de- fault on). @@ -2808,6 +2855,10 @@ ``X11'' (default depends on version). Cannot be set with the `O' command. + win_edge + Align menus and text windows in tty left instead of right. + (default off) + 9.5. Window Port Customization options Here are explanations of the various options that are used diff -bNurdX diff_ign.txt nh343orig/include/color.h nh343jl/include/color.h --- nh343orig/include/color.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/color.h 2003-12-14 21:06:10.000000000 +0200 @@ -5,6 +5,12 @@ #ifndef COLOR_H #define COLOR_H +#ifdef MENU_COLOR +# ifdef MENU_COLOR_REGEX +# include +# endif +#endif + /* * The color scheme used is tailored for an IBM PC. It consists of the * standard 8 colors, folowed by their bright counterparts. There are @@ -49,4 +55,16 @@ #define DRAGON_SILVER CLR_BRIGHT_CYAN #define HI_ZAP CLR_BRIGHT_BLUE +#ifdef MENU_COLOR +struct menucoloring { +# ifdef MENU_COLOR_REGEX + struct re_pattern_buffer match; +# else + char *match; +# endif + int color, attr; + struct menucoloring *next; +}; +#endif /* MENU_COLOR */ + #endif /* COLOR_H */ diff -bNurdX diff_ign.txt nh343orig/include/config.h nh343jl/include/config.h --- nh343orig/include/config.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/config.h 2007-04-22 23:10:11.000000000 +0300 @@ -349,7 +349,35 @@ */ /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ -/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */ +#define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */ +#define DUMP_LOG /* Dump game end information to a file */ +/* #define DUMP_FN "/tmp/%n.nh" */ /* Fixed dumpfile name, if you want + * to prevent definition by users */ +#define DUMPMSGS 20 /* Number of latest messages in the dump file */ +#define LOG_MOVES /* Move count and wiz/exp mode info in logfile */ +#define SHOW_BORN /* Show numbers of each monster created */ +#define SHOW_EXTINCT /* Show extinct species in the genocide list */ +#define SORTLOOT /* Enable alphabetical sorting of pickup lists */ +#define PARANOID /* Require "yes" for quit or switch to explore */ +#ifdef TTY_GRAPHICS +# define HPMON /* Color hp monitor */ +# define MENU_COLOR +/*# define MENU_COLOR_REGEX */ +/* if MENU_COLOR_REGEX is defined, use regular expressions (GNU regex.h) + * otherwise use pmatch() to match menu color lines. + * pmatch() provides basic globbing: '*' and '?' wildcards. + */ +# define WIN_EDGE /* windows aligned left&top */ +#endif +#define FORGET_QUITTER /* No record entry for quitters */ +#define PROMPT_LOGEXP /* Prompt for log entry in wizard or explore mode */ +#define DEATH_EXPLORE /* Prompt for explore mode on death */ +#define ITEMCAT /* Additional item categories */ +#define ITEMCAT_JP /* "just picked" category */ +#define ADJSPLIT /* splittable #adjust command */ +#define HELPLESS /* "while helpless" patch */ +#define ENL_STATS /* extra status attributes patch */ +#define QUIVER_FIRED /* prompt quivering on f command */ /* End of Section 5 */ diff -bNurdX diff_ign.txt nh343orig/include/decl.h nh343jl/include/decl.h --- nh343orig/include/decl.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/decl.h 2004-03-28 22:35:22.000000000 +0300 @@ -27,6 +27,9 @@ E NEARDATA int bases[MAXOCLASSES]; E NEARDATA int multi; +#ifdef HELPLESS +E char multi_txt[BUFSZ]; +#endif #if 0 E NEARDATA int warnlevel; #endif @@ -184,6 +187,9 @@ E long done_money; #endif E char killer_buf[BUFSZ]; +#ifdef DUMP_LOG +E char dump_fn[]; /* dumpfile name (dump patch) */ +#endif E const char *configfile; E NEARDATA char plname[PL_NSIZ]; E NEARDATA char dogname[]; diff -bNurdX diff_ign.txt nh343orig/include/extern.h nh343jl/include/extern.h --- nh343orig/include/extern.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/extern.h 2006-07-19 13:08:38.000000000 +0300 @@ -116,6 +116,10 @@ /* ### bones.c ### */ +#ifdef ENL_STATS +E const char *NDECL(encstat); +E const char *NDECL(hunstat); +#endif E boolean NDECL(can_make_bones); E void FDECL(savebones, (struct obj *)); E int NDECL(getbones); @@ -131,6 +135,10 @@ E int FDECL(describe_level, (char *)); E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P)); E void NDECL(bot); +#ifdef DUMP_LOG +E void FDECL(bot1str, (char *)); +E void FDECL(bot2str, (char *)); +#endif /* ### cmd.c ### */ @@ -166,6 +174,10 @@ E int NDECL(extcmd_via_menu); E void FDECL(enlightenment, (int)); E void FDECL(show_conduct, (int)); +#ifdef DUMP_LOG +E void FDECL(dump_enlightenment, (int)); +E void FDECL(dump_conduct, (int)); +#endif E int FDECL(xytod, (SCHAR_P,SCHAR_P)); E void FDECL(dtoxy, (coord *,int)); E int FDECL(movecmd, (CHAR_P)); @@ -281,6 +293,9 @@ E void FDECL(row_refresh, (int,int,int)); E void NDECL(cls); E void FDECL(flush_screen, (int)); +#ifdef DUMP_LOG +E void NDECL(dump_screen); +#endif E int FDECL(back_to_glyph, (XCHAR_P,XCHAR_P)); E int FDECL(zapdir_to_glyph, (int,int,int)); E int FDECL(glyph_at, (XCHAR_P,XCHAR_P)); @@ -553,6 +568,10 @@ #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) E void FDECL(done, (int)); E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P)); +#ifdef DUMP_LOG +E void FDECL(dump, (char *, char *)); +E void FDECL(do_containerconts, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P)); +#endif E void FDECL(terminate, (int)); E int NDECL(num_genocides); @@ -694,7 +713,11 @@ E int NDECL(dopickup); E void NDECL(lookaround); E int NDECL(monster_nearby); +#ifdef HELPLESS +E void FDECL(nomul, (int, const char *)); +#else E void FDECL(nomul, (int)); +#endif E void FDECL(unmul, (const char *)); E void FDECL(losehp, (int,const char *,BOOLEAN_P)); E int NDECL(weight_cap); @@ -790,6 +813,9 @@ E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long,long)); E int NDECL(ddoinv); E char FDECL(display_inventory, (const char *,BOOLEAN_P)); +#ifdef DUMP_LOG +E char FDECL(dump_inventory, (const char *,BOOLEAN_P,BOOLEAN_P)); +#endif E int FDECL(display_binventory, (int,int,BOOLEAN_P)); E struct obj *FDECL(display_cinventory,(struct obj *)); E struct obj *FDECL(display_minventory,(struct monst *,int,char *)); @@ -1360,6 +1386,9 @@ E boolean FDECL(not_fully_identified, (struct obj *)); E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P)); E char *FDECL(cxname, (struct obj *)); +#ifdef SORTLOOT +E char *FDECL(cxname2, (struct obj *)); +#endif E char *FDECL(killer_xname, (struct obj *)); E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P))); E char *FDECL(an, (const char *)); @@ -1405,6 +1434,9 @@ E int FDECL(add_autopickup_exception, (const char *)); E void NDECL(free_autopickup_exceptions); #endif /* AUTOPICKUP_EXCEPTIONS */ +#ifdef MENU_COLOR +E boolean FDECL(add_menu_coloring, (char *)); +#endif /* MENU_COLOR */ /* ### pager.c ### */ @@ -1483,6 +1515,9 @@ E int FDECL(in_container, (struct obj *)); E int FDECL(out_container, (struct obj *)); #endif +#ifdef ITEMCAT_JP +E void FDECL(jpick_free, (struct obj *)); +#endif E int FDECL(pickup, (int)); E int FDECL(pickup_object, (struct obj *, long, BOOLEAN_P)); E int FDECL(query_category, (const char *, struct obj *, int, @@ -2237,6 +2272,9 @@ E int NDECL(abon); E int NDECL(dbon); E int NDECL(enhance_weapon_skill); +#ifdef DUMP_LOG +E void NDECL(dump_weapon_skill); +#endif E void FDECL(unrestrict_weapon_skill, (int)); E void FDECL(use_skill, (int,int)); E void FDECL(add_weapon_skill, (int)); diff -bNurdX diff_ign.txt nh343orig/include/flag.h nh343jl/include/flag.h --- nh343orig/include/flag.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/flag.h 2007-04-22 23:17:08.000000000 +0300 @@ -155,6 +155,9 @@ */ struct instance_flags { +#ifdef ITEMCAT + boolean like_swimming; /* category r - Items known to be Rustprone */ +#endif /* ITEMCAT */ boolean cbreak; /* in cbreak mode, rogue format */ boolean DECgraphics; /* use DEC VT-xxx extended character set */ boolean echo; /* 1 to echo characters */ @@ -183,6 +186,12 @@ char prevmsg_window; /* type of old message window to use */ boolean extmenu; /* extended commands use menu interface */ #endif +#ifdef MENU_COLOR + boolean use_menu_color; /* use color in menus; only if wc_color */ +#endif +#ifdef WIN_EDGE + boolean win_edge; /* are the menus aligned left&top */ +#endif #ifdef MFLOPPY boolean checkspace; /* check disk space before writing files */ /* (in iflags to allow restore after moving @@ -216,6 +225,23 @@ boolean lan_mail; /* mail is initialized */ boolean lan_mail_fetched; /* mail is awaiting display */ #endif +#ifdef SHOW_BORN + boolean show_born; /* show numbers of created monsters */ +#endif +#ifdef SORTLOOT + char sortloot; /* sort items to loot alphabetically */ +#endif +#ifdef PARANOID + boolean paranoid_hit; /* Ask for 'yes' when hitting peacefuls */ + boolean paranoid_quit; /* Ask for 'yes' when quitting */ + boolean paranoid_remove; /* Always show menu for 'T' and 'R' */ +#endif +#ifdef DEATH_EXPLORE + boolean death_expl; /* prompt for explore mode at death */ +#endif +#ifdef QUIVER_FIRED + boolean quiver_fired; /* quiver with f command */ +#endif /* * Window capability support. */ diff -bNurdX diff_ign.txt nh343orig/include/hack.h nh343jl/include/hack.h --- nh343orig/include/hack.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/hack.h 2003-12-14 21:06:10.000000000 +0200 @@ -169,6 +169,13 @@ #define BUC_UNCURSED 0x200 #define BUC_UNKNOWN 0x400 #define BUC_ALLBKNOWN (BUC_BLESSED|BUC_CURSED|BUC_UNCURSED) +#ifdef ITEMCAT +#define UNIDENTIFIED 0x800 +#define RUSTPRONE 0x1000 +#endif +#ifdef ITEMCAT_JP +#define JUSTPICKED 0x2000 +#endif #define ALL_TYPES_SELECTED -2 /* Flags to control find_mid() */ diff -bNurdX diff_ign.txt nh343orig/include/obj.h nh343jl/include/obj.h --- nh343orig/include/obj.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/obj.h 2003-12-14 21:06:10.000000000 +0200 @@ -303,4 +303,17 @@ #define CONTAINED_TOO 0x1 #define BURIED_TOO 0x2 +#ifdef ITEMCAT +#ifdef MAIL +#define BKNOWN(otmp) (otmp->bknown || otmp->otyp == SCR_MAIL) +#else +#define BKNOWN(otmp) (otmp->bknown) +#endif + +/* faster version of not_fully_identified() for item selection + * (invent.c/pickup.c) */ +#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)))) + +#endif /* ITEMCAT */ + #endif /* OBJ_H */ diff -bNurdX diff_ign.txt nh343orig/include/objclass.h nh343jl/include/objclass.h --- nh343orig/include/objclass.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/objclass.h 2003-12-14 21:06:10.000000000 +0200 @@ -70,6 +70,14 @@ /* primary damage: fire/rust/--- */ /* is_flammable(otmp), is_rottable(otmp) in mkobj.c */ #define is_rustprone(otmp) (objects[otmp->otyp].oc_material == IRON) +#ifdef ITEMCAT +/* is rustprone, and rust matters (is displayed in inventory listing) */ +#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)) +/* rustproneness should not be immediately visible */ +#define hide_rust(otmp) ((otmp->otyp==GAUNTLETS_OF_POWER || otmp->otyp==KICKING_BOOTS) && !otmp->oeroded) +/* object is known to be rustprone and is NOT known to be rustproof */ +#define is_known_rustprone(otmp) (is_rustprone2(otmp) && !(otmp->rknown && otmp->oerodeproof) && (!hide_rust(otmp) || objects[otmp->otyp].oc_name_known)) +#endif /* ITEMCAT */ /* secondary damage: rot/acid/acid */ #define is_corrodeable(otmp) (objects[otmp->otyp].oc_material == COPPER || objects[otmp->otyp].oc_material == IRON) diff -bNurdX diff_ign.txt nh343orig/include/os2conf.h nh343jl/include/os2conf.h --- nh343orig/include/os2conf.h 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/include/os2conf.h 2003-12-14 21:06:10.000000000 +0200 @@ -28,7 +28,10 @@ #if defined(OS2_GCC) || defined(OS2_CSET2) # define OS2_32BITAPI /* enable for compilation in OS/2 2.0 */ #endif - +/* These are needed to allow defining directory names in the config file */ +#define NOCWD_ASSUMPTIONS +#define PC_LOCKING +#define HLOCK "NHPERM" /* * Other configurable options. Generally no * reason to touch the defaults, I think. diff -bNurdX diff_ign.txt nh343orig/src/allmain.c nh343jl/src/allmain.c --- nh343orig/src/allmain.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/allmain.c 2004-03-29 02:36:41.000000000 +0300 @@ -245,7 +245,11 @@ if (occupation) stop_occupation(); else - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if (change == 1) polyself(FALSE); else you_were(); change = 0; @@ -438,7 +442,11 @@ sync_hunger(); */ #ifdef REDO - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); pushch(0); #endif } diff -bNurdX diff_ign.txt nh343orig/src/apply.c nh343jl/src/apply.c --- nh343orig/src/apply.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/apply.c 2004-03-29 02:41:58.000000000 +0300 @@ -624,7 +624,11 @@ pline(Hallucination ? "Yow! The mirror stares back!" : "Yikes! You've frozen yourself!"); - nomul(-rnd((MAXULEV+6) - u.ulevel)); + nomul(-rnd((MAXULEV+6) - u.ulevel) +#ifdef HELPLESS + , "gazing into a mirror" +#endif + ); } else You("stiffen momentarily under your gaze."); } else if (youmonst.data->mlet == S_VAMPIRE) You("don't have a reflection."); @@ -788,7 +792,11 @@ break; case 2: /* no explanation; it just happens... */ nomovemsg = ""; - nomul(-rnd(2)); + nomul(-rnd(2) +#ifdef HELPLESS + , 0 +#endif + ); break; } } @@ -1358,7 +1366,11 @@ change_luck(-1); teleds(cc.x, cc.y, TRUE); - nomul(-1); + nomul(-1 +#ifdef HELPLESS + , "jumping around" +#endif + ); nomovemsg = ""; morehungry(rnd(25)); return 1; @@ -2750,7 +2762,11 @@ current_wand = 0; if (obj) delobj(obj); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return 1; } @@ -3012,11 +3028,19 @@ } pline("Sorry, I don't know how to use that."); xit: - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return 0; } if (res && obj && obj->oartifact) arti_speak(obj); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return res; } diff -bNurdX diff_ign.txt nh343orig/src/artifact.c nh343jl/src/artifact.c --- nh343orig/src/artifact.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/artifact.c 2004-03-29 02:36:40.000000000 +0300 @@ -856,7 +856,11 @@ if (Antimagic) { resisted = TRUE; } else { - nomul(-3); + nomul(-3 +#ifdef HELPLESS + , "being scared stiff" +#endif + ); nomovemsg = ""; if (magr && magr == u.ustuck && sticks(youmonst.data)) { u.ustuck = (struct monst *)0; diff -bNurdX diff_ign.txt nh343orig/src/ball.c nh343jl/src/ball.c --- nh343orig/src/ball.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/ball.c 2004-03-29 02:36:40.000000000 +0300 @@ -557,7 +557,11 @@ if (near_capacity() > SLT_ENCUMBER && dist2(x, y, u.ux, u.uy) <= 2) { You("cannot %sdrag the heavy iron ball.", invent ? "carry all that and also " : ""); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return FALSE; } @@ -595,7 +599,11 @@ u.uy = uchain->oy; newsym(u.ux0, u.uy0); } - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); *bc_control = BC_BALL; move_bc(1, *bc_control, *ballx, *bally, *chainx, *chainy); diff -bNurdX diff_ign.txt nh343orig/src/botl.c nh343jl/src/botl.c --- nh343orig/src/botl.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/botl.c 2006-07-19 13:13:16.000000000 +0300 @@ -3,6 +3,11 @@ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" +#if defined(HPMON) && defined(TEXTCOLOR) +# ifndef WINTTY_H +# include "wintty.h" +# endif +#endif #ifdef OVL0 extern const char *hu_stat[]; /* defined in eat.c */ @@ -165,10 +170,16 @@ } #endif +#ifdef DUMP_LOG +void bot1str(char *newbot1) +#else STATIC_OVL void bot1() +#endif { +#ifndef DUMP_LOG char newbot1[MAXCO]; +#endif register char *nb; register int i,j; @@ -215,6 +226,15 @@ if (flags.showscore) Sprintf(nb = eos(nb), " S:%ld", botl_score()); #endif +#ifdef DUMP_LOG +} +STATIC_OVL void +bot1() +{ + char newbot1[MAXCO]; + + bot1str(newbot1); +#endif curs(WIN_STATUS, 1, 0); putstr(WIN_STATUS, 0, newbot1); } @@ -242,12 +262,22 @@ return ret; } +#ifdef DUMP_LOG +void bot2str(newbot2) +char* newbot2; +#else STATIC_OVL void bot2() +#endif { +#ifndef DUMP_LOG char newbot2[MAXCO]; +#endif register char *nb; int hp, hpmax; +#ifdef HPMON + int hpcolor, hpattr; +#endif int cap = near_capacity(); hp = Upolyd ? u.mh : u.uhp; @@ -256,6 +286,15 @@ if(hp < 0) hp = 0; (void) describe_level(newbot2); Sprintf(nb = eos(newbot2), +#ifdef HPMON + "%c:%-2ld HP:", oc_syms[COIN_CLASS], +#ifndef GOLDOBJ + u.ugold +#else + money_cnt(invent) +#endif + ); +#else /* HPMON */ "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS], #ifndef GOLDOBJ u.ugold, @@ -263,6 +302,39 @@ money_cnt(invent), #endif hp, hpmax, u.uen, u.uenmax, u.uac); +#endif /* HPMON */ +#ifdef HPMON + curs(WIN_STATUS, 1, 1); + putstr(WIN_STATUS, 0, newbot2); + + Sprintf(nb = eos(newbot2), "%d(%d)", hp, hpmax); +#ifdef TEXTCOLOR + if (iflags.use_color) { + curs(WIN_STATUS, 1, 1); + hpattr = ATR_NONE; + if(hp == hpmax){ + hpcolor = NO_COLOR; + } else if(hp > (hpmax*2/3)) { + hpcolor = CLR_GREEN; + } else if(hp <= (hpmax/3)) { + hpcolor = CLR_RED; + if(hp<=(hpmax/10)) + hpattr = ATR_BLINK; + } else { + hpcolor = CLR_YELLOW; + } + if (hpcolor != NO_COLOR) + term_start_color(hpcolor); + if(hpattr!=ATR_NONE)term_start_attr(hpattr); + putstr(WIN_STATUS, hpattr, newbot2); + if(hpattr!=ATR_NONE)term_end_attr(hpattr); + if (hpcolor != NO_COLOR) + term_end_color(); + } +#endif /* TEXTCOLOR */ + Sprintf(nb = eos(newbot2), " Pw:%d(%d) AC:%-2d", + u.uen, u.uenmax, u.uac); +#endif /* HPMON */ if (Upolyd) Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel); @@ -292,10 +364,37 @@ if(Slimed) Sprintf(nb = eos(nb), " Slime"); if(cap > UNENCUMBERED) Sprintf(nb = eos(nb), " %s", enc_stat[cap]); +#ifdef DUMP_LOG +} +STATIC_OVL void +bot2() +{ + char newbot2[MAXCO]; + bot2str(newbot2); +#endif curs(WIN_STATUS, 1, 1); putstr(WIN_STATUS, 0, newbot2); } +#ifdef ENL_STATS +const char * +encstat() +{ + int cap = near_capacity(); + if(cap > UNENCUMBERED) + return enc_stat[cap]; + else return ""; +} + +const char * +hunstat() +{ + if (strcmp(hu_stat[u.uhs], " ")) + return hu_stat[u.uhs]; + else return ""; +} +#endif + void bot() { diff -bNurdX diff_ign.txt nh343orig/src/cmd.c nh343jl/src/cmd.c --- nh343orig/src/cmd.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/cmd.c 2006-07-19 13:22:09.000000000 +0300 @@ -123,6 +123,10 @@ STATIC_PTR int NDECL(wiz_show_vision); STATIC_PTR int NDECL(wiz_mon_polycontrol); STATIC_PTR int NDECL(wiz_show_wmodes); +STATIC_PTR int NDECL(wiz_showkills); /* showborn patch */ +#ifdef SHOW_BORN +extern void FDECL(list_vanquished, (int, BOOLEAN_P)); /* showborn patch */ +#endif /* SHOW_BORN */ #if defined(__BORLANDC__) && !defined(_WIN32) extern void FDECL(show_borlandc_stats, (winid)); #endif @@ -139,7 +143,7 @@ STATIC_DCL int NDECL(wiz_port_debug); # endif # endif -STATIC_PTR int NDECL(enter_explore_mode); +int NDECL(enter_explore_mode); /* deathexplore patch */ STATIC_PTR int NDECL(doattributes); STATIC_PTR int NDECL(doconduct); /**/ STATIC_PTR boolean NDECL(minimal_enlightenment); @@ -475,12 +479,29 @@ return 0; } -STATIC_PTR int +int /* deathexplore patch */ enter_explore_mode() { +#ifdef PARANOID + char buf[BUFSZ]; + int really_xplor = FALSE; +#endif if(!discover && !wizard) { pline("Beware! From explore mode there will be no return to normal game."); +#ifdef PARANOID + if (iflags.paranoid_quit) { + getlin ("Do you want to enter explore mode? [yes/no]?",buf); + (void) lcase (buf); + if (!(strcmp (buf, "yes"))) really_xplor = TRUE; + } else { if (yn("Do you want to enter explore mode?") == 'y') { + really_xplor = TRUE; + } + } + if (really_xplor) { +#else + if (yn("Do you want to enter explore mode?") == 'y') { +#endif clear_nhwindow(WIN_MESSAGE); You("are now in non-scoring explore mode."); discover = TRUE; @@ -756,6 +777,13 @@ return 0; } +/* #showkills command */ +STATIC_PTR int wiz_showkills() /* showborn patch */ +{ + list_vanquished('y', FALSE); + return 0; +} + #endif /* WIZARD */ @@ -1126,6 +1154,304 @@ return; } +#ifdef DUMP_LOG +void +dump_enlightenment(final) +int final; +{ + int ltmp; + char buf[BUFSZ]; + char buf2[BUFSZ]; + const char *enc_stat[] = { /* copied from botl.c */ + "", + "burdened", + "stressed", + "strained", + "overtaxed", + "overloaded" + }; + char *youwere = " You were "; + char *youhave = " You have "; + char *youhad = " You had "; + char *youcould = " You could "; + + dump("", "Final attributes"); + +#ifdef ELBERETH + if (u.uevent.uhand_of_elbereth) { + static const char * const hofe_titles[3] = { + "the Hand of Elbereth", + "the Envoy of Balance", + "the Glory of Arioch" + }; + dump(youwere, + (char *)hofe_titles[u.uevent.uhand_of_elbereth - 1]); + } +#endif + + if (u.ualign.record >= 20) + dump(youwere, "piously aligned"); + else if (u.ualign.record > 13) + dump(youwere, "devoutly aligned"); + else if (u.ualign.record > 8) + dump(youwere, "fervently aligned"); + else if (u.ualign.record > 3) + dump(youwere, "stridently aligned"); + else if (u.ualign.record == 3) + dump(youwere, "aligned"); + else if (u.ualign.record > 0) + dump(youwere, "haltingly aligned"); + else if (u.ualign.record == 0) + dump(youwere, "nominally aligned"); + else if (u.ualign.record >= -3) dump(youhave, "strayed"); + else if (u.ualign.record >= -8) dump(youhave, "sinned"); + else dump(" You have ", "transgressed"); + Sprintf(buf, " %d", u.ualign.record); + dump(" Your alignment was ", buf); + + /*** Resistances to troubles ***/ + if (Fire_resistance) dump(youwere, "fire resistant"); + if (Cold_resistance) dump(youwere, "cold resistant"); + if (Sleep_resistance) dump(youwere, "sleep resistant"); + if (Disint_resistance) dump(youwere, "disintegration-resistant"); + if (Shock_resistance) dump(youwere, "shock resistant"); + if (Poison_resistance) dump(youwere, "poison resistant"); + if (Drain_resistance) dump(youwere, "level-drain resistant"); + if (Sick_resistance) dump(youwere, "immune to sickness"); + if (Antimagic) dump(youwere, "magic-protected"); + if (Acid_resistance) dump(youwere, "acid resistant"); + if (Stone_resistance) dump(youwere, "petrification resistant"); + if (Invulnerable) dump(youwere, "invulnerable"); + if (u.uedibility) dump(youcould, "recognize detrimental food"); + + /*** Troubles ***/ + if (Halluc_resistance) dump(" ", "You resisted hallucinations"); + if (Hallucination) dump(youwere, "hallucinating"); + if (Stunned) dump(youwere, "stunned"); + if (Confusion) dump(youwere, "confused"); + if (Blinded) dump(youwere, "blinded"); + if (Sick) { + if (u.usick_type & SICK_VOMITABLE) + dump(youwere, "sick from food poisoning"); + if (u.usick_type & SICK_NONVOMITABLE) + dump(youwere, "sick from illness"); + } + if (Stoned) dump(youwere, "turning to stone"); + if (Slimed) dump(youwere, "turning into slime"); + if (Strangled) + dump(youwere, (u.uburied) ? "buried" : "being strangled"); + if (Glib) { + Sprintf(buf, "slippery %s", makeplural(body_part(FINGER))); + dump(youhad, buf); + } + if (Fumbling) dump(" ", "You fumbled"); + if (Wounded_legs +#ifdef STEED + && !u.usteed +#endif + ) { + Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); + dump(youhad, buf); + } +#ifdef STEED + if (Wounded_legs && u.usteed) { + Strcpy(buf, x_monnam(u.usteed, ARTICLE_YOUR, (char *)0, + SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION, FALSE)); + *buf = highc(*buf); + Strcat(buf, " had wounded legs"); + dump(" ", buf); + } +#endif + if (Sleeping) dump(" ", "You fell asleep"); + if (Hunger) dump(" ", "You hungered rapidly"); + + /*** Vision and senses ***/ + if (See_invisible) dump(" ", "You saw invisible"); + if (Blind_telepat) dump(youwere, "telepathic"); + if (Warning) dump(youwere, "warned"); + if (Warn_of_mon && flags.warntype) { + Sprintf(buf, "aware of the presence of %s", + (flags.warntype & M2_ORC) ? "orcs" : + (flags.warntype & M2_DEMON) ? "demons" : + something); + dump(youwere, buf); + } + if (Undead_warning) dump(youwere, "warned of undead"); + if (Searching) dump(youhad, "automatic searching"); + if (Clairvoyant) dump(youwere, "clairvoyant"); + if (Infravision) dump(youhad, "infravision"); + if (Detect_monsters) + dump(youwere, "sensing the presence of monsters"); + if (u.umconf) dump(youwere, "going to confuse monsters"); + + /*** Appearance and behavior ***/ + if (Adornment) { + int adorn = 0; + if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe; + if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe; + if (adorn < 0) + dump(youwere, "poorly adorned"); + else + dump(youwere, "adorned"); + } + if (Invisible) dump(youwere, "invisible"); + else if (Invis) dump(youwere, "invisible to others"); + /* ordinarily "visible" is redundant; this is a special case for + the situation when invisibility would be an expected attribute */ + else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis) + dump(youwere, "visible"); + if (Displaced) dump(youwere, "displaced"); + if (Stealth) dump(youwere, "stealthy"); + if (Aggravate_monster) dump(" ", "You aggravated monsters"); + if (Conflict) dump(" ", "You caused conflict"); + + /*** Transportation ***/ + if (Jumping) dump(youcould, "jump"); + if (Teleportation) dump(youcould, "teleport"); + if (Teleport_control) dump(youhad, "teleport control"); + if (Lev_at_will) dump(youwere, "levitating, at will"); + else if (Levitation) + dump(youwere, "levitating"); /* without control */ + else if (Flying) dump(youcould, "fly"); + if (Wwalking) dump(youcould, "walk on water"); + if (Swimming) dump(youcould, "swim"); + if (Breathless) dump(youcould, "survive without air"); + else if (Amphibious) dump(youcould, "breathe water"); + if (Passes_walls) dump(youcould, "walk through walls"); +#ifdef STEED + if (u.usteed && (final < 2 || strcmp(killer, "riding accident"))) { + Sprintf(buf, "riding %s", y_monnam(u.usteed)); + dump(youwere, buf); + } +#endif + if (u.uswallow) { + Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck)); +#ifdef WIZARD + if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim); +#endif + dump(youwere, buf); + } else if (u.ustuck) { + Sprintf(buf, "%s %s", + (Upolyd && sticks(youmonst.data)) ? "holding" : "held by", + a_monnam(u.ustuck)); + dump(youwere, buf); + } + + /*** Physical attributes ***/ + if (u.uhitinc) + dump(youhad, + enlght_combatinc("to hit", u.uhitinc, final, buf)); + if (u.udaminc) + dump(youhad, + enlght_combatinc("damage", u.udaminc, final, buf)); + if (Slow_digestion) dump(youhad, "slower digestion"); + if (Regeneration) dump(" ", "You regenerated"); + if (u.uspellprot || Protection) { + int prot = 0; + + if(uleft && uleft->otyp == RIN_PROTECTION) prot += uleft->spe; + if(uright && uright->otyp == RIN_PROTECTION) prot += uright->spe; + if (HProtection & INTRINSIC) prot += u.ublessed; + prot += u.uspellprot; + + if (prot < 0) + dump(youwere, "ineffectively protected"); + else + dump(youwere, "protected"); + } + if (Protection_from_shape_changers) + dump(youwere, "protected from shape changers"); + if (Polymorph) dump(youwere, "polymorphing"); + if (Polymorph_control) dump(youhad, "polymorph control"); + if (u.ulycn >= LOW_PM) { + Strcpy(buf, an(mons[u.ulycn].mname)); + dump(youwere, buf); + } + if (Upolyd) { + if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form"); + else Sprintf(buf, "polymorphed into %s", + an(youmonst.data->mname)); +#ifdef WIZARD + if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone); +#endif + dump(youwere, buf); + } + if (Unchanging) + dump(youcould, "not change from your current form"); + if (Fast) dump(youwere, Very_fast ? "very fast" : "fast"); + if (Reflecting) dump(youhad, "reflection"); + if (Free_action) dump(youhad, "free action"); + if (Fixed_abil) dump(youhad, "fixed abilities"); + if (Lifesaved) + dump(" ", "Your life would have been saved"); + if (u.twoweap) dump(youwere, "wielding two weapons at once"); + + /*** Miscellany ***/ + if (Luck) { + ltmp = abs((int)Luck); + Sprintf(buf, "%s%slucky (%d)", + ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "", + Luck < 0 ? "un" : "", Luck); + dump(youwere, buf); + } +#ifdef WIZARD + else if (wizard) dump(" ", "Your luck was zero"); +#endif + if (u.moreluck > 0) dump(youhad, "extra luck"); + else if (u.moreluck < 0) dump(youhad, "reduced luck"); + if (carrying(LUCKSTONE) || stone_luck(TRUE)) { + ltmp = stone_luck(FALSE); + if (ltmp <= 0) + dump(" ", "Bad luck did not time out for you"); + if (ltmp >= 0) + dump(" ", "Good luck did not time out for you"); + } + + if (u.ugangr) { + Sprintf(buf, " %sangry with you", + u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : ""); +#ifdef WIZARD + if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr); +#endif + Sprintf(buf2, "%s was %s", u_gname(), buf); + dump(" ", buf2); + } + + { + const char *p; + + buf[0] = '\0'; + if (final < 2) { /* quit/escaped/ascended */ + p = "survived after being killed "; + switch (u.umortality) { + case 0: p = "survived"; break; + case 1: Strcpy(buf, "once"); break; + case 2: Strcpy(buf, "twice"); break; + case 3: Strcpy(buf, "thrice"); break; + default: Sprintf(buf, "%d times", u.umortality); + break; + } + } else { /* game ended in character's death */ + p = "are dead"; + switch (u.umortality) { + case 0: impossible("dead without dying?"); + case 1: break; /* just "are dead" */ + default: Sprintf(buf, " (%d%s time!)", u.umortality, + ordin(u.umortality)); + break; + } + } + if (p) { + Sprintf(buf2, "You %s %s", p, buf); + dump(" ", buf2); + } + } + dump("", ""); + return; + +} /* dump_enlightenment */ +#endif + /* * Courtesy function for non-debug, non-explorer mode players * to help refresh them about who/what they are. @@ -1145,6 +1471,9 @@ static const char tabbed_deity_fmtstr[] = "%s\t%s"; static const char *fmtstr; static const char *deity_fmtstr; +#ifdef ENL_STATS + boolean stats = FALSE; +#endif fmtstr = iflags.menu_tab_sep ? tabbed_fmtstr : untabbed_fmtstr; deity_fmtstr = iflags.menu_tab_sep ? @@ -1224,6 +1553,48 @@ Sprintf(buf, fmtstr, "Lawful", buf2); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); +#ifdef ENL_STATS + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE); + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Status", FALSE); + if (strcmp(hunstat(), "")) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, hunstat(), FALSE); + stats = TRUE; + } + if (near_capacity() > UNENCUMBERED) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, encstat(), FALSE); + stats = TRUE; + } + if (Confusion) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Confused", FALSE); stats = TRUE; + } + if (Sick) { + if (u.usick_type & SICK_VOMITABLE) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Dying from food poisoning", FALSE); + stats = TRUE; + } + if (u.usick_type & SICK_NONVOMITABLE) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Dying from illness", FALSE); + stats = TRUE; + } + } + if (Blind) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Blind", FALSE); + stats = TRUE; + } + if (Stunned) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Stunned", FALSE); stats = TRUE; + } + if (Hallucination) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Hallucinating", FALSE); + stats = TRUE; + } + if (Slimed) { + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Slimed", FALSE); + stats = TRUE; + } + if (!stats) add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "None", FALSE); +#endif + end_menu(tmpwin, "Base Attributes"); n = select_menu(tmpwin, PICK_NONE, &selected); destroy_nhwindow(tmpwin); @@ -1341,6 +1712,99 @@ destroy_nhwindow(en_win); } +#ifdef DUMP_LOG +void +dump_conduct(final) +int final; +{ + char buf[BUFSZ]; + int ngenocided; + + dump("", "Voluntary challenges"); + + if (!u.uconduct.food) + dump("", " You went without food"); + /* But beverages are okay */ + else if (!u.uconduct.unvegan) + dump("", " You followed a strict vegan diet"); + else if (!u.uconduct.unvegetarian) + dump("", " You were a vegetarian"); + else if (Role_if(PM_MONK) && u.uconduct.unvegetarian < 10) { + sprintf(buf, " You ate non-vegetarian food %ld time%s.", + u.uconduct.unvegetarian, plur(u.uconduct.unvegetarian)); + dump("", buf); + } + + if (!u.uconduct.gnostic) + dump("", " You were an atheist"); + + if (!u.uconduct.weaphit) + dump("", " You never hit with a wielded weapon"); + else if (Role_if(PM_MONK) && u.uconduct.weaphit < 10) { + Sprintf(buf, " You hit with a wielded weapon %ld time%s", + u.uconduct.weaphit, plur(u.uconduct.weaphit)); + dump("", buf); + } +#ifdef WIZARD + else if (wizard) { + Sprintf(buf, "hit with a wielded weapon %ld time%s", + u.uconduct.weaphit, plur(u.uconduct.weaphit)); + dump(" You ", buf); + } +#endif + if (!u.uconduct.killer) + dump("", " You were a pacifist"); + + if (!u.uconduct.literate) + dump("", " You were illiterate"); +#ifdef WIZARD + else if (wizard) { + Sprintf(buf, "read items or engraved %ld time%s", + u.uconduct.literate, plur(u.uconduct.literate)); + dump(" You ", buf); + } +#endif + + ngenocided = num_genocides(); + if (ngenocided == 0) { + dump("", " You never genocided any monsters"); + } else { + Sprintf(buf, "genocided %d type%s of monster%s", + ngenocided, plur(ngenocided), plur(ngenocided)); + dump(" You ", buf); + } + + if (!u.uconduct.polypiles) + dump("", " You never polymorphed an object"); + else { + Sprintf(buf, "polymorphed %ld item%s", + u.uconduct.polypiles, plur(u.uconduct.polypiles)); + dump(" You ", buf); + } + + if (!u.uconduct.polyselfs) + dump("", " You never changed form"); + else { + Sprintf(buf, "changed form %ld time%s", + u.uconduct.polyselfs, plur(u.uconduct.polyselfs)); + dump(" You ", buf); + } + + if (!u.uconduct.wishes) + dump("", " You used no wishes"); + else { + Sprintf(buf, "used %ld wish%s", + u.uconduct.wishes, (u.uconduct.wishes > 1L) ? "es" : ""); + dump(" You ", buf); + + if (!u.uconduct.wisharti) + dump("", " You did not wish for any artifacts"); + } + + dump("", ""); +} +#endif /* DUMP_LOG */ + #endif /* OVLB */ #ifdef OVL1 @@ -1519,6 +1983,7 @@ {(char *)0, (char *)0, donull, TRUE}, #endif {(char *)0, (char *)0, donull, TRUE}, + {(char *)0, (char *)0, donull, TRUE}, /* showkills (showborn patch) */ {(char *)0, (char *)0, donull, TRUE}, {(char *)0, (char *)0, donull, TRUE}, {(char *)0, (char *)0, donull, TRUE}, @@ -1544,6 +2009,7 @@ {"portdebug", "wizard port debug command", wiz_port_debug, TRUE}, #endif {"seenv", "show seen vectors", wiz_show_seenv, TRUE}, + {"showkills", "show list of monsters killed", wiz_showkills, TRUE}, {"stats", "show memory statistics", wiz_show_stats, TRUE}, {"timeout", "look at timeout queue", wiz_timeout_queue, TRUE}, {"vision", "show vision array", wiz_show_vision, TRUE}, diff -bNurdX diff_ign.txt nh343orig/src/decl.c nh343jl/src/decl.c --- nh343orig/src/decl.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/decl.c 2004-03-29 02:36:39.000000000 +0300 @@ -20,6 +20,9 @@ NEARDATA int bases[MAXOCLASSES] = DUMMY; NEARDATA int multi = 0; +#ifdef HELPLESS +char multi_txt[BUFSZ] = DUMMY; +#endif #if 0 NEARDATA int warnlevel = 0; /* used by movemon and dochugw */ #endif @@ -209,6 +212,15 @@ NEARDATA struct mvitals mvitals[NUMMONS]; +/* originally from end.c */ +#ifdef DUMP_LOG +#ifdef DUMP_FN +char dump_fn[] = DUMP_FN; +#else +char dump_fn[PL_PSIZ] = DUMMY; +#endif +#endif /* DUMP_LOG */ + NEARDATA struct c_color_names c_color_names = { "black", "amber", "golden", "light blue", "red", "green", @@ -235,6 +247,10 @@ "white", /* CLR_WHITE */ }; +#ifdef MENU_COLOR +struct menucoloring *menu_colorings = 0; +#endif + struct c_common_strings c_common_strings = { "Nothing happens.", "That's enough tries!", "That is a silly thing to %s.", "shudder for a moment.", diff -bNurdX diff_ign.txt nh343orig/src/detect.c nh343jl/src/detect.c --- nh343orig/src/detect.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/detect.c 2004-03-29 02:36:39.000000000 +0300 @@ -861,7 +861,11 @@ return; } You("peer into %s...", the(xname(obj))); - nomul(-rnd(10)); + nomul(-rnd(10) +#ifdef HELPLESS + , "gazing into a crystal ball" +#endif + ); nomovemsg = ""; if (obj->spe <= 0) pline_The("vision is unclear."); @@ -1191,7 +1195,11 @@ if(rnl(7-fund)) continue; cvt_sdoor_to_door(&levl[x][y]); /* .typ = DOOR */ exercise(A_WIS, TRUE); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if (Blind && !aflag) feel_location(x,y); /* make sure it shows up */ else @@ -1201,7 +1209,11 @@ levl[x][y].typ = CORR; unblock_point(x,y); /* vision */ exercise(A_WIS, TRUE); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); newsym(x,y); } else { /* Be careful not to find anything in an SCORR or SDOOR */ @@ -1246,7 +1258,11 @@ } if ((trap = t_at(x,y)) && !trap->tseen && !rnl(8)) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if (trap->ttyp == STATUE_TRAP) { if (activate_statue_trap(trap, x, y, FALSE)) diff -bNurdX diff_ign.txt nh343orig/src/dig.c nh343jl/src/dig.c --- nh343orig/src/dig.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/dig.c 2004-03-29 02:36:39.000000000 +0300 @@ -916,7 +916,11 @@ aobjnam(obj, "become")); /* you ought to be able to let go; tough luck */ /* (maybe `move_into_trap()' would be better) */ - nomul(-d(2,2)); + nomul(-d(2,2) +#ifdef HELPLESS + , "stuck in a spider web" +#endif + ); nomovemsg = "You pull free."; } else if (lev->typ == IRONBARS) { pline("Clang!"); diff -bNurdX diff_ign.txt nh343orig/src/display.c nh343jl/src/display.c --- nh343orig/src/display.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/display.c 2004-07-13 12:40:38.000000000 +0300 @@ -1370,6 +1370,106 @@ /* ========================================================================= */ +#ifdef DUMP_LOG +/* D: Added to dump screen to output file */ +STATIC_PTR uchar get_glyph_char(glyph) +int glyph; +{ + uchar ch; + register int offset; + + if (glyph >= NO_GLYPH) + return ' '; + + /* + * Map the glyph back to a character. + * + * Warning: For speed, this makes an assumption on the order of + * offsets. The order is set in display.h. + */ + if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */ + ch = def_warnsyms[offset].sym; + } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */ + /* see swallow_to_glyph() in display.c */ + ch = (uchar) defsyms[S_sw_tl + (offset & 0x7)].sym; + } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */ + /* see zapdir_to_glyph() in display.c */ + ch = defsyms[S_vbeam + (offset & 0x3)].sym; + } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */ + ch = defsyms[offset].sym; + } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) { /* object */ + ch = def_oc_syms[(int)objects[offset].oc_class]; + } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */ + ch = def_monsyms[(int)mons[offset].mlet]; + } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */ + ch = def_oc_syms[(int)objects[CORPSE].oc_class]; + } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */ + ch = def_monsyms[(int)mons[offset].mlet]; + } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */ + ch = DEF_INVISIBLE; + } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */ + ch = def_monsyms[(int)mons[offset].mlet]; + } else { /* a monster */ + ch = monsyms[(int)mons[glyph].mlet]; + } + return ch; +} + +#ifdef TTY_GRAPHICS +extern const char * FDECL(compress_str, (const char *)); +#else +const char* +compress_str(str) /* copied from win/tty/wintty.c */ +const char *str; +{ + static char cbuf[BUFSZ]; + /* compress in case line too long */ + if((int)strlen(str) >= 80) { + register const char *bp0 = str; + register char *bp1 = cbuf; + + do { + if(*bp0 != ' ' || bp0[1] != ' ') + *bp1++ = *bp0; + } while(*bp0++); + } else + return str; + return cbuf; +} +#endif /* TTY_GRAPHICS */ + +/* Take a screen dump */ +void dump_screen() +{ + register int x,y; + int lastc; + /* D: botl.c has a closer approximation to the size, but we'll go with + * this */ + char buf[300], *ptr; + + for (y = 0; y < ROWNO; y++) { + lastc = 0; + ptr = buf; + for (x = 1; x < COLNO; x++) { + uchar c = get_glyph_char(gbuf[y][x].glyph); + *ptr++ = c; + if (c != ' ') + lastc = x; + } + buf[lastc] = '\0'; + dump("", buf); + } + dump("", ""); + bot1str(buf); + ptr = (char *) compress_str((const char *) buf); + dump("", ptr); + bot2str(buf); + dump("", buf); + dump("", ""); + dump("", ""); +} +#endif /* DUMP_LOG */ + /* * back_to_glyph() * diff -bNurdX diff_ign.txt nh343orig/src/do.c nh343jl/src/do.c --- nh343orig/src/do.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/do.c 2003-12-14 21:06:10.000000000 +0200 @@ -667,8 +667,14 @@ all_categories = FALSE; n = query_category("Drop what type of items?", invent, - UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL | - BUC_BLESSED | BUC_CURSED | BUC_UNCURSED | BUC_UNKNOWN, + UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL +#ifdef ITEMCAT_JP + | JUSTPICKED +#endif +#ifdef ITEMCAT + | UNIDENTIFIED | RUSTPRONE +#endif + | BUC_BLESSED | BUC_CURSED | BUC_UNCURSED | BUC_UNKNOWN, &pick_list, PICK_ANY); if (!n) goto drop_done; for (i = 0; i < n; i++) { diff -bNurdX diff_ign.txt nh343orig/src/do_wear.c nh343jl/src/do_wear.c --- nh343orig/src/do_wear.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/do_wear.c 2004-03-29 02:36:38.000000000 +0300 @@ -1078,7 +1078,11 @@ " Use 'R' command to remove accessories." : ""); return 0; } - if (armorpieces > 1) + if (armorpieces > 1 +#ifdef PARANOID + || iflags.paranoid_remove +#endif + ) otmp = getobj(clothes, "take off"); if (otmp == 0) return(0); if (!(otmp->owornmask & W_ARMOR)) { @@ -1128,7 +1132,11 @@ " Use 'T' command to take off armor." : ""); return(0); } - if (Accessories != 1) otmp = getobj(accessories, "remove"); + if (Accessories != 1 +#ifdef PARANOID + || iflags.paranoid_remove +#endif + ) otmp = getobj(accessories, "remove"); if(!otmp) return(0); if(!(otmp->owornmask & (W_RING | W_AMUL | W_TOOL))) { You("are not wearing that."); @@ -1184,7 +1192,11 @@ if(cursed(otmp)) return(0); if(delay) { - nomul(delay); + nomul(delay +#ifdef HELPLESS + , "disrobing" +#endif + ); if (is_helmet(otmp)) { nomovemsg = "You finish taking off your helmet."; afternmv = Helmet_off; @@ -1441,7 +1453,11 @@ setworn(otmp, mask); delay = -objects[otmp->otyp].oc_delay; if(delay){ - nomul(delay); + nomul(delay +#ifdef HELPLESS + , "dressing up" +#endif + ); if(is_boots(otmp)) afternmv = Boots_on; if(is_helmet(otmp)) afternmv = Helmet_on; if(is_gloves(otmp)) afternmv = Gloves_on; diff -bNurdX diff_ign.txt nh343orig/src/dothrow.c nh343jl/src/dothrow.c --- nh343orig/src/dothrow.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/dothrow.c 2007-04-22 23:22:56.000000000 +0300 @@ -300,8 +300,16 @@ if (!flags.autoquiver) { /* Don't automatically fill the quiver */ You("have no ammunition readied!"); +#ifdef QUIVER_FIRED + if (iflags.quiver_fired) + dowieldquiver(); /* quiver_fired */ + if (!uquiver) +#endif return(dothrow()); } +#ifdef QUIVER_FIRED + else { /* quiver_fired */ +#endif autoquiver(); if (!uquiver) { You("have nothing appropriate for your quiver!"); @@ -310,6 +318,9 @@ You("fill your quiver:"); prinv((char *)0, uquiver, 0L); } +#ifdef QUIVER_FIRED + } /* quiver_fired */ +#endif } /* @@ -608,13 +619,21 @@ */ if(Punished && !carried(uball)) { You_feel("a tug from the iron ball."); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } else if (u.utrap) { You("are anchored by the %s.", u.utraptype == TT_WEB ? "web" : u.utraptype == TT_LAVA ? "lava" : u.utraptype == TT_INFLOOR ? surface(u.ux,u.uy) : "trap"); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } @@ -624,7 +643,11 @@ if(!range || (!dx && !dy) || u.ustuck) return; /* paranoia */ - nomul(-range); + nomul(-range +#ifdef HELPLESS + , "moving through the air" +#endif + ); if (verbose) You("%s in the opposite direction.", range > 1 ? "hurtle" : "float"); /* if we're in the midst of shooting multiple projectiles, stop */ diff -bNurdX diff_ign.txt nh343orig/src/eat.c nh343jl/src/eat.c --- nh343orig/src/eat.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/eat.c 2004-03-29 02:36:37.000000000 +0300 @@ -862,7 +862,11 @@ /* A pile of gold can't ride. */ if (u.usteed) dismount_steed(DISMOUNT_FELL); #endif - nomul(-tmp); + nomul(-tmp +#ifdef HELPLESS + , "pretending to be a pile of gold" +#endif + ); Sprintf(buf, Hallucination ? "You suddenly dread being peeled and mimic %s again!" : "You now prefer mimicking %s again.", @@ -1224,7 +1228,11 @@ surface(u.ux,u.uy); pline_The("world spins and %s %s.", what, where); flags.soundok = 0; - nomul(-rnd(10)); + nomul(-rnd(10) +#ifdef HELPLESS + , "unconscious from rotten food" +#endif + ); nomovemsg = "You are conscious again."; afternmv = Hear_again; return(1); @@ -2244,7 +2252,11 @@ void reset_faint() /* call when a faint must be prematurely terminated */ { - if(is_fainted()) nomul(0); + if(is_fainted()) nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); } #if 0 @@ -2255,7 +2267,11 @@ if(is_fainted()) { flags.soundok = 0; - nomul(-10+(u.uhunger/10)); + nomul(-10+(u.uhunger/10) +#ifdef HELPLESS + , "fainted from lack of food" +#endif + ); nomovemsg = "You regain consciousness."; afternmv = unfaint; } @@ -2320,7 +2336,11 @@ stop_occupation(); You("faint from lack of food."); flags.soundok = 0; - nomul(-10+(u.uhunger/10)); + nomul(-10+(u.uhunger/10) +#ifdef HELPLESS + , "fainted from lack of food" +#endif + ); nomovemsg = "You regain consciousness."; afternmv = unfaint; newhs = FAINTED; @@ -2489,7 +2509,11 @@ vomit() /* A good idea from David Neves */ { make_sick(0L, (char *) 0, TRUE, SICK_VOMITABLE); - nomul(-2); + nomul(-2 +#ifdef HELPLESS + , "vomiting" +#endif + ); } int diff -bNurdX diff_ign.txt nh343orig/src/end.c nh343jl/src/end.c --- nh343orig/src/end.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/end.c 2006-08-19 00:12:31.000000000 +0300 @@ -10,6 +10,9 @@ #include #endif #include "dlb.h" +#ifdef DEATH_EXPLORE +extern int NDECL(enter_explore_mode); +#endif /* these probably ought to be generated by makedefs, like LAST_GEM */ #define FIRST_GEM DILITHIUM_CRYSTAL @@ -39,8 +42,16 @@ STATIC_DCL void FDECL(sort_valuables, (struct valuable_data *,int)); STATIC_DCL void FDECL(artifact_score, (struct obj *,BOOLEAN_P,winid)); STATIC_DCL void FDECL(savelife, (int)); -STATIC_DCL void FDECL(list_vanquished, (CHAR_P,BOOLEAN_P)); +void FDECL(list_vanquished, (CHAR_P,BOOLEAN_P)); +#ifdef DUMP_LOG +extern char msgs[][BUFSZ]; +extern int lastmsg; +extern void NDECL(dump_spells); +void FDECL(do_vanquished, (int, BOOLEAN_P, BOOLEAN_P)); +STATIC_DCL void FDECL(list_genocided, (int, BOOLEAN_P, BOOLEAN_P)); +#else STATIC_DCL void FDECL(list_genocided, (CHAR_P,BOOLEAN_P)); +#endif /* DUMP_LOG */ STATIC_DCL boolean FDECL(should_query_disclose_option, (int,char *)); #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) @@ -86,6 +97,62 @@ extern const char * const killed_by_prefix[]; /* from topten.c */ +#ifdef DUMP_LOG +FILE *dump_fp = (FILE *)0; /* file pointer for dumps */ +/* functions dump_init, dump_exit and dump are from the dump patch */ + +void +dump_init () +{ + if (dump_fn[0]) { + char *p = (char *) strstr(dump_fn, "%n"); + if (p) { + int new_dump_fn_len = strlen(dump_fn)+strlen(plname)-2; /* %n */ + char *new_dump_fn = (char *) alloc((unsigned)(new_dump_fn_len+1)); + char *q = new_dump_fn; + strncpy(q, dump_fn, p-dump_fn); + q += p-dump_fn; + strncpy(q, plname, strlen(plname) + 1); + regularize(q); + q[strlen(plname)] = '\0'; + q += strlen(q); + p += 2; /* skip "%n" */ + strncpy(q, p, strlen(p)); + new_dump_fn[new_dump_fn_len] = '\0'; + + dump_fp = fopen(new_dump_fn, "w"); + if (!dump_fp) { + pline("Can't open %s for output.", new_dump_fn); + pline("Dump file not created."); + } + free(new_dump_fn); + + } else { + dump_fp = fopen (dump_fn, "w"); + + if (!dump_fp) { + pline("Can't open %s for output.", dump_fn); + pline("Dump file not created."); + } + } + } +} + +void +dump_exit () +{ + if (dump_fp) + fclose (dump_fp); +} + +void dump (pre, str) + char *pre, *str; +{ + if (dump_fp) + fprintf (dump_fp, "%s%s\n", pre, str); +} +#endif /* DUMP_LOG */ + /*ARGSUSED*/ void done1(sig_unused) /* called as signal() handler, so sent at least one arg */ @@ -101,7 +168,11 @@ clear_nhwindow(WIN_MESSAGE); curs_on_u(); wait_synch(); - if(multi > 0) nomul(0); + if(multi > 0) nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); } else { (void)done2(); } @@ -112,14 +183,32 @@ int done2() { +#ifdef PARANOID + char buf[BUFSZ]; + int really_quit = FALSE; + + if (iflags.paranoid_quit) { + getlin ("Really quit [yes/no]?",buf); + (void) lcase (buf); + if (!(strcmp (buf, "yes"))) really_quit = TRUE; + } else { + if(yn("Really quit?") == 'y') really_quit = TRUE; + } + if (!really_quit) { +#else /* PARANOID */ if(yn("Really quit?") == 'n') { +#endif /* PARANOID */ #ifndef NO_SIGNAL (void) signal(SIGINT, (SIG_RET_TYPE) done1); #endif clear_nhwindow(WIN_MESSAGE); curs_on_u(); wait_synch(); - if(multi > 0) nomul(0); + if(multi > 0) nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if(multi == 0) { u.uinvulnerable = FALSE; /* avoid ctrl-C bug -dlc */ u.usleep = 0; @@ -224,7 +313,14 @@ Sprintf(eos(buf), " called %s", NAME(mtmp)); } - if (multi) Strcat(buf, ", while helpless"); + if (multi) { +#ifdef HELPLESS + if (strlen(multi_txt) > 0) + Sprintf(eos(buf), ", while %s", multi_txt); + else +#endif + Strcat(buf, ", while helpless"); + } killer = buf; if (mtmp->data->mlet == S_WRAITH) u.ugrave_arise = PM_WRAITH; @@ -366,18 +462,30 @@ ask = should_query_disclose_option('i', &defquery); if (!done_stopprint) { c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery; - if (c == 'y') { + } else { + c = 'n'; + } + { +#ifdef DUMP_LOG + boolean want_disp = (c == 'y')? TRUE: FALSE; +#endif struct obj *obj; for (obj = invent; obj; obj = obj->nobj) { makeknown(obj->otyp); obj->known = obj->bknown = obj->dknown = obj->rknown = 1; } +#ifdef DUMP_LOG + (void) dump_inventory((char *)0, TRUE, want_disp); + do_containerconts(invent, TRUE, TRUE, TRUE, want_disp); +#else + if (c == 'y') { (void) display_inventory((char *)0, TRUE); container_contents(invent, TRUE, TRUE); } - if (c == 'q') done_stopprint++; +#endif /* DUMP_LOG */ } + if (c == 'q') done_stopprint++; } ask = should_query_disclose_option('a', &defquery); @@ -388,14 +496,28 @@ enlightenment(how >= PANICKED ? 1 : 2); /* final */ if (c == 'q') done_stopprint++; } +#ifdef DUMP_LOG + if (dump_fp) { + dump_enlightenment((int) (how >= PANICKED ? 1 : 2)); + dump_spells(); + } +#endif ask = should_query_disclose_option('v', &defquery); +#ifdef DUMP_LOG + do_vanquished(defquery, ask, TRUE); +#else if (!done_stopprint) list_vanquished(defquery, ask); +#endif ask = should_query_disclose_option('g', &defquery); if (!done_stopprint) +#ifdef DUMP_LOG + list_genocided(defquery, ask,TRUE); +#else list_genocided(defquery, ask); +#endif ask = should_query_disclose_option('c', &defquery); if (!done_stopprint) { @@ -405,6 +527,12 @@ show_conduct(how >= PANICKED ? 1 : 2); if (c == 'q') done_stopprint++; } +#ifdef DUMP_LOG + if (dump_fp) { + dump_conduct(how >= PANICKED ? 1 : 2); + dump_weapon_skill(); + } +#endif } /* try to get the player back in a viable state after being killed */ @@ -523,6 +651,11 @@ otmp->oartifact ? artifact_name(xname(otmp), &dummy) : OBJ_NAME(objects[otmp->otyp]), value, currency(value), points); +#ifdef DUMP_LOG + if (dump_fp) + dump("", pbuf); + if (endwin != WIN_ERR) +#endif putstr(endwin, 0, pbuf); } } @@ -536,12 +669,23 @@ done(how) int how; { +#if defined(WIZARD) && defined(PARANOID) + char paranoid_buf[BUFSZ]; + int really_bon = TRUE; +#endif boolean taken; +#ifdef DEATH_EXPLORE + boolean goexplore = FALSE; +#endif char kilbuf[BUFSZ], pbuf[BUFSZ]; winid endwin = WIN_ERR; boolean bones_ok, have_windows = iflags.window_inited; +#ifdef PROMPT_LOGEXP + boolean update_log; +#endif struct obj *corpse = (struct obj *)0; long umoney; + int i; if (how == TRICKED) { if (killer) { @@ -591,6 +735,7 @@ return; } } + bones_ok = (how < GENOCIDED) && can_make_bones(); /* dthexpl patch */ if (( #ifdef WIZARD wizard || @@ -605,15 +750,63 @@ killer_format = 0; return; } +#ifdef DEATH_EXPLORE + else if (iflags.death_expl && how <= GENOCIDED && !bones_ok && +#ifdef WIZARD + !wizard && +#endif + !discover) { + if(yn("Continue in explore mode?") == 'y') { + enter_explore_mode(); + if (discover) goexplore = TRUE; + } + } +#endif /* DEATH_EXPLORE */ /* * The game is now over... */ die: +#ifdef DEATH_EXPLORE + if (!goexplore) { +#endif program_state.gameover = 1; /* in case of a subsequent panic(), there's no point trying to save */ program_state.something_worth_saving = 0; +#ifdef DUMP_LOG + /* D: Grab screen dump right here */ + if (dump_fn[0]) { + dump_init(); + Sprintf(pbuf, "%s, %s %s %s %s", plname, + aligns[1 - u.ualign.type].adj, + genders[flags.female].adj, + urace.adj, + (flags.female && urole.name.f)? + urole.name.f : urole.name.m); + dump("", pbuf); + /* D: Add a line for clearance from the screen dump */ + dump("", ""); + dump_screen(); +# ifdef DUMPMSGS + if (lastmsg >= 0) { + dump ("", "Latest messages"); + for (i = lastmsg + 1; i < DUMPMSGS; i++) { + if (msgs[i] && strcmp(msgs[i], "") ) + dump (" ", msgs[i]); + } + for (i = 0; i <= lastmsg; i++) { + if (msgs[i] && strcmp(msgs[i], "") ) + dump (" ", msgs[i]); + } + dump ("",""); + } +# endif /* DUMPMSGS */ + } +#endif /* DUMP_LOG */ +#ifdef DEATH_EXPLORE + } +#endif /* render vision subsystem inoperative */ iflags.vision_inited = 0; /* might have been killed while using a disposable item, so make sure @@ -628,6 +821,9 @@ pline("Do not pass go. Do not collect 200 %s.", currency(200L)); if (have_windows) wait_synch(); /* flush screen output */ +#ifdef DEATH_EXPLORE + if (!goexplore) { +#endif #ifndef NO_SIGNAL (void) signal(SIGINT, (SIG_RET_TYPE) done_intr); # if defined(UNIX) || defined(VMS) || defined (__EMX__) @@ -636,7 +832,7 @@ # endif #endif /* NO_SIGNAL */ - bones_ok = (how < GENOCIDED) && can_make_bones(); + /* bones_ok = (how < GENOCIDED) && can_make_bones(); moved up */ if (how == TURNED_SLIME) u.ugrave_arise = PM_GREEN_SLIME; @@ -668,6 +864,9 @@ make_grave(u.ux, u.uy, pbuf); } } +#ifdef DEATH_EXPLORE + } /* if (!goexplore) */ +#endif if (how == QUIT) { killer_format = NO_KILLER_PREFIX; @@ -688,14 +887,21 @@ clearpriests(); } else taken = FALSE; /* lint; assert( !bones_ok ); */ +#ifdef DEATH_EXPLORE + if (!goexplore) { +#endif clearlocks(); if (have_windows) display_nhwindow(WIN_MESSAGE, FALSE); - if (strcmp(flags.end_disclose, "none") && how != PANICKED) + if (strcmp(flags.end_disclose, "none") && how != PANICKED) { disclose(how, taken); + } /* finish_paybill should be called after disclosure but before bones */ if (bones_ok && taken) finish_paybill(); +#ifdef DEATH_EXPLORE + } +#endif /* calculate score, before creating bones [container gold] */ { @@ -721,18 +927,53 @@ if (deepest > 20) u.urexp += 1000L * (long)((deepest > 30) ? 10 : deepest - 20); if (how == ASCENDED) u.urexp *= 2L; +#ifdef DEATH_EXPLORE + if (goexplore) { + discover = FALSE; /* a kludge to fool the topten function.. */ + topten(how); + /* undo some things that were done for score calculation */ + /* this branch is not entered when you ascend, escape or quit */ + discover = TRUE; + umoney -= hidden_gold(); + u.urexp -= tmp; + u.urexp -= 50L * (long)(deepest - 1); + /* now do what is done when you refuse to die in explore mode */ + if (u.uhpmax <= 0) u.uhpmax = u.ulevel * 8; + savelife(how); + killer = 0; + killer_format = 0; + vision_reset(); + return; + } +#endif } if (bones_ok) { #ifdef WIZARD +# ifdef PARANOID + if(wizard) { + getlin("Save WIZARD MODE bones? [no/yes]", paranoid_buf); + (void) lcase (paranoid_buf); + if (strcmp (paranoid_buf, "yes")) + really_bon = FALSE; + } + if(really_bon) +# else if (!wizard || yn("Save bones?") == 'y') -#endif +# endif /* PARANOID */ +#endif /* WIZARD */ savebones(corpse); /* corpse may be invalid pointer now so ensure that it isn't used again */ corpse = (struct obj *)0; } - +#ifdef PROMPT_LOGEXP + if (wizard || discover) { + update_log = (yn("Update logfile?") == 'y'); + } else { + update_log = TRUE; + } +#endif /* update gold for the rip output, which can't use hidden_gold() (containers will be gone by then if bones just got saved...) */ #ifndef GOLDOBJ @@ -770,15 +1011,18 @@ /* don't bother counting to see whether it should be plural */ } - if (!done_stopprint) { Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname, how != ASCENDED ? (const char *) ((flags.female && urole.name.f) ? urole.name.f : urole.name.m) : (const char *) (flags.female ? "Demigoddess" : "Demigod")); + if (!done_stopprint) { putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); } +#ifdef DUMP_LOG + if (dump_fp) dump("", pbuf); +#endif if (how == ESCAPED || how == ASCENDED) { register struct monst *mtmp; @@ -805,31 +1049,39 @@ keepdogs(TRUE); viz_array[0][0] |= IN_SIGHT; /* need visibility for naming */ mtmp = mydogs; - if (!done_stopprint) Strcpy(pbuf, "You"); + Strcpy(pbuf, "You"); if (mtmp) { while (mtmp) { - if (!done_stopprint) Sprintf(eos(pbuf), " and %s", mon_nam(mtmp)); if (mtmp->mtame) u.urexp += mtmp->mhp; mtmp = mtmp->nmon; } if (!done_stopprint) putstr(endwin, 0, pbuf); +#ifdef DUMP_LOG + if (dump_fp) dump("", pbuf); +#endif pbuf[0] = '\0'; } else { if (!done_stopprint) Strcat(pbuf, " "); } - if (!done_stopprint) { Sprintf(eos(pbuf), "%s with %ld point%s,", how==ASCENDED ? "went to your reward" : "escaped from the dungeon", u.urexp, plur(u.urexp)); +#ifdef DUMP_LOG + if (dump_fp) dump("", pbuf); +#endif + if (!done_stopprint) { putstr(endwin, 0, pbuf); } if (!done_stopprint) artifact_score(invent, FALSE, endwin); /* list artifacts */ - +#ifdef DUMP_LOG + else if (dump_fp) + artifact_score(invent, FALSE, WIN_ERR); /* only to dumpfile */ +#endif /* list valuables here */ for (val = valuables; val->list; val++) { sort_valuables(val->list, val->size); @@ -855,10 +1107,13 @@ count, plur(count)); } putstr(endwin, 0, pbuf); +#ifdef DUMP_LOG + if (dump_fp) dump("", pbuf); +#endif } } - } else if (!done_stopprint) { + } else { /* did not escape or ascend */ if (u.uz.dnum == 0 && u.uz.dlevel <= 0) { /* level teleported out of the dungeon; `how' is DIED, @@ -878,21 +1133,32 @@ Sprintf(eos(pbuf), " with %ld point%s,", u.urexp, plur(u.urexp)); - putstr(endwin, 0, pbuf); + if (!done_stopprint) putstr(endwin, 0, pbuf); +#ifdef DUMP_LOG + if (dump_fp) dump("", pbuf); +#endif } - if (!done_stopprint) { Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.", umoney, plur(umoney), moves, plur(moves)); - putstr(endwin, 0, pbuf); + if (!done_stopprint) putstr(endwin, 0, pbuf); +#ifdef DUMP_LOG + if (dump_fp) { + dump("", pbuf); + Sprintf(pbuf, "Killer: %s", killer); + dump("", pbuf); } - if (!done_stopprint) { +#endif Sprintf(pbuf, "You were level %d with a maximum of %d hit point%s when you %s.", u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]); + if (!done_stopprint) { putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); } +#ifdef DUMP_LOG + if (dump_fp) dump("", pbuf); +#endif if (!done_stopprint) display_nhwindow(endwin, TRUE); if (endwin != WIN_ERR) @@ -901,14 +1167,23 @@ /* "So when I die, the first thing I will see in Heaven is a * score list?" */ if (flags.toptenwin) { +#ifdef PROMPT_LOGEXP + if (update_log) +#endif topten(how); if (have_windows) exit_nhwindows((char *)0); } else { if (have_windows) exit_nhwindows((char *)0); +#ifdef PROMPT_LOGEXP + if (update_log) +#endif topten(how); } +#ifdef DUMP_LOG + if (dump_fp) dump_exit(); +#endif if(done_stopprint) { raw_print(""); raw_print(""); } terminate(EXIT_SUCCESS); @@ -919,8 +1194,23 @@ container_contents(list, identified, all_containers) struct obj *list; boolean identified, all_containers; +#ifdef DUMP_LOG +{ + do_containerconts(list, identified, all_containers, FALSE, TRUE); +} + +void do_containerconts(list, identified, all_containers, want_dump, want_disp) +struct obj *list; +boolean identified, all_containers, want_dump, want_disp; +#endif +/* The original container_contents function */ { register struct obj *box, *obj; +#ifdef SORTLOOT + struct obj **oarray; + int i,j,n; + char *invlet; +#endif /* SORTLOOT */ char buf[BUFSZ]; for (box = list; box; box = box->nobj) { @@ -928,25 +1218,101 @@ if (box->otyp == BAG_OF_TRICKS) { continue; /* wrong type of container */ } else if (box->cobj) { - winid tmpwin = create_nhwindow(NHW_MENU); + winid tmpwin; +#ifdef DUMP_LOG + if (want_disp) +#endif + tmpwin = create_nhwindow(NHW_MENU); +#ifdef SORTLOOT + /* count the number of items */ + for (n = 0, obj = box->cobj; obj; obj = obj->nobj) n++; + /* Make a temporary array to store the objects sorted */ + oarray = (struct obj **) alloc(n*sizeof(struct obj*)); + + /* Add objects to the array */ + i = 0; + invlet = flags.inv_order; + nextclass: + for (obj = box->cobj; obj; obj = obj->nobj) { + if (!flags.sortpack || obj->oclass == *invlet) { + if (iflags.sortloot == 'f' + || iflags.sortloot == 'l') { + /* Insert object at correct index */ + for (j = i; j; j--) { + if (strcmpi(cxname2(obj), cxname2(oarray[j-1]))>0 + || (flags.sortpack && + oarray[j-1]->oclass != obj->oclass)) + break; + oarray[j] = oarray[j-1]; + } + oarray[j] = obj; + i++; + } else { + /* Just add it to the array */ + oarray[i++] = obj; + } + } + } /* for loop */ + if (flags.sortpack) { + if (*++invlet) goto nextclass; + } +#endif /* SORTLOOT */ Sprintf(buf, "Contents of %s:", the(xname(box))); +#ifdef DUMP_LOG + if (want_disp) { +#endif putstr(tmpwin, 0, buf); putstr(tmpwin, 0, ""); +#ifdef DUMP_LOG + } + if (dump_fp) dump("", buf); +#endif +#ifdef SORTLOOT + for (i = 0; i < n; i++) { + obj = oarray[i]; +#else for (obj = box->cobj; obj; obj = obj->nobj) { +#endif if (identified) { makeknown(obj->otyp); obj->known = obj->bknown = obj->dknown = obj->rknown = 1; } +#ifdef DUMP_LOG + if (want_dump) dump(" ", doname(obj)); + if (want_disp) +#endif putstr(tmpwin, 0, doname(obj)); } +#ifdef DUMP_LOG + if (want_dump) dump("",""); + if (want_disp) { +#endif display_nhwindow(tmpwin, TRUE); destroy_nhwindow(tmpwin); - if (all_containers) +#ifdef DUMP_LOG + } + if (all_containers) { + do_containerconts(box->cobj, identified, TRUE, + want_dump, want_disp); +#else + if (all_containers) { container_contents(box->cobj, identified, TRUE); +#endif /* DUMP_LOG */ + } } else { +#ifdef DUMP_LOG + if (want_disp) { +#endif pline("%s empty.", Tobjnam(box, "are")); display_nhwindow(WIN_MESSAGE, FALSE); +#ifdef DUMP_LOG + } + if (want_dump) { + dump(The(xname(box)), " is empty."); + dump("", ""); + } +#endif } } if (!all_containers) @@ -973,10 +1339,21 @@ nethack_exit(status); } -STATIC_OVL void +void /* showborn patch */ list_vanquished(defquery, ask) char defquery; boolean ask; +#ifdef DUMP_LOG +{ + do_vanquished(defquery, ask, FALSE); +} + +void +do_vanquished(defquery, ask, want_dump) +int defquery; +boolean ask; +boolean want_dump; +#endif { register int i, lev; int ntypes = 0, max_lev = 0, nkilled; @@ -996,13 +1373,22 @@ * includes all dead monsters, not just those killed by the player */ if (ntypes != 0) { - c = ask ? yn_function("Do you want an account of creatures vanquished?", +#ifdef DUMP_LOG + c = done_stopprint ? 'n': ask ? +#else + c = ask ? +#endif + yn_function("Do you want an account of creatures vanquished?", ynqchars, defquery) : defquery; if (c == 'q') done_stopprint++; if (c == 'y') { klwin = create_nhwindow(NHW_MENU); putstr(klwin, 0, "Vanquished creatures:"); putstr(klwin, 0, ""); +#ifdef DUMP_LOG + } /* the original end of block removed by the patch */ + if (want_dump) dump("", "Vanquished creatures"); +#endif /* countdown by monster "toughness" */ for (lev = max_lev; lev >= 0; lev--) @@ -1029,21 +1415,38 @@ else Sprintf(buf, "%d %s", nkilled, makeplural(mons[i].mname)); +#ifdef SHOW_BORN + if (iflags.show_born && nkilled != mvitals[i].born) + Sprintf(buf + strlen(buf), " (%d created)", + (int) mvitals[i].born); +#endif } - putstr(klwin, 0, buf); + if (c == 'y') putstr(klwin, 0, buf); +#ifdef DUMP_LOG + if (want_dump) dump(" ", buf); +#endif } /* * if (Hallucination) * putstr(klwin, 0, "and a partridge in a pear tree"); */ if (ntypes > 1) { - putstr(klwin, 0, ""); + if (c == 'y') putstr(klwin, 0, ""); Sprintf(buf, "%ld creatures vanquished.", total_killed); - putstr(klwin, 0, buf); + if (c == 'y') putstr(klwin, 0, buf); +#ifdef DUMP_LOG + if (want_dump) dump(" ", buf); +#endif } + if (c == 'y') { display_nhwindow(klwin, TRUE); destroy_nhwindow(klwin); } +#ifdef DUMP_LOG + if (want_dump) dump("", ""); +#else + } /* the original end of if (c == 'y') */ +#endif } } @@ -1059,43 +1462,112 @@ return n; } +#ifdef DUMP_LOG +STATIC_OVL void +list_genocided(defquery, ask, want_dump) +int defquery; +boolean ask; +boolean want_dump; +#else STATIC_OVL void list_genocided(defquery, ask) char defquery; boolean ask; +#endif { register int i; - int ngenocided; + int ngenocided=0; +#ifdef SHOW_EXTINCT + int nextincted=0; +#endif char c; winid klwin; char buf[BUFSZ]; + /* get totals first */ +#ifdef SHOW_EXTINCT + for (i = LOW_PM; i < NUMMONS; i++) { + if (mvitals[i].mvflags & G_GENOD) + ngenocided++; + else if ( (mvitals[i].mvflags & G_GONE) && !(mons[i].geno & G_UNIQ) ) + nextincted++; + } ngenocided = num_genocides(); +#endif /* genocided species list */ - if (ngenocided != 0) { + if (ngenocided != 0 +#ifdef SHOW_EXTINCT + || nextincted != 0 +#endif + ) { +#ifdef SHOW_EXTINCT + if (nextincted != 0) + c = ask ? + yn_function("Do you want a list of species genocided or extincted?", + ynqchars, defquery) : defquery; + else +#endif c = ask ? yn_function("Do you want a list of species genocided?", ynqchars, defquery) : defquery; if (c == 'q') done_stopprint++; if (c == 'y') { klwin = create_nhwindow(NHW_MENU); - putstr(klwin, 0, "Genocided species:"); +#ifdef SHOW_EXTINCT + Sprintf(buf, "Genocided or extinct species:"); +#else + Sprintf(buf, "Genocided species:"); +#endif + putstr(klwin, 0, buf); putstr(klwin, 0, ""); +#ifdef DUMP_LOG + if (want_dump) dump("", buf); +#endif for (i = LOW_PM; i < NUMMONS; i++) +#ifdef SHOW_EXTINCT + if (mvitals[i].mvflags & G_GONE && !(mons[i].geno & G_UNIQ) ){ +#else if (mvitals[i].mvflags & G_GENOD) { +#endif if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST) Sprintf(buf, "%s%s", !type_is_pname(&mons[i]) ? "" : "the ", mons[i].mname); else Strcpy(buf, makeplural(mons[i].mname)); +#ifdef SHOW_EXTINCT + if( !(mvitals[i].mvflags & G_GENOD) ) + Strcat(buf, " (extinct)"); +#endif putstr(klwin, 0, buf); +#ifdef DUMP_LOG + if (want_dump) dump(" ", buf); +#endif } putstr(klwin, 0, ""); +#ifdef SHOW_EXTINCT + if (ngenocided>0) { +#endif Sprintf(buf, "%d species genocided.", ngenocided); putstr(klwin, 0, buf); +#ifdef DUMP_LOG + if (want_dump) dump(" ", buf); +#endif +#ifdef SHOW_EXTINCT + } + if (nextincted>0) { + Sprintf(buf, "%d species extinct.", nextincted); + putstr(klwin, 0, buf); +#ifdef DUMP_LOG + if (want_dump) dump(" ", buf); +#endif + } +#endif /* SHOW_EXTINCT */ +#ifdef DUMP_LOG + if (want_dump) dump("", ""); +#endif display_nhwindow(klwin, TRUE); destroy_nhwindow(klwin); diff -bNurdX diff_ign.txt nh343orig/src/engrave.c nh343jl/src/engrave.c --- nh343orig/src/engrave.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/engrave.c 2004-03-29 02:36:37.000000000 +0300 @@ -343,7 +343,11 @@ et = ep->engr_txt; You("%s: \"%s\".", (Blind) ? "feel the words" : "read", et); - if(flags.run > 1) nomul(0); + if(flags.run > 1) nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); } } } diff -bNurdX diff_ign.txt nh343orig/src/explode.c nh343jl/src/explode.c --- nh343orig/src/explode.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/explode.c 2004-03-29 02:36:36.000000000 +0300 @@ -513,7 +513,11 @@ if (scflags & MAY_HITYOU) { int hitvalu, hitu; - if (multi) nomul(0); + if (multi) nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); hitvalu = 8 + stmp->obj->spe; if (bigmonst(youmonst.data)) hitvalu++; hitu = thitu(hitvalu, diff -bNurdX diff_ign.txt nh343orig/src/files.c nh343jl/src/files.c --- nh343orig/src/files.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/files.c 2003-12-14 21:39:45.000000000 +0200 @@ -57,7 +57,7 @@ #endif #if !defined(MFLOPPY) && !defined(VMS) && !defined(WIN32) -char bones[] = "bonesnn.xxx"; +char bones[] = "bones/bonesnn.xxx"; char lock[PL_NSIZ+14] = "1lock"; /* long enough for uid+name+.99 */ #else # if defined(MFLOPPY) @@ -614,8 +614,13 @@ s_level *sptr; char *dptr; +#ifdef UNIX + Sprintf(file, "bones/bon%c%s", dungeons[lev->dnum].boneid, + In_quest(lev) ? urole.filecode : "0"); +#else Sprintf(file, "bon%c%s", dungeons[lev->dnum].boneid, In_quest(lev) ? urole.filecode : "0"); +#endif dptr = eos(file); if ((sptr = Is_special(lev)) != 0) Sprintf(dptr, ".%c", sptr->boneid); @@ -1794,6 +1799,10 @@ } else if (match_varname(buf, "BOULDER", 3)) { (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE, 1, "BOULDER"); + } else if (match_varname(buf, "MENUCOLOR", 9)) { +#ifdef MENU_COLOR + (void) add_menu_coloring(bufp); +#endif } else if (match_varname(buf, "GRAPHICS", 4)) { len = get_uchars(fp, buf, bufp, translate, FALSE, MAXPCHARS, "GRAPHICS"); diff -bNurdX diff_ign.txt nh343orig/src/hack.c nh343jl/src/hack.c --- nh343orig/src/hack.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/hack.c 2004-03-29 02:44:09.000000000 +0300 @@ -72,7 +72,11 @@ rx = u.ux + 2 * u.dx; /* boulder destination position */ ry = u.uy + 2 * u.dy; - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if (Levitation || Is_airlevel(&u.uz)) { if (Blind) feel_location(sx, sy); You("don't have enough leverage to push %s.", the(xname(otmp))); @@ -323,7 +327,11 @@ if (!boulder && IS_ROCK(lev->typ) && !may_dig(x,y)) { You("hurt your teeth on the %s.", IS_TREE(lev->typ) ? "tree" : "hard stone"); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return 1; } else if (digging.pos.x != x || digging.pos.y != y || !on_level(&digging.level, &u.uz)) { @@ -719,7 +727,11 @@ if (test_move(u.ux, u.uy, u.tx-u.ux, u.ty-u.uy, TEST_MOVE)) { u.dx = u.tx-u.ux; u.dy = u.ty-u.uy; - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); iflags.travelcc.x = iflags.travelcc.y = -1; return TRUE; } @@ -785,7 +797,11 @@ u.dx = x-ux; u.dy = y-uy; if (x == u.tx && y == u.ty) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); /* reset run so domove run checks work */ flags.run = 8; iflags.travelcc.x = iflags.travelcc.y = -1; @@ -855,7 +871,11 @@ found: u.dx = 0; u.dy = 0; - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return FALSE; } @@ -891,7 +911,11 @@ exercise(A_CON, FALSE); } else You("collapse under your load."); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } if(u.uswallow) { @@ -943,7 +967,11 @@ do { if(tries++ > 50) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } confdir(); @@ -955,14 +983,22 @@ if (u.uinwater) { water_friction(); if (!u.dx && !u.dy) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } x = u.ux + u.dx; y = u.uy + u.dy; } if(!isok(x, y)) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } if (((trap = t_at(x, y)) && trap->tseen) || @@ -970,11 +1006,19 @@ !is_clinger(youmonst.data) && (is_pool(x, y) || is_lava(x, y)) && levl[x][y].seenv)) { if(flags.run >= 2) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); flags.move = 0; return; } else - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); } if (u.ustuck && (x != u.ustuck->mx || y != u.ustuck->my)) { @@ -1015,7 +1059,11 @@ !Conflict && !u.ustuck->mconf) goto pull_free; You("cannot escape from %s!", mon_nam(u.ustuck)); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } } @@ -1031,7 +1079,11 @@ mtmp->m_ap_type != M_AP_OBJECT) || Protection_from_shape_changers)) || sensemon(mtmp))) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); flags.move = 0; return; } @@ -1046,7 +1098,11 @@ /* attack monster */ if(mtmp) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); /* only attack if we know it's there */ /* or if we used the 'F' command to fight blindly */ /* or if it hides_under, in which case we call attack() to print @@ -1108,7 +1164,11 @@ is_pool(x,y) ? "empty water" : buf); unmap_object(x, y); /* known empty -- remove 'I' if present */ newsym(x, y); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if (expl) { u.mh = -1; /* dead in the current form */ rehumanize(); @@ -1123,7 +1183,11 @@ #ifdef STEED if (u.usteed && !u.usteed->mcanmove && (u.dx || u.dy)) { pline("%s won't move!", upstart(y_monnam(u.usteed))); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } else #endif @@ -1131,7 +1195,11 @@ You("are rooted %s.", Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz) ? "in place" : "to the ground"); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } if(u.utrap) { @@ -1254,7 +1322,11 @@ if (!test_move(u.ux, u.uy, x-u.ux, y-u.uy, DO_MOVE)) { flags.move = 0; - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } @@ -1370,7 +1442,11 @@ if ( flags.run < 8 ) if (IS_DOOR(tmpr->typ) || IS_ROCK(tmpr->typ) || IS_FURNITURE(tmpr->typ)) - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); } if (hides_under(youmonst.data)) @@ -1408,7 +1484,11 @@ /* delay next move because of ball dragging */ /* must come after we finished picking up, in spoteffects() */ if (cause_delay) { - nomul(-2); + nomul(-2 +#ifdef HELPLESS + , "dragging an iron ball" +#endif + ); nomovemsg = ""; } @@ -1436,7 +1516,11 @@ char buf[BUFSZ]; struct obj *otmp = carrying(CANDELABRUM_OF_INVOCATION); - nomul(0); /* stop running or travelling */ + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); /* stop running or travelling */ #ifdef STEED if (u.usteed) Sprintf(buf, "beneath %s", y_monnam(u.usteed)); else @@ -1924,7 +2008,11 @@ /* Grid bugs stop if trying to move diagonal, even if blind. Maybe */ /* they polymorphed while in the middle of a long move. */ if (u.umonnum == PM_GRID_BUG && u.dx && u.dy) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } @@ -2001,7 +2089,11 @@ continue; } stop: - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return; } /* end for loops */ @@ -2063,14 +2155,27 @@ return(0); } +#ifdef HELPLESS +void +nomul(nval, txt) + register int nval; + const char *txt; +#else void nomul(nval) register int nval; +#endif { if(multi < nval) return; /* This is a bug fix by ab@unido */ u.uinvulnerable = FALSE; /* Kludge to avoid ctrl-C bug -dlc */ u.usleep = 0; multi = nval; +#ifdef HELPLESS + if (txt && txt[0]) + (void) strncpy(multi_txt, txt, BUFSZ); + else + (void) memset(multi_txt, 0, BUFSZ); +#endif flags.travel = iflags.travel1 = flags.mv = flags.run = 0; } @@ -2080,6 +2185,9 @@ const char *msg_override; { multi = 0; /* caller will usually have done this already */ +#ifdef HELPLESS + (void) memset(multi_txt, 0, BUFSZ); +#endif if (msg_override) nomovemsg = msg_override; else if (!nomovemsg) nomovemsg = You_can_move_again; if (*nomovemsg) pline(nomovemsg); diff -bNurdX diff_ign.txt nh343orig/src/invent.c nh343jl/src/invent.c --- nh343orig/src/invent.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/invent.c 2005-05-19 17:08:33.000000000 +0300 @@ -19,7 +19,12 @@ STATIC_DCL boolean FDECL(putting_on, (const char *)); STATIC_PTR int FDECL(ckunpaid,(struct obj *)); STATIC_PTR int FDECL(ckvalidcat,(struct obj *)); +#ifdef DUMP_LOG +static char FDECL(display_pickinv, + (const char *,BOOLEAN_P, long *, BOOLEAN_P, BOOLEAN_P)); +#else static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *)); +#endif /* DUMP_LOG */ #ifdef OVLB STATIC_DCL boolean FDECL(this_type_only, (struct obj *)); STATIC_DCL void NDECL(dounpaid); @@ -532,6 +537,11 @@ freeinv(obj) register struct obj *obj; { +#ifdef ITEMCAT_JP +/* this is a very uncritical thing so we do it here. if the jpicklist was + * persistent, this should have been in extract_nobj() itself */ + jpick_free(obj); +#endif /* ITEMCAT_JP */ extract_nobj(obj, &invent); freeinv_core(obj); update_inventory(); @@ -1017,7 +1027,11 @@ if (ilet == '?' && !*lets && *altlets) allowed_choices = altlets; ilet = display_pickinv(allowed_choices, TRUE, - allowcnt ? &ctmp : (long *)0); + allowcnt ? &ctmp : (long *)0 +#ifdef DUMP_LOG + , FALSE, TRUE +#endif + ); if(!ilet) continue; if (allowcnt && ctmp >= 0) { cnt = ctmp; @@ -1689,13 +1703,27 @@ * inventory and return a count as well as a letter. If out_cnt is not null, * any count returned from the menu selection is placed here. */ +#ifdef DUMP_LOG +static char +display_pickinv(lets, want_reply, out_cnt, want_dump, want_disp) +register const char *lets; +boolean want_reply; +long* out_cnt; +boolean want_dump; +boolean want_disp; +#else static char display_pickinv(lets, want_reply, out_cnt) register const char *lets; boolean want_reply; long* out_cnt; +#endif { struct obj *otmp; +#ifdef SORTLOOT + struct obj **oarray; + int i, j; +#endif char ilet, ret; char *invlet = flags.inv_order; int n, classcount; @@ -1704,6 +1732,9 @@ anything any; menu_item *selected; +#ifdef DUMP_LOG + if (want_disp) { +#endif /* overriden by global flag */ if (flags.perm_invent) { win = (lets && *lets) ? local_win : WIN_INVEN; @@ -1713,6 +1744,11 @@ } else win = WIN_INVEN; +#ifdef DUMP_LOG + } + if (want_dump) dump("", "Your inventory"); +#endif + /* Exit early if no inventory -- but keep going if we are doing a permanent inventory update. We need to keep going so the @@ -1725,11 +1761,24 @@ to here is short circuited away. */ if (!invent && !(flags.perm_invent && !lets && !want_reply)) { +#ifdef DUMP_LOG + if (want_disp) { +#endif #ifndef GOLDOBJ pline("Not carrying anything%s.", u.ugold ? " except gold" : ""); #else pline("Not carrying anything."); #endif +#ifdef DUMP_LOG + } + if (want_dump) { +#ifdef GOLDOBJ + dump(" ", "Not carrying anything"); +#else + dump(" Not carrying anything", u.ugold ? " except gold." : "."); +#endif + } +#endif return 0; } @@ -1743,37 +1792,124 @@ ret = '\0'; for (otmp = invent; otmp; otmp = otmp->nobj) { if (otmp->invlet == lets[0]) { +#ifdef DUMP_LOG + if (want_disp) { +#endif ret = message_menu(lets[0], want_reply ? PICK_ONE : PICK_NONE, xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L)); if (out_cnt) *out_cnt = -1L; /* select all */ +#ifdef DUMP_LOG + } + if (want_dump) { + char letbuf[7]; + sprintf(letbuf, " %c - ", lets[0]); + dump(letbuf, + xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L)); + } +#endif break; } } return ret; } +#ifdef SORTLOOT + /* count the number of items */ + for (n = 0, otmp = invent; otmp; otmp = otmp->nobj) + if(!lets || !*lets || index(lets, otmp->invlet)) n++; + + /* Make a temporary array to store the objects sorted */ + oarray = (struct obj **)alloc(n*sizeof(struct obj*)); + + /* Add objects to the array */ + i = 0; + for(otmp = invent; otmp; otmp = otmp->nobj) + if(!lets || !*lets || index(lets, otmp->invlet)) { + if (iflags.sortloot == 'f') { + /* Insert object at correct index */ + for (j = i; j; j--) { + if (strcmpi(cxname2(otmp), cxname2(oarray[j-1]))>0) break; + oarray[j] = oarray[j-1]; + } + oarray[j] = otmp; + i++; + } else { + /* Just add it to the array */ + oarray[i++] = otmp; + } + } +#endif /* SORTLOOT */ + +#ifdef DUMP_LOG + if (want_disp) +#endif start_menu(win); nextclass: classcount = 0; any.a_void = 0; /* set all bits to zero */ +#ifdef SORTLOOT + for(i = 0; i < n; i++) { + otmp = oarray[i]; + ilet = otmp->invlet; + if (!flags.sortpack || otmp->oclass == *invlet) { + if (flags.sortpack && !classcount) { + any.a_void = 0; /* zero */ +#ifdef DUMP_LOG + if (want_dump) + dump(" ", let_to_name(*invlet, FALSE)); + if (want_disp) +#endif + add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, + let_to_name(*invlet, FALSE), MENU_UNSELECTED); + classcount++; + } + any.a_char = ilet; +#ifdef DUMP_LOG + if (want_dump) { + char letbuf[7]; + sprintf(letbuf, " %c - ", ilet); + dump(letbuf, doname(otmp)); + } + if (want_disp) +#endif + add_menu(win, obj_to_glyph(otmp), + &any, ilet, 0, ATR_NONE, doname(otmp), + MENU_UNSELECTED); + } + } +#else /* SORTLOOT */ for(otmp = invent; otmp; otmp = otmp->nobj) { ilet = otmp->invlet; if(!lets || !*lets || index(lets, ilet)) { if (!flags.sortpack || otmp->oclass == *invlet) { if (flags.sortpack && !classcount) { any.a_void = 0; /* zero */ +#ifdef DUMP_LOG + if (want_dump) + dump(" ", let_to_name(*invlet, FALSE)); + if (want_disp) +#endif add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, let_to_name(*invlet, FALSE), MENU_UNSELECTED); classcount++; } any.a_char = ilet; +#ifdef DUMP_LOG + if (want_dump) { + char letbuf[7]; + sprintf(letbuf, " %c - ", ilet); + dump(letbuf, doname(otmp)); + } + if (want_disp) +#endif add_menu(win, obj_to_glyph(otmp), &any, ilet, 0, ATR_NONE, doname(otmp), MENU_UNSELECTED); } } } +#endif /* SORTLOOT */ if (flags.sortpack) { if (*++invlet) goto nextclass; #ifdef WIZARD @@ -1783,6 +1919,12 @@ } #endif } +#ifdef SORTLOOT + free(oarray); +#endif +#ifdef DUMP_LOG + if (want_disp) { +#endif end_menu(win, (char *) 0); n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected); @@ -1792,6 +1934,10 @@ free((genericptr_t)selected); } else ret = !n ? '\0' : '\033'; /* cancelled */ +#ifdef DUMP_LOG + } /* want_disp */ + if (want_dump) dump("", ""); +#endif return ret; } @@ -1808,9 +1954,24 @@ register const char *lets; boolean want_reply; { - return display_pickinv(lets, want_reply, (long *)0); + return display_pickinv(lets, want_reply, (long *)0 +#ifdef DUMP_LOG + , FALSE , TRUE +#endif + ); } +#ifdef DUMP_LOG +/* See display_inventory. This is the same thing WITH dumpfile creation */ +char +dump_inventory(lets, want_reply, want_disp) +register const char *lets; +boolean want_reply, want_disp; +{ + return display_pickinv(lets, want_reply, (long *)0, TRUE, want_disp); +} +#endif + /* * Returns the number of unpaid items within the given list. This includes * contained objects. @@ -1861,6 +2022,16 @@ if (list->oclass != COIN_CLASS && !list->bknown) count++; break; +#ifdef ITEMCAT + case UNIDENTIFIED: + if (NOT_FULLY_IDENTIFIED(list)) + count++; + break; + case RUSTPRONE: + if (list->oclass != COIN_CLASS && is_known_rustprone(list)) + count++; + break; +#endif /* ITEMCAT */ default: impossible("need count of curse status %d?", type); return 0; @@ -2650,13 +2821,23 @@ register char let; char alphabet[52+1], buf[52+1]; char qbuf[QBUFSZ]; +#ifdef ADJSPLIT + char allowallcnt[3]; +#else char allowall[2]; +#endif const char *adj_type; if (!flags.invlet_constant) reassign(); /* get a pointer to the object the user wants to organize */ +#ifdef ADJSPLIT + allowallcnt[0] = ALLOW_COUNT; allowallcnt[1] = ALL_CLASSES; + allowallcnt[2] = '\0'; + if (!(obj = getobj(allowallcnt,"adjust"))) return(0); +#else allowall[0] = ALL_CLASSES; allowall[1] = '\0'; if (!(obj = getobj(allowall,"adjust"))) return(0); +#endif /* initialize the list with all upper and lower case letters */ for (let = 'a', ix = 0; let <= 'z';) alphabet[ix++] = let++; @@ -2685,7 +2866,11 @@ let = yn_function(qbuf, (char *)0, '\0'); if(index(quitchars,let)) { pline(Never_mind); +#ifdef ADJSPLIT + goto cleansplit; +#else return(0); +#endif } if (let == '@' || !letter(let)) pline("Select an inventory slot letter."); @@ -2694,7 +2879,9 @@ } /* change the inventory and print the resulting item */ +#ifndef ADJSPLIT adj_type = "Moving:"; +#endif /* * don't use freeinv/addinv to avoid double-touching artifacts, @@ -2702,19 +2889,56 @@ */ extract_nobj(obj, &invent); +#ifdef ADJSPLIT + for (otmp = invent; otmp && otmp->invlet != let;) + otmp = otmp->nobj; + if (!otmp) + adj_type = "Moving:"; + else if (merged(&otmp,&obj)) { +#else for (otmp = invent; otmp;) if (merged(&otmp,&obj)) { +#endif adj_type = "Merging:"; obj = otmp; +#ifndef ADJSPLIT otmp = otmp->nobj; +#endif extract_nobj(obj, &invent); } else { +#ifdef ADJSPLIT + struct obj *otmp2; + for (otmp2 = invent; otmp2 + && otmp2->invlet != obj->invlet;) + otmp2 = otmp2->nobj; + + if (otmp2) { + char oldlet = obj->invlet; + + adj_type = "Displacing:"; + + /* Here be a nasty hack; solutions that don't + * require duplication of assigninvlet's code + * here are welcome. + */ + assigninvlet(obj); + + if (obj->invlet == NOINVSYM) { + pline("There's nowhere to put that."); + obj->invlet = oldlet; + goto cleansplit; + } + } else +#else if (otmp->invlet == let) { +#endif adj_type = "Swapping:"; otmp->invlet = obj->invlet; } +#ifndef ADJSPLIT otmp = otmp->nobj; } +#endif /* inline addinv (assuming flags.invlet_constant and !merged) */ obj->invlet = let; @@ -2726,6 +2950,14 @@ prinv(adj_type, obj, 0L); update_inventory(); return(0); +#ifdef ADJSPLIT +cleansplit: + for (otmp = invent; otmp; otmp = otmp->nobj) + if (otmp != obj && otmp->invlet == obj->invlet) + merged( &otmp, &obj ); + + return 0; +#endif } /* common to display_minventory and display_cinventory */ diff -bNurdX diff_ign.txt nh343orig/src/mcastu.c nh343jl/src/mcastu.c --- nh343orig/src/mcastu.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/mcastu.c 2004-03-29 02:38:07.000000000 +0300 @@ -228,7 +228,11 @@ return(0); } - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if(rn2(ml*10) < (mtmp->mconf ? 100 : 20)) { /* fumbled attack */ if (canseemon(mtmp) && flags.soundok) pline_The("air crackles around %s.", mon_nam(mtmp)); @@ -600,13 +604,21 @@ shieldeff(u.ux, u.uy); if (multi >= 0) You("stiffen briefly."); - nomul(-1); + nomul(-1 +#ifdef HELPLESS + , "paralyzed by a monster" +#endif + ); } else { if (multi >= 0) You("are frozen in place!"); dmg = 4 + (int)mtmp->m_lev; if (Half_spell_damage) dmg = (dmg + 1) / 2; - nomul(-dmg); + nomul(-dmg +#ifdef HELPLESS + , "paralyzed by a monster" +#endif + ); } dmg = 0; break; @@ -771,7 +783,11 @@ return(0); } if(lined_up(mtmp) && rn2(3)) { - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if(mattk->adtyp && (mattk->adtyp < 11)) { /* no cf unsigned >0 */ if(canseemon(mtmp)) pline("%s zaps you with a %s!", Monnam(mtmp), diff -bNurdX diff_ign.txt nh343orig/src/mhitu.c nh343jl/src/mhitu.c --- nh343orig/src/mhitu.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/mhitu.c 2004-03-29 02:36:35.000000000 +0300 @@ -317,7 +317,11 @@ * invisible, or you might be blind.... */ - if(!ranged) nomul(0); + if(!ranged) nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if(mtmp->mhp <= 0 || (Underwater && !is_swimmer(mtmp->data))) return(0); @@ -1122,7 +1126,11 @@ if (Blind) You("are frozen!"); else You("are frozen by %s!", mon_nam(mtmp)); nomovemsg = 0; /* default: "you can move again" */ - nomul(-rnd(10)); + nomul(-rnd(10) +#ifdef HELPLESS + , "paralyzed by a monster" +#endif + ); exercise(A_DEX, FALSE); } } diff -bNurdX diff_ign.txt nh343orig/src/mthrowu.c nh343jl/src/mthrowu.c --- nh343orig/src/mthrowu.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/mthrowu.c 2004-03-29 02:36:35.000000000 +0300 @@ -324,7 +324,11 @@ if (ohitmon(mtmp, singleobj, range, TRUE)) break; } else if (bhitpos.x == u.ux && bhitpos.y == u.uy) { - if (multi) nomul(0); + if (multi) nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); if (singleobj->oclass == GEM_CLASS && singleobj->otyp <= LAST_GEM+9 /* 9 glass colors */ @@ -608,7 +612,11 @@ m_shot.o = STRANGE_OBJECT; m_shot.s = FALSE; - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); } #endif /* OVL1 */ @@ -646,7 +654,11 @@ pline("%s spits venom!", Monnam(mtmp)); m_throw(mtmp, mtmp->mx, mtmp->my, sgn(tbx), sgn(tby), distmin(mtmp->mx,mtmp->my,mtmp->mux,mtmp->muy), otmp); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); return 0; } } @@ -684,7 +696,11 @@ breathwep[typ-1]); buzz((int) (-20 - (typ-1)), (int)mattk->damn, mtmp->mx, mtmp->my, sgn(tbx), sgn(tby)); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); /* breath runs out sometimes. Also, give monster some * cunning; don't breath if the player fell asleep. */ diff -bNurdX diff_ign.txt nh343orig/src/muse.c nh343jl/src/muse.c --- nh343orig/src/muse.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/muse.c 2004-03-29 02:36:34.000000000 +0300 @@ -1121,7 +1121,11 @@ losehp(tmp, "wand", KILLED_BY_AN); } else pline_The("wand misses you."); stop_occupation(); - nomul(0); + nomul(0 +#ifdef HELPLESS + , 0 +#endif + ); } else if (resists_magm(mtmp)) { shieldeff(mtmp->mx, mtmp->my); pline("Boing!"); diff -bNurdX diff_ign.txt nh343orig/src/objnam.c nh343jl/src/objnam.c --- nh343orig/src/objnam.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/objnam.c 2004-01-14 18:23:51.000000000 +0200 @@ -15,6 +15,9 @@ #endif static char *NDECL(nextobuf); static void FDECL(add_erosion_words, (struct obj *, char *)); +#ifdef SORTLOOT +char * FDECL(xname2, (struct obj *, boolean)); +#endif struct Jitem { int item; @@ -233,6 +236,15 @@ char * xname(obj) register struct obj *obj; +#ifdef SORTLOOT +{ + return xname2(obj, FALSE); +} +char * +xname2(obj, ignore_oquan) +register struct obj *obj; +boolean ignore_oquan; +#endif { register char *buf; register int typ = obj->otyp; @@ -469,6 +481,9 @@ default: Sprintf(buf,"glorkum %d %d %d", obj->oclass, typ, obj->spe); } +#ifdef SORTLOOT + if (!ignore_oquan) +#endif if (obj->quan != 1L) Strcpy(buf, makeplural(buf)); if (obj->onamelth && obj->dknown) { @@ -853,6 +868,16 @@ return corpse_xname(obj, FALSE); return xname(obj); } +#ifdef SORTLOOT +char * +cxname2(obj) +struct obj *obj; +{ + if (obj->otyp == CORPSE) + return corpse_xname(obj, TRUE); + return xname2(obj, TRUE); +} +#endif /* SORTLOOT */ /* treat an object as fully ID'd when it might be used as reason for death */ char * diff -bNurdX diff_ign.txt nh343orig/src/options.c nh343jl/src/options.c --- nh343orig/src/options.c 2003-12-08 01:39:13.000000000 +0200 +++ nh343jl/src/options.c 2007-04-22 23:29:09.000000000 +0300 @@ -75,6 +75,9 @@ {"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/ # endif {"confirm",&flags.confirm, TRUE, SET_IN_GAME}, +#ifdef DEATH_EXPLORE + {"death_explore", &iflags.death_expl, FALSE, SET_IN_GAME}, +#endif #if defined(TERMLIB) && !defined(MAC_GRAPHICS_ENV) {"DECgraphics", &iflags.DECgraphics, FALSE, SET_IN_GAME}, #else @@ -113,6 +116,9 @@ #endif {"large_font", &iflags.obsolete, FALSE, SET_IN_FILE}, /* OBSOLETE */ {"legacy", &flags.legacy, TRUE, DISP_IN_GAME}, +#ifdef ITEMCAT + {"like_swimming", &iflags.like_swimming, FALSE, SET_IN_GAME}, +#endif /* ITEMCAT */ {"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME}, {"lootabc", &iflags.lootabc, FALSE, SET_IN_GAME}, #ifdef MAC_GRAPHICS_ENV @@ -125,6 +131,15 @@ #else {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif +#ifdef MENU_COLOR +# ifdef MICRO + {"menucolors", &iflags.use_menu_color, TRUE, SET_IN_GAME}, +# else + {"menucolors", &iflags.use_menu_color, FALSE, SET_IN_GAME}, +# endif +#else + {"menucolors", (boolean *)0, FALSE, SET_IN_GAME}, +#endif #ifdef WIZARD /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, @@ -143,11 +158,19 @@ #else {"page_wait", (boolean *)0, FALSE, SET_IN_FILE}, #endif +#ifdef PARANOID + {"paranoid_hit", &iflags.paranoid_hit, FALSE, SET_IN_GAME}, + {"paranoid_quit", &iflags.paranoid_quit, FALSE, SET_IN_GAME}, + {"paranoid_remove", &iflags.paranoid_remove, FALSE, SET_IN_GAME}, +#endif {"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME}, {"popup_dialog", &iflags.wc_popup_dialog, FALSE, SET_IN_GAME}, /*WC*/ {"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME}, {"preload_tiles", &iflags.wc_preload_tiles, TRUE, DISP_IN_GAME}, /*WC*/ {"pushweapon", &flags.pushweapon, FALSE, SET_IN_GAME}, +#ifdef QUIVER_FIRED + {"quiver_fired", &iflags.quiver_fired, FALSE, SET_IN_GAME}, +#endif #if defined(MICRO) && !defined(AMIGA) {"rawio", &iflags.rawio, FALSE, DISP_IN_GAME}, #else @@ -160,6 +183,9 @@ #else {"sanity_check", (boolean *)0, FALSE, SET_IN_FILE}, #endif +#ifdef SHOW_BORN + {"showborn", &iflags.show_born, FALSE, SET_IN_GAME}, +#endif #ifdef EXP_ON_BOTL {"showexp", &flags.showexp, FALSE, SET_IN_GAME}, #else @@ -193,6 +219,11 @@ #else {"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/ #endif +#ifdef WIN_EDGE + {"win_edge", &iflags.win_edge, FALSE, SET_IN_GAME}, +#else + {"win_edge", (boolean *)0, TRUE, SET_IN_FILE}, +#endif {"verbose", &flags.verbose, TRUE, SET_IN_GAME}, {"wraptext", &iflags.wc2_wraptext, FALSE, SET_IN_GAME}, {(char *)0, (boolean *)0, FALSE, 0} @@ -224,6 +255,14 @@ SET_IN_GAME }, { "dogname", "the name of your (first) dog (e.g., dogname:Fang)", PL_PSIZ, DISP_IN_GAME }, +#ifdef DUMP_LOG + { "dumpfile", "where to dump data (e.g., dumpfile:/tmp/dump.nh)", +#ifdef DUMP_FN + PL_PSIZ, DISP_IN_GAME }, +#else + PL_PSIZ, SET_IN_GAME }, +#endif +#endif { "dungeon", "the symbols to use in drawing the dungeon map", MAXDCHARS+1, SET_IN_FILE }, { "effects", "the symbols to use in drawing special effects", @@ -246,6 +285,9 @@ { "horsename", "the name of your (first) horse (e.g., horsename:Silver)", PL_PSIZ, DISP_IN_GAME }, { "map_mode", "map display mode under Windows", 20, DISP_IN_GAME }, /*WC*/ +#ifdef MENU_COLOR + { "menucolor", "set menu colors", PL_PSIZ, SET_IN_FILE }, +#endif { "menustyle", "user interface for object selection", MENUTYPELEN, SET_IN_GAME }, { "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE }, @@ -306,6 +348,9 @@ { "scroll_amount", "amount to scroll map when scroll_margin is reached", 20, DISP_IN_GAME }, /*WC*/ { "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/ +#ifdef SORTLOOT + { "sortloot", "sort object selection lists by description", 4, SET_IN_GAME }, +#endif #ifdef MSDOS { "soundcard", "type of sound card to use", 20, SET_IN_FILE }, #endif @@ -532,6 +577,10 @@ flags.warnlevel = 1; flags.warntype = 0L; +#ifdef SORTLOOT + iflags.sortloot = 'n'; +#endif + /* assert( sizeof flags.inv_order == sizeof def_inv_order ); */ (void)memcpy((genericptr_t)flags.inv_order, (genericptr_t)def_inv_order, sizeof flags.inv_order); @@ -964,6 +1013,120 @@ } } +#ifdef MENU_COLOR +extern struct menucoloring *menu_colorings; + +static const struct { + const char *name; + const int color; +} colornames[] = { + {"black", CLR_BLACK}, + {"red", CLR_RED}, + {"green", CLR_GREEN}, + {"brown", CLR_BROWN}, + {"blue", CLR_BLUE}, + {"magenta", CLR_MAGENTA}, + {"cyan", CLR_CYAN}, + {"gray", CLR_GRAY}, + {"orange", CLR_ORANGE}, + {"lightgreen", CLR_BRIGHT_GREEN}, + {"yellow", CLR_YELLOW}, + {"lightblue", CLR_BRIGHT_BLUE}, + {"lightmagenta", CLR_BRIGHT_MAGENTA}, + {"lightcyan", CLR_BRIGHT_CYAN}, +