Pull request from AndrioCelos: for feedback during pickup, add a
separate message from stressed instead of sharing the burdened one
and issue messages at higher encumbrance levels.
This 'tweak' will probably need more tweaking to reduce verbosity
when picking up multiple items in one operation.
Closes#1135
Issue reported by entrez: on tty, ^C while a menu was open followed
by 'yes' to "Really quit?" would lead to a bad window panic.
Brought on by screen erasure changes included with recent SIGWINCH
(window resize signal) changes.
Closes#1145
NetHack has historically had problems (both in terms of interface
and in terms of gameplay exploits) caused by unidentified items
not stacking with identified items. The 3.7 change to cause items
picked up by monsters to become unidentified has exacerbated this,
e.g. there's an undesirable strategy in which players give
ammunition to hostile monsters in order to unidentify it, allowing
it to stack with other unidentified ammunition so that the whole
stack can be enchanted with a single scroll.
This commit makes it possible to stack items with different
identification statuses (unles Blind), in effect causing the
unidentified items to be identified by comparing them to the
identified items (this is consistent with the mechanic via which
two stacks of unidentified items can be determined to be the same
as each other). The hope is that this will prevent any gain from
exploits involving intentionally unidentifying (or intentionally
failing to identify) items, that it will prevent interface clutter
caused by (e.g.) a Ranger's main projectiles becoming partially
unidentified as a nymph picks them up and subsequently failing to
stack, and that it will reduce the incentive to backtrack to an
altar to merge, e.g., a stack of formally-known-uncursed and a
stack of informally-known-uncursed food rations to stack.
'/ e' (or '/ `') lists nearby engravings (including headstones) that
the hero has read or felt (even if currently covered up) or can see
on the map;
'/ E' (or '/ |') lists all such on the level.
If the hero remembers an engraving and then monsters scuff it out of
existence, it will magically disappear from the list of remembered
engravings when deleted. I don't think that's worth bothering with.
[During testing, my pet seemed extremely reluctant to step on a
corridor engraving. That could have been coincidence but it seemed
to keep happening until I moved so close that it had no choice. I
wasn't carrying tripe.]
Report headstone engraving when using farlook to examine a grave:
| a grave (grave whose headstone reads: "foo")
or
| a grave (grave whose headstone you haven't read)
Make the farlook of ordinary engravings operate more like farlook of
other things:
| a boulder or a statue or an engraving (engraving with text: "bar")
rather than
| a boulder or a statue or an engraving with text: "bar"
The "or a statue" phrase will now be suppressed because statues aren't
shown as backtick anymore, so the parenthesized form isn't quite as
long as it would otherwise have been. If OPTIONS=boulder:symbol is in
use, the "a boulder" part will be gone too.
| an engraving (engraving with text: "bar")
or
| an engraving (engraving that you haven't read)
Make quicklook include engraving text. It's quick because it doesn't
ask the player to pick additional spots or whether to look up relevant
data.base quote, not because it skimps on useful information.
Autodescribe still does not include engraving text.
When using the 'm' prefix with #overview to get a menu of visited
levels and then picking one to annotate, replace the generic prompt
"what do you want to call this dungeon level?" with more specific
location information. Location details are visible while within the
menu but as soon as you choose something that goes away.
Pull request from entrez: when issuing the "welcome back" message
when restoring, print the current level's player-suppliedannotation
if there is one. Doesn't show automatically generated annotations
like "Oralce of Delphi" or "a sink" or "stairs to the Gnomish Mines".
Closes#1142
'm O' is a prime candidate for using ':' to select a menu item since
you can use that to avoid scrolling through many pages, but typing ':'
would immediately overwrite two or three lines of the menu with a
status refresh. curses doesn't suffer from this problem. X11 and Qt
show menus in separate windows do don't either. Not sure about WinGUI.
I think that this may have been reported in the past, but if so I don't
recall by whom, or why it wasn't addressed.
Remove menu_color support from the window port side of the interface.
The window port just has to honor the color parameter that was added
to the add_menu() interface definition in June 2022 commit
2770223d10, and let the core-side of
the interface handle things.
To that end, this does the following:
Removes the #define of add_menu() from include/winprocs.h and add a
real core-side add_menu() function to windows.c which acts as a
trampoline to the window port win_add_menu() function, while providing
a single location to adjust the parameters passed to the window port
function. get_menu_coloring() is now called in there.
Moves get_menu_coloring() from options.c into windows.c and makes it
static.
Removes all the calls to get_menu_coloring() from the tty, Qt, X11,
curses, and win32 interfaces and adjusts their code to simply honor
the color parameter in add_menu, similar to what the menu_headings
change from earlier today did.
Instead of just accepting an attribute, it's now possible to
use a color, or both color and attribute, for example:
OPTIONS=menu_headings:inverse
OPTIONS=menu_headings:red
OPTIONS=menu_headings:red&underline
Default is still just inverse.
This lets the player change the menu heading color without
needing to use menu colors for them.
Also makes it so the core uses NO_COLOR instead of 0, for all
the menu lines which don't have any prefedefined color.
Tested for tty, curses, x11, qt, and win32
Pull request by entrez: have monsters and the hero use the same code
when deciding whether to destroy a missile that hits a monster after
being thrown or shot.
Closes#1129
Suggestion from entrez: If dipping something in a sink while hands
are slippery happens to cause that sink to break, only remind player
about still being Glib if the item was '-' or uarmg.
Redo one of the fixes entries: dipping a potion into a sink does not
dilute it. The potion is used up and gives a hint about what it does
so player might discover it.
If hero has slippery hands, include '-' among likely candidates for
item to #dip when dipping at a pool, fountain, or sink location.
When dipping an item (including hands), have a modest chance for the
sink to be destroyed--which turns it into a fountain--each time so
that it can't be used to blank scrolls an unlimited number of items.
(Pools can already be used for that, but you need to obtain water
walking ability or else drop most of your stuff and enter the water;
sinks weren't imposing any such requirements or risks.)
Pull request from entrez: when at a fountain, pool, or sink location,
the #dip command will allow #dip to pick terrain and player to choose
pseudo-item '-' for hands. Also allow dipping actual items in sinks.
Closes#1112
Pull request from entrez: the mstate field in struct mon defines many
bits but didn't use some of them consistently.
Initially they were intended to be examined via debugger, where being
inconsistent might lead to confusion but not have a negative impact on
gameplay. However, some of them have morphed into affecting gameplay.
Closes#1116
One can observe the following problems when generating or viewing plain
text versions of the Guidebook. (There are three; "Guidebook" and
"Guidebook.txt" are identical, and are paginated; "Guidebook.dat" is not
paginated.)
1. The line "(Edited and expanded for NetHack 3.7.0 by Mike Stephenson
and others)" is overset.
2. So are Figures 1 and 2, by one character cell, when rendered with
groff 1.23.0 because of the way it handles boxed tables and those
with vertical rules at table boundaries.
https://git.savannah.gnu.org/cgit/groff.git/commit/?id=8f066786ea3cb5e1dbade1149e7d50ae978da202
3. When viewing the Guidebook in an 80-column terminal, the left and
right margins are asymmetric; you get 10 columns on the left but
only 5 on the right.
So:
* doc/Guidebook.mn: In nroff mode, set page offset to 5n and increase
line and title line lengths by 5n to 70n.
Now, the margins are symmetric, there's ample room for the figures, and
the expansion credit fits.
(One diagnostic remains when formatting with groff 1.23.0.
troff:tmac.n:762: error: cannot load font 'S' for emboldening
This is a groff bug and will be fixed in the next release. The
diagnostic is spurious and can be ignored.
See <https://savannah.gnu.org/bugs/?64866>.)
Explain behavior of GNU tbl when setting boxed tables on terminals.
Drop reference to bug fixed in groff 1.23.0
<https://savannah.gnu.org/bugs/?49390>.
There's not much to say about other tbls except that they handle boxed
tables _terribly_ on terminals.
$ cat ./hello-table.roff
.TS
box;
L.
hello
.TE
$ ./bin/tbl ./hello-table.roff|./bin/nroff|cat -s # Heirloom Doctools
_______
hello
_______
|
| |
DWB tbl behaves the same way. I expect all System V Unix-descended
tbls/nroffs do the same.
This is my attempt to revise the figure by working _with_ tbl(1)
and nroff(1)/troff(1) features instead of fighting them or enduring
suffering and significant maintenance challenges.
* Stop using mn(7) display macros; the other two figures didn't and they
don't appear to be buying much.
* Use `tr` character translation feature to temporarily remap characters
for clarity of input. It's convenient to input ordinary characters
here since the table's contents are (mostly) character-cell art.
Remap `-` to minus sign and `@` to the "reverse solidus" special
character. (`\` is the default *roff escape character. It can be
changed, but attempting that seems hopeless inside a tbl(1) table.)
Revert the translations after the table. (There's nothing special
about `@`; you could choose any other character that isn't otherwise
needed in the table.)
* Use `box` region option as with Figures 1 and 2. Perhaps this wasn't
done because those are meant to depict a terminal window, but Figure 2
depicts only part of one, so its top border is a fib.
* Use `expand` region option to obtain roughly the same spread-out
effect that the table was laboriously using empty columns and the `e`
column modifier for.
* Consequently, reduce the column count to 2; both have real content.
* Annotate both keycap diagrams--in part for clarity, but also to make
it more obvious that the columns will balance in width.
These changes don't require GNU extensions to *roff or tbl except,
arguably, the \(rs special character. But support for that special
character identifier is easily added to any device-independent troff;
see §23.2 of CSTR #54 (Kernighan 1992 revision) or groff_font(5). Or I
can prepare a patch--just ask me. But given that no one seems to have
complained about the disaster that AT&T tbl/nroff must have been making
of Figures 1 and 2 for decades, I'm guessing this isn't a practical
concern. Any if it _is_ a problem, `\e` can be used instead of `\(rs`.
(I didn't use it because what is wanted is the backslash glyph
specifically [to mirror `/`], not "the escape character". But given the
constraints imposed by use of tbl(1), it's an academic point.)
On my system, the figure captions in Guidebook.ps were getting set in
Courier roman. This was clearly unintentional. Here's why it didn't
work.
1. Figures 1 and 2 selected the previous font, but only after a table
had been set. But tbl(1) does not preserve identity of the previous
font. I investigated, and none of GNU, Heirloom Doctools, nor
Documenter's Workbench tbl implementations preserve it. So the user
can't rely on it. See
<https://savannah.gnu.org/bugs/index.php?64862>.
2. Figure 3 attempted to select the roman font (typically Times), but
did so in a table cell that was empty of text. It therefore did not
have any visible effect.
* doc/Guidebook.mn: Explicitly select font `R` after setting tables. On
typesetters, put half a vee of space between the table's box border
and the figure caption.
doc/Gbk-1pg-sfx.mn is already using one half of a sound technique: set
the page length to a very large value, guaranteed to overshoot the
vertical space required by the document's text. The other half is to,
at the end of the document, set the page length to the current vertical
position, so that it ends immediately.
https://www.gnu.org/software/groff/manual/groff.html.node/Manipulating-Spacing.html
String definitions were being used with a pointless leading double
quote. This syntax is used only to define strings containing leading
space characters. (You might also use it defensively if you're defining
one string whose contents start with the interpolation of another, and
the latter might interpolate leading space--but that is not the case
here.)
Remove unnecessary leading quotes from string definitions.
* doc/Guidebook.mn: Do it. Also annotate empty strings with comment.
* sys/unix/hints/include/gbdates-post.370: Don't put them back.
https://www.gnu.org/software/groff/manual/groff.html.node/Strings.html
'nethack --show' is rejected, which is ok, but the feedback is
'prscore: bad arguments (2)' which is pretty confusing.
Reject any --s unless it's the start of --scores or --showpath[s].
'nethack --show' will be rejected as "Unknown option: --show."
'nethack -show' is still accepted and will report that it can't find
any scores for how as it always has (assuming that there aren't any
score entries for "how" :-).
Remainder of 'database-suggestions' pull request by entrez: named
fruit lookup when checking for data.base entries.
I'll admit that not sure what this actually accomplishes and am not
interested enough to figure it out myself.
This is the first time I've ever managed to do something useful with
'git cherry-pick', although I haven't tried much after early failures.
The other part of the pull request was dealt with manually earlier,
commit bc9518ca16.
Closes#1109
Add a new option 'perminv_mode' to augment perm_invent. It handles
the same choices as the temporary TTYINV method: show all items other
than gold, show full inventory including gold, or only show in-use
items (similar to the '*' command).
For tty, both the all-except-gold and full-inventory modes can add
the poorly named 'sparse' variation which populates unused slots in
its fixed grid with the inventory letter that would go in each.
For others, the default has been changed from full-inventory to
all-except-gold. Note that gold is treated as part of 'all' or of
'in-use' if it is quivered because having the amount be shown on the
status line doesn't make that redundant.
Changing the default may mess up WinGUI if it assumes that perm_invent
is full inventory with gold.
Initially I was going to change perm_invent into a compound but this
leaves it as an on/off toggle and adds perminv_mode as a separate
option for how to show the inventory when the toggle is on. It may
make sense to combine them since dual controls is a little confusing,
but right now setting perm_invent On when perminv_mode is 'none'
changes that to 'all' and changing perminv_mode away from 'none' when
perm_invent is Off toggles it to On.
Guidebook.mn has been updated but as usual Guidebook.tex is lagging.
Part of the pull request by entrez, changing a few data.base entries
recently introduced by PR #1108.
Changes ice box to a different quote, but I've re-applied the prior
quote to ice terrain rather than delete it. Also replace a UTF
apropostophe in the ice quote which escaped the previous purge of
such things.
Replaces the C.S.Lewis quote for Demonbane with a one-liner from the
Bible. I realized a bit late that Demonbane is no longer a sword and
never given to lawful Angels as starting gear anymore, consequently
the new quote doesn't fit very well.
The PR changed the helm of brilliance entry to be for all helms and
this rejects that. Instead, it adds a few generic helmet descriptions
and changes the helm of brilliance quote--now misquote--to be useful
to players, describing it as crystal rather than steel.
Pull request 1109 is still open--there's a second commit in it dealing
with fruit name handling that this commit doesn't touch.
Pull request from vultur-cadens: make thrown potion of sickness more
consistently effective but less powerful. It is no longer blocked
by a target monster's innate magic resistance but it now only halves
current HP without also halving maximum HP, and the message about the
target "looking rather ill" is skipped if it only has 1HP so doesn't
take any damage.
Closes#1103
Pull request from bernhardreiter: NetHack.ad has a comment about
needing to use an external tool such as XV or PBMplus rather than
the NetHack.double_tile_size resource if nethack is built with the
USE_XPM configuration. Add some more detail since using 'hints' when
setting up the Makefiles can define that behind the builder's back.
The extra detail won't be useful to players who obtain prebuilt
binaries that incorporate the X11 interface. The comment in config.h
(see preceding pull request) won't be either, and maybe should be
moved to NetHack.ad where such users will be able to see it.
Fixes#1114.
Stop trying to deduce whether the document is being formatted for a
typesetter (a device that can use proportional fonts) or a terminal (a
device that generally can't) by asking the formatter to measure
formatted texts. Instead, use the built-in `n` and `t` conditions that
nroff and troff have supported for this purpose since 1976 at the
latest. All known troff implementations support these.
https://www.gnu.org/software/groff/manual/groff.html.node/Operators-in-Conditionals.html
These *roff control lines were ill-formed. `.fi` is a request to turn
on filling, not a closing bracket for an `if` request (*roff is not a
Bourne shell).
https://www.gnu.org/software/groff/manual/groff.html.node/Conditional-Blocks.html
Further, *roff generally does not accept more than one request per
input line. Exceptions to this rule are the control structuring
requests (`if`, `ie`, `el`, and in GNU troff, `while`, `do` and `nop`).
But here, only one (`do`-nested) request is governed by the `if` anyway.
I did this several months ago to avoid a sanity check warning (and
consequent fuzzer panic) when an engulfer expels the hero on a full
level. I was hoping to refine it but never went back; install it
now before forgetting about it entirely.
If a chameleon changes from wall-phazer to engulfer while in a spot
the hero can't move onto and engulfs him/her, expelling the hero
after the engulfer has taken the hero's spot might be forced to put
the hero on top of the engulfer or another monster when unable to
use the engulfer's former spot. Rather than try to figure out all
the possible ways this might happen and attempt to deal with each
of them, just prevent an engulf attack from succeeding if the hero
wouldn't be able to move to the engulfer's spot. (Does not prevent
an air elemental over water from engulfing the hero.)