diff -urd --exclude-from=diff_ign.txt nh343off/dat/opthelp nh343dex/dat/opthelp --- nh343off/dat/opthelp Mon Dec 8 01:39:14 2003 +++ nh343dex/dat/opthelp Sat Dec 13 15:53:04 2003 @@ -61,6 +61,9 @@ Boolean option if MFLOPPY was set at compile time: checkspace check free disk space before writing files to disk [TRUE] +Boolean option if DEATH_EXPLORE was set at compile time: +death_explore prompt for changing to explore mode when you die [FALSE] + Boolean option if EXP_ON_BOTL was set at compile time: showexp display your accumulated experience points [FALSE] diff -urd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.mn nh343dex/doc/Guidebook.mn --- nh343off/doc/Guidebook.mn Mon Dec 8 01:39:14 2003 +++ nh343dex/doc/Guidebook.mn Sat Dec 13 15:53:04 2003 @@ -1723,6 +1723,8 @@ .lp "confirm " Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). +.lp death_explore +Prompt for changing to explore mode when your character dies. .lp DECgraphics Use a predefined selection of characters from the DEC VT-xxx/DEC Rainbow/ANSI line-drawing character set to display the dungeon/effects/traps diff -urd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.tex nh343dex/doc/Guidebook.tex --- nh343off/doc/Guidebook.tex Mon Dec 8 01:39:14 2003 +++ nh343dex/doc/Guidebook.tex Sat Dec 13 15:53:04 2003 @@ -2161,6 +2161,9 @@ Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). %.lp +\item[\ib{death_explore}] +Prompt for changing to explore mode when your character dies. +%.lp \item[\ib{DECgraphics}] Use a predefined selection of characters from the DEC VT-xxx/DEC Rainbow/ANSI line-drawing character set to display the dungeon/effects/traps diff -urd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.txt nh343dex/doc/Guidebook.txt --- nh343off/doc/Guidebook.txt Mon Dec 8 01:39:14 2003 +++ nh343dex/doc/Guidebook.txt Sat Dec 13 15:58:08 2003 @@ -2223,6 +2223,9 @@ Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). + death_explore + Prompt for changing to explore mode when your character dies. + DECgraphics Use a predefined selection of characters from the DEC VT- xxx/DEC Rainbow/ANSI line-drawing character set to display the diff -urd --exclude-from=diff_ign.txt nh343off/include/flag.h nh343dex/include/flag.h --- nh343off/include/flag.h Mon Dec 8 01:39:14 2003 +++ nh343dex/include/flag.h Sat Dec 13 15:53:04 2003 @@ -216,6 +216,9 @@ boolean lan_mail; /* mail is initialized */ boolean lan_mail_fetched; /* mail is awaiting display */ #endif +#ifdef DEATH_EXPLORE + boolean death_expl; /* prompt for explore mode at death */ +#endif /* * Window capability support. */ diff -urd --exclude-from=diff_ign.txt nh343off/src/cmd.c nh343dex/src/cmd.c --- nh343off/src/cmd.c Mon Dec 8 01:39:14 2003 +++ nh343dex/src/cmd.c Sat Dec 13 15:53:04 2003 @@ -139,7 +139,7 @@ STATIC_DCL int NDECL(wiz_port_debug); # endif # endif -STATIC_PTR int NDECL(enter_explore_mode); +int NDECL(enter_explore_mode); /* deathexplore patch */ STATIC_PTR int NDECL(doattributes); STATIC_PTR int NDECL(doconduct); /**/ STATIC_PTR boolean NDECL(minimal_enlightenment); @@ -475,7 +475,7 @@ return 0; } -STATIC_PTR int +int /* deathexplore patch */ enter_explore_mode() { if(!discover && !wizard) { diff -urd --exclude-from=diff_ign.txt nh343off/src/end.c nh343dex/src/end.c --- nh343off/src/end.c Mon Dec 8 01:39:14 2003 +++ nh343dex/src/end.c Sat Dec 13 15:55:46 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 @@ -537,6 +540,9 @@ 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; @@ -591,6 +597,7 @@ return; } } + bones_ok = (how < GENOCIDED) && can_make_bones(); /* dthexpl patch */ if (( #ifdef WIZARD wizard || @@ -605,15 +612,33 @@ 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; /* 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 @@ -628,6 +653,9 @@ pline("Do not pass go. Do not collect 200 %s.", currency(200L)); if (have_windows) wait_synch(); /* flush screen output */ +#ifdef DEATH_EXPLORE + if (!goexplore) { +#endif #ifndef NO_SIGNAL (void) signal(SIGINT, (SIG_RET_TYPE) done_intr); # if defined(UNIX) || defined(VMS) || defined (__EMX__) @@ -636,7 +664,7 @@ # endif #endif /* NO_SIGNAL */ - bones_ok = (how < GENOCIDED) && can_make_bones(); + /* bones_ok = (how < GENOCIDED) && can_make_bones(); moved up */ if (how == TURNED_SLIME) u.ugrave_arise = PM_GREEN_SLIME; @@ -668,6 +696,9 @@ make_grave(u.ux, u.uy, pbuf); } } +#ifdef DEATH_EXPLORE + } /* if (!goexplore) */ +#endif if (how == QUIT) { killer_format = NO_KILLER_PREFIX; @@ -688,6 +719,9 @@ clearpriests(); } else taken = FALSE; /* lint; assert( !bones_ok ); */ +#ifdef DEATH_EXPLORE + if (!goexplore) { +#endif clearlocks(); if (have_windows) display_nhwindow(WIN_MESSAGE, FALSE); @@ -696,6 +730,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] */ { @@ -721,6 +758,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) { diff -urd --exclude-from=diff_ign.txt nh343off/src/options.c nh343dex/src/options.c --- nh343off/src/options.c Mon Dec 8 01:39:14 2003 +++ nh343dex/src/options.c Sat Dec 13 15:55:46 2003 @@ -75,6 +75,9 @@ {"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/ # endif {"confirm",&flags.confirm, TRUE, SET_IN_GAME}, +#ifdef DEATH_EXPLORE + {"death_explore", &iflags.death_expl, FALSE, SET_IN_GAME}, +#endif #if defined(TERMLIB) && !defined(MAC_GRAPHICS_ENV) {"DECgraphics", &iflags.DECgraphics, FALSE, SET_IN_GAME}, #else