This is a combined diff for the following patches for Nethack 3.4.0 which is already an OUTDATED version. I recommend downloading newer sources (see http://www.nethack.org) and the corresponding patch instead of patching the old game version. - a fix for the known bug C340-2 - record the number of moves, and mark wizard/explore mode games in logfile / record (src/topten.c) - show numbers of different monsters born int the "vanquished" list after the numbers killed. (include/flag.h, src/cmd.c, src/end.c, src/options.c, dat/opthelp, dat/wizhelp, doc/Guidebook.*) - display the player with the race-specific symbol instead of always using @ (include/display.h, include/flag.h, src/options.c, dat/opthelp, doc/Guidebook.*) - Tom Friedetzky's "dump character" patch somewhat modified by me, Darshan Shaligram and possibly 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, dat/opthelp, doc/Guidebook.*) - Wingnut's "extinct" patch (src/end.c) - alt key for Linux (sys/unix/nethack.sh) - prompt for entering explore mode at death (include/flag.h, src/end.c, src/options.c, dat/opthelp, doc/Guidebook.*) - paranoid quit, by David Damerell, Jonathan Nieder and Jukka Lahtinen (include/flag.h, src/cmd.c, src/end.c, src/options.c, dat/opthelp, doc/Guidebook.*) - compatibility check for bones and save files changed to a bit more relaxed, allowing differences in compile time options TIMED_DELAY, SCORE_ON_BOTL, EXP_ON_BOTL and TEXTCOLOR. (src/version.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) - Alexis Manning's "travelcache" patch to store the previous target of the '_' command if the command is interrupted (src/cmd.c, src/hack.c) - Pasi Kallinen's "showrun" patch (http://www.cs.joensuu.fi/~pkalli) (dat/opthelp, include/flag.h, src/hack.c, src/options.c) - Fixes for known bugs C340-108 and C340-110 - Compile-time options for not writing #quit games to the record file (FORGET_QUITTER) and not writing explore mode games to the logfile (FORGET_EXPLORE). The config.h diff included here does not define these - Patch to swap the y and z command keys for German keyboards (#define GERMANKB in config.h, not defined here) - Ralph Churchill's colored Hp monitor (src/botl.c) - Display the contents of carried statues at the end, like the contents of carried bags and boxes. (src/end.c) Generally these patches need some #define in include/config.h to get compiled in. I included a diff for config.h to set them all on, except FORGET_QUITTER, FORGET_EXPLORE and GERMANKB. If you find any bugs in these patches, or if it looks like I forgot to include the diff for some file, please let me know. Mail sent to jukkal@despammed.com should get forwarded to whatever my current address is. 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. Set OPTIONS=dumpfile:/tmp/%n.nh (for the dump character patch in unix) OPTIONS=dumpfile:%n.nh (for the dump character patch in single user systems) OPTIONS=death_explore (to be prompted for explore mode when you die) OPTIONS=hero_race (to show the player with the race-specific symbol) OPTIONS=showborn (to see the numbers of monsters born) OPTIONS=show_run (to visualize running) OPTIONS=menucolors (to turn on the menucolor option) MENUCOLOR=" blessed "=green (some menucolor definition examples) MENUCOLOR=" holy "=green (if you have USE_REGEX_MATCH on in config.h) MENUCOLOR=" cursed "=red MENUCOLOR=" unholy "=red MENUCOLOR=" cursed .* (being worn)"=orange&underline MENUCOLOR="* blessed *"=green (this is how you define menucolors, if you ) MENUCOLOR="* holy *"=green (don't have GNU regex.h or just leave ) MENUCOLOR="* cursed *"=red (USE_REGEX_MATCH off in config.h ) MENUCOLOR="* unholy *"=red MENUCOLOR="* cursed * (being worn)"=orange&underline The diffs begin here: *** dat/help.off Thu Mar 21 01:42:29 2002 --- dat/help Fri Oct 25 17:55:56 2002 *************** *** 62,67 **** --- 62,69 ---- case means the Control key, not a caret) > down m: move without picking up objects F: fight even if you don't sense a monster + If the game was compiled with the GERMANKB patch enabled, + z will be used for Northwest movement instead of y. If the number_pad option is set, the number keys move instead. Depending on the platform, Shift number (on the numberpad), Meta number, or Alt number will invoke the YUHJKLBN commands. *************** *** 145,150 **** --- 147,154 ---- z Zap a wand. Z Cast a spell. ^Z Suspend the game. + If the game was compiled with the GERMANKB patch enabled, + y zaps a wand, Y casts a spell and ^Y suspends the game. : Look at what is here. ; Look at what is somewhere else. , Pick up some things. *** dat/hh.off Thu Mar 21 01:42:29 2002 --- dat/hh Fri Oct 25 17:55:56 2002 *************** *** 9,14 **** --- 9,16 ---- case means the Control key, not a caret) > down m: move without picking up objects/fighting F: fight even if you don't sense a monster + If the game was compiled with the GERMANKB patch enabled, + z will be used for Northwest movement instead of y. If the number_pad option is set, the number keys move instead. Depending on the platform, Shift number (on the numberpad), Meta number, or Alt number will invoke the YUHJKLBN commands. *************** *** 21,26 **** --- 23,30 ---- S save save the game (to be continued later) and exit ! sh escape to some SHELL (if allowed) ^Z suspend suspend the game (independent of your current suspend char) + If the game was compiled with the GERMANKB patch enabled, ^Y will be used + for the suspend command instead of ^Z. O options set options / whatis tell what a map symbol represents \ known display list of what's been discovered *************** *** 66,71 **** --- 70,77 ---- x xchange swap wielded and secondary weapons z zap zap a wand Z Zap cast a spell + If the game was compiled with the GERMANKB patch enabled, + y zaps a wand and Y casts a spell. < up go up the stairs > down go down the stairs ^ trap_id identify a previously found trap *** dat/opthelp.off Thu Mar 21 01:42:31 2002 --- dat/opthelp Fri Apr 5 14:34:22 2002 *************** *** 56,61 **** --- 56,75 ---- 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 HERO_RACE was set at compile time: + hero_race display the player with the race symbol (otherwise + always @) [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 PARANOID was set at compile time: + paranoid_quit ask for explicit 'yes' when quitting [FALSE] + Boolean option if EXP_ON_BOTL was set at compile time: showexp display your accumulated experience points [FALSE] *************** *** 90,95 **** --- 104,112 ---- boulder override the default boulder symbol with another default:` disclose the types of information you want offered at the end of the game [all] + 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: *** doc/Guidebook.mn.off Thu Mar 21 01:42:39 2002 --- doc/Guidebook.mn Fri Oct 25 17:54:58 2002 *************** *** 440,451 **** Go up to the previous level (if you are on a staircase or ladder). .lp > Go down to the next level (if you are on a staircase or ladder). ! .lp [yuhjklbn] Go one step in the direction indicated (see Figure 2). If you sense or remember a monster there, you will fight the monster instead. Only these one-step movement commands cause you to fight monsters; the others (below) are ``safe.'' .sd .TS S center; --- 440,454 ---- Go up to the previous level (if you are on a staircase or ladder). .lp > Go down to the next level (if you are on a staircase or ladder). ! .lp [yuhjklbn] (or [zuhjklbn] if the game was compiled with GERMANKB patch enabled) Go one step in the direction indicated (see Figure 2). If you sense or remember a monster there, you will fight the monster instead. Only these one-step movement commands cause you to fight monsters; the others (below) are ``safe.'' + If the game was compiled with the GERMANKB patch enabled, + z will be used instead of y for all kinds of movement, + including all the modified movements described below. .sd .TS S center; *************** *** 608,618 **** .lp ^X Display your name, role, race, gender, and alignment as well as the various deities in your game. ! .lp z Zap a wand. To aim at yourself, use `.' for the direction. ! .lp Z Zap (cast) a spell. To cast at yourself, use `.' for the direction. ! .lp ^Z Suspend the game .ux " versions with job control only)." ( .lp : --- 611,621 ---- .lp ^X Display your name, role, race, gender, and alignment as well as the various deities in your game. ! .lp z (y if the game was compiled with GERMANKB patch enabled) Zap a wand. To aim at yourself, use `.' for the direction. ! .lp Z (Y if the game was compiled with GERMANKB patch enabled) Zap (cast) a spell. To cast at yourself, use `.' for the direction. ! .lp ^Z (^Y if the game was compiled with GERMANKB patch enabled) Suspend the game .ux " versions with job control only)." ( .lp : *************** *** 1643,1648 **** --- 1646,1653 ---- .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 *************** *** 1690,1695 **** --- 1695,1706 ---- .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#{}.}..##\ #}''). *************** *** 1927,1932 **** --- 1938,1946 ---- 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_quit + If true, asks you to type the word ``yes'' when quitting or entering + Explore mode, not just the letter ``y''. .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. *************** *** 1971,1976 **** --- 1985,1994 ---- 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 showscore *************** *** 2089,2094 **** --- 2107,2116 ---- NetHack should use this size font for the status window. .lp font_size_text NetHack should use this size font for text windows. + .lp hero_race + Makes the player be shown with the symbol of his/her race + (dwarf, elf, gnome, human, orc). Normally the player is + always shown as a human regardless of his/her race. .lp hilite_pet Visually distinguish pets from similar animals (default off). The behavior of this option depends on the type of windowing you use. *** doc/Guidebook.tex.off Thu Mar 21 01:42:39 2002 --- doc/Guidebook.tex Fri Oct 25 17:54:59 2002 *************** *** 600,605 **** --- 600,608 ---- a monster there, you will fight the monster instead. Only these one-step movement commands cause you to fight monsters; the others (below) are ``safe.'' + If the game was compiled with the GERMANKB patch enabled, + z will be used instead of y for all kinds of movement, + including all the modified movements described below. %.sd \begin{center} \begin{tabular}{cc} *************** *** 809,820 **** --- 812,826 ---- the various deities in your game. %.lp \item[\tb{z}] + (y if the game was compiled with GERMANKB patch enabled) Zap a wand. To aim at yourself, use `{\tt .}' for the direction. %.lp \item[\tb{Z}] + (Y if the game was compiled with GERMANKB patch enabled) Zap (cast) a spell. To cast at yourself, use `{\tt .}' for the direction. %.lp \item[\tb{\^{}Z}] + (^Z if the game was compiled with GERMANKB patch enabled) Suspend the game (UNIX versions with job control only). %.lp \item[\tb{:}] *************** *** 2064,2069 **** --- 2070,2078 ---- 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 *************** *** 2112,2117 **** --- 2121,2133 ---- 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&.##<><>_|\\#{}.}..## #}&''). *************** *** 2366,2371 **** --- 2382,2391 ---- 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\_quit}] + If true, asks you to type the word ``yes'' when quitting or entering + Explore mode, not just the letter ``y''. + %.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. *************** *** 2421,2426 **** --- 2441,2451 ---- ``{\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 *************** *** 2572,2577 **** --- 2597,2607 ---- \item[\ib{font\_size\_text}] NetHack should use this size font for text windows. %.lp + \item[\ib{hero\_race}] + Makes the player be shown with the symbol of his/her race + (dwarf, elf, gnome, human, orc). Normally the player is + always shown as a human regardless of his/her race. + %.lp \item[\ib{hilite\_pet}] Visually distinguish pets from similar animals (default off). The behavior of this option depends on the type of windowing you use. *** doc/Guidebook.txt.off Thu Mar 21 01:42:39 2002 --- doc/Guidebook.txt Fri Oct 25 17:54:57 2002 *************** *** 577,592 **** > Go down to the next level (if you are on a staircase or lad- der). ! [yuhjklbn] Go one step in the direction indicated (see Figure 2). If you sense or remember a monster there, you will fight the monster instead. Only these one-step movement commands cause you to fight monsters; the others (below) are ``safe.'' ! ! ! ! NetHack 3.4 March 20, 2002 --- 577,592 ---- > Go down to the next level (if you are on a staircase or lad- der). ! [yuhjklbn] (or [zuhjklbn] if the game was compiled with GERMANKB ! patch enabled) Go one step in the direction indicated (see Figure 2). If you sense or remember a monster there, you will fight the monster instead. Only these one-step movement commands cause you to fight monsters; the others (below) are ``safe.'' ! If the game was compiled with the GERMANKB patch enabled, ! z will be used instead of y for all kinds of movement, ! including all the modified movements described below. NetHack 3.4 March 20, 2002 *************** *** 781,788 **** ^X Display your name, role, race, gender, and alignment as well as the various deities in your game. ! z Zap a wand. To aim at yourself, use `.' for the direction. ! --- 781,788 ---- ^X Display your name, role, race, gender, and alignment as well as the various deities in your game. ! z (y if the game was compiled with GERMANKB patch enabled) ! Zap a wand. To aim at yourself, use `.' for the direction. *************** *** 796,805 **** ! Z Zap (cast) a spell. To cast at yourself, use `.' for the direction. ! ^Z Suspend the game (UNIX(R) versions with job control only). : Look at what is here. --- 796,807 ---- ! Z (Y if the game was compiled with GERMANKB patch enabled) ! Zap (cast) a spell. To cast at yourself, use `.' for the direction. ! ^Z (^Y if the game was compiled with GERMANKB patch enabled) ! Suspend the game (UNIX(R) versions with job control only). : Look at what is here. *************** *** 846,853 **** #adjust Adjust inventory letters (most useful when the fixinv option is ``on''). - - __________ (R)UNIX is a registered trademark of AT&T. --- 848,853 ---- *************** *** 2141,2146 **** --- 2141,2149 ---- 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 *************** *** 2194,2199 **** --- 2197,2209 ---- 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 unix systems. + dungeon Set the graphics symbols for displaying the dungeon (default `` |--------||.-|++##.##<><>_|\\#{}.}..## #}''). The dun- *************** *** 2519,2524 **** --- 2529,2538 ---- Any omitted types are filled in at the end from the previous order. + paranoid_quit + If true, asks you to type the word ``yes'' when quitting or + entering Explore mode, not just the letter ``y''. + perm_invent If true, always display your current inventory in a window. This only makes sense for windowing system interfaces that *************** *** 2590,2595 **** --- 2604,2614 ---- scores''). 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 (de- fault off). *************** *** 2785,2790 **** --- 2804,2814 ---- font_size_text NetHack should use this size font for text windows. + hero_race + Makes the player be shown with the symbol of his/her race + (dwarf, elf, gnome, human, orc). Normally the player is + always shown as a human regardless of his/her race. + hilite_pet Visually distinguish pets from similar animals (default off). The behavior of this option depends on the type of *** include/color.h.off Thu Mar 21 01:42:43 2002 --- include/color.h Sat Apr 20 18:23:40 2002 *************** *** 5,10 **** --- 5,16 ---- #ifndef COLOR_H #define COLOR_H + #ifdef MENU_COLOR + # ifdef USE_REGEX_MATCH + # 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 *************** *** 48,51 **** --- 54,69 ---- #define HI_MINERAL CLR_GRAY #define HI_ZAP CLR_BRIGHT_BLUE + #ifdef MENU_COLOR + struct menucoloring { + #ifdef USE_REGEX_MATCH + struct re_pattern_buffer match; + #else + char *match; + #endif + int color, attr; + struct menucoloring *next; + }; + #endif + #endif /* COLOR_H */ *** include/config.h.off Thu Mar 21 01:42:43 2002 --- include/config.h Fri Feb 21 14:54:30 2003 *************** *** 347,355 **** */ /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ ! /* End of Section 5 */ #include "global.h" /* Define everything else according to choices above */ - #endif /* CONFIG_H */ --- 347,373 ---- */ /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ ! #define HERO_RACE /* Show player with race-specific symbol */ ! #define LOG_MOVES /* Move count and wiz/exp mode info in logfile */ ! #define SHOW_BORN /* Show numbers of each monster created */ ! #define DUMP_LOG /* Dump game end information to a file */ ! /* #define DUMP_FN "/tmp/dump.nh" */ /* Fixed dumpfile name, use if ! * you want to prevent definition by users */ ! #define SHOW_EXTINCT /* Show extinct species in the genocide list */ ! #define DEATH_EXPLORE /* Prompt for explore mode on death */ ! #define PARANOID /* Require "yes" reply for quit or switch to explore */ ! #define SHOWRUNNING /* Show every move when running, travelling, etc. */ ! #define HPMON /* Color Hp monitor */ ! #define STATCONT /* List contents of carried statues at the end */ ! #ifdef TTY_GRAPHICS ! # define MENU_COLOR ! #endif ! #define USE_REGEX_MATCH ! /* if USE_REGEX_MATCH is defined, use regular expressions (GNU regex.h) ! * otherwise use pmatch() to match menu color lines. ! * pmatch() provides basic globbing: '*' and '?' wildcards. ! */ /* End of Section 5 */ #include "global.h" /* Define everything else according to choices above */ #endif /* CONFIG_H */ *** include/decl.h.off Thu Mar 21 01:42:44 2002 --- include/decl.h Tue Mar 26 20:53:08 2002 *************** *** 183,188 **** --- 183,191 ---- E const char *configfile; E NEARDATA char plname[PL_NSIZ]; E NEARDATA char dogname[]; + #ifdef DUMP_LOG + E NEARDATA char dump_fn[]; /* dump patch */ + #endif E NEARDATA char catname[]; E NEARDATA char horsename[]; E char preferred_pet; *** include/display.h.off Thu Mar 21 01:42:44 2002 --- include/display.h Mon Mar 25 23:14:13 2002 *************** *** 317,323 **** --- 317,328 ---- /* The hero's glyph when seen as a monster. Could also be... * mon_to_glyph(Upolyd || Race_if(PM_HUMAN) ? u.umonnum : urace.malenum) */ + #ifdef HERO_RACE + #define hero_glyph monnum_to_glyph(Upolyd || !iflags.hero_race ? \ + u.umonnum : urace.malenum) + #else #define hero_glyph monnum_to_glyph(u.umonnum) + #endif /* *** include/extern.h.off Thu Mar 21 01:42:46 2002 --- include/extern.h Wed Oct 23 20:00:18 2002 *************** *** 130,135 **** --- 130,139 ---- 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 ### */ *************** *** 165,170 **** --- 169,178 ---- 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)); *************** *** 278,283 **** --- 286,292 ---- E void FDECL(row_refresh, (int,int,int)); E void NDECL(cls); E void FDECL(flush_screen, (int)); + E void NDECL(dump_screen); 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)); *************** *** 543,548 **** --- 552,561 ---- #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_container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P)); + #endif E void FDECL(terminate, (int)); E int NDECL(num_genocides); *************** *** 765,770 **** --- 778,786 ---- 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)); + #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 *)); *************** *** 1353,1358 **** --- 1369,1377 ---- E void FDECL(set_duplicate_opt_detection, (int)); E void FDECL(set_wc_option_mod_status, (unsigned long, int)); E void FDECL(set_option_mod_status, (char *, int)); + #ifdef MENU_COLOR + E boolean FDECL(add_menu_coloring, (char *)); + #endif /* ### pager.c ### */ *************** *** 1619,1625 **** E NhRegion *FDECL(visible_region_at, (XCHAR_P,XCHAR_P)); E void FDECL(show_region, (NhRegion*, XCHAR_P, XCHAR_P)); E void FDECL(save_regions, (int,int)); ! E void FDECL(rest_regions, (int)); E NhRegion* FDECL(create_gas_cloud, (XCHAR_P, XCHAR_P, int, int)); /* ### restore.c ### */ --- 1638,1644 ---- E NhRegion *FDECL(visible_region_at, (XCHAR_P,XCHAR_P)); E void FDECL(show_region, (NhRegion*, XCHAR_P, XCHAR_P)); E void FDECL(save_regions, (int,int)); ! E void FDECL(rest_regions, (int, BOOLEAN_P)); E NhRegion* FDECL(create_gas_cloud, (XCHAR_P, XCHAR_P, int, int)); /* ### restore.c ### */ *************** *** 2168,2173 **** --- 2187,2195 ---- 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)); *** include/flag.h.off Thu Mar 21 01:42:46 2002 --- include/flag.h Mon Jul 15 16:32:20 2002 *************** *** 165,170 **** --- 165,173 ---- boolean window_inited; /* true if init_nhwindows() completed */ boolean vision_inited; /* true if vision is ready */ boolean menu_tab_sep; /* Use tabs to separate option menu fields */ + #ifdef SHOWRUNNING + boolean show_run; /* show every move if running */ + #endif int purge_monsters; /* # of dead monsters still on fmon list */ int *opt_booldup; /* for duplication of boolean opts in config file */ int *opt_compdup; /* for duplication of compound opts in config file */ *************** *** 177,182 **** --- 180,188 ---- boolean prevmsg_window; /* show more old messages at a time */ 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 MFLOPPY boolean checkspace; /* check disk space before writing files */ /* (in iflags to allow restore after moving *************** *** 208,213 **** --- 214,231 ---- 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 HERO_RACE + boolean hero_race; /* show player with the race symbol */ + #endif + #ifdef DEATH_EXPLORE + boolean death_expl; /* prompt for explore mode at death */ + #endif + #ifdef PARANOID + boolean paranoid_quit; /* Ask for 'yes' when quitting */ + #endif /* * Window capability support. */ --- src/botl.c.off Thu Mar 21 01:43:02 2002 +++ src/botl.c Sun Feb 9 03:09:22 2003 @@ -163,10 +163,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; @@ -193,8 +199,10 @@ Sprintf(nb = eos(nb)," "); i = mrank_sz + 15; j = (nb + 2) - newbot1; /* aka strlen(newbot1) but less computation */ +#ifndef DUMP_LOG if((i - j) > 0) Sprintf(nb = eos(nb),"%*s", i-j, " "); /* pad with spaces */ +#endif if (ACURR(A_STR) > 18) { if (ACURR(A_STR) > STR18(100)) Sprintf(nb = eos(nb),"St:%2d ",ACURR(A_STR)-100); @@ -213,6 +221,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); } @@ -240,12 +257,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; @@ -254,6 +281,15 @@ if(hp < 0) hp = 0; (void) describe_level(newbot2); Sprintf(nb = eos(newbot2), +#ifdef HPMON + "%c:%-2ld HP:", oc_syms[GOLD_CLASS], +#ifndef GOLDOBJ + u.ugold +#else + money_cnt(invent) +#endif + ); +#else /* HPMON */ "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[GOLD_CLASS], #ifndef GOLDOBJ u.ugold, @@ -261,6 +297,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); @@ -290,6 +359,14 @@ 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); } *** src/cmd.c.off Thu Mar 21 01:43:01 2002 --- src/cmd.c Fri Sep 27 19:51:24 2002 *************** *** 122,127 **** --- 122,129 ---- 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 */ + extern void FDECL(list_vanquished, (int, BOOLEAN_P)); /* showborn patch */ #if defined(__BORLANDC__) && !defined(_WIN32) extern void FDECL(show_borlandc_stats, (winid)); #endif *************** *** 132,138 **** STATIC_DCL void FDECL(contained, (winid, const char *, long *, long *)); STATIC_PTR int NDECL(wiz_show_stats); # endif ! STATIC_PTR int NDECL(enter_explore_mode); STATIC_PTR int NDECL(doattributes); STATIC_PTR int NDECL(doconduct); /**/ STATIC_PTR void NDECL(minimal_enlightenment); --- 134,140 ---- STATIC_DCL void FDECL(contained, (winid, const char *, long *, long *)); STATIC_PTR int NDECL(wiz_show_stats); # endif ! int NDECL(enter_explore_mode); /* deathexplore patch */ STATIC_PTR int NDECL(doattributes); STATIC_PTR int NDECL(doconduct); /**/ STATIC_PTR void NDECL(minimal_enlightenment); *************** *** 145,150 **** --- 147,154 ---- #endif /* OVLB */ static const char* readchar_queue=""; + coord cctravel = {-1, -1}; + d_level travlev = {-1, -1}; STATIC_DCL char *NDECL(parse); *************** *** 465,476 **** return 0; } ! STATIC_PTR int enter_explore_mode() { if(!discover && !wizard) { pline("Beware! From explore mode there will be no return to normal game."); if (yn("Do you want to enter explore mode?") == 'y') { clear_nhwindow(WIN_MESSAGE); You("are now in non-scoring explore mode."); discover = TRUE; --- 469,498 ---- return 0; } ! 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; *************** *** 719,724 **** --- 741,752 ---- return 0; } + STATIC_PTR int wiz_showkills() /* showborn patch */ + { + list_vanquished('y',FALSE); + return 0; + } + #endif /* WIZARD */ *************** *** 901,907 **** else if (Levitation) you_are("levitating"); /* without control */ else if (Flying) you_can("fly"); if (Wwalking) you_can("walk on water"); ! if (Swimming) you_can("swim"); if (Breathless) you_can("survive without air"); else if (Amphibious) you_can("breathe water"); if (Passes_walls) you_can("walk through walls"); --- 929,935 ---- else if (Levitation) you_are("levitating"); /* without control */ else if (Flying) you_can("fly"); if (Wwalking) you_can("walk on water"); ! if (Swimming) you_can("swim"); if (Breathless) you_can("survive without air"); else if (Amphibious) you_can("breathe water"); if (Passes_walls) you_can("walk through walls"); *************** *** 1036,1041 **** --- 1064,1350 ---- 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" + }; + dump("", "Final attributes"); + #ifdef ELBERETH + if (u.uevent.uhand_of_elbereth) { + static const char *hofe_titles[3] = { + "the Hand of Elbereth", + "the Envoy of Balance", + "the Glory of Arioch" + }; + dump(" You were ", + (char *)hofe_titles[u.uevent.uhand_of_elbereth - 1]); + } + #endif + if (u.ualign.record >= 20) dump(" You were ", "piously aligned"); + else if (u.ualign.record > 13) dump(" You were ", "devoutly aligned"); + else if (u.ualign.record > 8) + dump(" You were ", "fervently aligned"); + else if (u.ualign.record > 3) + dump(" You were ", "stridently aligned"); + else if (u.ualign.record == 3) + dump(" You were ", "aligned"); + else if (u.ualign.record > 0) + dump(" You were ", "haltingly aligned"); + else if (u.ualign.record == 0) + dump(" You were ", "nominally aligned"); + else if (u.ualign.record >= -3) dump(" You have ", "strayed"); + else if (u.ualign.record >= -8) dump(" You have ", "sinned"); + else dump(" You have ", "transgressed"); + + #ifdef WIZARD + if (wizard) { + Sprintf(buf, " %d", u.ualign.record); + dump(" Your alignment was ", buf); + } + #endif + + /*** Resistances to troubles ***/ + if (Fire_resistance) dump(" You were ", "fire resistant"); + if (Cold_resistance) dump(" You were ", "cold resistant"); + if (Sleep_resistance) dump(" You were ", "sleep resistant"); + if (Disint_resistance) dump(" You were ", "disintegration-resistant"); + if (Shock_resistance) dump(" You were ", "shock resistant"); + if (Poison_resistance) dump(" You were ", "poison resistant"); + if (Drain_resistance) dump(" You were ", "level-drain resistant"); + if (Sick_resistance) dump(" You were ", "immune to sickness"); + if (Antimagic) dump(" You were ", "magic-protected"); + if (Acid_resistance) dump(" You were ", "acid resistant"); + if (Stone_resistance) dump(" You were ", "petrification resistant"); + if (Invulnerable) dump(" You were ", "invulnerable"); + if (u.uedibility) dump(" You could ", "recognize detrimental food"); + + /*** Troubles ***/ + if (Halluc_resistance) dump(" ", "You resisted hallucinations"); + if (Hallucination) dump(" You were ", "hallucinating"); + if (Stunned) dump(" You were ", "stunned"); + if (Confusion) dump(" You were ", "confused"); + if (Blinded) dump(" You were ", "blinded"); + if (Sick) { + if (u.usick_type & SICK_VOMITABLE) + dump(" You were ", "sick from food poisoning"); + if (u.usick_type & SICK_NONVOMITABLE) + dump(" You were ", "sick from illness"); + } + /* added by JDS */ + if (u.uhitinc) { + Sprintf(buf, "%s%i %s to hit", u.uhitinc > 0 ? "+" : "", + u.uhitinc, u.uhitinc > 0 ? "bonus" : "penalty"); + dump(" You had ", buf); + } + if (u.udaminc) { + Sprintf(buf, "%s%i %s to damage", u.udaminc > 0 ? "+" : "", + u.udaminc, u.udaminc > 0 ? "bonus" : "penalty"); + dump(" You had ", buf); + } /* end JDS portion */ + if (Stoned) dump(" You were ", "turning to stone"); + if (Slimed) dump(" You were ", "turning into slime"); + if (Strangled) + dump(" You were ", (u.uburied) ? "buried" : "being strangled"); + if (Glib) { + Sprintf(buf, "slippery %s", makeplural(body_part(FINGER))); + dump(" You had ", buf); + } + if (Fumbling) dump(" ", "You fumbled"); + if (Wounded_legs + #ifdef STEED + && !u.usteed + #endif + ) { + Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); + dump(" You had ", buf); + } + #if defined(WIZARD) && defined(STEED) + if (Wounded_legs && u.usteed && wizard) { + 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(" ", "You were telepathic"); + if (Warning) dump(" ", "You were 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(" You were ", buf); + } + if (Undead_warning) dump(" You were ", "warned of undead"); + if (Searching) dump(" You had ", "automatic searching"); + if (Clairvoyant) dump(" You were ", "clairvoyant"); + if (Infravision) dump(" You had ", "infravision"); + if (Detect_monsters) + dump(" You were ", "sensing the presence of monsters"); + if (u.umconf) dump(" You were ", "going to confuse monsters"); + + /*** Appearance and behavior ***/ + if (Adornment) dump(" You were ", "adorned"); + if (Invisible) dump(" You were ", "invisible"); + else if (Invis) dump(" You were ", "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(" You were ", "visible"); + if (Displaced) dump(" You were ", "displaced"); + if (Stealth) dump(" You were ", "stealthy"); + if (Aggravate_monster) dump(" ", "You aggravated monsters"); + if (Conflict) dump(" ", "You caused conflict"); + + /*** Transportation ***/ + if (Jumping) dump(" You could ", "jump"); + if (Teleportation) dump(" You could ", "teleport"); + if (Teleport_control) dump(" You had ", "teleport control"); + if (Lev_at_will) dump(" You were ", "levitating, at will"); + else if (Levitation) + dump(" You were ", "levitating"); /* without control */ + else if (Flying) dump(" You could ", "fly"); + if (Wwalking) dump(" You could ", "walk on water"); + if (Swimming) dump(" You could ", "swim"); + if (Breathless) dump(" You could ", "survive without air"); + else if (Amphibious) dump(" You could ", "breathe water"); + if (Passes_walls) dump(" You could ", "walk through walls"); + #ifdef STEED + if (u.usteed) { + Sprintf(buf, "riding %s", y_monnam(u.usteed)); + dump(" You were ", 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(" You were ", buf); + } else if (u.ustuck) { + Sprintf(buf, "%s %s", + (Upolyd && sticks(youmonst.data)) ? "holding" : "held by", + a_monnam(u.ustuck)); + dump(" You were ", buf); + } + + /*** Physical attributes ***/ + if (Slow_digestion) dump(" You had ", "slower digestion"); + if (Regeneration) dump(" ", "You regenerated"); + if (u.uspellprot || Protection) dump(" You were ", "protected"); + if (Protection_from_shape_changers) + dump(" You were ", "protected from shape changers"); + if (Polymorph) dump(" You were ", "polymorphing"); + if (Polymorph_control) dump(" You had ", "polymorph control"); + if (u.ulycn >= LOW_PM) { + Strcpy(buf, an(mons[u.ulycn].mname)); + dump(" You were ", buf); + } + if (Upolyd) { + if (u.ulycn >= LOW_PM) 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(" You were ", buf); + } + if (Unchanging) + dump(" You could ", "not change from your current form"); + if (Fast) dump(" You were ", Very_fast ? "very fast" : "fast"); + if (Reflecting) dump(" You had ", "reflection"); + if (Free_action) dump(" You had ", "free action"); + if (Fixed_abil) dump(" You had ", "fixed abilities"); + if (Lifesaved) + dump(" ", "Your life would have been saved"); + if (u.twoweap) dump(" You were ", "wielding two weapons at once"); + + /*** Miscellany ***/ + if (Luck) { + ltmp = abs((int)Luck); + Sprintf(buf, "%s%slucky", + ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "", + Luck < 0 ? "un" : ""); + #ifdef WIZARD + if (wizard) Sprintf(eos(buf), " (%d)", Luck); + #endif + dump(" You were ", buf); + } + #ifdef WIZARD + else if (wizard) dump(" ", "Your luck was zero"); + #endif + if (u.moreluck > 0) dump(" You had ", "extra luck"); + else if (u.moreluck < 0) dump(" You had ", "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 = !final ? (char *)0 : "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. *************** *** 1238,1243 **** --- 1547,1646 ---- 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, "used a wielded weapon %ld time%s", + u.uconduct.weaphit, plur(u.uconduct.weaphit)); + dump(" You have ", buf); + } + #ifdef WIZARD + else if (wizard) { + Sprintf(buf, "used a wielded weapon %ld time%s", + u.uconduct.weaphit, plur(u.uconduct.weaphit)); + dump(" You have ", 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 *************** *** 1273,1280 **** --- 1676,1687 ---- #endif {C('x'), TRUE, doattributes}, #ifdef SUSPEND + #ifdef GERMANKB + {C('y'), TRUE, dosuspend}, + #else {C('z'), TRUE, dosuspend}, #endif + #endif {'a', FALSE, doapply}, {'A', FALSE, doddoremarm}, {M('a'), TRUE, doorganize}, *************** *** 1337,1345 **** --- 1744,1757 ---- {M('w'), FALSE, dowipe}, {'x', FALSE, doswapweapon}, {'X', TRUE, enter_explore_mode}, + #ifdef GERMANKB + {'y', FALSE, dozap}, + {'Y', TRUE, docast}, + #else /* 'y', 'Y' : go nw */ {'z', FALSE, dozap}, {'Z', TRUE, docast}, + #endif {'<', FALSE, doup}, {'>', FALSE, dodown}, {'/', TRUE, dowhatis}, *************** *** 1409,1414 **** --- 1821,1827 ---- {(char *)0, (char *)0, donull, TRUE}, {(char *)0, (char *)0, donull, TRUE}, {(char *)0, (char *)0, donull, TRUE}, + {(char *)0, (char *)0, donull, TRUE}, /* showborn patch */ {(char *)0, (char *)0, donull, TRUE}, {(char *)0, (char *)0, donull, TRUE}, {(char *)0, (char *)0, donull, TRUE}, *************** *** 1427,1432 **** --- 1840,1846 ---- {"monpoly_control", "control monster polymorphs", wiz_mon_polycontrol, TRUE}, {"poly", "polymorph self", wiz_polyself, TRUE}, {"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}, *************** *** 2143,2157 **** static char cmd[2]; coord cc; cmd[1]=0; ! cc.x = u.ux; ! cc.y = u.uy; pline("Where do you want to travel to?"); if (getpos(&cc, TRUE, "the desired destination") < 0) { /* user pressed ESC */ return 0; } ! u.tx = cc.x; ! u.ty = cc.y; cmd[0] = CMD_TRAVEL; readchar_queue = cmd; return 0; --- 2557,2578 ---- static char cmd[2]; coord cc; cmd[1]=0; ! cc.x = cctravel.x; ! cc.y = cctravel.y; ! if ((cc.x == -1 && cc.y == -1) || travlev.dlevel != u.uz.dlevel) { ! /* Last travel attempt was successful or on another level, ! start attempt from current position */ ! cc.x = u.ux; ! cc.y = u.uy; ! } pline("Where do you want to travel to?"); if (getpos(&cc, TRUE, "the desired destination") < 0) { /* user pressed ESC */ return 0; } ! cctravel.x = u.tx = cc.x; ! cctravel.y = u.ty = cc.y; ! travlev.dlevel = u.uz.dlevel; cmd[0] = CMD_TRAVEL; readchar_queue = cmd; return 0; *** src/decl.c.off Thu Mar 21 01:43:01 2002 --- src/decl.c Fri Sep 27 19:51:24 2002 *************** *** 96,102 **** --- 96,106 ---- NEARDATA struct sinfo program_state; /* 'rogue'-like direction commands (cmd.c) */ + #ifdef GERMANKB + const char sdir[] = "hzkulnjb><"; + #else const char sdir[] = "hykulnjb><"; + #endif const char ndir[] = "47896321><"; /* number pad mode */ const schar xdir[10] = { -1,-1, 0, 1, 1, 1, 0,-1, 0, 0 }; const schar ydir[10] = { 0,-1,-1,-1, 0, 1, 1, 1, 0, 0 }; *************** *** 195,200 **** --- 199,213 ---- /* used to zero all elements of a struct obj */ NEARDATA struct obj zeroobj = DUMMY; + /* originally from end.c */ + #ifdef DUMP_LOG + #ifdef DUMP_FN + NEARDATA char dump_fn[] = DUMP_FN; + #else + NEARDATA char dump_fn[PL_PSIZ] = DUMMY; + #endif + #endif + /* originally from dog.c */ NEARDATA char dogname[PL_PSIZ] = DUMMY; NEARDATA char catname[PL_PSIZ] = DUMMY; *************** *** 233,238 **** --- 246,255 ---- "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.", *** src/display.c.off Thu Mar 21 01:43:02 2002 --- src/display.c Sat May 25 10:45:53 2002 *************** *** 1339,1344 **** --- 1339,1420 ---- /* ========================================================================= */ + #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 ch; + + /* + * 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; + } + + /* 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); + dump("", buf); + bot2str(buf); + dump("", buf); + dump("", ""); + dump("", ""); + } + #endif /* DUMP_LOG */ + /* * back_to_glyph() * --- src/end.c.off Thu Mar 21 01:43:06 2002 +++ src/end.c Tue Feb 18 18:46:34 2003 @@ -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 @@ -40,8 +43,14 @@ STATIC_DCL void FDECL(add_artifact_score, (struct obj *)); STATIC_DCL void FDECL(display_artifact_score, (struct obj *,winid)); STATIC_DCL void FDECL(savelife, (int)); -STATIC_DCL void FDECL(list_vanquished, (int, BOOLEAN_P)); +void FDECL(list_vanquished, (int, BOOLEAN_P)); /* showborn patch */ +#ifdef DUMP_LOG +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, (int, BOOLEAN_P)); +#endif STATIC_DCL boolean FDECL(should_query_disclose_option, (int, int*)); #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) @@ -83,6 +92,58 @@ extern const char *killed_by_prefix[]; +#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) { + 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)); + q += strlen(plname); + p += 2; + 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.", dump_fn); + pline("Dump file not created."); + } + + } 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 @@ -110,7 +171,21 @@ 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 if(yn("Really quit?") == 'n') { +#endif #ifndef NO_SIGNAL (void) signal(SIGINT, (SIG_RET_TYPE) done1); #endif @@ -269,11 +344,13 @@ # endif !program_state.something_worth_saving ? "" : " and it may be possible to rebuild."); +#endif /* panic patch moves this end here */ if (program_state.something_worth_saving) { +#if defined(WIZARD) && !defined(MICRO) /* panic patch */ set_error_savefile(); +#endif (void) dosave0(); } -#endif { char buf[BUFSZ]; Vsprintf(buf,str,VA_ARGS); @@ -351,8 +428,13 @@ makeknown(obj->otyp); obj->known = obj->bknown = obj->dknown = obj->rknown = 1; } +#ifdef DUMP_LOG + (void) dump_inventory((char *)0, TRUE); + do_container_contents(invent, TRUE, TRUE, TRUE); +#else (void) display_inventory((char *)0, TRUE); container_contents(invent, TRUE, TRUE); +#endif } if (ask && c == 'q') done_stopprint++; } @@ -366,14 +448,28 @@ enlightenment(how >= PANICKED ? 1 : 2); /* final */ if (ask && c == 'q') done_stopprint++; } +#ifdef DUMP_LOG + if (dump_fn) { + dump_enlightenment((int) (how >= PANICKED ? 1 : 2)); + dump_spells(); + } +#endif ask = should_query_disclose_option('v', &defquery); if (!done_stopprint) +#ifdef DUMP_LOG + do_vanquished(defquery, ask, TRUE); +#else 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) { @@ -383,6 +479,12 @@ show_conduct(how >= PANICKED ? 1 : 2); if (ask && c == 'q') done_stopprint++; } +#ifdef DUMP_LOG + if (dump_fn) { + dump_conduct(how >= PANICKED ? 1 : 2); + dump_weapon_skill(); + } +#endif } /* try to get the player back in a viable state after being killed */ @@ -514,6 +616,10 @@ arti_cost(otmp), currency(2L), arti_cost(otmp) * 5 / 2); putstr(endwin, 0, pbuf); +#ifdef DUMP_LOG + if (dump_fn) + dump("",pbuf); +#endif } if (Has_contents(otmp)) display_artifact_score(otmp->cobj,endwin); @@ -526,9 +632,12 @@ int how; { 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; + boolean bones_ok = FALSE, have_windows = iflags.window_inited; struct obj *corpse = (struct obj *)0; long umoney; @@ -572,6 +681,9 @@ return; } } + + bones_ok = (how < GENOCIDED) && can_make_bones(); /* dthexpl patch */ + if (( #ifdef WIZARD wizard || @@ -586,15 +698,51 @@ 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 /* * The game is now over... */ die: +#ifdef DEATH_EXPLORE + if (!goexplore) { +#endif program_state.gameover = 1; +#ifdef DUMP_LOG + /* D: Grab screen dump right here */ + if (dump_fn) { + 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(); + } +#endif /* in case of a subsequent panic(), there's no point trying to save */ program_state.something_worth_saving = 0; +#ifdef DEATH_EXPLORE + } /* if (!goexplore) */ +#endif /* render vision subsystem inoperative */ iflags.vision_inited = 0; /* might have been killed while using a disposable item, so make sure @@ -609,6 +757,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__) @@ -617,7 +768,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; @@ -639,6 +790,9 @@ make_grave(u.ux, u.uy, pbuf); } } +#ifdef DEATH_EXPLORE + } /* if (!goexplore) */ +#endif if (how == QUIT) { killer_format = NO_KILLER_PREFIX; @@ -659,6 +813,9 @@ clearpriests(); } else taken = FALSE; /* lint; assert( !bones_ok ); */ +#ifdef DEATH_EXPLORE + if (!goexplore) { +#endif clearlocks(); if (have_windows) display_nhwindow(WIN_MESSAGE, FALSE); @@ -667,6 +824,9 @@ 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] */ { @@ -692,6 +852,25 @@ 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) { @@ -740,15 +919,19 @@ /* don't bother counting to see whether it should be plural */ } + 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) { - 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")); putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); } +#ifdef DUMP_LOG + if (dump_fn) + dump("",pbuf); +#endif if (how == ESCAPED || how == ASCENDED) { register struct monst *mtmp; @@ -774,27 +957,34 @@ 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)); + 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_fn) + dump("",pbuf); +#endif pbuf[0] = '\0'; } else { if (!done_stopprint) Strcat(pbuf, " "); } - if (!done_stopprint) { - Sprintf(eos(pbuf), "%s with %ld point%s,", + Sprintf(eos(pbuf), "%s with %ld point%s,", how==ASCENDED ? "went to your reward" : "escaped from the dungeon", u.urexp, plur(u.urexp)); + if (!done_stopprint) { putstr(endwin, 0, pbuf); } +#ifdef DUMP_LOG + if (dump_fn) + dump("",pbuf); +#endif if (!done_stopprint) display_artifact_score(invent,endwin); @@ -824,6 +1014,10 @@ count, plur(count)); } putstr(endwin, 0, pbuf); +#ifdef DUMP_LOG + if (dump_fn) + dump("",pbuf); +#endif } } @@ -848,12 +1042,23 @@ Sprintf(eos(pbuf), " with %ld point%s,", u.urexp, plur(u.urexp)); putstr(endwin, 0, pbuf); +#ifdef DUMP_LOG + if (dump_fn) + 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); +#ifdef DUMP_LOG + if (dump_fn) { + dump("",pbuf); + Sprintf(pbuf, "Killer: %s",killer); + dump("",pbuf); + } +#endif } if (!done_stopprint) { Sprintf(pbuf, @@ -861,6 +1066,10 @@ u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]); putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); +#ifdef DUMP_LOG + if (dump_fn) + dump("",pbuf); +#endif } if (!done_stopprint) display_nhwindow(endwin, TRUE); @@ -878,6 +1087,10 @@ exit_nhwindows((char *)0); topten(how); } +#ifdef DUMP_LOG + if (dump_fn) + dump_exit(); +#endif if(done_stopprint) { raw_print(""); raw_print(""); } terminate(EXIT_SUCCESS); @@ -888,37 +1101,98 @@ container_contents(list, identified, all_containers) struct obj *list; boolean identified, all_containers; +#ifdef DUMP_LOG +{ + do_container_contents(list, identified, all_containers, FALSE); +} + +void do_container_contents(list, identified, all_containers, want_dump) +struct obj *list; +boolean identified, all_containers, want_dump; +#endif +/* The original container_contents function */ { register struct obj *box, *obj; - char buf[BUFSZ]; + char buf[BUFSZ], *invlet; + int classcount; for (box = list; box; box = box->nobj) { +#ifndef STATCONT if (Is_container(box) && box->otyp != BAG_OF_TRICKS) { +#endif if (box->cobj) { winid tmpwin = create_nhwindow(NHW_MENU); Sprintf(buf, "Contents of %s:", the(xname(box))); putstr(tmpwin, 0, buf); putstr(tmpwin, 0, ""); +#ifdef DUMP_LOG + if (want_dump) + dump("", buf); +#endif + invlet = flags.inv_order; +nextclass: + classcount = 0; for (obj = box->cobj; obj; obj = obj->nobj) { + if (!flags.sortpack || obj->oclass == *invlet +#ifdef DUMP_LOG + || !want_dump +#endif + ) { if (identified) { makeknown(obj->otyp); obj->known = obj->bknown = obj->dknown = obj->rknown = 1; } putstr(tmpwin, 0, doname(obj)); +#ifdef DUMP_LOG + if (want_dump) + dump("", doname(obj)); +#endif + } + } + if (flags.sortpack +#ifdef DUMP_LOG + && want_dump +#endif + ) { + if (*++invlet) + goto nextclass; } + display_nhwindow(tmpwin, TRUE); destroy_nhwindow(tmpwin); - if (all_containers) + if (all_containers) { +#ifdef DUMP_LOG + if (want_dump) + dump("", ""); + do_container_contents(box->cobj, identified, TRUE, + want_dump); +#else container_contents(box->cobj, identified, TRUE); - } else { +#endif + } + } else +#ifdef STATCONT + if (Is_container(box)) +#endif + { pline("%s empty.", Tobjnam(box, "are")); display_nhwindow(WIN_MESSAGE, FALSE); +#ifdef DUMP_LOG + if (want_dump) + dump(The(xname(box)), " is empty."); +#endif } - } +#ifndef STATCONT + } /* Is_container */ +#endif if (!all_containers) break; } +#ifdef DUMP_LOG + if (want_dump) + dump("", ""); +#endif } @@ -940,10 +1214,21 @@ nethack_exit(status); } -STATIC_OVL void +void /* showborn patch */ list_vanquished(defquery, ask) int 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; @@ -971,6 +1256,10 @@ klwin = create_nhwindow(NHW_MENU); putstr(klwin, 0, "Vanquished creatures:"); putstr(klwin, 0, ""); +#ifdef DUMP_LOG + if (want_dump) + dump("", "Vanquished creatures"); +#endif /* countdown by monster "toughness" */ for (lev = max_lev; lev >= 0; lev--) @@ -997,8 +1286,17 @@ 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); +#ifdef DUMP_LOG + if (want_dump) + dump(" ", buf); +#endif } /* * if (Hallucination) @@ -1008,9 +1306,17 @@ putstr(klwin, 0, ""); Sprintf(buf, "%ld creatures vanquished.", total_killed); putstr(klwin, 0, buf); +#ifdef DUMP_LOG + if (want_dump) + dump(" ", buf); +#endif } display_nhwindow(klwin, TRUE); destroy_nhwindow(klwin); +#ifdef DUMP_LOG + if (want_dump) + dump("", ""); +#endif } } } @@ -1027,44 +1333,118 @@ 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) int 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++; + } +#else ngenocided = num_genocides(); +#endif /* genocided species list */ - if (ngenocided != 0) { + if (ngenocided != 0 +#ifdef SHOW_EXTINCT + || nextincted != 0 +#endif + ) { if (ask) +#ifdef SHOW_EXTINCT + if (nextincted != 0) + c = yn_function("Do you want a list of species genocided or extincted?", + ynqchars, defquery); + else +#endif c = yn_function("Do you want a list of species genocided?", ynqchars, defquery); if (ask && c == 'q') done_stopprint++; if ((!ask && defquery == 'y') || (ask && c == 'y')) { klwin = create_nhwindow(NHW_MENU); - putstr(klwin, 0, "Genocided species:"); +#ifdef SHOW_EXTINCT + Sprintf(buf, "Genocided or extincted 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, ""); - Sprintf(buf, "%d species genocided.", ngenocided); +#ifdef SHOW_EXTINCT + if (ngenocided>0) { +#endif + Sprintf(buf, "%d species genocided.", num_genocides()); putstr(klwin, 0, buf); +#ifdef DUMP_LOG + if (want_dump) + dump("", buf); +#endif +#ifdef SHOW_EXTINCT + } + if (nextincted!=0) { + Sprintf(buf, "%d species extincted.", nextincted); + putstr(klwin, 0, buf); +#ifdef DUMP_LOG + if (want_dump) + dump("", buf); +#endif + } +#endif +#ifdef DUMP_LOG + if (want_dump) + dump("",""); +#endif display_nhwindow(klwin, TRUE); destroy_nhwindow(klwin); *** src/explode.c.off Thu Mar 21 01:43:05 2002 --- src/explode.c Mon Mar 25 17:22:56 2002 *************** *** 439,445 **** if (otmp->otyp == BOULDER) { pline("%s apart.", Tobjnam(otmp, "break")); fracture_rock(otmp); ! place_object(otmp, sx, sy); /* put fragments on floor */ if ((otmp = sobj_at(BOULDER, sx, sy)) != 0) { /* another boulder here, restack it to the top */ obj_extract_self(otmp); --- 439,445 ---- if (otmp->otyp == BOULDER) { pline("%s apart.", Tobjnam(otmp, "break")); fracture_rock(otmp); ! /* place_object(otmp, sx, sy); /* put fragments on floor */ if ((otmp = sobj_at(BOULDER, sx, sy)) != 0) { /* another boulder here, restack it to the top */ obj_extract_self(otmp); *************** *** 452,458 **** deltrap(trap); pline("%s.", Tobjnam(otmp, "crumble")); (void) break_statue(otmp); ! place_object(otmp, sx, sy); /* put fragments on floor */ } used_up = TRUE; --- 452,458 ---- deltrap(trap); pline("%s.", Tobjnam(otmp, "crumble")); (void) break_statue(otmp); ! /* place_object(otmp, sx, sy); /* put fragments on floor */ } used_up = TRUE; *** src/files.c.off Thu Mar 21 01:43:06 2002 --- src/files.c Sat Apr 20 18:43:30 2002 *************** *** 1355,1360 **** --- 1355,1364 ---- } else if (match_varname(buf, "BOULDER", 3)) { (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, 1, "BOULDER"); + #ifdef MENU_COLOR + } else if (match_varname(buf, "MENUCOLOR", 9)) { + add_menu_coloring(bufp); + #endif } else if (match_varname(buf, "GRAPHICS", 4)) { len = get_uchars(fp, buf, bufp, translate, MAXPCHARS, "GRAPHICS"); assign_graphics(translate, len, MAXPCHARS, 0); *** src/hack.c.off Thu Mar 21 01:43:06 2002 --- src/hack.c Mon Jul 15 16:38:52 2002 *************** *** 4,9 **** --- 4,11 ---- #include "hack.h" + extern coord cctravel; + #ifdef OVL1 STATIC_DCL void NDECL(maybe_wail); #endif /*OVL1*/ *************** *** 716,721 **** --- 718,724 ---- u.dx = 0; u.dy = 0; + cctravel.x = cctravel.y = -1; nomul(0); } *************** *** 1271,1276 **** --- 1274,1286 ---- nomul(-2); nomovemsg = ""; } + + #ifdef SHOWRUNNING + if (flags.run && iflags.show_run) { + flush_screen(1); + delay_output(); + } + #endif } void *** src/invent.c.off Thu Mar 21 01:43:07 2002 --- src/invent.c Thu Mar 28 19:39:29 2002 *************** *** 20,26 **** --- 20,30 ---- 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)); + #else static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *)); + #endif #ifdef OVLB STATIC_DCL boolean FDECL(this_type_only, (struct obj *)); STATIC_DCL void NDECL(dounpaid); *************** *** 962,968 **** if (ilet == '?' && !*lets && *altlets) allowed_choices = altlets; ilet = display_pickinv(allowed_choices, TRUE, ! allowcnt ? &ctmp : (long *)0); if(!ilet) continue; if (allowcnt && ctmp >= 0) { cnt = ctmp; --- 966,976 ---- if (ilet == '?' && !*lets && *altlets) allowed_choices = altlets; ilet = display_pickinv(allowed_choices, TRUE, ! allowcnt ? &ctmp : (long *)0 ! #ifdef DUMP_LOG ! , FALSE ! #endif ! ); if(!ilet) continue; if (allowcnt && ctmp >= 0) { cnt = ctmp; *************** *** 1580,1590 **** --- 1588,1607 ---- * 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) + register const char *lets; + boolean want_reply; + long* out_cnt; + boolean want_dump; + #else static char display_pickinv(lets, want_reply, out_cnt) register const char *lets; boolean want_reply; long* out_cnt; + #endif { struct obj *otmp; char ilet, ret; *************** *** 1604,1609 **** --- 1621,1631 ---- } 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 *************** *** 1621,1626 **** --- 1643,1652 ---- #else pline("Not carrying anything."); #endif + #ifdef DUMP_LOG + if (want_dump) + dump(" Not carrying anything",u.ugold ? " except gold." : "."); + #endif return 0; } *************** *** 1637,1642 **** --- 1663,1675 ---- ret = message_menu(lets[0], want_reply ? PICK_ONE : PICK_NONE, xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L)); + #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; } } *************** *** 1655,1666 **** --- 1688,1710 ---- any.a_void = 0; /* zero */ add_menu(win, NO_GLYPH, &any, 0, 0, ATR_INVERSE, let_to_name(*invlet, FALSE), MENU_UNSELECTED); + #ifdef DUMP_LOG + if (want_dump) + dump(" ", let_to_name(*invlet, FALSE)); + #endif classcount++; } any.a_char = ilet; add_menu(win, obj_to_glyph(otmp), &any, ilet, 0, ATR_NONE, doname(otmp), MENU_UNSELECTED); + #ifdef DUMP_LOG + if (want_dump) { + char letbuf[7]; + sprintf(letbuf, " %c - ", ilet); + dump(letbuf, doname(otmp)); + } + #endif } } } *************** *** 1682,1687 **** --- 1726,1735 ---- free((genericptr_t)selected); } else ret = !n ? '\0' : '\033'; /* cancelled */ + #ifdef DUMP_LOG + if (want_dump) + dump("", ""); + #endif return ret; } *************** *** 1698,1706 **** register const char *lets; boolean want_reply; { ! return display_pickinv(lets, want_reply, (long *)0); } /* * Returns the number of unpaid items within the given list. This includes * contained objects. --- 1746,1769 ---- register const char *lets; boolean want_reply; { ! return display_pickinv(lets, want_reply, (long *)0 ! #ifdef DUMP_LOG ! , FALSE ! #endif ! ); } + #ifdef DUMP_LOG + /* See display_inventory. This is the same thing WITH dumpfile creation */ + char + dump_inventory(lets, want_reply) + register const char *lets; + boolean want_reply; + { + return display_pickinv(lets, want_reply, (long *)0, TRUE); + } + #endif + /* * Returns the number of unpaid items within the given list. This includes * contained objects. *** src/mhitm.c.c340-110 Thu Mar 21 01:43:08 2002 --- src/mhitm.c Fri Oct 25 17:50:44 2002 *************** *** 568,574 **** struct obj *obj; char buf[BUFSZ]; int protector = ! mattk->aatyp == AT_TENT ? 0 : mattk->aatyp == AT_KICK ? W_ARMF : W_ARMG; int num; --- 568,574 ---- struct obj *obj; char buf[BUFSZ]; int protector = ! (mattk->aatyp == AT_TENT || mattk->aatyp == AT_BITE) ? 0 : mattk->aatyp == AT_KICK ? W_ARMF : W_ARMG; int num; *** src/options.c.off Thu Mar 21 01:43:12 2002 --- src/options.c Mon Jul 15 16:39:36 2002 *************** *** 68,73 **** --- 68,76 ---- {"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 *************** *** 92,97 **** --- 95,103 ---- {"flush", (boolean *)0, FALSE, SET_IN_FILE}, #endif {"help", &flags.help, TRUE, SET_IN_GAME}, + #ifdef HERO_RACE + {"hero_race", &iflags.hero_race, FALSE, SET_IN_GAME}, + #endif {"hilite_pet", &iflags.wc_hilite_pet, FALSE, SET_IN_GAME}, /*WC*/ #ifdef ASCIIGRAPH {"IBMgraphics", &iflags.IBMgraphics, FALSE, SET_IN_GAME}, *************** *** 116,121 **** --- 122,134 ---- #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 + #endif #ifdef WIZARD /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, *************** *** 139,144 **** --- 152,160 ---- #else {"page_wait", (boolean *)0, FALSE, SET_IN_FILE}, #endif + #ifdef PARANOID + {"paranoid_quit", &iflags.paranoid_quit, 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}, *************** *** 156,161 **** --- 172,185 ---- #else {"sanity_check", (boolean *)0, FALSE, SET_IN_FILE}, #endif + #ifdef SHOWRUNNING + {"show_run", &iflags.show_run, FALSE, SET_IN_GAME}, + #endif + #ifdef SHOW_BORN + {"showborn", &iflags.show_born, FALSE, SET_IN_GAME}, + #else + {"showborn", (boolean *)0, FALSE, SET_IN_FILE}, + #endif #ifdef EXP_ON_BOTL {"showexp", &flags.showexp, FALSE, SET_IN_GAME}, #else *************** *** 215,220 **** --- 239,252 ---- 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", *************** *** 237,242 **** --- 269,277 ---- { "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 }, *************** *** 929,934 **** --- 964,1085 ---- } } + #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}, + {"white", CLR_WHITE} + }; + + static const struct { + const char *name; + const int attr; + } attrnames[] = { + {"none", ATR_NONE}, + {"bold", ATR_BOLD}, + {"dim", ATR_DIM}, + {"underline", ATR_ULINE}, + {"blink", ATR_BLINK}, + {"inverse", ATR_INVERSE} + + }; + + /* parse '"regex_string"=color' and add it to menucoloring */ + boolean + add_menu_coloring(str) + char *str; + { + int i, c = NO_COLOR, a = ATR_NONE; + struct menucoloring *tmp; + char *tmps, *cs = strchr(str, '='); + const char *err = (char *)0; + + if (!cs || !str) return FALSE; + + tmps = cs; + tmps++; + while (*tmps && isspace(*tmps)) tmps++; + + for (i = 0; i < SIZE(colornames); i++) + if (strstri(tmps, colornames[i].name) == tmps) { + c = colornames[i].color; + break; + } + if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9')) + c = atoi(tmps); + + if (c > 15) return FALSE; + + tmps = strchr(str, '&'); + if (tmps) { + tmps++; + while (*tmps && isspace(*tmps)) tmps++; + for (i = 0; i < SIZE(attrnames); i++) + if (strstri(tmps, attrnames[i].name) == tmps) { + a = attrnames[i].attr; + break; + } + if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9')) + a = atoi(tmps); + } + + *cs = '\0'; + tmps = str; + if ((*tmps == '"') || (*tmps == '\'')) { + cs--; + while (isspace(*cs)) cs--; + if (*cs == *tmps) { + *cs = '\0'; + tmps++; + } + } + + tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring)); + #ifdef USE_REGEX_MATCH + tmp->match.translate = 0; + tmp->match.fastmap = 0; + tmp->match.buffer = 0; + tmp->match.allocated = 0; + tmp->match.regs_allocated = REGS_FIXED; + err = re_compile_pattern(tmps, strlen(tmps), &tmp->match); + #else + tmp->match = (char *)alloc(strlen(tmps)+1); + (void) memcpy((genericptr_t) tmp->match, (genericptr_t)tmps, + strlen(tmps)+1); + #endif + if (err) { + raw_printf("\nMenucolor regex error: %s\n", err); + wait_synch(); + free(tmp); + return FALSE; + } else { + tmp->next = menu_colorings; + tmp->color = c; + tmp->attr = a; + menu_colorings = tmp; + return TRUE; + } + } + #endif /* MENU_COLOR */ + + void parseoptions(opts, tinitial, tfrom_file) register char *opts; *************** *** 1041,1046 **** --- 1192,1210 ---- return; } + #ifdef DUMP_LOG + fullname = "dumpfile"; + if (match_optname(opts, fullname, 3, TRUE)) { + #ifndef DUMP_FN + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_opt(opts, !tfrom_file)) != 0 + && strlen(op) > 1) + nmcpy(dump_fn, op, PL_PSIZ); + #endif + return; + } + #endif + fullname = "horsename"; if (match_optname(opts, fullname, 5, TRUE)) { if (negated) bad_negation(fullname, FALSE); *************** *** 1049,1054 **** --- 1213,1230 ---- return; } + #ifdef MENU_COLOR + /* menucolor:"regex_string"=color */ + fullname = "menucolor"; + if (match_optname(opts, fullname, 9, TRUE)) { + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) + if (!add_menu_coloring(op)) + badoption(opts); + return; + } + #endif + fullname = "msghistory"; if (match_optname(opts, fullname, 3, TRUE)) { op = string_for_env_opt(fullname, opts, negated); *************** *** 2085,2091 **** # endif } #endif ! return; } } --- 2261,2271 ---- # endif } #endif ! #ifdef HERO_RACE ! else if (boolopt[i].addr == &iflags.hero_race) { ! need_redraw = TRUE; ! } ! #endif return; } } *************** *** 2519,2524 **** --- 2699,2708 ---- } else if (!strcmp(optname, "dogname")) Sprintf(buf, "%s", dogname[0] ? dogname : none ); + #ifdef DUMP_LOG + else if (!strcmp(optname, "dumpfile")) + Sprintf(buf, "%s", dump_fn[0] ? dump_fn: none ); + #endif else if (!strcmp(optname, "dungeon")) Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "effects")) *** src/region.c.c340-108 Thu Mar 21 01:43:15 2002 --- src/region.c Wed Oct 23 20:00:18 2002 *************** *** 657,664 **** } void ! rest_regions(fd) int fd; { int i, j; unsigned n; --- 657,665 ---- } void ! rest_regions(fd,ghostly) int fd; + boolean ghostly; /* If a bones file restore */ { int i, j; unsigned n; *************** *** 667,673 **** clear_regions(); /* Just for security */ mread(fd, (genericptr_t) &tmstamp, sizeof (tmstamp)); ! tmstamp = (moves - tmstamp); mread(fd, (genericptr_t) &n_regions, sizeof (n_regions)); max_regions = n_regions; if (n_regions > 0) --- 668,675 ---- clear_regions(); /* Just for security */ mread(fd, (genericptr_t) &tmstamp, sizeof (tmstamp)); ! if (ghostly) tmstamp = 0; ! else tmstamp = (moves - tmstamp); mread(fd, (genericptr_t) &n_regions, sizeof (n_regions)); max_regions = n_regions; if (n_regions > 0) *** src/restore.c.c340-108 Thu Mar 21 01:43:15 2002 --- src/restore.c Sat Dec 28 11:46:53 2002 *************** *** 348,353 **** --- 348,354 ---- int uid; mread(fd, (genericptr_t) &uid, sizeof uid); + #if 0 /* don't check the uid */ if (uid != getuid()) { /* strange ... */ /* for wizard mode, issue a reminder; for others, treat it as an attempt to cheat and refuse to restore this file */ *************** *** 357,363 **** #endif return FALSE; } ! mread(fd, (genericptr_t) &flags, sizeof(struct flag)); flags.bypasses = 0; /* never use the saved value of bypasses */ --- 358,364 ---- #endif return FALSE; } ! #endif mread(fd, (genericptr_t) &flags, sizeof(struct flag)); flags.bypasses = 0; /* never use the saved value of bypasses */ *************** *** 810,816 **** } restdamage(fd, ghostly); ! rest_regions(fd); if (ghostly) { /* Now get rid of all the temp fruits... */ freefruitchn(oldfruit), oldfruit = 0; --- 811,817 ---- } restdamage(fd, ghostly); ! rest_regions(fd, ghostly); if (ghostly) { /* Now get rid of all the temp fruits... */ freefruitchn(oldfruit), oldfruit = 0; *** src/save.c.off Thu Mar 21 01:43:16 2002 --- src/save.c Sat May 25 12:13:30 2002 *************** *** 49,54 **** --- 49,58 ---- #define HUP #endif + #ifdef MENU_COLOR + extern struct menucoloring *menu_colorings; + #endif + /* need to preserve these during save to avoid accessing freed memory */ static unsigned ustuck_id = 0, usteed_id = 0; *************** *** 939,950 **** --- 943,977 ---- return; } + #ifdef MENU_COLOR + void + free_menu_coloring() + { + struct menucoloring *tmp = menu_colorings; + + while (tmp) { + struct menucoloring *tmp2 = tmp->next; + #ifdef USE_REGEX_MATCH + (void) regfree(&tmp->match); + #else + free(tmp->match); + #endif + free(tmp); + tmp = tmp2; + } + return; + } + #endif + void freedynamicdata() { unload_qtlist(); free_invbuf(); /* let_to_name (invent.c) */ free_youbuf(); /* You_buf,&c (pline.c) */ + #ifdef MENU_COLOR + free_menu_coloring(); + #endif tmp_at(DISP_FREEMEM, 0); /* temporary display effects */ #ifdef FREE_ALL_MEMORY # define freeobjchn(X) (saveobjchn(0, X, FREE_SAVE), X = 0) *** src/spell.c.off Thu Mar 21 01:43:18 2002 --- src/spell.c Sun Jul 28 12:46:50 2002 *************** *** 1042,1047 **** --- 1042,1076 ---- return FALSE; } + #ifdef DUMP_LOG + void + dump_spells() + { + int i, n; + char buf[BUFSZ]; + + if (spellid(0) == NO_SPELL) { + dump("", "You didn't know any spells."); + dump("", ""); + return; + } + dump("", "Spells known in the end"); + + Sprintf(buf, "%-20s Level %-12s Fail", " Name", "Category"); + dump(" ",buf); + for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) { + Sprintf(buf, "%c - %-20s %2d%s %-12s %3d%%", + spellet(i), spellname(i), spellev(i), + spellknow(i) ? " " : "*", + spelltypemnemonic(spell_skilltype(spellid(i))), + 100 - percent_success(i)); + dump(" ", buf); + } + dump("",""); + + } /* dump_spells */ + #endif + /* Integer square root function without using floating point. */ STATIC_OVL int isqrt(val) *** src/topten.c.off Thu Mar 21 01:43:19 2002 --- src/topten.c Wed Oct 23 20:39:02 2002 *************** *** 38,44 **** #define ENTRYMAX 100 /* must be >= 10 */ #if !defined(MICRO) && !defined(MAC) ! #define PERS_IS_UID /* delete for PERSMAX per name; now per uid */ #endif struct toptenentry { struct toptenentry *tt_next; --- 38,44 ---- #define ENTRYMAX 100 /* must be >= 10 */ #if !defined(MICRO) && !defined(MAC) ! /* #define PERS_IS_UID /* delete for PERSMAX per name; now per uid */ #endif struct toptenentry { struct toptenentry *tt_next; *************** *** 252,257 **** --- 252,258 ---- FILE *rfile; register int flg = 0; boolean t0_used; + char buf[15]; #ifdef LOGFILE FILE *lfile; #endif /* LOGFILE */ *************** *** 331,336 **** --- 332,347 ---- (void) strncat(t0->death, killer, DTHSZ); break; } + #ifdef LOG_MOVES + /* jl 11.08.2000 */ + sprintf(buf," {%ld}",moves); + if (strlen(t0->death) + strlen(buf) < DTHSZ) + Strcat(t0->death, buf); + if (wizard && strlen(t0->death) < DTHSZ - 6) + Strcat(t0->death, " {wiz}"); + if (discover && strlen(t0->death) < DTHSZ - 6) + Strcat(t0->death, " {exp}"); + #endif t0->birthdate = yyyymmdd(u.ubirthday); t0->deathdate = yyyymmdd((time_t)0L); t0->tt_next = 0; *************** *** 339,344 **** --- 350,358 ---- #endif #ifdef LOGFILE /* used for debugging (who dies of what, where) */ + #ifdef FORGET_EXPLORE + if (!wizard && !discover) + #endif if (lock_file(LOGFILE, SCOREPREFIX, 10)) { if(!(lfile = fopen_datafile(LOGFILE, "a", TRUE))) { HUP raw_print("Cannot open log file!"); *************** *** 358,366 **** --- 372,400 ---- "Since you were in %s mode, the score list will not be checked.", wizard ? "wizard" : "discover"); topten_print(pbuf); + #ifdef DUMP_LOG + if (dump_fn) { + dump("", ""); + dump("", pbuf); + } + #endif } goto showwin; } + #ifdef FORGET_QUITTER + if (how == QUIT) { + char pbuf[]="Since you quit, the score list will not be checked."; + topten_print(""); + topten_print(pbuf); + #ifdef DUMP_LOG + if (dump_fn) { + dump("", ""); + dump("", pbuf); + } + #endif + goto showwin; + } + #endif if (!lock_file(RECORD, SCOREPREFIX, 60)) goto destroywin; *************** *** 378,383 **** --- 412,421 ---- } HUP topten_print(""); + #ifdef DUMP_LOG + dump("", ""); + dump("", ""); + #endif /* assure minimum number of points */ if(t0->points < POINTSMIN) t0->points = 0; *************** *** 422,427 **** --- 460,469 ---- t1->points); topten_print(pbuf); topten_print(""); + #ifdef DUMP_LOG + dump("", pbuf); + dump("", ""); + #endif } } if(occ_cnt < 0) { *************** *** 453,468 **** } #endif /* UPDATE_RECORD_IN_PLACE */ if(!done_stopprint) if(rank0 > 0){ ! if(rank0 <= 10) topten_print("You made the top ten list!"); ! else { char pbuf[BUFSZ]; Sprintf(pbuf, "You reached the %d%s place on the top %d list.", rank0, ordin(rank0), ENTRYMAX); topten_print(pbuf); } topten_print(""); } } if(rank0 == 0) rank0 = rank1; --- 495,519 ---- } #endif /* UPDATE_RECORD_IN_PLACE */ if(!done_stopprint) if(rank0 > 0){ ! if(rank0 <= 10) { topten_print("You made the top ten list!"); ! #ifdef DUMP_LOG ! dump("", "You made the top ten list!"); ! #endif ! } else { char pbuf[BUFSZ]; Sprintf(pbuf, "You reached the %d%s place on the top %d list.", rank0, ordin(rank0), ENTRYMAX); topten_print(pbuf); + #ifdef DUMP_LOG + dump("", pbuf); + #endif } topten_print(""); + #ifdef DUMP_LOG + dump("", ""); + #endif } } if(rank0 == 0) rank0 = rank1; *************** *** 488,495 **** )) continue; if (rank == rank0 - flags.end_around && rank0 > flags.end_top + flags.end_around + 1 && ! !flags.end_own) topten_print(""); if(rank != rank0) outentry(rank, t1, FALSE); else if(!rank1) --- 539,550 ---- )) continue; if (rank == rank0 - flags.end_around && rank0 > flags.end_top + flags.end_around + 1 && ! !flags.end_own) { topten_print(""); + #ifdef DUMP_LOG + dump("", ""); + #endif + } if(rank != rank0) outentry(rank, t1, FALSE); else if(!rank1) *************** *** 547,552 **** --- 602,610 ---- while(bp < linebuf + COLNO - 9) *bp++ = ' '; Strcpy(bp, "Hp [max]"); topten_print(linebuf); + #ifdef DUMP_LOG + dump("", linebuf); + #endif } /* so>0: standout line; so=0: ordinary line */ *************** *** 664,671 **** while (bp < linebuf + (COLNO-1)) *bp++ = ' '; *bp = 0; topten_print_bold(linebuf); ! } else topten_print(linebuf); Sprintf(linebuf, "%15s %s", "", linebuf3); lngr = strlen(linebuf); } --- 722,736 ---- while (bp < linebuf + (COLNO-1)) *bp++ = ' '; *bp = 0; topten_print_bold(linebuf); ! #ifdef DUMP_LOG ! dump("*", linebuf); ! #endif ! } else { topten_print(linebuf); + #ifdef DUMP_LOG + dump(" ", linebuf); + #endif + } Sprintf(linebuf, "%15s %s", "", linebuf3); lngr = strlen(linebuf); } *************** *** 690,695 **** --- 755,763 ---- topten_print_bold(linebuf); } else topten_print(linebuf); + #ifdef DUMP_LOG + dump(" ", linebuf); + #endif } STATIC_OVL int *** src/version.c.off Thu Mar 21 01:43:20 2002 --- src/version.c Sun Apr 28 18:49:48 2002 *************** *** 14,19 **** --- 14,27 ---- #include "patchlevel.h" #endif + /* Features to be ignored for checking version compatibility (JL): + * 23 TIMED_DELAY + * 21 SCORE_ON_BOTL + * 20 EXP_ON_BOTL + * 17 TEXTCOLOR + */ + #define FEATURE_MASK 1L << 23 | 1L << 21 | 1L << 20 | 1L << 17 + /* fill and return the given buffer with the nethack version string */ char * getversionstring(buf) *************** *** 64,70 **** if (complain) pline("Version mismatch for file \"%s\".", filename); return FALSE; ! } else if (version_data->feature_set != VERSION_FEATURES || version_data->entity_count != VERSION_SANITY1 || version_data->struct_sizes != VERSION_SANITY2) { if (complain) --- 72,84 ---- if (complain) pline("Version mismatch for file \"%s\".", filename); return FALSE; ! } else if ( ! #ifdef FEATURE_MASK ! (version_data->feature_set | FEATURE_MASK) != ! (VERSION_FEATURES | FEATURE_MASK) || ! #else ! version_data->feature_set != VERSION_FEATURES || ! #endif version_data->entity_count != VERSION_SANITY1 || version_data->struct_sizes != VERSION_SANITY2) { if (complain) *************** *** 72,77 **** --- 86,95 ---- filename); return FALSE; } + #ifdef FEATURE_MASK + else if (complain && version_data->feature_set != VERSION_FEATURES) + pline("Slightly different features in file \"%s\".", filename); + #endif return TRUE; } *** src/weapon.c.off Thu Mar 21 01:43:21 2002 --- src/weapon.c Sat May 25 10:38:35 2002 *************** *** 9,14 **** --- 9,18 ---- */ #include "hack.h" + #ifdef DUMP_LOG + STATIC_DCL int FDECL(enhance_skill, (BOOLEAN_P)); + #endif + /* Categories whose names don't come from OBJ_NAME(objects[type]) */ #define PN_BARE_HANDED (-1) /* includes martial arts */ *************** *** 838,843 **** --- 842,864 ---- */ int enhance_weapon_skill() + #ifdef DUMP_LOG + { + return enhance_skill(FALSE); + } + + void dump_weapon_skill() + { + enhance_skill(TRUE); + } + + int enhance_skill(BOOLEAN_P want_dump) + #endif + /* This is the original enhance_weapon_skill() function slightly modified + * to write the skills to the dump file. I added the wrapper functions just + * because it looked like the easiest way to add a parameter to the + * function call. - Jukka Lahtinen, August 2001 + */ { int pass, i, n, len, longest, to_advance, eventually_advance, maxxed_cnt; *************** *** 847,854 **** --- 868,882 ---- anything any; winid win; boolean speedy = FALSE; + #ifdef DUMP_LOG + char buf2[BUFSZ]; + boolean logged; + #endif #ifdef WIZARD + #ifdef DUMP_LOG + if (!want_dump) + #endif if (wizard && yn("Advance skills without practice?") == 'y') speedy = TRUE; #endif *************** *** 865,870 **** --- 893,903 ---- else if (peaked_skill(i)) maxxed_cnt++; } + #ifdef DUMP_LOG + if (want_dump) + dump("","Your skills"); + else { + #endif win = create_nhwindow(NHW_MENU); start_menu(win); *************** *** 892,897 **** --- 925,933 ---- add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED); } + #ifdef DUMP_LOG + } /* want_dump or not */ + #endif /* List the skills, making ones that could be advanced selectable. List the miscellaneous skills first. *************** *** 903,911 **** --- 939,965 ---- /* Print headings for skill types */ any.a_void = 0; if (i == skill_ranges[pass].first) + #ifdef DUMP_LOG + if (want_dump) { + dump(" ",(char *) skill_ranges[pass].name); + logged=FALSE; + } else + #endif add_menu(win, NO_GLYPH, &any, 0, 0, ATR_BOLD, skill_ranges[pass].name, MENU_UNSELECTED); + #ifdef DUMP_LOG + if (want_dump) { + if (P_SKILL(i) > P_UNSKILLED) { + Sprintf(buf2,"%-*s [%s]", + longest, P_NAME(i),skill_level_name(i, buf)); + dump(" ",buf2); + logged=TRUE; + } else if (i == skill_ranges[pass].last && !logged) { + dump(" ","(none)"); + } + } else { + #endif if (P_RESTRICTED(i)) continue; /* * Sigh, this assumes a monospaced font unless *************** *** 949,954 **** --- 1003,1011 ---- any.a_int = can_advance(i, speedy) ? i+1 : 0; add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); + #ifdef DUMP_LOG + } + #endif } Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" : *************** *** 958,963 **** --- 1015,1026 ---- Sprintf(eos(buf), " (%d slot%s available)", u.weapon_slots, plur(u.weapon_slots)); #endif + #ifdef DUMP_LOG + if (want_dump) { + dump("",""); + n=0; + } else { + #endif end_menu(win, buf); n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected); destroy_nhwindow(win); *************** *** 974,979 **** --- 1037,1045 ---- } } } + #ifdef DUMP_LOG + } + #endif } while (speedy && n > 0); return 0; } *** sys/share/pcunix.c.off Thu Mar 21 01:43:48 2002 --- sys/share/pcunix.c Fri Oct 25 17:42:30 2002 *************** *** 7,17 **** #include "hack.h" #include ! #if defined(WIN32) || defined(MSDOS) #include #endif ! #if defined(WIN32) || defined(MSDOS) extern char orgdir[]; # ifdef WIN32 extern void NDECL(backsp); --- 7,17 ---- #include "hack.h" #include ! #if defined(WIN32) || defined(MSDOS) || defined(PC_LOCKING) #include #endif ! #if defined(WIN32) || defined(MSDOS) || defined(PC_LOCKING) extern char orgdir[]; # ifdef WIN32 extern void NDECL(backsp); *** sys/unix/nethack.sh.off Thu Mar 21 01:43:54 2002 --- sys/unix/nethack.sh Mon Mar 25 16:31:53 2002 *************** *** 54,59 **** exec $HACK "$@" ;; *) ! exec $HACK "$@" $MAXNROFPLAYERS ;; esac --- 54,63 ---- exec $HACK "$@" ;; *) ! # Alt-key as 'meta' ! setmetamode meta > /dev/null ! $HACK "$@" $MAXNROFPLAYERS ! # Change alt key back ! setmetamode esc > /dev/null ;; esac --- util/makedefs.c.off Thu Mar 21 01:44:06 2002 +++ util/makedefs.c Thu Feb 20 19:57:48 2003 @@ -725,6 +725,57 @@ #ifdef ZEROCOMP "zero-compressed save files", #endif +#ifdef AOY_CONTAINER + "patch: baggable amulet", +#endif +#ifdef DUMP_LOG + "patch: dump game end info", +#endif +#ifdef HPMON + "patch: color Hp monitor", +#endif +#ifdef DEATH_EXPLORE + "patch: explore mode at death", +#endif +#ifdef GERMANKB + "patch: german keyboard", +#endif +#ifdef SHOP_CREDIT + "patch: no credit cloning", +#endif +#ifdef FORGET_QUITTER + "patch: no record entry for quitting", +#endif +#ifdef FORGET_WIZARD + "patch: no log entry for wizard/explore mode", +#endif +#ifdef LOG_MOVES + "patch: log move counter", +#endif +#ifdef MENU_COLOR + "patch: tty menu coloring", +#endif +#ifdef PARANOID + "patch: paranoid quit", +#endif +#ifdef RECORD_CONDUCT + "patch: log conducts", +#endif +#ifdef SHOW_EXTINCT + "patch: show extincted monsters", +#endif +#ifdef SHOW_BORN + "patch: show monsters born", +#endif +#ifdef HERO_RACE + "patch: show player with race symbol", +#endif +#ifdef SHOWRUNNING + "patch: show running", +#endif +#ifdef STATCONT + "patch: statue contents", +#endif "basic NetHack features" }; *** win/tty/wintty.c.off Thu Mar 21 01:44:19 2002 --- win/tty/wintty.c Sat Apr 20 19:01:26 2002 *************** *** 119,124 **** --- 119,128 ---- static char winpanicstr[] = "Bad window id %d"; char defmorestr[] = "--More--"; + #ifdef MENU_COLOR + extern struct menucoloring *menu_colorings; + #endif + #ifdef CLIPPING # if defined(USE_TILES) && defined(MSDOS) boolean clipping = FALSE; /* clipping on? */ *************** *** 1117,1122 **** --- 1121,1148 ---- } } + #ifdef MENU_COLOR + STATIC_OVL boolean + get_menu_coloring(str, color, attr) + char *str; + int *color, *attr; + { + struct menucoloring *tmpmc; + if (iflags.use_menu_color) + for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next) + #ifdef USE_REGEX_MATCH + if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) { + #else + if (pmatch(tmpmc->match, str)) { + #endif + *color = tmpmc->color; + *attr = tmpmc->attr; + return TRUE; + } + return FALSE; + } + #endif /* MENU_COLOR */ + STATIC_OVL void process_menu_window(window, cw) winid window; *************** *** 1190,1195 **** --- 1216,1225 ---- for (page_lines = 0, curr = page_start; curr != page_end; page_lines++, curr = curr->next) { + #ifdef MENU_COLOR + int color = NO_COLOR, attr = ATR_NONE; + boolean menucolr = FALSE; + #endif if (curr->selector) *rp++ = curr->selector; *************** *** 1205,1210 **** --- 1235,1247 ---- * actually output the character. We're faster doing * this. */ + #ifdef MENU_COLOR + if (iflags.use_menu_color && + (menucolr = get_menu_coloring(curr->str, &color,&attr))) { + term_start_attr(attr); + if (color != NO_COLOR) term_start_color(color); + } else + #endif term_start_attr(curr->attr); for (n = 0, cp = curr->str; *cp && (int) ++ttyDisplay->curx < (int) ttyDisplay->cols; *************** *** 1217,1222 **** --- 1254,1265 ---- (void) putchar('#'); /* count selected */ } else (void) putchar(*cp); + #ifdef MENU_COLOR + if (iflags.use_menu_color && menucolr) { + if (color != NO_COLOR) term_end_color(); + term_end_attr(attr); + } else + #endif term_end_attr(curr->attr); } } else { *************** *** 1741,1747 **** if(str == (const char*)0 || ( (cw->flags & WIN_CANCELLED) && ! (cw->type != NHW_MESSAGE || !iflags.prevmsg_window) )) return; if(cw->type != NHW_MESSAGE) str = compress_str(str); --- 1784,1790 ---- if(str == (const char*)0 || ( (cw->flags & WIN_CANCELLED) && ! (cw->type != NHW_MESSAGE) )) return; if(cw->type != NHW_MESSAGE) str = compress_str(str);