Commit Graph

5495 Commits

Author SHA1 Message Date
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
Pasi Kallinen
c90cc53ab3 Ogresmasher gives a higher chance of knockback 2025-05-12 10:24:36 +03:00
PatR
a1e3943e1f fix #K4327 - inaccurate Guidebook for role/race/&c
The Guidebook states that the default values for 'role', 'race',
'gender', and 'alignment' are "random" but that's wrong.  Omitting
those options results in interactive prompting.
2025-05-01 15:43:57 -07:00
PatR
d8ff80978e remove vestige of 'use_menu_glyphs' 2025-04-29 11:05:03 -07:00
PatR
a587ccaa26 merge new use_menu_glyphs option with menu_objsyms
The two options are very similar but probably mutually exclusive
except when using look-here and look-into-container (both via ':')
with the default setting for 'sortloot', or with inventory when
'sortpack' has been toggled off.

This removes 'use_menu_glyphs' and changes 'menu_objsyms' from a
boolean to a compound taking six possible values:
| 0: no object symbols in menus,
| 1: append object class symbol to object header lines (same as old
|menu_objsyms boolean),
| 2: include object symbol in menu entry lines for objects (same as
|recently added use_menu_glyphs),
| 3: both 1 and 2,
| 4: display as #2 but only if the menu lacks class header lines,
| 5: if header lines are present, display as #1; if headers are not
|present, then display as #4 (which will implicitly be #2).
Default is #4.

Effectively replaces the options portion of pull request #1406 and
retains the functionality, but not as default for normal menus.

Guidebook.tex is only partially updated.  Someone else will need to
finish that.
2025-04-28 18:12:02 -07:00
Kestrel
91f0c0852b Correct Guidebook.tex typo. 2025-04-26 12:50:18 -07:00
Kestrel
61f2af9ca9 Update Guidebook.tex with use_menu_glyphs. 2025-04-26 12:50:18 -07:00
Kestrel
ee6538b398 Update Guidebook.mn with use_menu_glyphs. 2025-04-26 12:50:18 -07:00
Kestrel
9e1e032ea8 use_menu_glyphs 2025-04-26 12:50:18 -07:00
PatR
1c679779f4 final disclosure of inventory vs force_invmenu
It seems surpristing that no one has noticed this since the code that
is responsible has been present for six months.  Inventory list at
end of game included bogus "? - (list likely candidates)".
2025-04-20 19:36:56 -07:00
PatR
d32c8c63bd Mention reading scrolls while blind in Guidebook 2025-04-19 17:53:22 -07:00
Pasi Kallinen
178bd3a988 Wielding Trollsbane grants hungerless regeneration 2025-04-17 17:28:07 +03:00
Pasi Kallinen
a185c270bb Expose trap once-field to lua 2025-04-13 17:32:14 +03:00
Pasi Kallinen
85de51a69a Add invocation effect to Fire and Frost Brand
Casts fireball or cone of cold at expert level
2025-04-13 13:13:54 +03:00
Pasi Kallinen
652f8576c0 Cursed magic whistle can teleport you to your pet 2025-04-13 12:48:21 +03:00
PatR
a05cca16ef fixes entry for PR #1408, typos in tribute names
Pull request from rbsec:  a couple of character names had misspellings.

Closes #1408
2025-04-12 10:43:32 -07:00
Pasi Kallinen
8f7258dc35 Buff Grimtooth with poison
Grimtooth is now permanently poisoned, protects the wielder from
poison, and can be invoked to throw poison.

Permapoison code comes from xNetHack by copperwater <aosdict@gmail.com>.
2025-04-12 19:24:36 +03:00
PatR
1fd27044b7 github PR #1384 - THEMERM and ThEMERMFILL
Pull request from copperwater:  reorganize the theme rooms data so
that a room or a fill can be chosen by name, and when in wizard mode,
consult environment variables THEMERM and THEMERMFILL during level
creation to provide control over which theme rooms/room fills to
generate.

I reverted a commit that did a bunch of reformatting to themerms.lua
because to caused substantial merge conflicts.  I will redo at least
part of it.

Closes #1384
2025-04-11 16:29:08 -07:00
Pasi Kallinen
7138af00ba Praying on an altar with pet statue on it can revive the pet 2025-04-10 23:38:44 +03:00
Pasi Kallinen
fa229439d4 Fixes entry for silver mace
Fixes #1405
2025-04-09 21:05:59 +03:00
Pasi Kallinen
2065d2d392 Avoid premapping outside Sokoban map to prevent showing stone glyphs
If user has changed the stone glyph to something other than a space
(or uses a tileset), Sokoban levels showed the unreachable stone outside
the map area.  Prevent marking those areas as seen, so the stone
glyphs aren't shown.
2025-04-09 18:41:00 +03:00
nhmall
9e2a0f977e fixes entry update 2025-03-20 14:39:04 -04:00
PatR
90717ca633 more chest->tknown handling
Disarming a chest trap was setting obj->tknown = 0 even though the
hero just discovered that it isn't trapped.

Triggering a chest trap behaved similarly.  Since there are no
repeating chest traps, hero should know that the chest whose trap
just went off is no longer trapped.

chest_trap() didn't document its return value but was clearly meant
to return True if the chest was destroyed.  It didn't handle that
correctly when the chest was being carried.  However, none of the
callers actually use the return value.  [This fix tracks whether the
chest gets deleted; a better fix would be to destroy an exploding
chest even when it is being carried.]
2025-03-13 13:54:56 -07:00
nhkeni
67dc6662ac remove bogus content from template file 2025-03-13 12:48:07 -04:00
PatR
1d22a396d4 fixes3-7-0 typo 2025-03-10 21:54:22 -07:00
nhmall
d6829cdcd2 fixes entry for musl libc build, rather than glibc
We've had reports of a couple of issues building against musl libc.

Issues reported:
  - build procedures utilize col for Guidebook-creation, and col
    is deprecated in distros that use musl libc

  - some of the CRASHREPORT code is using library functions that
    are not available in the musl libc environment. The reported
    functions were backtrace() and backtrace_symbols(), which use
    header file /usr/include/execinfo.h.

So we'll try to accommodate this. Since we don't have a means of
autodetecting the musl libc situation during the build (as of yet), the
builder will have to specify 'make musl=1' on the make command line.

Specifying 'musl=1' on the make command line will:
1. ensure that NOCRASHREPORT gets defined in the C preprocessor.
2. set COLCMD to be '../util/stripbs' instead of 'col -bx'.

Related to GitHub #1393
2025-03-10 19:54:12 -04:00
PatR
719166f9ec fix issue #1377 - Forcefight vs displacer beasts
Issue reported by elunna:  Using the 'F' prefix against a displacer
beast prevented swapping places.

This doesn't use the suggested fix.  It is quite short but there is
a large diff due to change in indentation and reformatting several
comments because of that.

Attacking a displacer beast either with or without 'F' might miss,
hit, or swap places.  It won't "harmlessly attack thin air."

Fixes #1377
2025-03-10 09:17:41 -07:00
copperwater
01cdf51993 Add a bit of detail in selection.room() documentation
It wasn't clear to me how selection.room() handles room edges and
unusual terrain in the room, so I looked at the code and wrote down how
it behaves for posterity.

I don't believe the one room currently capable of getting a random fill
while already containing some odd terrain, "Blocked center", actually
has unusual terrain in the room fill. This is because filler_region
creates an irregular region (i.e. a room containing the ROOM points in a
square ring around the blocked center). The points in the middle don't
share the same roomno, so they won't be returned in the selection
created by selection.room(). But there's no reason a room couldn't be
added in the future which does specify some nonstandard terrain and then
a themeroom fill.
2025-03-04 18:46:31 +02:00
PatR
6c42180cfc fix issue #1383 - chopping boulder at tree spot
Reported by k21971:  applying an axe toward a location that contained
both a tree and a boulder (or statue) would use the axe to break the
boulder/statue rather than chop down the tree.

Different code is used to finish the dig/chop than is used to decide
whether the tool is appropriate for its target.

Fixes #1383
2025-02-26 12:15:13 -08:00
nhkeni
e358f37863 Merge remote-tracking branch 'origin/keni-fetchdocs' into NetHack-3.7 2025-02-07 15:36:19 -05:00
PatR
a311f4b467 fix issue #1362 - carrying Mitre of Holiness
Issue reported by elunna:  the definition of the Mitre of Holiness
specifies that carrying it should confer fire resistance but that
didn't work.

The Mitre's definition (added in 3.1.0) has always included that,
but such a capability had never been implemented.  Wearing it didn't
confer fire resistance either--its definition doesn't bother to
specify a 'defend' attribute since the 'carry' one should cover that.

This adds carrying capability for damage types fire, cold, sleep,
disintegration, electrity, poison, acid, and petrification.  Fire is
still specified by the Mitre; none of the others are currently used.

Fixes #1362
2025-02-03 11:42:36 -08:00
nhmall
785f78c39b avoid "You fall down a deep shaft!" if flying down
Fixes #1371
2025-02-03 00:53:06 -05:00
nhkeni
cfe39900ca Demo for downloading formatted docs
Written for MacOS, more useful for Windows (but I'm not writing that).
2025-01-31 21:48:15 -05:00
Pasi Kallinen
c9abc92dd7 Fix lua.adoc 2025-01-24 19:04:17 +02:00
PatR
1acc272718 fix memory leak for knight's starting pony
makemon() has a 1% chance to bestow a worn saddle when creating any
rideable monster.  If that chance kicked in on a knight's starting
pony, an extra saddle would end up being created but not worn nor
in inventory nor on floor so not be freed when the game ended.

That 1% chance also overrode saddle suppression for pauper knights.
There wouldn't be any extra saddle but their pony could start with
one, against intent.

Have makedog() (which is only used for starting pet) tell makemon()
to suppress inventory when creating the initial pet.
2025-01-20 10:24:12 -08:00
nhmall
8ee014f5d1 update credits 2025-01-12 23:57:56 -05:00
Pasi Kallinen
256b820fe3 Fix impossible no_charge obj in untended shop
Sanity checking was complaining about a no_charge obj in untended shop.

Angry shopkeeper was accepting thrown items as no_charge objects:
To reproduce the impossible, kick down the shop door angering
the shopkeeper. While the shopkeeper is still in their shop,
throw an item they don't want into the shop. Wait for the shopkeeper
to get out of the shop.

Move the anger checking before the sell auto-accept code,
so the shopkeeper will charge for the object.
2025-01-08 12:59:08 +02:00
nhw_cron
9b71efe69e This is cron-daily v1-Apr-1-2024. 005manpages updated: recover.txt 2025-01-07 11:52:43 -05:00