Commit Graph

5133 Commits

Author SHA1 Message Date
nhmall
aa026e0f89 fixes update 2023-11-22 17:55:27 -05:00
nhmall
b09d663f71 placeholder copies of doc/*.txt until cron job gets repaired 2023-11-22 17:00:09 -05:00
nhmall
6272e18d7b updated doc/*.txt from cron job 2023-11-22 09:32:38 -05:00
PatR
eb89388b35 pull request #1135 - tweak encumbrance messages
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
2023-11-20 13:21:37 -08:00
PatR
3021423a5f github issue #1145 - ^C-induced panic on tty
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
2023-11-18 17:45:43 -08:00
Alex Smith
86c29f5b47 Allow identifying stackable items by comparison to identical items
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.
2023-11-19 01:21:53 +00:00
PatR
1fc56e4be8 new bugs - implement 'whatis' of engravings
'/ 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.]
2023-11-18 00:35:30 -08:00
PatR
389f03e90e farlook of engravings
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.
2023-11-17 17:36:04 -08:00
PatR
a49c872f47 another 'm #overview' fix
Once in the endgame, suppress non-endgame levels from the 'm #overview'
annotation menu like is already done for normal #overview.
2023-11-17 00:43:06 -08:00
PatR
387cef9899 'm #overview' enhancement
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.
2023-11-17 00:36:43 -08:00
PatR
3accaf9c53 PR #1142 - show level annotation when restoring
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
2023-11-16 23:16:54 -08:00
PatR
73fed3d5d8 tty: menu search (':') fix
'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.
2023-11-16 23:11:54 -08:00
nhmall
4b79baa55b add_menu follow-up, part 2 of interface adjustment
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.
2023-11-13 12:56:38 -05:00
nhw_cron
86914f03f0 This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-13 08:26:36 -05:00
nhmall
31a46e72c0 Guidebook date stamp 2023-11-13 07:46:17 -05:00
nhw_cron
62d8d5858f This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-13 07:39:05 -05:00
Pasi Kallinen
dd5ca5b058 Change menu_headings to accept color and attribute
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
2023-11-13 07:33:56 +02:00
PatR
fcf1a42cac fix for two empty-handed hits
When using bare-handed combat or martial arts at better than 'basic'
skill, don't attempt a second hit if wearing a shield.
2023-11-12 10:21:51 -08:00
PatR
ce79cb519c fixes entry for PR #1129 - using up ammo/missiles
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
2023-11-11 01:25:49 -08:00
nhmall
f360cb24b1 allow monster that has swallowed hero to be named 2023-11-10 16:35:43 -05:00
PatR
915da30c9d more PR #1112 - dipping in sinks
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.
2023-11-10 01:14:24 -08:00
PatR
394fa24666 refine PR #1112 - washing, dipping in sinks
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.)
2023-11-09 18:22:06 -08:00
PatR
f86dbf13b5 fixes entry for PR #1112- wash hands, dip in sink
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
2023-11-09 16:46:36 -08:00
Pasi Kallinen
2e8adda028 Clouds cannot have engravings in them
... so delete the existing engraving if a cloud is put on the map.
2023-11-09 18:08:00 +02:00
PatR
e783c82b84 pull request #1116 - mon->mstate flags
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
2023-11-08 10:41:40 -08:00
nhw_cron
484cd86ce3 This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-06 16:53:12 -05:00
G. Branden Robinson
44c012e9cf doc/Guidebook.mn: Fix overset lines in nroff mode
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>.)
2023-11-06 14:44:58 -06:00
G. Branden Robinson
4eeab8824d doc/Guidebook.txt: Update table annotations
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.
2023-11-06 14:44:54 -06:00
G. Branden Robinson
0571cb395e doc/Guidebook.mn: Completely revamp Figure 3
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.)
2023-11-06 14:44:09 -06:00
G. Branden Robinson
9658f6769d doc/Guidebook.mn: Caption figures consistently
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.
2023-11-06 14:43:59 -06:00
G. Branden Robinson
93dd1a09d5 doc/Guidebook.mn: Improve roff character reference
And point people to a more authoritative reference.
2023-11-06 14:43:56 -06:00
G. Branden Robinson
363f8db139 Use *roffier method of producing Guidebook.dat
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
2023-11-06 14:43:50 -06:00
G. Branden Robinson
b35350d7d3 doc/Guidebook.mn: Drop junk argument to TS
The "S" argument has no meaning.  tbl(1) doesn't interpret it, and the
"n" and "nh" macro packages don't, either.
2023-11-06 14:43:47 -06:00
G. Branden Robinson
9a96e0a198 Fix *roff string usage nit
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
2023-11-06 14:43:34 -06:00
nhw_cron
62ea71bd6b This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-06 07:31:47 -05:00
PatR
6e137628fb perminv_mode in Guidebook
Tweak the new entry in Guidebook.mn and catch up with that entry in
Guidebook.tex (untested).
2023-11-06 00:46:18 -08:00
PatR
1b04533b35 fix #4027 - unix command line parsing bug
'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" :-).
2023-11-05 17:16:02 -08:00
nhw_cron
9d83152ced This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-05 19:16:23 -05:00
PatR
e1b47e74e3 remainder of PR #1109 - named fruit lookup
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
2023-11-05 15:08:02 -08:00
Pasi Kallinen
8dc7a4882a Make spell menu work with repeat command 2023-11-05 13:49:04 +02:00
PatR
2ee7509945 replace getenv("TTYINV") with perminv_mode option
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.
2023-11-05 02:31:26 -08:00
Pasi Kallinen
738c2239c9 Lightning has a small chance of melting iron bars 2023-11-04 13:04:27 +02:00
PatR
bc9518ca16 part of PR #1109 - data.base entries
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.
2023-11-03 13:26:53 -07:00
PatR
957b8ac601 fixes entry for PR #1103 - potion of sickness
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
2023-11-03 11:20:57 -07:00
PatR
8f1b1288cb pull request #1114 - NetHack.ad remarks about XPM
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.
2023-11-03 11:04:35 -07:00
nhmall
75384b95d4 Merge branch 'NetHack-3.7' of https://github.com/g-branden-robinson/NetHack into NetHack-3.7 2023-11-02 16:42:38 -04:00
Pasi Kallinen
e6993f2ef1 Digging down on a magical trap causes it to explode 2023-11-02 19:18:18 +02:00
G. Branden Robinson
467a0180a6 doc/Guidebook.mn: Use idiomatic *roff features
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
2023-11-02 11:55:35 -05:00
G. Branden Robinson
462973ab53 doc/Guidebook.mn: Drop junk syntax
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.
2023-11-02 11:55:22 -05:00
PatR
c1045cc18a sanity check: avoid "you over monster" impossible
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.)
2023-11-02 09:12:37 -07:00