Commit Graph

5632 Commits

Author SHA1 Message Date
nhmall
9321316634 Guidebook date stamp to match most recent change 2025-12-05 20:00:14 -05:00
Alex Smith
02ce11a7c6 Move some chronicle-related fixes entries to the correct section 2025-12-03 23:19:58 +00:00
Alex Smith
621d21ebb9 Archeologists can decipher scroll labels
Prior to this commit, Archeologists had an incredibly difficult
start, worse than was intended. This is intended to make it a bit
easier (whilst making the role more different from other roles) via
allowing them to identify scroll types earlier in the game than the
other roles are able to (they do it using a knowledge of ancient
languages that lets them read scroll labels that other roles
couldn't).
2025-12-03 21:35:17 +00:00
Alex Smith
a0ccb4b0cb Show spells and skills in the dumplog
These are often an important part of a character's build. There's
no purpose in listing them in disclose because the player generally
already knows what spells and skills they had and doesn't need them
identified, but they're useful when looking at someone else's game
or reminiscing over a past game.
2025-12-02 19:19:18 +00:00
Alex Smith
29df69d542 Writing on an unidentified scroll of blank paper identifies paper
The character doesn't know that an unlabeled scroll is blank until
they look at the inside of the scroll, but that could be done
either by reading or by writing.
2025-12-02 18:14:40 +00:00
Alex Smith
656f58b099 A basic version of starting character rerolling
This adds a "reroll" option that lets players reroll their
character's attributes and starting inventory. Although I generally
think doing this makes the game worse, a) some players are going to
do it regardless and b) if a player is going for a challenge game,
rather than to win, it may be required. So in the absence of an
option like this, players repeatedly start and quit games instead,
creating a large number of junk logfile entries and generally
causing problems for other players on the same shared machine
(because repeatedly reloading the game is very CPU-intensive).

This should in theory be windowport-agnostic (although in practice
it may not be). Tested on tty, X11 and curses; on tty and X11 it
works fine (although X11 treats the change in attributes as
something that needs a status highlight), on curses it is slightly
jankier in terms of what other windows are drawn in the background
(but still plays correctly and I suspect this is a pre-existing
bug).

To form a complete implementation, we will need to consider the
following:

- Should there be a delay on a) starting the game and/or b)
  rerolling? If so, what should it be (maybe configurable via
  sysconf?)

- Should we take more steps to discourage players from rerolling?
  It would be bad if players see the option exists and turn it on
  just because it exists, or (worse) treat it as condoning the
  particular style of play.

- Should we take steps to detect that players are rerolling
  manually and a) tell them to use the option instead, b) tell them
  that this is not an intended way to play (and may make the game
  less enjoyable and/or prevent them getting the practice they need
  to eventually win)?

Breaks save and bones files.
2025-11-30 06:49:14 +00:00
PatR
94e5f7b861 part of issue #1463: // vs lootabc
Issue reported by ashleyharvey in a comment to issue #1463:  with the
'lootabc' option set, using the '/' command wouldn't accept a second
slash to look at things on the map (nor a question mark to type in
text to look up).

Not a bug since '//' is not documented as the way to look at the map
and '/a' works for lootabc, but '//' is useful so add support for it.

The '/' menu already uses 'y' and 'n' as unshown synonyms for looking
at the map and for looking up words.  Those now only work for the
'!lootabc' setting since lootabc can't assign multiple group
accelerators to the relevant choices.  Many of the other !lootabc
choice letters now work as unshown synonyms for lootabc choices, but
not all.  Feeding 'i' and 'e' to the menu as group accelerators would
interfere with using them as ordinary abc choices (at least for tty).
2025-11-28 15:13:01 -08:00
Alex Smith
b08fbef739 Followup to erinyes changes / offering while impaired
The important part of the "don't offer while impaired" change was to
prevent offering while confused.  However, it was also extended to
other status conditions: stunning seems fine, but hallucination was
problematic (both because it makes a large number of messages
inaccessible, and because hallucination is more of a long-term status
effect than the other two and players may sometimes choose to play
with it for a large portion of the game).  So make the change trigger
only on stunning and confusion, not hallucination.

This also updates the changelog for the change, because while
connected to the erinys changes, it's technically separate and is
relevant even in games where erinyes are never summoned.
2025-11-27 23:14:17 +00:00
Alex Smith
8c29b20010 Accurately track which items have been discovered, even if not #named
This fixes a couple of bugs: a long-standing bug in which writing a
scroll by label could fail even if you've already seen a scroll with
that label (due to the game not tracking whether or not you've seen a
scroll if it doesn't have a name); and a somewhat newer bug in which
spellbooks auto-identified by Wizard knowledge were marked as having
been encountered (rather than as known but not encountered).

Breaks save file compatibility, but not bones files.
2025-11-25 22:42:38 +00:00
Alex Smith
10a5e67478 Some types of shopkeeper start with a scroll of charging
This is partially for the pun, and partially because the "wish for
scrolls of charging to identify them" strategy has been nerfed in
previous commits and this offers an opportunity to discover what
scrolls of charging are without randomly encountering one.
2025-11-25 22:19:24 +00:00
PatR
7b5d7d7ae6 fix issue #1462 - objects embedded in trees
Issue reported by chappg:  on arboreal levels, when an object was
located at a stone location treated as a tree location, examining
the object would report it as embedded in stone.

The Ranger quest has arboreal levels where STONE becomes TREE, and
items that would become embedded in stone will be in trees instead.
(Sometimes kicking a tree would drop fruit onto an adjacent tree,
effectively embedding it.  For testing, it's easier just to poly
into a xorn, walk onto the tree spot, and drop something.)  The item
description code for farlook and quicklook wasn't checking for that.

The fix also corrects another bug:  an item located at a normal tree
location would just be described as itself with no mention of the
tree at all.  Attempting to walk onto it would report the terrain
and not let you move there (assuming not in xorn form), like trying
to walk into a wall.

Fixes #1462
2025-11-24 12:37:08 -08:00
Alex Smith
fce66245ca Don't attempt to cache encumber_msg result
There was only one point in the code at which this caching was
being done, and it was incorrect: it's possible for the result of
near_capacity to change during a monster turn because monster
actions can change either inventory weight or carry capacity.

The bug was particularly relevant in cases where a character
polymorphed into a slow weak monster gets attacked by a monster
that moves at normal speed: due to the polyform being slow, the
normal-speed monster gets in a lot of attacks and causes a
rehumanization, but due to the polyform being weak, it was
burdened at the start of the monster turn, and so when that
penalty is (due to the bug) applied to the next turn it can
mean that the character misses the next turn too, and may end up
dying as a result.
2025-11-24 02:07:23 +00:00
PatR
93f8e5b3b3 fix #S14702 - travel to covered vibrating square
Targeting '~' when vibrating square has been discovered would report
"Can't find dungeon feature '~'" if it was covered by an object or a
monster.

That's normal behavior for a trap but the vibrating square is only
one of those for display purposes.
2025-11-20 15:02:54 -08:00
PatR
9b1bb1150e fix issue #1458 - inappropriate verbal messages
Issue reported by chappg:  succubi could produce "it's on the house"
(quoted verbal message) when hero is deaf.  The mail daemon could
produce a variety of verbal message when hero is deaf.

The succubus/incubus one is easy to fix.  The mail daemon ones are
untested and a couple haven't been given non-verbal alternatives.

Fixes #1458
2025-11-09 12:58:19 -08:00
PatR
0524ff482b fix #S14678 - livelog of bribery when hallucinat
If hallucinating hero bribes a demon lord, report its true identity for
livelog/#chronicle.  Unlike with the similar change for genocide, this
does give away information if the player checks #chronicle.

Again, the report via the web contact form was misclassified as spam.
2025-11-09 06:33:19 -08:00
PatR
f7e12d2801 do-again vs yn_function()
This fixes the impossible from yn_function() for ^A after Z.  One
call to yn_function stored the spell letter for do-again and then
another call was unintentionally using that when getting a y/n
response for askchain() while using menustyle:Traditional [when
spell was identify and eligible objects needed confirmation about
whether to be ID'd].

Fixing that seemed to break #pray so the paranoid_confirm routine
has been changed to not rely on canned input, even for queries where
the player hasn't specified that confirmation be required.

Behavior of ^A might be different in unexpected ways, but it wasn't
working correctly before.
2025-11-08 18:38:55 -08:00
nhmall
d5658018ac alternative to display_inventory for window-port
Several window ports that support perm_invent were
using a call back to the core display_inventory()
function.

While calling from the window port back to core functions
is arguably not ideal in the first place, it was recently
brought to light that code NetHack-3.7 code changes to
display_inventory() actually caused it to stop repopulating
the perm_invent window as intended under certain circumstances.

For now, provide an alternative function, repopulate_perminvent(),
that hopefullshould still work the way it did previously.

There will likely be some additional changes after this to
further improve things, at some point.

For now though, this
Resolves #1454
2025-11-08 14:26:07 -05:00
PatR
3113387371 fix #S14667 - livelog of genocide when hallucinating
Uncursed genocide while hallucinating deliberately reports hero's
role to the player as the affected target, but it was also showing
that for livelog and #chronicle.

Making the true target be visible for #chronicle gives away a little
information but that should be inconsequential in this siutation
since the player specifies the target.

Not sure why this report got misclassified as spam.
2025-11-07 13:03:46 -08:00
Alex Smith
82edcca402 Improve messages for oilskin sack protection versus water
The existing messages made sense for brief dips into water, but
didn't make sense when using an oilskin sack for an extended
period underwater (and also assumed that the player was able to
see the sack). This commit changes the message to make sense
(and to be less spamy) if the hero enters water and remains there,
and prevents oilskin sacks self-IDing if the hero is blind and
thus can't see the water.
2025-11-07 18:21:21 +00:00
Alex Smith
db8e76ffd1 Changelog entry for 0-damage nonweapon changes 2025-11-01 16:11:22 +00:00
nhw_cron
7ab563ffc9 This is cron-daily v1-Apr-1-2024. 005manpages updated: mn.txt 2025-10-25 07:46:55 -04:00
nhkeni
987e3d93e0 Fix a typo going back to B news 2.11; 1986 (or earlier) according to tmac.n 2025-10-24 16:34:35 -04:00
nhw_cron
62e4a0bc91 This is cron-daily v1-Apr-1-2024. 005guidebook updated: doc/Guidebook.txt 2025-10-24 12:29:44 -04:00
nhmall
3c8628f549 correct a few typos 2025-10-24 12:27:05 -04:00
nhmall
3eed021a39 date stamp update 2025-10-24 12:01:37 -04:00
nhmall
dbe5ebfa94 Guidebook typo
doc/Guidebook.mn:2928:54 - Unknown word (situtaion) fix: (situation)
2025-10-24 11:46:10 -04:00
nhmall
42a08f1a86 typo fixes in fixes3-7-0.txt
doc/fixes3-7-0.txt:218:11 - Unknown word (redundate) fix: (redundant)
doc/fixes3-7-0.txt:533:23 - Unknown word (adjustmens) fix: (adjustments)
doc/fixes3-7-0.txt:718:2 - Unknown word (uniforn) fix: (uniform)
doc/fixes3-7-0.txt:1240:57 - Unknown word (attibute) fix: (attribute)
doc/fixes3-7-0.txt:1858:43 - Unknown word (foced) fix: (forced)
doc/fixes3-7-0.txt:1948:7 - Unknown word (thorougnly) fix: (thoroughly)
doc/fixes3-7-0.txt:2072:8 - Unknown word (interferring) fix:(interfering)
2025-10-24 11:24:48 -04:00
nhmall
98b526eb15 sync NetHack-3.6/doc/fixes36.7 -> NetHack-3.7/doc/fixes3-6-7.txt 2025-10-14 11:52:46 -04:00
PatR
34d0e956ed fix issue #1453 - throwing crackable object upward
Issue reported by NullCGT:  throwing a crackable item against the
ceiling would cause it to vanish if it became [more] cracked but not
yet fully shattered.

Fixes #1453
2025-10-13 23:02:56 -07:00
nhw_cron
9f6d1d17dd This is cron-daily v1-Apr-1-2024. 005guidebook updated: doc/Guidebook.txt 2025-10-05 22:35:49 -04:00
nhmall
60e2598d81 SYMBOLS=S_ghost:
Resolves #1448
2025-10-05 22:10:34 -04:00
PatR
edd11009e9 issue #1447 - physical damage when polymorphed
Isssue reported by Tomsod:  hero-as-target section of mhitm_ad_phys()
was not handling hero's Half_physical_damage attribute.

The issue was about cloning a pet from hero who is poly'd into a
pudding but it was more general than that.  Half_physical_damage was
ignored for any hit by a monster-wielded weapon against poly'd hero.

It took a while to convince myself that Half_physical_damage wasn't
aleady being applied elsewhere but it doesn't seem to be.

Fixes #1447
2025-09-25 09:59:15 -07:00
PatR
d0b79912ed support 'nethack --nethackrc=~/File'
Substitute $HOME/File if command line specifies --nethackrc=~/File
to avoid "Access to ~/File denied (2)".

Only implemented for opening run-time config file on Unix.  Works for
NETHACKOPTIONS=@~/File too; the normally optional at-sign is required
since the tilde won't match a slash to distinguish file versus options.

Only supports "~/" file path prefix, not "~user/".
2025-09-22 14:47:54 -07:00
PatR
e4f0d1a3e2 fix #4341 - jousting while trapped 2025-09-01 13:35:05 -07:00
nhmall
6fade4b184 don't split pudding that got jousted into a hole 2025-09-01 10:34:38 -04:00
George Huebner
91f973d454 config.nh: fix example MENUCOLOR regex
Matching literal parentheses requires escaping them with `\`
2025-08-27 12:24:56 -07:00
PatR
407a2e0ea8 fix issue #1436 - object_from_map() vs Hallu
Issue reported by janne-hmp:  examining an object on the map while
halluicinating might operate on an object whose name is Null since the
random object could be one that holds an extra description for item
shuffling at game start.  Attempting to format the object led to a
crash.

I wasn't able to reproduce the crash, possibly because MacOS produces
the string "(null)" for sprintf("%s",NULL) instead of dereferencing
the Null pointer.

Perhaps random object selection for display should reject the extra
description objects in some classes.  This susbstitutes a different
object if examining the map encounters one of those.

Fixes #1436
2025-08-10 12:45:29 -07:00
PatR
695c6ef3ac fix issue #1434 - engulfed gas spore explosion
Issue reported by Umbire:  a gas spore that got swallowed and killed
didn't die but exploded anyway, with the explosion affecting the map
instead of being contained in the swallower.

There was code to handle that but it wasn't being executed.  This fix
feels unclean but seems to work.

I couldn't reproduce the survival of the gas spore but since that
isn't wanted I won't worry about it.

Fixes #1434
2025-08-05 13:30:17 -07:00
PatR
5fe746a0d6 fix issue #1435 - vampire leaders as wolves
Issue reported by by vultur-cadens:  a vampire lord or lady might change
to wolf form while flying over water or lava, ending flight and dropping
into that water or lava.  It would then drown or burn up, revert to
vampire leader form and resume flying, then be teleported since it was
past the check for being in flight.

The fix is pretty staightforward.  It is still possible to force wolf
form with the monpolycontrol option, leaving the wolf standing on water
(didn't test for lava) and then drowning on its next move, where it will
revert to vampire form but no longer teleport away.  There's no need for
a wizard mode hack to behave more stringently.

Fixes #1435
2025-08-04 19:56:51 -07:00
Pasi Kallinen
e240efa10b Restoring a game can return to the wishing prompt
In TTY or curses, if the terminal goes away while you're in the wishing
prompt, return to the prompt when the game is restored.

Breaks saves.
2025-07-12 18:21:12 +03:00
Pasi Kallinen
8570421449 Create familiar spell can create harder creatures 2025-07-11 13:04:25 +03:00
Pasi Kallinen
e2b80cd886 Monsters trapped in pits cannot kick 2025-07-04 17:39:08 +03:00
Pasi Kallinen
a0d9c94ece Dwarves can sense buried items under their feet 2025-07-04 17:04:46 +03:00
Pasi Kallinen
b8664198da Alchemy smock reduces chances of dipped potions exploding 2025-07-03 21:07:05 +03:00
nhmall
1ece615eb2 fixes3-7-0.txt catch-up; also replace some magic hex numbers 2025-06-30 09:04:41 -04:00
PatR
d2810a4bcd fix github issue #1413 - mimic feedback for gold
Issue reported by ars3niy:  if a mimic was given the shape of a
gold piece it gets reported as 2 gold pieces but the message was
|A gold pieces appears next to you.

Avoid article "A" prefix, and use plural verb "appear" instead of
singular "appears", yielding
|Gold pieces appear next to you.

Fixes #1413
2025-05-30 22:20:21 -07:00
nhmall
b303f91f3a engraving pristine text field not properly filled
level creation was not populating the pristine text field
of engraving appropriately
2025-05-26 12:56:44 -04:00
nhmall
82fd29c429 cron update 2025-05-25 15:47:05 -04:00
nhmall
f4a6da2e52 save/restore changes - part 2
This is the second of a series of changes related to save/restore.

    No EDITLEVEL bump has been included, because although the code
    is changed extensively by this, the content of the savefiles have
    not been changed.

    Push the use of the structlevel bwrite() and mread() function use
    out of the core and into sfstruct.c. This is groundwork for upcoming
    changes.

    In the core, replace the bwrite() and mread() calls with the
    use of type-specific savefile output (Sfo) and savefile
    input (Sfi) macros.  The macros are defined in a new header file
    savefile.h, which also contains the prototypes for the sfo_* and
    sfi_* functions that the macros ultimately expand to. The functions
    themselves are in src/sfbase.c.

    On C99, each Sfo or Sfi macro expansion refers directly to the
    corresponding  type-specific sfo_* or sfi_* function.

    If C23 or later is is use, the majority (all but 3 types) of the
    macros refer to a single _Generic output routine sfo(nhfp, dt, tag),
    and a single _Generic input routine sfi(nhfp, dt, tag), which handles
    the dispatch of the type-specific underlying functions. This was
    somewhat experimental, but turned out to be practical because the
    compiler would gripe if the type for a variable was not included in
    the _Generic when passed as an argument, so it could be fixed.

    This alters the savefile verication process by having a common set
    return values for the related functions such as uptodate(),
    check_version(), etc. The new return values return more information
    about savefile incompatibilities, beyond failure/sucess. The
    additional information will be useful for an upcoming addition.
    The expanded return values are:
     SF_UPTODATE                     (0) everything matched and looks good
     SF_OUTDATED                     (1) savefile is outdated
     SF_CRITICAL_BYTE_COUNT_MISMATCH (2) critical size count mismatch
     SF_DM_IL32LLP64_ON_ILP32LL64    (3) Windows x64 savefile on x86
     SF_DM_I32LP64_ON_ILP32LL64      (4) Unix 64 savefile on x86
     SF_DM_ILP32LL64_ON_I32LP64      (5) x86 savefile on Unix 64
     SF_DM_ILP32LL64_ON_IL32LLP64    (6) x86 savefile on Windows x64
     SF_DM_I32LP64_ON_IL32LLP64      (7) Unix 64 savefile on Windows x64
     SF_DM_IL32LLP64_ON_I32LP64      (8) Windows x64 savefile on Unix 64
     SF_DM_MISMATCH                  (9) some other mismatch
    The callers in the core have been adjusted to deal with the expanded
    return values.

    Other miscellaneous inclusions:

       - go.oracle_loc -> svo.oracle_loc.
       - add a bit (1UL << 30) to  called SFCTOOL_BIT as groundwork
         for changes to follow.
2025-05-25 15:03:13 -04:00
Pasi Kallinen
035cd4377f Snickersnee can hit at a distance once per turn for free
Once per turn, Snickersnee can be used to hit at a distance,
similar to a polearm, without taking any time.

Breaks saves.
2025-05-12 20:26:53 +03:00