diff --git a/dat/opthelp b/dat/opthelp index ee9092ede..0bcc8547e 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -99,7 +99,7 @@ altmeta For unix and VMS, treat two character sequence "ESC c" as M-c (Meta+c, 8th bit set) when nethack [FALSE] obtains a command from player's keyboard. -Boolean option if USE_TILES was set at compile time (MSDOS protected mode only): +Boolean option if USE_TILES was set at compile time (MSDOS protected mode): preload_tiles control whether tiles get pre-loaded into RAM at [TRUE] the start of the game. Doing so enhances performance of the tile graphics, but uses more memory. @@ -157,9 +157,13 @@ paranoid_confirmation space separated list [paranoid_confirmation:pray] die -- yes vs y to confirm dying (for explore or debug mode) bones -- yes vs y to confirm saving bones data in debug mode attack -- yes vs y to confirm attacking a peaceful monster + wand-break -- yes vs y to confirm breaking a wand + eating -- yes vs y to confirm whether to continue eating + Were-change -- yes vs y to confirm changing form due to + lycanthropy when hero has polymorph control; pray -- y to confirm an attempt to pray; on by default Remove -- always pick from inventory for 'R' and 'T' even when - wearing just one applicable item to remove or take off + wearing just one applicable item to remove or take off pickup_burden when you pick up an item that exceeds this encumbrance [S] level (Unencumbered, Burdened, streSsed, straiNed, overTaxed, or overLoaded), you will be asked if you want to continue. diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 02f561fe1..e143fb268 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,4 @@ -.\" $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.331 $ $NHDT-Date: 1573943499 2019/11/16 22:31:39 $ +.\" $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.333 $ $NHDT-Date: 1574900824 2019/11/28 00:27:04 $ .\" .\" This is an excerpt from the 'roff' man page from the 'groff' package. .\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines. @@ -24,7 +24,7 @@ .ds vr "NetHack 3.7 .ds f0 "\*(vr .ds f1 -.ds f2 "November 17, 2019 +.ds f2 "November 27, 2019 . .\" A note on some special characters: .\" \(lq = left double quote @@ -693,6 +693,14 @@ Normally checks for edible item(s) on the floor, then if none are found or none are chosen, checks for edible item(s) in inventory. Precede \(oqe\(cq with the \(oqm\(cq prefix to bypass attempting to eat anything off the floor. +.lp "" +If you attempt to eat while already satiated, you might choke to death. +If you risk it, you will be asked whether +to \(lqcontinue eating?\(rq \fIif you survive the first bite\fP. +You can set the +.op paranoid_confirmation:eating +option to require a response of \f(CRyes\fP instead of just \f(CRy\fP. +. .\" Make sure Elbereth is not hyphenated below, the exact spelling matters .hw Elbereth .lp E @@ -3307,6 +3315,8 @@ bones data when dying in debug mode; require \(lqyes\(rq rather than \(oqy\(cq to confirm attacking a peaceful monster; .PL wand-break require \(lqyes\(rq rather than \(oqy\(cq to confirm breaking a wand; +.PL eating +require \(lqyes\(rq rather than \(oqy\(cq to confirm whether to continue eating; .PL Were-change require \(lqyes\(rq rather than \(oqy\(cq to confirm changing form due to lycanthropy when hero has polymorph control; diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 44f89c18a..5afd79a9c 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -45,7 +45,7 @@ %.au \author{Original version - Eric S. Raymond\\ (Edited and expanded for 3.6 by Mike Stephenson and others)} -\date{November 17, 2019} +\date{November 27, 2019} \maketitle @@ -796,7 +796,14 @@ Eat food.\\ Normally checks for edible item(s) on the floor, then if none are found or none are chosen, checks for edible item(s) in inventory. Precede `{\tt e}' with the `{\tt m}' prefix to bypass attempting to eat -anything off the floor. +anything off the floor.\\ +%.lp "" +If you attempt to eat while already satiated, you might choke to death. +If you risk it, you will be asked whether +to ``continue eating?'' {\it if you survive the first bite\/}. +You can set the +{\it paranoid\verb+_+confirmation:eating\/} +option to require a response of ``{\tt yes}'' instead of just `{\tt y}'. %.lp % Make sure Elbereth is not hyphenated below, the exact spelling matters. % (Only specified here to parallel Guidebook.mn; use of \tt font implicity @@ -1333,7 +1340,7 @@ Autocompletes. Debug mode only.\\ %.lp "" Asks for confirmation; default is `{\tt n}' (no); continue playing. -To really panic, respond with `{\tt y}''. +To really panic, respond with `{\tt y}'. You can set the {\it paranoid\verb+_+confirmation:quit\/} option to require a response of ``{\tt yes}'' instead. @@ -3640,6 +3647,9 @@ a peaceful monster; \item[{\tt wand-break}] require ``{\tt yes}'' rather than `{\tt y}' to confirm breaking a wand; +\item[{\tt eating}] +require ``{\tt yes}'' rather than `{\tt y}' to confirm whether to +continue eating; \item[{\tt Were-change}] require ``{\tt yes}'' rather than `{\tt y}' to confirm changing form due to lycanthropy diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 238f156ca..2573be3bc 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.191 $ $NHDT-Date: 1574722861 2019/11/25 23:01:01 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.192 $ $NHDT-Date: 1574882658 2019/11/27 19:24:18 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -306,6 +306,14 @@ look-at of mimics mimicking altars got an arbitary alignment from misuse of underlying terrain polymorph_sink creating an altar passed a call to rn2() as an argument to a macro which evaluates its parameter more than once +if a monster (presumably sensed but not seen) was displayed at a location + showing "remembered, unseen monster", remove that since hero now knows + something else is there (3.6.1 had similar fix for warned-of monsters) +clairvoyance showed all monsters in range, then after player viewed the map, + replaced them with "remembered, unseen monster" glyph and finally + did a normal monster refresh; the 'I' glyph step clobbers remembered + object at same spot, so skip it for locations where monster refresh + is going to immediately redisplay a monster unix: fix double DLB definition in linux hints file windows: fix --showpaths output for the data file which relies on being constructed programmatically to incorporate the version suffix @@ -471,6 +479,7 @@ add a couple of engraving suggestions in pull request #79 chasonr's faster method to write characters to msdos VGA in pull request #220 chasonr's msdos Makefile.gcc pdcurses build changes in pull request #243 autopickup exception priority change in pull request #226 +FIQ's curses (PDCurses) number pad changes in pull request #247 Code Cleanup and Reorganization diff --git a/include/flag.h b/include/flag.h index 89535b53e..19c1ec9f6 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 flag.h $NHDT-Date: 1569276988 2019/09/23 22:16:28 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.155 $ */ +/* NetHack 3.6 flag.h $NHDT-Date: 1574900824 2019/11/28 00:27:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.160 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2006. */ /* NetHack may be freely redistributed. See license for details. */ @@ -91,6 +91,7 @@ struct flag { #define PARANOID_REMOVE 0x0040 #define PARANOID_BREAKWAND 0x0080 #define PARANOID_WERECHANGE 0x0100 +#define PARANOID_EATING 0x0200 int pickup_burden; /* maximum burden before prompt */ int pile_limit; /* controls feedback when walking over objects */ char sortloot; /* 'n'=none, 'l'=loot (pickup), 'f'=full ('l'+invent) */ @@ -506,6 +507,9 @@ enum runmode_types { /* werechange: accepting randomly timed werecreature change to transform from human to creature or vice versa while having polymorph control */ #define ParanoidWerechange ((flags.paranoia_bits & PARANOID_WERECHANGE) != 0) +/* continue eating: prompt given _after_first_bite_ when eating something + while satiated */ +#define ParanoidEating ((flags.paranoia_bits & PARANOID_EATING) != 0) /* command parsing, mainly dealing with number_pad handling; not saved and restored */ diff --git a/src/detect.c b/src/detect.c index c874dd47d..5af21a22f 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 detect.c $NHDT-Date: 1562630266 2019/07/08 23:57:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.96 $ */ +/* NetHack 3.6 detect.c $NHDT-Date: 1574882659 2019/11/27 19:24:19 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.99 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1414,8 +1414,13 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */ continue; newglyph = glyph_at(zx, zy); if (glyph_is_monster(newglyph) - && glyph_to_mon(newglyph) != PM_LONG_WORM_TAIL) - map_invisible(zx, zy); + && glyph_to_mon(newglyph) != PM_LONG_WORM_TAIL) { + /* map_invisible() was unconditional here but that made + remembered objects be forgotten for the case where a + monster is immediately redrawn by see_monsters() */ + if ((mtmp = m_at(zx, zy)) == 0 || !canspotmon(mtmp)) + map_invisible(zx, zy); + } } see_monsters(); diff --git a/src/display.c b/src/display.c index bda966cc3..5a6369ec2 100644 --- a/src/display.c +++ b/src/display.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 display.c $NHDT-Date: 1573934698 2019/11/16 20:04:58 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.107 $ */ +/* NetHack 3.6 display.c $NHDT-Date: 1574882660 2019/11/27 19:24:20 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.108 $ */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* and Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ @@ -123,6 +123,7 @@ */ #include "hack.h" +static void FDECL(show_mon_or_warn, (int, int, int)); static void FDECL(display_monster, (XCHAR_P, XCHAR_P, struct monst *, int, XCHAR_P)); static int FDECL(swallow_to_glyph, (int, int)); @@ -361,6 +362,25 @@ int x, y, show; _map_location(x, y, show); } +/* display something on monster layer; may need to fixup object layer */ +static void +show_mon_or_warn(x, y, monglyph) +int x, y, monglyph; +{ + struct obj *o; + + /* "remembered, unseen monster" is tracked by object layer so if we're + putting something on monster layer at same spot, stop remembering + that; if an object is in view there, start remembering it instead */ + if (glyph_is_invisible(levl[x][y].glyph)) { + unmap_object(x, y); + if (cansee(x, y) && (o = vobj_at(x, y)) != 0) + map_object(o, FALSE); + } + + show_glyph(x, y, monglyph); +} + #define DETECTED 2 #define PHYSICALLY_SEEN 1 #define is_worm_tail(mon) ((mon) && ((x != (mon)->mx) || (y != (mon)->my))) @@ -477,7 +497,7 @@ xchar worm_tail; /* mon is actually a worm tail */ else num = mon_to_glyph(mon, rn2_on_display_rng); } - show_glyph(x, y, num); + show_mon_or_warn(x, y, num); } } @@ -507,14 +527,7 @@ register struct monst *mon; impossible("display_warning did not match warning type?"); return; } - /* warning glyph is drawn on the monster layer; unseen - monster glyph is drawn on the object/trap/floor layer; - if we see a 'warning' move onto 'remembered, unseen' we - need to explicitly remove that in order for it to not - reappear when the warned-of monster moves off that spot */ - if (glyph_is_invisible(levl[x][y].glyph)) - unmap_object(x, y); - show_glyph(x, y, glyph); + show_mon_or_warn(x, y, glyph); } int diff --git a/src/eat.c b/src/eat.c index 1b4a7a5a9..7144eecf2 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 eat.c $NHDT-Date: 1573346189 2019/11/10 00:36:29 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.205 $ */ +/* NetHack 3.6 eat.c $NHDT-Date: 1574900825 2019/11/28 00:27:05 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.206 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2869,23 +2869,20 @@ int num; /* Have lesshungry() report when you're nearly full so all eating * warns when you're about to choke. */ - if (u.uhunger >= 1500) { - if (!g.context.victual.eating - || (g.context.victual.eating && !g.context.victual.fullwarn)) { - pline("You're having a hard time getting all of it down."); - g.nomovemsg = "You're finally finished."; - if (!g.context.victual.eating) { - g.multi = -2; - } else { - g.context.victual.fullwarn = TRUE; - if (g.context.victual.canchoke - && g.context.victual.reqtime > 1) { - /* a one-gulp food will not survive a stop */ - if (yn_function("Continue eating?", ynchars, 'n') - != 'y') { - reset_eat(); - g.nomovemsg = (char *) 0; - } + if (u.uhunger >= 1500 + && (!g.context.victual.eating + || (g.context.victual.eating && !g.context.victual.fullwarn))) { + pline("You're having a hard time getting all of it down."); + g.nomovemsg = "You're finally finished."; + if (!g.context.victual.eating) { + g.multi = -2; + } else { + g.context.victual.fullwarn = TRUE; + if (g.context.victual.canchoke && g.context.victual.reqtime > 1) { + /* a one-gulp food will not survive a stop */ + if (!paranoid_query(ParanoidEating, "Continue eating?")) { + reset_eat(); + g.nomovemsg = (char *) 0; } } } diff --git a/src/options.c b/src/options.c index f3384f214..632598e28 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1573505739 2019/11/11 20:55:39 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.386 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1574900826 2019/11/28 00:27:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.388 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1290,12 +1290,13 @@ static const struct paranoia_opts { and "d"ie vs "d"eath, synonyms for each other so doesn't matter; (also "p"ray vs "P"aranoia, "pray" takes precedence since "Paranoia" is just a synonym for "Confirm"); "b"ones vs "br"eak-wand, the - latter requires at least two letters; "wand"-break vs "Were"-change, + latter requires at least two letters; "e"at vs "ex"plore, + "cont"inue eating vs "C"onfirm; "wand"-break vs "Were"-change, both require at least two letters during config processing and use case-senstivity for 'O's interactive menu */ { PARANOID_CONFIRM, "Confirm", 1, "Paranoia", 2, "for \"yes\" confirmations, require \"no\" to reject" }, - { PARANOID_QUIT, "quit", 1, "explore", 1, + { PARANOID_QUIT, "quit", 1, "explore", 2, "yes vs y to quit or to enter explore mode" }, { PARANOID_DIE, "die", 1, "death", 2, "yes vs y to die (explore mode or debug mode)" }, @@ -1305,6 +1306,8 @@ static const struct paranoia_opts { "yes vs y to attack a peaceful monster" }, { PARANOID_BREAKWAND, "wand-break", 2, "break-wand", 2, "yes vs y to break a wand via (a)pply" }, + { PARANOID_EATING, "eat", 1, "continue", 4, + "yes vs y to continue eating after first bite when satiated" }, { PARANOID_WERECHANGE, "Were-change", 2, (const char *) 0, 0, "yes vs y to change form when lycanthropy is controllable" }, { PARANOID_PRAY, "pray", 1, 0, 0, diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index daf7eba3a..314efe5af 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -873,6 +873,9 @@ curses_convert_keys(int key) readchar() and stripping the value down to 0..255 yields ^G! */ ret = C('H'); break; +#ifdef KEY_B1 + case KEY_B1: +#endif case KEY_LEFT: if (iflags.num_pad) { ret = '4'; @@ -880,6 +883,9 @@ curses_convert_keys(int key) ret = 'h'; } break; +#ifdef KEY_B3 + case KEY_B3: +#endif case KEY_RIGHT: if (iflags.num_pad) { ret = '6'; @@ -887,6 +893,9 @@ curses_convert_keys(int key) ret = 'l'; } break; +#ifdef KEY_A2 + case KEY_A2: +#endif case KEY_UP: if (iflags.num_pad) { ret = '8'; @@ -894,6 +903,9 @@ curses_convert_keys(int key) ret = 'k'; } break; +#ifdef KEY_C2 + case KEY_C2: +#endif case KEY_DOWN: if (iflags.num_pad) { ret = '2'; @@ -903,40 +915,44 @@ curses_convert_keys(int key) break; #ifdef KEY_A1 case KEY_A1: +#endif + case KEY_HOME: if (iflags.num_pad) { ret = '7'; } else { - ret = 'y'; + ret = !g.Cmd.swap_yz ? 'y' : 'z'; } break; -#endif /* KEY_A1 */ #ifdef KEY_A3 case KEY_A3: +#endif + case KEY_PPAGE: if (iflags.num_pad) { ret = '9'; } else { ret = 'u'; } break; -#endif /* KEY_A3 */ #ifdef KEY_C1 case KEY_C1: +#endif + case KEY_END: if (iflags.num_pad) { ret = '1'; } else { ret = 'b'; } break; -#endif /* KEY_C1 */ #ifdef KEY_C3 case KEY_C3: +#endif + case KEY_NPAGE: if (iflags.num_pad) { ret = '3'; } else { ret = 'n'; } break; -#endif /* KEY_C3 */ #ifdef KEY_B2 case KEY_B2: if (iflags.num_pad) {