From 23ea5b07fe70c78d0c69ec643dd247a2ae420cdf Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 1 Mar 2019 17:09:54 -0800 Subject: [PATCH 1/3] Guidebook update number_pad got removed from Guidebook.tex when mouse_support was added by cc0e7a8750fd4e07d3a44592c38f5912d4e603de; put it back. Evidently a cut-and-paste mishap when copy-and-paste was intended, probably provoked by '\numbox{}'. Remove \numbox{} from mouse_support; it isn't needed there since the choices aren't trying to line up with '-1'. Both Guidebook.mn and Guidebook.tex: Remove number_pad's "for backward compatibility" from mouse_support since the latter is brand new. New petattr list of uppercase letters seemed intrusive when rendered with a bold font, so switch to lowercase. (Option processing already supports either case.) Mention the '=' prefix for hilite_status 'absolute' threshold. [As usual, the Guidebook.tex changes haven't been tested.] --- doc/Guidebook.mn | 49 +++++++++++++++---------------- doc/Guidebook.tex | 75 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 76 insertions(+), 48 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 8f0fb925f..ec00bf74b 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,4 @@ -.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.298 $ $NHDT-Date: 1551312285 2019/02/28 00:04:45 $ +.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.299 $ $NHDT-Date: 1551488947 2019/03/02 01:09:07 $ .\" .\" This is an excerpt from the 'roff' man page from the 'groff' package. .\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines. @@ -1713,7 +1713,7 @@ outside the shop. While the shopkeeper watches you like a hawk, he will generally ignore any other customers. .lp * 2 -If a shop is \(lqclosed for inventory\(rq, it will not open of its own accord. +If a shop is \(lqclosed for inventory,\(rq it will not open of its own accord. .lp * 2 Shops do not get restocked with new items, regardless of inventory depletion. . @@ -3158,15 +3158,14 @@ Debug mode only. .lp mouse_support Allow use of the mouse for input and travel. Valid settings are: -.PS -1 -.PL "\ 0" -disabled -.PL "\ 1" -enabled and make OS adjustments to support mouse use in the game. -.PL "\ 2" -like 1 but does not make any OS adjustments -.PE -For backward compatibility, omitting a value is the same as specifying 1 +.sd +.si +.CC 0 "disabled" +.CC 1 "enabled and make OS adjustments to support mouse use in the game" +.CC 2 "like 1 but does not make any OS adjustments" +.ei +.ed +Omitting a value is the same as specifying 1 and negating .op mouse_support is the same as specifying 0. @@ -3291,23 +3290,23 @@ boolean option. Curses interface only; value is one or more of the following letters. .sd .si -.CC N "Normal text (no highlighting)" -.CC I "Inverse video (default)" -.CC B "Bold text" -.CC U "Underlined text" -.CC K "blinKing text" -.CC D "Dim text" -.CC T "iTalic text" -.CC L "Left line indicator" -.CC R "Right line indicator" +.CC n "Normal text (no highlighting)" +.CC i "Inverse video (default)" +.CC b "Bold text" +.CC u "Underlined text" +.CC k "blinKing text" +.CC d "Dim text" +.CC t "iTalic text" +.CC l "Left line indicator" +.CC r "Right line indicator" .ei .ed Some of those choices might not work, particularly the final three, depending upon terminal hardware or terminal emulation software. .lp "" Currently multiple highlight-style letters can be combined by simply -stringing them together (for example, \(lqBK\(rq), but in the future -they might require being separated by plus signs (such as \(lqB+K\(rq, +stringing them together (for example, \(lqbk\(rq), but in the future +they might require being separated by plus signs (such as \(lqb+k\(rq, which works already). When using the \(oqN\(cq choice, it should be specified on its own, not in combination with any of the other letters. @@ -4234,13 +4233,13 @@ it also matches when value is below or above the percentage. Use prefix \(oq<\(cq or \(oq>\(cq to match when strictly below or above. (The numeric limit is relaxed slightly for those: \f(CR>-1%\fP and \f(CR<101%\fP are allowed.) -Only valid for \(lqpower\(rq and \(lqhitpoints\(rq fields. +Only valid for \(lqhitpoints\(rq and \(lqpower\(rq fields. .lp "*" absolute value sets the attribute when the field value matches that number. The number must be 0 or higher, except for \(lqarmor-class\(cq which -allows negative values. -If the number is prefixed with \(oq<=\(cq or \(oq>=\(cq, +allows negative values, and may optionally be preceded by \(oq=\(cq. +If the number is preceded by \(oq<=\(cq or \(oq>=\(cq instead, it also matches when value is below or above. If the prefix is \(oq<\(cq or \(oq>\(cq, only match when strictly above or below. diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 743a53e21..497fb660a 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -1892,7 +1892,7 @@ While the shopkeeper watches you like a hawk, he will generally ignore any other customers. %.lp \(bu 2 \item[$\bullet$] -If a shop is ``closed for inventory'', it will not open of its own accord. +If a shop is ``closed for inventory,'' it will not open of its own accord. %.lp \(bu 2 \item[$\bullet$] Shops do not get restocked with new items, regardless of inventory depletion. @@ -3471,16 +3471,13 @@ Valid settings are: %.sd %.si -\newlength{\mwidth} -\settowidth{\mwidth}{\tt -0} -\newcommand{\numbox}[1]{\makebox[\mwidth][r]{{\tt #1}}} -\numbox{0} --- disabled\\ -\numbox{1} --- enabled and make OS adjustment to support mouse use in the game\\ -\numbox{2} --- enabled like {\tt 1}, but does not make any OS adjustments\\ +{\tt 0} --- disabled\\ +{\tt 1} --- enabled and make OS adjustment to support mouse use in the game\\ +{\tt 2} --- enabled like {\tt 1}, but does not make any OS adjustments\\ %.ei %.ed -For backward compatibility, omitting a value is the same as specifying {\tt 1} +Omitting a value is the same as specifying {\tt 1} and negating {\it mouse\verb+_+support\/} is the same as specifying {\tt 0}. @@ -3527,6 +3524,37 @@ Start the character with no armor (default false). Persistent. \item[\ib{null}] Send padding nulls to the terminal (default on). Persistent. %.lp +\item[\ib{number\verb+_+pad}] +Use digit keys instead of letters to move (default 0 or off).\\ +Valid settings are: + +%.sd +%.si +\newlength{\mwidth} +\settowidth{\mwidth}{\tt -0} +\newcommand{\numbox}[1]{\makebox[\mwidth][r]{{\tt #1}}} +\numbox{0} --- move by letters; `{\tt yuhjklbn}'\\ +\numbox{1} --- move by numbers; digit `{\tt 5}' acts as `{\tt G}' movement prefix\\ +\numbox{2} --- like {\tt 1} but `{\tt 5}' works as `{\tt g}' prefix instead of as `{\tt G}'\\ +\numbox{3} --- by numbers using phone key layout; {\tt 123} above, {\tt 789} below\\ +\numbox{4} --- combines {\tt 3} with {\tt 2}; phone layout plus MS-DOS compatibility\\ +\numbox{-1} --- by letters but use `{\tt z}' to go northwest, `{\tt y}' to zap wands +%.ei +%.ed + +For backward compatibility, omitting a value is the same as specifying {\tt 1} +and negating +{\it number\verb+_+pad\/} +is the same as specifying {\tt 0}. +(Settings {\tt 2} and {\tt 4} are for compatibility with MS-DOS or old PC Hack; +in addition to the different behavior for `{\tt 5}', `{\tt Alt-5}' acts as `{\tt G}' +and `{\tt Alt-0}' acts as `{\tt I}'. +Setting {\tt -1} is to accommodate some QWERTZ keyboards which have the +location of the `{\tt y}' and `{\tt z}' keys swapped.) +When moving by numbers, to enter a count prefix for those commands +which accept one (such as ``{\tt 12s}'' to search twelve times), precede it +with the letter `{\tt n}' (``{\tt n12s}''). +%.lp \item[\ib{packorder}] Specify the order to list object types in (default ``\verb&")[%?+!=/(*`0_&''). The value of this option should be a string @@ -3594,15 +3622,15 @@ Curses interface only; value is one or more of the following letters. %.sd %.si -{\tt N} --- Normal text (no highlighting)\\ -{\tt I} --- Inverse video (default)\\ -{\tt B} --- Bold text\\ -{\tt U} --- Underlined text\\ -{\tt K} --- blinKing text\\ -{\tt D} --- Dim text\\ -{\tt T} --- iTalic text\\ -{\tt L} --- Left line indicator\\ -{\tt R} --- Right line indicator\\ +{\tt n} --- Normal text (no highlighting)\\ +{\tt i} --- Inverse video (default)\\ +{\tt b} --- Bold text\\ +{\tt u} --- Underlined text\\ +{\tt k} --- blinKing text\\ +{\tt d} --- Dim text\\ +{\tt t} --- iTalic text\\ +{\tt l} --- Left line indicator\\ +{\tt r} --- Right line indicator\\ %.ei %.ed @@ -3611,8 +3639,8 @@ depending upon terminal hardware or terminal emulation software. %.lp "" Currently multiple highlight-style letters can be combined by simply -stringing them together (for example, ``BK''), but in the future -they might require being separated by plus signs (such as ``B\verb&+&K'', +stringing them together (for example, ``bk''), but in the future +they might require being separated by plus signs (such as ``b\verb&+&k'', which works already). When using the `N' choice, it should be specified on its own, not in combination with any of the other letters. @@ -4651,7 +4679,8 @@ depending upon your other option settings. Instead of a behavior, `condition' takes the following condition flags: {\it stone}, {\it slime}, {\it strngl}, {\it foodpois}, {\it termill}, {\it blind}, {\it deaf}, {\it stun}, {\it conf}, {\it hallu}, -{\it lev}, {\it fly}, and {\it ride}. You can use `major\_troubles' as an alias +{\it lev}, {\it fly}, and {\it ride}. +You can use `major\_troubles' as an alias for stone through termill, `minor\_troubles' for blind through hallu, `movement' for lev, fly, and ride, and `all' for every condition. @@ -4686,14 +4715,14 @@ it also matches when value is below or above the percentage. Use prefix `{\tt <}' or `{\tt >}' to match when strictly below or above. (The numeric limit is relaxed slightly for those: {\tt >-1\%} and {\tt <101\%} are allowed.) -Only valid for ``{\it power\/}'' and ``{\it hitpoints\/}'' fields. +Only valid for ``{\it hitpoints\/}'' and ``{\it power\/}'' fields. %.lp "*" \item{\bb{}} absolute value sets the attribute when the field value matches that number. The number must be 0 or higher, except for ``{\it armor-class\/} which -allows negative values. -If the number is prefixed with `{\tt <=}' or `{\tt >=}', +allows negative values, and may optionally be preceded by `{\tt =}'. +If the number is preceded by `{\tt <=}' or `{\tt >=}' instead, it also matches when value is below or above. If the prefix is `{\tt <}' or `{\tt >}', only match when strictly above or below. From b211c1b832da0d012fb4accb7cb7baa951174177 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 1 Mar 2019 18:32:41 -0800 Subject: [PATCH 2/3] fix #H8310 - riding a saddled tripe ration If steed ate a mimic corpse and started mimicking an object or dungeon furniture, the hero was able to keep riding. Force a dismount when that happens, even if steed takes on monster shape rather than object or furniture. After that, #ride to remount non-monster will fail unless using wizard mode's "force mount to succeed" action, in which case steed's eating finishes immediately and it returns to normal. This doesn't address the older report that mounted hero can continue to move around while the steed is eating. --- doc/fixes36.2 | 4 +++- src/dogmove.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 621a2a910..1d3e8511c 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.267 $ $NHDT-Date: 1551395521 2019/02/28 23:12:01 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.268 $ $NHDT-Date: 1551493951 2019/03/02 02:32:31 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -387,6 +387,8 @@ toggling perm_invent on didn't immediately show persistent inventory window some fish should lay their eggs in the water rather than on land wand or spell of undead turning handled messages and wand-discovery in a non-intuitive manner biased toward healers +if steed ate a mimic corpse and began masquerading as something, hero could + keep riding it; force dismount Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/dogmove.c b/src/dogmove.c index 1c8f4dd79..604877103 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 dogmove.c $NHDT-Date: 1502753407 2017/08/14 23:30:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.63 $ */ +/* NetHack 3.6 dogmove.c $NHDT-Date: 1551493951 2019/03/02 02:32:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.72 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1379,6 +1379,15 @@ struct monst *mtmp; if (Protection_from_shape_changers || !mtmp->meating) return; + /* with polymorph, the steed's equipment would be re-checked and its + saddle would come off, triggering DISMOUNT_FELL, but mimicking + doesn't impact monster's equipment; normally DISMOUNT_POLY is for + rider taking on an unsuitable shape, but its message works fine + for this and also avoids inflicting damage during forced dismount; + do this before changing so that dismount refers to original shape */ + if (mtmp == u.usteed) + dismount_steed(DISMOUNT_POLY); + do { idx = rn2(SIZE(qm)); if (qm[idx].mndx != 0 && monsndx(mtmp->data) == qm[idx].mndx) From e2b6cf4066c75f2cd93a3c5d9edc8ae25b781edb Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 4 Mar 2019 14:40:01 -0800 Subject: [PATCH 3/3] fix #H8319 - hero-owned container used inside shop showed non-empty containers in inventory (including the one being applied) with a 'for sale' suffix during put-in operations, as if the shop was trying to sell it to the hero. Amount shown was cumulative value of its contents. (Using /menustyle:T doesn't show the container being applied so this wasn't visible with it unless other non-empty containers were being carried.) Two or three fix attempts solved one problem but introduced another. This one seems to finally get things right but considering that there was trial and error along the way, my confidence isn't great. --- doc/fixes36.2 | 9 ++++++--- src/shk.c | 37 +++++++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 1d3e8511c..81a32b514 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.268 $ $NHDT-Date: 1551493951 2019/03/02 02:32:31 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.269 $ $NHDT-Date: 1551739190 2019/03/04 22:39:50 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -445,13 +445,16 @@ when engulfed while in a shop, dropping an item into the engulfer and then using ':' to look at current location could cause a crash when items were on the floor just inside a shop's door where the shopkeeper doesn't buy and sell stuff, those items showed a 'for sale' price +applying a container while inside a shop and initiating a put-in operation + would show non-empty containers in inventory--including the one being + applied--with "for sale" amounts for the prices of their contents after 'when donning armor, enchanment becomes known even if interrupted' fix, wearing a leather jacket, fedora, or dented pot (no multi-turn delay worn in a slot which usually has one) didn't make +/- become known +when persistent inventory window is enabled, wearing armor didn't immediately + update it with armor's newly observed +/- value having an artifact wish be refused ("for a moment you feel in your hands, but it disappears") would immediately segfault -when persistent inventory window is enabled, wearing armor doesn't immediately - update it with armor's newly observed +/- value tty: turn off an optimization that is the suspected cause of Windows reported partial status lines following level changes tty: ensure that current status fields are always copied to prior status diff --git a/src/shk.c b/src/shk.c index a72152f12..ef5bc0206 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 shk.c $NHDT-Date: 1549921170 2019/02/11 21:39:30 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.156 $ */ +/* NetHack 3.6 shk.c $NHDT-Date: 1551738135 2019/03/04 22:22:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.157 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1328,7 +1328,7 @@ dopay() debugpline0("dopay: null shkp."); return 0; } -proceed: + proceed: eshkp = ESHK(shkp); ltmp = eshkp->robbed; @@ -1547,7 +1547,7 @@ proceed: } } } - thanks: + thanks: if (!itemize) update_inventory(); /* Done in dopayobj() if itemize. */ } @@ -1867,7 +1867,7 @@ boolean silently; eshkp->following = 0; eshkp->robbed = 0L; } - skip: + skip: /* in case we create bones */ rouse_shk(shkp, FALSE); /* wake up */ if (!inhishop(shkp)) @@ -2013,7 +2013,7 @@ int *nochrg; /* alternate return value: 1: no charge, 0: shop owned, */ if (carried(top) ? (int) obj->unpaid : !*nochrg) cost = obj->quan * get_cost(obj, shkp); if (Has_contents(obj) && !freespot) - cost += contained_cost(obj, shkp, 0L, FALSE, FALSE); + cost += contained_cost(obj, shkp, 0L, FALSE, TRUE); } return cost; } @@ -2154,7 +2154,19 @@ long price; boolean usell; boolean unpaid_only; { - register struct obj *otmp; + register struct obj *otmp, *top; + xchar x, y; + boolean on_floor, freespot; + + for (top = obj; top->where == OBJ_CONTAINED; top = top->ocontainer) + continue; + /* pick_obj() removes item from floor, adds it to shop bill, then + puts it in inventory; behave as if it is still on the floor + during the add-to-bill portion of that situation */ + on_floor = (top->where == OBJ_FLOOR || top->where == OBJ_FREE); + if (top->where == OBJ_FREE || !get_obj_location(top, &x, &y, 0)) + x = u.ux, y = u.uy; + freespot = (on_floor && x == ESHK(shkp)->shk.x && y == ESHK(shkp)->shk.y); /* price of contained objects; "top" container handled by caller */ for (otmp = obj->cobj; otmp; otmp = otmp->nobj) { @@ -2168,8 +2180,13 @@ boolean unpaid_only; && !(Is_candle(otmp) && otmp->age < 20L * (long) objects[otmp->otyp].oc_cost)) price += set_cost(otmp, shkp); - } else if (!otmp->no_charge && (otmp->unpaid || !unpaid_only)) { - price += get_cost(otmp, shkp) * otmp->quan; + } else { + /* no_charge is only set for floor items (including + contents of floor containers) inside shop proper; + items on freespot are implicitly 'no charge' */ + if (on_floor ? (!otmp->no_charge && !freespot) + : (otmp->unpaid || !unpaid_only)) + price += get_cost(otmp, shkp) * otmp->quan; } if (Has_contents(otmp)) @@ -3317,7 +3334,7 @@ int mode; /* 0: deliver count 1: paged */ putstr(datawin, 0, ""); putstr(datawin, 0, buf_p); display_nhwindow(datawin, FALSE); -quit: + quit: destroy_nhwindow(datawin); return 0; } @@ -4100,7 +4117,7 @@ boolean cant_mollify; if ((um_dist(x, y, 1) && !uinshp) || cant_mollify || (money_cnt(invent) + ESHK(shkp)->credit) < cost_of_damage || !rn2(50)) { - getcad: + getcad: if (muteshk(shkp)) { if (animal && shkp->mcanmove && !shkp->msleeping) yelp(shkp);