Compare commits

...
1297 Commits
Author SHA1 Message Date
nhmall bad3e02246 follow-up comment bit 2026-04-23 17:31:20 -04:00
Patric Mueller b051ce8fd9 Add Unicode glyphs to Enhanced1 symset comments 2026-04-23 22:51:13 +02:00
Patric Mueller 34b85dbea6 Partly revert changes to Enhanced1 symset
Keep Enhanced1 as a conservative symset that should work everywhere.

Added description on the scope of the different Unicode symsets.
2026-04-23 22:51:13 +02:00
PatR b196863bbd reroll feedback
All the conduct feedback via "you ..." is directed at the character, so
seeing "you have rerolled your character 3 times" in conduct disclosure
looked strange.  Change that to "your character was rerolled 3 times."
2026-04-23 13:31:56 -07:00
nhmall 1556aec451 formatting (line length) bit 2026-04-23 15:28:20 -04:00
PatR 020604291d display buglet: newsym(0,0)
Starting a new game as a monk was calling newsym(0,0).

<0,0> is within array bounds but off the map.  Have newsym() check the
coordinates it receives.
2026-04-23 12:07:31 -07:00
nhmall 93ab8405d8 some further startup, option processing bits 2026-04-23 14:31:43 -04:00
Pasi Kallinen 21f0e18595 Fix visual reset in simple options
Switching symset in simple options menu did not reset the
map glyphs corectly.  Just call the same routine for resetting
visuals as in the #optionsfull command.
2026-04-23 15:51:36 +03:00
Barry Nelson 25849ac5a2 enhanced2 unicode symset w/ double line symbols
This is from PR #1503 on GitHub, contributed by @abcbarryn.

Closes #1503
2026-04-22 21:48:30 -04:00
Barry Nelson 09cb9e2425 Fixed corridor symbols in Enhanced1 PR #1503
This is the Enhanced1 symbols changes that were part of
GitHub pull request #1503
https://github.com/NetHack/NetHack/pull/1503

This is not the full pull request.
2026-04-22 21:33:50 -04:00
nhmall 965e1bf99d make program_state initialization a discrete step
Having it rolled into decl_globals_init() was
causing some early options to misbehave because
those early options were trying to use program_state
fields to determine their behavior, but decl_globals_init()
was resetting the program_state fields that were being used
to do that.
2026-04-22 11:15:19 -04:00
PatR 0a51a9656e address issue #1499 - saving grace vs traps
Issue reported by Shrigis1:  hero at or close to full HP stepped on
a not-yet-discovered rolling boulder trap and was killed; end-of-game
disclosure reported "You could have avoided a one-shot death via
saving-grace."

Originally, saving grace was completely hidden, so the disclosure
line wouldn't have been included.  Once disclosure was incorporated,
having saving grace not work for traps triggered by the hero seems
counter-intuitive, regardless of whether player is aware of the trap.

This makes saving grace apply to any damage applied by losehp().  The
original purpose of unexpectedly survivng by the skin of one's teeth
is still maintained.

Aside from having more of a chance of surviving via saving-grace,
the main difference is that some players might try for "survived by
saving-grace" as an unofficial conduct.  As long as we don't start
tracking that as a conduct, I don't think this is a big deal.

Fixes #1499
2026-04-21 20:55:39 -07:00
PatR 2b74dce88c still more thitu() and Half_physical_damage
Half_physical_damage does not reduce damage from acid.
2026-04-21 11:33:09 -07:00
nhmall 0ef54e364e more thitu() and Half_physical_damage
As commented in:
https://github.com/NetHack/NetHack/issues/1459#issuecomment-4280354364

This also fixes a minor typo in the related doc/fixes3-7-0.txt paragraph.
2026-04-21 05:40:52 -04:00
nhmall 32acb80174 resolve some valid warnings on Windows
../sys/windows/windmain.c:226:12: warning: address of array 'gc.chosen_windowtype' will always
      evaluate to 'true' [-Wpointer-bool-conversion]
  226 |     if (gc.chosen_windowtype && *gc.chosen_windowtype)

../sys/windows/consoletty.c:873:27: warning: address of array 'back->utf8str' will always evaluate
      to 'true' [-Wpointer-bool-conversion]
  873 |                 if (back->utf8str && front->utf8str
      |                     ~~~~~~^~~~~~~ ~~
../sys/windows/consoletty.c:873:45: warning: address of array 'front->utf8str' will always evaluate
      to 'true' [-Wpointer-bool-conversion]
  873 |                 if (back->utf8str && front->utf8str
      |                                   ~~ ~~~~~~~^~~~~~~
2026-04-21 05:13:46 -04:00
nhmall 0ca6e6f16f stray tabs 2026-04-20 21:04:22 -04:00
nhmall 7d377a0f02 clang detection in unix hints
Closes #1500 but it does apply the pull request.
Hopefully, this makes things a little clearer.
2026-04-20 20:47:59 -04:00
nhmall b5e6840bea vestigal line removed
Closes #1502
2026-04-20 10:31:32 -04:00
PatR 84c7e96644 fix issue #1459 - Half_physical_damage vs missiles
Issue reported by Tomsod nearly six months ago: missile damage against
hero was not honoring the Half_physical_damage attribute when hero had
that.

Fixes #1459
2026-04-18 19:22:07 -07:00
PatR 2b88cf0475 new options vs O
Change the classification of new weaponstatus, armorstatus, and
terrainstatus from 'OptS_Status' to 'OptS_Advanced' to keep the menu
for the 'O' command shorter.  Doesn't affect 'mO'.

Including them in 'O' might make more players notice them though.
2026-04-17 10:06:23 -07:00
St4ckC00ki3 ea6ae3359e Fix windows-port crash on startup when showvers option is enabled 2026-04-17 17:59:03 +08:00
nhmall 3d5b3e35ea Guidebook.txt update (from NetHack daily cron) 2026-04-16 22:34:24 -04:00
nhmall fd1b8e60f8 quiet a new warning that recently appeared
[warning]NetHack\src\hack.c(3223,16): Warning C4389: '!=': signed/unsigned mismatch
2026-04-16 19:57:02 -04:00
nhmall 47892c1f22 update tested versions of Visual Studio 2026-04-16 2026-04-16 19:46:46 -04:00
nhmall bf7ba34a1e Guidebook datestamp update 2026-04-16 19:31:12 -04:00
PatR 84ddf85cb4 new composite status conditions: weaponstatus,\
armorstatus, and terrainstatus

This adds three special status items to show at a glance what the hero
is wielding, wearing, and standing on.

Each of the three items has its own boolean option rather than try to
fix them in with the existing opttional status conditions.  After a
lot of testing, I think the weapon and armor ones will prove useful
but the terrain one probably won't be.

Presently it is implemented for tty and curses.  When I developed it
six years ago, it was also working for X11 but I'm not able to test
the resurrection of that part so have left it out.
2026-04-16 13:35:08 -07:00
Alex Smith 45e8305918 True rumor and oracularity update
This removes or updates several true rumors that have become
misleading or inaccurate due to changes to the mechanics they were
describing, and adds several new rumors describing mechanics that
are either new, or are intended to be a larger part of the game
than they were in previous versions.

More oracularities describing the new mechanics are needed, but I
haven't managed to get into the write frame of mind to write in the
Oracle's voice yet...
2026-04-14 20:35:40 +01:00
Alex Smith 620d889016 Correctly abbreviate a message to shrink executable size
No player-visible gameplay changes.
2026-04-14 17:53:58 +01:00
Alex Smith b67c624034 Vampires are not polymorphed by Vlad's throne
The throne was intended for one specific vampire, but the others are
"close enough" to not be warped into a different shape.
2026-04-14 17:48:49 +01:00
Alex Smith a5be241bd4 Fix polymorphing into a large monster while wearing unusual cloaks
Most cloaks have a clasp, but some don't, so they need different
messages (and occasionally different behaviour).
2026-04-14 17:42:03 +01:00
Alex Smith 89473216ae Iron footwear and traps balance fixes
Any sort of iron footwear now protects from traps, and polymorph
traps change one sort of iron footwear into a different sort of
iron footwear (removing any incentive to try to farm them, because
you will see both options very quickly).
2026-04-14 16:51:20 +01:00
Alex Smith acfbd6d0e4 Add rolling boulder traps in Sokoban to reduce wrist strain
When playtesting NetHack heavily, I observed that most of the time
it wasn't placing much strain on my wrists, but Sokoban was an
exception: travel, farmove, etc. can normally be used to avoid the
need to spam keys, but they don't work while pushing a boulder, and
the boulders often need to be pushed along precise routes, so you
have to tap out every movement. This becomes particularly straining
when pushing in the last few boulders, as you have to push them a
long way along the goal corridor.

This commit adds rolling boulder traps to Sokoban that will
automatically roll boulders along the goal corridor, meaning that
you don't have to push them there manually. This considerably
reduces the number of keystrokes needed to solve Sokoban, without
making any significant change to the difficulty of the levels.
Some of the designs had to change slightly in order to make room
for them, but not in a way that meaningfully changes the solution.
2026-04-14 12:47:13 +01:00
Alex Smith bc94d7a355 More interesting rolling boulder traps
Rolling boulder traps now react to having boulders pushed onto them;
the boulder will roll until reaching the trap's launch spot
(resetting the trap if the boulder was removed), or until it hits a
wall otherwise.

Because they can now be reset, they aren't removed when stepping on
them with a misplaced boulder (although no boulder moves unless
there's one on the appropriate spot).
2026-04-14 12:19:48 +01:00
Pasi Kallinen 10a47c0713 Remove unused curses define 2026-04-13 16:54:44 +03:00
nhmall 8c8121eb3c move a pair of functions from save.c to restore.c
A utility that links only with restore.o needs to find them.
2026-04-13 09:08:53 -04:00
nhmall efaabc3203 more storing only relative times in save & bones 2026-04-13 07:53:51 -04:00
nhmall 4bd3f8398e whitespace cleanup: tabs to spaces 2026-04-13 07:35:23 -04:00
nhmall 36c3f208a6 again store relative timestamps in save and bones 2026-04-13 07:32:54 -04:00
nhmall c249de0c2a timestamp change in save files requires EDITLEVEL bump 2026-04-13 07:11:47 -04:00
nhmall 4665b6c13c follow-up
staticfn define caused test to succeed when it shouldn't have
2026-04-13 06:47:10 -04:00
nhmall 337c5189dd store relative timestamps in save and bones 2026-04-13 06:39:54 -04:00
PatR 7ed50f6ef8 wand of stasis tweaks
When wand of stasis is zapped multiple times, keep the longest duration
rather than replace duration with each zap.

When current level is under the effect of a wand of stasis, have the
wizard-mode command #timeout say so.
2026-04-12 21:03:21 -07:00
Pasi Kallinen 8d6ab2f9ab Allow m-prefixing #annotate
This is the same as m-prefixing #overview
2026-04-12 19:55:12 +03:00
Pasi Kallinen 635dca05d5 Shapeshifters change shape less
Non-vampire shapeshifters were changing shape a lot; often you
could have a chameleon turning into a different monster each turn.

Now monster shape changing is actually their "special" power,
and it takes 3-12 turns until they can do it again.
2026-04-12 19:01:20 +03:00
Pasi Kallinen 26453eaea0 Allow polearming a monster in unlit space
... as long as you can see the monster, eg. via infravision
2026-04-12 15:54:18 +03:00
PatR c7ccd4ca5d add pet->droptime check to monster sanity check
I don't see where loading or saving bones makes any attempt to fix up
pet->droptime at all.
2026-04-11 17:35:35 -07:00
Pasi Kallinen 8cf6c62862 Don't put non-m-prefix command msg into history 2026-04-11 23:05:41 +03:00
nhmall 80cc5ecb29 some windows cleanup at end of game 2026-04-11 14:08:36 -04:00
Pasi Kallinen 9d27cfe8b8 Prevent selecting all options in #optionsfull menu
No-one ever intentionally selected all entries in the options
menu.  Prevent it from happening by accident.
2026-04-11 18:37:56 +03:00
nhmall f6e341546d thinko 2026-04-11 11:10:47 -04:00
nhmall f29cea4a35 another impossible() update for dog_eat() 2026-04-11 07:17:20 -04:00
nhmall 85f03deca9 refine a dog_eat impossible()
Have the impossible message indicate whether the pointed-to
edog struct itself is still intact (not overwritten somewhere,
such as misuse of a stale or bad pointer) versus the apport field
itself being assigned an out-of-whack value some place.
2026-04-11 06:37:10 -04:00
PatR b264e17cf2 fix use-after-free bug in curses shutdown
A year ago a use-free-bug was reported for curses.  I don't use ASAN
so haven't reproduced it, but I think this should fix it.

If the RIP window is deleted after the map window has gone away, the
code from commit 5e572d3d5f (post 3.6.7)
would execute and access the internals of the deleted map window.
2026-04-11 01:02:42 -07:00
nhmall 45b01cdb9a nomenclature of a couple of tasks in CI 2026-04-10 11:30:46 -04:00
nhmall e8290bc275 try testing a Windows 11 snapdragon build in CI 2026-04-10 11:14:22 -04:00
nhmall 3acb327115 resolve a warning on one platform 2026-04-10 10:53:53 -04:00
nhmall fffbf4c2e5 Windows option update for map_mode
Ensure preference_update() is called
2026-04-10 10:36:36 -04:00
Pasi Kallinen 9172b7eb09 Add tutorial and tips to Windows nethackrc template 2026-04-10 16:39:16 +03:00
nhmall 832db5b9e1 define TTY_PERM_INVENT in Windows console build 2026-04-10 09:26:24 -04:00
nhmall e005c26fbd another safestartup vestige 2026-04-10 09:24:10 -04:00
nhmall 4dd47db3ad yet more Windows startup; also safestartup vestige 2026-04-09 15:08:07 -04:00
nhmall 3b7c0e8a19 follow-up: more Windows startup 2026-04-09 14:14:49 -04:00
nhmall 335cd65d5a some further Windows startup tweaking 2026-04-09 14:04:28 -04:00
nhmall 699c31459b follow-up: fix placement location 2026-04-09 10:32:24 -04:00
nhmall 8b2b749f6f quiet a warning observed when compiling consoletty
The warning was observed during CI build:
[warning]NetHack\sys\windows\consoletty.c(2573,29): Warning C4127: conditional expression is constant
2026-04-09 10:28:52 -04:00
nhmall 4f5146306b follow-up: punctuation 2026-04-09 10:20:01 -04:00
nhmall 213400529a follow-up comment bit 2026-04-09 10:18:00 -04:00
nhmall 49cccb5a8d quiet a warning compiling sys/share/uudecode in recent compiler
../sys/share/uudecode.c: In function ‘main’:
../sys/share/uudecode.c:131:32: warning: format ‘%o’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘int *’ [-Wformat=]
  131 |     (void) sscanf(buf, "begin %o %s", &mode, dest);
      |                               ~^      ~~~~~
      |                                |      |
      |                                |      int *
      |                                unsigned int *
      |                               %o
2026-04-09 10:06:24 -04:00
nhmall f8fbd9848e a couple more minor startup tweaks 2026-04-08 10:32:29 -04:00
nhmall 0085feb56a follow-up: remove one unnecessary change 2026-04-07 14:29:58 -04:00
nhmall 8cbbb74f3b more early config file pass
Because some optlist entries were ignored in the early pass,
some non OPTIONS= lines in the config file were having issues
due to those options not being set.

Extend what is being disregarded in the early config file pass
to include other config file statements.
2026-04-07 14:22:07 -04:00
nhmall cf7a514596 consoletty.c bit
restrict a debugging line
2026-04-07 13:59:43 -04:00
nhmall fdbf84b9b7 remove some dead code 2026-04-06 13:17:32 -04:00
nhmall 8716d92280 objects.txt tile numbering
Closes #1496 reported by @horlogeislux
2026-04-06 12:38:25 -04:00
nhmall b2b2c3f6f2 remove extraneous line 2026-04-06 11:00:12 -04:00
Pasi Kallinen 190cbfa2b7 Fix segfault when binding keys in-game 2026-04-06 11:50:22 +03:00
nhmall 0a3b8a7b72 Makefile.nmake tweaking 2026-04-05 20:28:43 -04:00
nhw_cron 2790fa22b2 This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-04-05 13:40:19 -04:00
nhmall 1745d0bcce follow-up: cross compile for msdos 2026-04-05 13:36:06 -04:00
nhmall 6234e96b57 Change Windows startup - take 2
remove the safeproc pseudo-windowport routines from
almost a decade ago.

A very early pass is made through the config file,
seeking out just the interface-related OPTIONS=windowport
and OPTIONS=soundlib and ignoring all other options in the
config file during that early pass, so the windowport
can be activated without the NetHack core initialization
in place that some of the other rcfile OPTIONS require.

Bundles the existing rcfile processing code into rcfile().

New functions to control which rcfile options will be
disregarded in the early config file pass, and which will be
processed:

    set_all_options_disregarded();
    set_all_options_heeded();
    disregard_this_option(opt_xx);
    heed_this_option(opt_xx);

Windows calls rcfile_interface_options(), which is
a bundling of a series of function calls to achieve
the desired result.

    void
    rcfile_interface_options(void)
    {
        allopt_array_init();
        set_all_options_disregarded();
        heed_this_option(opt_windowtype);
        heed_this_option(opt_soundlib);
        rcfile();
        set_all_options_heeded();
        disregard_this_option(opt_windowtype);
        disregard_this_option(opt_soundlib);
    }
2026-04-05 13:11:14 -04:00
nhmall db1f230772 Revert "Change Windows startup"
This reverts commit acb85b18cf.

Some optlist issues arose on some platforms, but not all.
I need to investigate the cause of those.
2026-04-05 12:07:57 -04:00
nhmall acb85b18cf Change Windows startup
remove the safeproc pseudo-windowport routines from
almost a decade ago.

A very early pass is made through the config file,
seeking out just the interface-related OPTIONS=windowport
and OPTIONS=soundlib and ignoring all other options in the
config file during that early pass, so the windowport
can be activated without the NetHack core initialization
in place that some of the other rcfile OPTIONS require.

Bundles the existing rcfile processing code into rcfile().

New functions to control which rcfile options will be
disregarded in the early config file pass, and which will be
processed:

    set_all_options_disregarded();
    set_all_options_heeded();
    disregard_this_option(opt_xx);
    heed_this_option(opt_xx);

Windows calls rcfile_interface_options(), which is
a bundling of a series of function calls to achieve
the desired result.

    void
    rcfile_interface_options(void)
    {
        allopt_array_init();
        set_all_options_disregarded();
        heed_this_option(opt_windowtype);
        heed_this_option(opt_soundlib);
        rcfile();
        set_all_options_heeded();
        disregard_this_option(opt_windowtype);
        disregard_this_option(opt_soundlib);
    }
2026-04-05 11:37:20 -04:00
nhmall 92340a6827 consolidate some arg processing
Unix and Windows had diverged significantly for command line
options handling.

This:
   1. uses the the Unix processing as a baseline.
   2. consolidates the code in earlyarg.c, where it can
      be a common copy to be shared.
   3. start converting the Windows command line argument
      processing to the Unix code that now resides in earlyarg.c.
2026-04-04 13:44:23 -04:00
Pasi Kallinen 9c8c17b70c Tweak the blessed potion of see invisible
Blessed potion guarantees the intrinsic, if you're
invisible and can see invisible before quaffing.
2026-04-04 17:58:30 +03:00
Pasi Kallinen 87b3549134 Blessed potion of see invisible
Blessed potion of see invisible was guaranteed to give see invisible
intrinsic, making it far too easy to acquire.  It now has 1/10 chance
of giving it permanently, somewhat similarly to potion of invisibility.
2026-04-04 17:01:58 +03:00
Pasi Kallinen c5efbf6cf7 Split level rnd mon generation into separate function 2026-04-04 16:08:58 +03:00
Pasi Kallinen 5f1163c11a Change the tips internal data struct
Previously adding any new tips invalidated saves; now you can have
up to the number of bits in a long without change in savefile.

Invalidates saves.
2026-04-04 15:39:46 +03:00
nhmall 7120a7190e some more discarded-qualifiers fixes 2026-04-04 07:52:06 -04:00
PatR 9bdc41b263 more mhitu.c style/formatting 2026-04-03 08:37:14 -07:00
Pasi Kallinen 8c55e7df1c Code style nit 2026-04-03 12:59:09 +03:00
Pasi Kallinen b2a80ab87a Prevent phaseable monster hiding deep in undiggable walls
The outer edge of a random dungeon level can have undiggable
walls.  Phaseable monsters, such as earth elementals, could
hide deep inside that boundary.  Turn the walls beyond the
first layer of non-diggable walls also non-phaseable.
2026-04-02 15:43:13 +03:00
Pasi Kallinen fc6c7d70be Give spellcast attack to monster priest and wizard
Acolytes grow up to priests, apprentices to wizards, but they
did not cast spells after they grew up.  Give the monster priests
and wizards the same spellcasting attack as all the other
priest and wizard -type monsters.

This lack of magical ability goes back at least to 3.3.1;
I didn't bother checking back further.
2026-04-02 12:28:00 +03:00
nhmall 3b4d4cd261 expand range of oc_weight 2026-04-01 12:56:37 -04:00
Pasi Kallinen 542d1db5f4 Another fix for #K4317 - monster grudge
Undead monsters created by the level creation routine do not grudge
other (zombifiable) monsters created during the level creation.

This of course doesn't prevent the grudge happening with monsters
created during gameplay.

Invalidates saves and bones.
2026-04-01 19:24:43 +03:00
nhw_cron d911e4c4d3 This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-04-01 11:02:46 -04:00
nhmall e377591240 follow-up: avoid issue with onefile concatenation 2026-04-01 10:59:22 -04:00
nhmall ab459265b0 top line fixup 2026-04-01 09:09:39 -04:00
nhmall 396a3735ca follow-up for Xcode project 2026-04-01 08:48:05 -04:00
nhmall 686618f34d move early arg and enum dump processing to own file 2026-04-01 08:32:13 -04:00
Pasi Kallinen 3917f5493d More mcastu code reorg
Instead of using two separate functions with switch-cases for
wizard and clerical spell lists, define the spell lists
as arrays and use a single function to pick a spell
from the lists.

Adds levels to the monster spells, using the switch-case values,
with some minor fudging.
2026-04-01 13:17:09 +03:00
PatR c8e97527f1 Schroedinger's live cat
Give a little experience when releasing live housecat from Schroedinger's
Box, similar to recent change giving experience when opening the Box
produces a dead cat.
2026-03-31 20:48:01 -07:00
nhmall aa25005cf0 whitespace cleanup on recent file
replace leading tab with spaces to match include style
2026-03-31 12:57:41 -04:00
nhmall 90db8d7e2d clear up some warnings appearing with gcc 15.2.0
allmain.c: In function ‘debug_fields’:
allmain.c:1133:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1133 |     while ((op = strchr(opts, ',')) != 0) {
      |                ^
cfgfiles.c: In function ‘find_optparam’:
cfgfiles.c:590:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  590 |     bufp = strchr(buf, '=');
      |          ^
cfgfiles.c:591:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  591 |     altp = strchr(buf, ':');
      |          ^
end.c: In function ‘should_query_disclose_option’:
end.c:482:14: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  482 |     if ((dop = strchr(disclosure_options, category)) != 0) {
      |              ^
invent.c: In function ‘loot_classify’:
invent.c:175:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  175 |     p = strchr(classorder, oclass);
      |       ^
o_init.c: In function ‘dodiscovered’:
o_init.c:774:33: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  774 |     if (!flags.discosort || !(p = strchr(disco_order_let, flags.discosort)))
      |                                 ^
o_init.c: In function ‘doclassdisco’:
o_init.c:907:33: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  907 |     if (!flags.discosort || !(p = strchr(disco_order_let, flags.discosort)))
      |                                 ^
objnam.c: In function ‘the’:
objnam.c:2200:19: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2200 |         if (((tmp = strrchr(str, ' ')) != 0 || (tmp = strrchr(str, '-')) != 0)
      |                   ^
objnam.c:2200:53: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2200 |         if (((tmp = strrchr(str, ' ')) != 0 || (tmp = strrchr(str, '-')) != 0)
      |                                                     ^
options.c: In function ‘optfn_disclose’:
options.c:1529:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1529 |             dop = strchr(disclosure_options, c);
      |                 ^
pager.c: In function ‘add_cmap_descr’:
pager.c:1212:28: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1212 |                     || ((p = strchr(x_str, ' ')) != 0 && !strcmpi(p, " ice"))
      |                            ^
2026-03-31 10:16:28 -04:00
Pasi Kallinen 9bf90ee07f Replace magic number with define 2026-03-30 19:07:18 +03:00
Pasi Kallinen f68f15e3b5 Simplify some special level lua
These were generated by a script that converted the des-file
format to lua.
2026-03-30 18:27:10 +03:00
Pasi Kallinen f4173adc88 Use define for player name length in botl
This defines the cut-off how many characters of the player's name
is shown in the bottom status line.
Also increase the limit from 10 characters to 16.
2026-03-30 16:41:37 +03:00
Pasi Kallinen 9fba4af323 Status hilite menu retry limit
Fuzzer got stuck here for a very long time, so bail out
from the status hilite menu after few failed tries.
2026-03-30 13:29:12 +03:00
nhmall 12663473ab update tested versions of Visual Studio 2026-03-29 2026-03-29 20:20:56 -04:00
PatR 1813e27098 farlook of quest stairs down
When access to the quest isn't available yet, describe the stairs down
as "blocked staircase down" instead of the usual "staircase down".
Applies to mimics posing as stairs too.

Does not apply to the stairs when standing on them and using lookhere.

I was going to use "locked staircase down" but that would imply that a
key or unlocking magic could be applicable.
2026-03-29 14:02:21 -07:00
Pasi Kallinen e3e01267aa Debug panic when level has too many (sub)rooms 2026-03-29 18:47:55 +03:00
nhmall 5d814053a1 some outdated cleanup outdated/sys/windows 2026-03-27 06:59:49 -04:00
PatR f49ac037f9 release wish history memory
The memory leak only happened at end of game so wasn't a big deal.
2026-03-25 15:54:44 -07:00
nhw_cron d939238ea6 This is cron-daily v1-Jan-12-2026. 005guidebook updated: doc/Guidebook.txt 2026-03-25 15:26:08 -04:00
PatR 11f27226cb 'pauper' documentation
The LaTeX Guidebook has been updated but not tested.  It's unlikely that
this small change has introduced any problems though.
2026-03-25 11:18:15 -07:00
nhw_cron 7c9b4b9595 This is cron-daily v1-Jan-12-2026. 005guidebook updated: doc/Guidebook.txt 2026-03-25 09:10:17 -04:00
nhmall b58d2d4096 try to reduce some Amiga cross-compile warnings 2026-03-25 08:48:14 -04:00
nhmall 3c89dc2387 Guidebook date stamp to reflect most recent update 2026-03-25 08:06:12 -04:00
Pasi Kallinen f8bd79354c Add a history menu for wizwish
Use the 'm' Prefix to make wizwish show the history menu.
Also entries wished via WIZKIT are added to the history.

While debugging, I often need to wish the same thing multiple
times, and typing or pasting it with mouse is annoying...
2026-03-25 13:46:07 +02:00
Pasi Kallinen 41b2087436 Hero has a small chance of catching items thrown at them 2026-03-25 09:35:39 +02:00
nhw_cron 0f461df338 This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-03-24 12:42:07 -04:00
nhmall aac60db8d6 update Cross-compiling for Amiga steps 2026-03-24 11:46:07 -04:00
Pasi Kallinen d78af5cec7 Add monster spell header file mcastu.h
Move the monster spell definitions there, and use hackery
(similar to objects.h) to generate enum and data from
the header file.

I have not tested Windows, VMS, or Amiga builds.
2026-03-24 17:26:24 +02:00
nhmall d929adc85c warning fix in sp_lev.c
In function 'create_monster',
    inlined from 'lspo_monster' at sp_lev.c:3385:5:
sp_lev.c:2169:32: warning: 'tmpmons.m_lev_adj' may be used uninitialized [-Wmaybe-uninitialized]
 2169 |             if (mtmp->m_lev + m->m_lev_adj > 49)
      |                               ~^~~~~~~~~~~
sp_lev.c: In function 'lspo_monster':
sp_lev.c:3217:13: note: 'tmpmons.m_lev_adj' was declared here
 3217 |     monster tmpmons;
      |             ^~~~~~~
2026-03-24 10:05:48 -04:00
nhmall 39a4111104 Merge branch 'amiga-port' of https://github.com/ingpaschke/NetHack into NetHack-3.7 2026-03-24 07:53:39 -04:00
nhmall 4991339655 don't abort clean if target cross-compile directory isn't there 2026-03-24 07:49:38 -04:00
Ingo Paschke ced24f6fc9 Remove dead -DLUA_32BITS=1 flag
luaconf.h hardcodes #define LUA_32BITS 0 which overrides the
command-line flag. m68k-amigaos-gcc supports long long so 32-bit
mode is not needed anyway.
2026-03-24 12:49:14 +01:00
Ingo Paschke a398a9bdc7 Use NetHack's util/uudecode instead of system uudecode 2026-03-24 12:49:14 +01:00
nhw_cron ab04f5455d This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-03-24 07:38:08 -04:00
nhmall 7f8f7c54dc Files identification update 2026-03-24 07:13:04 -04:00
nhw_cron 875efba210 This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-03-24 07:01:58 -04:00
nhmall 507f526b43 remove duplicate entry in .gitignore 2026-03-24 05:48:51 -04:00
nhmall 14c5f318e1 Add a fixes3-7-0.txt entry for Amiga build pr1494
Build instructions in sys/amiga/README.amiga

The Amiga cross-compile support makes the following file changes to
the repository:

 rename {outdated/include => include}/amiconf.h (96%)
 create mode 100644 sys/amiga/README.amiga
 rename {outdated/sys => sys}/amiga/amidos.c (91%)
 rename {outdated/sys => sys}/amiga/amidos.p (100%)
 rename {outdated/sys => sys}/amiga/amifont.uu (100%)
 rename {outdated/sys => sys}/amiga/amifont8.uu (100%)
 rename {outdated/sys => sys}/amiga/amigst.c (100%)
 rename {outdated/sys => sys}/amiga/amii.hlp (100%)
 rename {outdated/sys => sys}/amiga/amimenu.c (100%)
 rename {outdated/sys => sys}/amiga/amirip.c (93%)
 rename {outdated/sys => sys}/amiga/amistack.c (55%)
 rename {outdated/sys => sys}/amiga/amitty.c (97%)
 rename {outdated/sys => sys}/amiga/amiwind.c (90%)
 rename {outdated/sys => sys}/amiga/amiwind.p (100%)
 create mode 100644 sys/amiga/bmp2iff_host.c
 rename {outdated/sys => sys}/amiga/clipwin.c (100%)
 rename {outdated/sys => sys}/amiga/colorwin.c (100%)
 rename {outdated/sys => sys}/amiga/grave16.xpm (100%)
 create mode 100644 sys/amiga/nethack.cnf
 rename {outdated/sys => sys}/amiga/winamenu.c (94%)
 rename {outdated/sys => sys}/amiga/winami.c (94%)
 rename {outdated/sys => sys}/amiga/winami.p (87%)
 rename {outdated/sys => sys}/amiga/winchar.c (78%)
 rename {outdated/sys => sys}/amiga/windefs.h (98%)
 rename {outdated/sys => sys}/amiga/winext.h (100%)
 rename {outdated/sys => sys}/amiga/winfuncs.c (86%)
 rename {outdated/sys => sys}/amiga/winkey.c (89%)
 rename {outdated/sys => sys}/amiga/winproto.h (88%)
 rename {outdated/sys => sys}/amiga/winreq.c (95%)
 rename {outdated/sys => sys}/amiga/winstr.c (95%)
 create mode 100644 sys/amiga/xpm2iff_host.c
2026-03-24 05:43:46 -04:00
nhmall aa90cd5cd8 Merge branch 'amiga-port' of https://github.com/ingpaschke/NetHack into NetHack-3.7 2026-03-24 05:37:17 -04:00
Ingo Paschke 2979030af1 Use NetHack's util/uudecode instead of system uudecode 2026-03-24 02:37:02 +01:00
Ingo Paschke c5dfd1fc5c Fetch BSD regex from GitHub at build time
Replace bundled Spencer regex with a fetch-regex build step that
clones https://github.com/garyhouston/regex.git, generates the
required .ih and regex.h headers via mkh, and copies the result
into sys/amiga/regex/.

Usage: make CROSS_TO_AMIGA=1 fetch-regex

The fetched sources are not tracked in git.
2026-03-24 01:21:00 +01:00
Ingo Paschke cb0b11be11 Add portable utilities for creating tiles, add AmigaFont to symbols
- bmp2iff_host: convert nhtiles.bmp to Amiga IFF tile files. Uses
  the AMIV UI palette in pens 0-15, remaining pens filled with tile
  colors sorted by frequency.
  Usage: bmp2iff_host -planes N input.bmp output.iff

- xpm2iff_host: convert XPM to IFF for tomb.iff (RIP screen).
  Adapted from xpm2iff.c, Copyright (c) 1995 Gregg Wonderly.

- Auto-select tiles32.iff (5 planes) or tiles16.iff (4 planes)
  based on screen color depth at runtime.

- Fix NO_GLYPH in amiv_lprint_glyph: return early to prevent
  blitting with uninitialised data (caused black spots).

- Add AmigaFont symbol set to dat/symbols for AMII text mode.
2026-03-23 21:11:56 +01:00
Ingo Paschke cee390482c Add BSD POSIX regex for Amiga
Add Henry Spencer's BSD regex implementation (from ixemul) to provide
POSIX regular expressions for the Amiga port, enabling menu coloring
and config file pattern matching.

Copyright (c) 1992 Henry Spencer, The Regents of the University of
California. BSD license.
2026-03-23 20:48:28 +01:00
Ingo Paschke 2d597cb9fa Revive Amiga port for NetHack 3.7
Update the Amiga Intuition window port (AMII/AMIV) for the 3.7
window_procs API. Key changes:

- Update all window function signatures for 3.7
- Add assembly trampolines for AmigaOS register-based callbacks
- Convert all K&R function definitions to C99
- Add cross-compilation build system (cross-pre1/pre2/post.370)
  using bebbo's m68k-amigaos-gcc with -noixemul -std=gnu17 -m68000
- Clipping fixes: viewport centering, simplified ScrollRaster,
  duplicate Ctrl-R suppression, glyph buffer invalidation
- Add menucolor support in menu rendering
- Move native txt2iff.c and xpm2iff.c to outdated/
- Add nethack.cnf and README.amiga
2026-03-23 20:48:06 +01:00
Ingo Paschke 7b89255ea8 Move Amiga port files from outdated/ to sys/amiga/
Move the active Amiga source files back into their proper locations.
Legacy native build files (Makefile.ami, Build.ami, etc.) remain
in outdated/ as they are not used by the cross-compilation build.
2026-03-23 20:46:56 +01:00
Ingo Paschke 1ca15d99ff Fix clipping: move cliparound after vision_recalc
cliparound() was called before rhack(), triggering a map redraw with
stale vision data followed by a second correct redraw. Move it after
vision_recalc() so the map is redrawn once with correct data.
2026-03-23 20:46:31 +01:00
Ingo Paschke e07eb1a550 Fix vision: remove NO_MACRO_CPATH
The non-macro q_path() function wrappers in vision.c pass the first
two arguments in the wrong order to the _q*_path() functions, swapping
rows and columns. This causes the Bresenham line-of-sight code to use
column values as row indices into viz_clear_rows[ROWNO], producing
out-of-bounds access and infinite loops.

NO_MACRO_CPATH selects these broken function wrappers. It was only
defined for Amiga (in config1.h), so the bug never triggered on other
platforms. Remove the define to use the correct macro versions.
2026-03-23 20:46:08 +01:00
Pasi Kallinen d80e194735 Split mcast_spell into separate functions 2026-03-23 14:51:48 +02:00
Pasi Kallinen c0f5d2dd92 Allow monster level adjustments in special levels
Add a new parameter to des.monster, m_lev_adj, which is a level
adjustment for the monster.  This only applies to the monster's
level, so basically only affects the spellcasting, it does not
change the monster's hit die or inventory.

Change one of the shamans in Orctown to be 3 levels higher.
2026-03-23 12:51:50 +02:00
nhmall 1ba9be09fa pre-C23 build fix
Prior to C23, a statement is required after a label.
2026-03-23 06:42:11 -04:00
Pasi Kallinen d6cbaca654 Reorganize mcastu code
Merge the two different enums, so all monster spells are in one
list.  This should have no functional difference, but cleans up
the code a bit.
2026-03-23 11:42:54 +02:00
PatR 10eedbe2f0 fix #S15496 - #chronicle oversight
Add a livelog/#chronicle message for quest leader opening the quest.

A similar message for being expelled doesn't seem possible to be
triggered.

Log the initial visit to each level in the quest branch.  They record
when the hero actually visits the quest levels, beyond the new one
about permission to do the quest.
2026-03-22 22:01:40 -07:00
nhmall e94a2f2bf2 doc/Guidebook.txt update Mar03-2026 2026-03-22 11:37:07 -04:00
nhmall f9cebc5890 avoid a warning with Xcode build 2026-03-22 11:33:26 -04:00
nhmall 8ee179a594 Guidebook timestamp to reflect the most recent update 2026-03-22 09:30:16 -04:00
nhmall 33b24fbd13 update Xcode project to reflect recent file addition 2026-03-21 18:43:04 -04:00
nhw_cron dffb40c0e7 This is cron-daily v1-Jan-12-2026. 005guidebook updated: doc/Guidebook.txt 2026-03-21 18:01:37 -04:00
Pasi Kallinen 8e4c7f9fb5 Change some command keys
Change 'v' from #versionshort to #chronicle.
Change 'V' from #history to #versionshort.
History can still be accessed either directly with the extended command,
or via the help menu.
Versionshort now accepts the m-prefix, and then shows the longer version.
2026-03-21 17:56:37 +02:00
nhmall 1eadfa962d don't include size_t * and time_t * in _Generic for now
There are behavior differences with macOS and other plaforms that
would need to be addressed if they were included.
2026-03-21 11:11:28 -04:00
Pasi Kallinen 9fc1514253 Amulet of magical breathing increases energy regen
Normally energy regen is 1d2 or 1d3, so wearing the amulet increases
that to 1d4 or 1d5.  The only way to get energy regeneration is via
The Eye of the Aethiopica, so you cannot have both at the same time.
2026-03-21 13:20:14 +02:00
Pasi Kallinen 63a78edcfa Add toggle extended command
Allows the user to configure a key binding to toggle any boolean
option, for example:

BIND=':toggle(price_quotes)
BIND=v:toggle(autodig)

The option must be settable in-game.
2026-03-21 12:17:37 +02:00
Alex Smith 62a50413d3 New debug command #wizobjprobs for listing item probabilities
As of the change to allow for item probabilities that don't add up
to 1000, it's become a little difficult to figure out the exact
probabilities from the source code, which makes it hard to balance
item generation. Adding a tool to list the probabilities helps.

Part of the problem is that changing an item's probability without
balancing it elsewhere is usually wrong: doing that would in effect
take the probability equally from (or add the probability equally
to) all other items in the class, which might break the balancing
of those items due to the probability change.

As such, it is usually better to make an intentional decision about
which items should be less and which items should be more likely to
generate, then change them in a balancing way (meaning that the
probabilities of objects that weren't intentionally changed remain
unchanged). Doing a complex such change makes arithmetic errors
fairly likely, though, so it's useful to have a command that verifies
that it's been done correctly.

This command is primarily intended as a development aid, so it's
included only in debug builds and pre-release builds (the same as
other similar commands like #wizmondiff).
2026-03-21 05:05:48 +00:00
Alex Smith 26fd5e7d73 Armor probability tweaks
Armor is now slightly more likely to generate outside Gehennom (at
the expense of gems that generate via random generation rather than
mineralisation or level rules).

Basic nonmagical armor (especially body armor) has had its generation
probabilities reduced *relative to other armor*, but outside
Gehennom, it is no less likely to generate (because armor in general
is now more likely to generate outside Gehennom). It is slightly less
likely to generate in Gehennom (but isn't typically needed in
quantity there).

Armor that has extrinsics is more likely to generate, both due to
having increased probability relative to other armor, and due to the
increased proportion of generated items being armor: this is the
primary goal of this change.

The intention behind this change is to increase the chance that
players naturally find useful armor (especially armor that they might
not have been planning to use, but that they can adapt their strategy
to make use of), rather than needing to wish for it: the chance of
finding useful armor is higher both in the Dungeons (due to the
increased probability) and in Gehennom (because it is more biased
towards armor that might be useful at that stage of the game).  In
practice, in 3.6.x (prior to this change and to wishing changes), it
was quite common for players to wish up an entire set of armor at the
Castle, ignoring almost everything they'd found so far that game; I'm
hoping this change encourages more wish variety rather than spending
the majority of wishes on armor.
2026-03-21 04:52:51 +00:00
Pasi Kallinen f85b5b1c9d Fix segfaults from the key binds change
Should've checked rest_on_space behaviour ...
2026-03-20 22:49:29 +02:00
Pasi Kallinen c595f241e6 Change key binds from array to linked list
Key bindings were stored as a fixed-size array, indexed by the input
character, pointing to the extended commands.  This changes that into
a linked list of an intermediary struct Cmd_bind, storing the input key
and the pointer to the command.

This is just code cleanup for future enhancements, and should have
no effect on gameplay.
2026-03-20 19:57:44 +02:00
nhmall 044a229467 whitespace cleanup: tabs to spaces in sys 2026-03-19 20:33:03 -04:00
nhmall b33b09bcac whitespace cleanup: tabs to spaces 2026-03-19 20:22:24 -04:00
PatR e38377e899 some reformatting for read.c 2026-03-19 16:29:11 -07:00
PatR aafc414a9f remove inaccurate comment
Floating eyes aren't the only monsters that pass the is_floater() test.
Other 'e's aned 'y's do too.
2026-03-19 15:55:08 -07:00
nhw_cron 6cd742632c This is cron-daily v1-Jan-12-2026. 005guidebook updated: doc/Guidebook.txt 2026-03-19 11:36:11 -04:00
nhmall e21995a36d follow-up bit (from testing) 2026-03-19 10:10:59 -04:00
nhmall 9aa2f61058 limits.h follow-up 2026-03-19 10:02:10 -04:00
nhmall 87ab214229 allow some additional values for compiler testing
Allow compiler.370 to recognize a couple of additional values on the Make command line.
.
2026-03-19 09:54:19 -04:00
nhmall e8363ae23d include limits.h in cstd.h
Ensure the standard C99 values are available to the NetHack code base, so that
code/macros to accomplish essentially the same thing are not necessary.

    CHAR_BIT        Defines the number of bits in a byte.
    SCHAR_MIN       Defines the minimum value for a signed char.
    SCHAR_MAX       Defines the maximum value for a signed char.
    UCHAR_MAX       Defines the maximum value for an unsigned char.
    CHAR_MIN        Defines the minimum value for type char and its value will be equal to SCHAR_MIN if char represents negative values, otherwise zero.
    CHAR_MAX        Defines the value for type char and its value will be equal to SCHAR_MAX if char represents negative values, otherwise UCHAR_MAX.
    MB_LEN_MAX      Defines the maximum number of bytes in a multi-byte character.
    SHRT_MIN        Defines the minimum value for a short int.
    SHRT_MAX        Defines the maximum value for a short int.
    USHRT_MAX       Defines the maximum value for an unsigned short int.
    INT_MIN         Defines the minimum value for an int.
    INT_MAX         Defines the maximum value for an int.
    UINT_MAX        Defines the maximum value for an unsigned int.
    LONG_MIN        Defines the minimum value for a long int.
    LONG_MAX        Defines the maximum value for a long int.
    ULONG_MAX       Defines the maximum value for an unsigned long int.
2026-03-19 09:48:29 -04:00
Alex Smith e6d44c68e8 Overhaul of priest donations
The old code had two main problems: a) it was very difficult for
unspoiled players to figure out how it worked (because donating too
much got you a bad result, and the exact amount you needed depended
on magic numbers that weren't stated in game, and because you had to
hide your visible gold to get a good result); b) for players who
knew the mechanics, it was somewhat exploitable and also somewhat
tedious to make use of (due to needing to hide visible gold before
donating).

This change preserves the spirit of the previous code whilst making
things more transparent for new players and less tedious for existing
players: the donation amounts for the various effects are still
roughly the same (but randomized), but the amounts you need to donate
for clairvoyance and for protection are explicitly stated (and as
before, the alignment reset is done by donating an unnecessarily
large amount and isn't explicitly stated as an option).  If you have
a lot of visible gold, you still need to donate a sizeable proportion
of it to get a useful effect, but now you get a larger reward to
compensate for the larger donation (to the extent that doing this
gives comparable results to doing it as a series of small donations,
removing the incentive to hide your gold before donating).

There's also something here for those players who like to squeeze
every last point of optimality out of a game: the "obvious" donation
strategy gives decent results, but players who are really willing to
dig into the mechanics may be able to find a way to get slightly
better results on average (which if I've balanced this correctly,
will lead to a very long and complicated spoiler).

One other change is that this is now based on your peak rather than
current level, to fix an exploit in which the character was drained
down to level 1 to donate a very large amount of gold (improving by
20 AC points) and then immediately restored back to the previous
experience level using a blessed potion of restore ablity.

This breaks save compatibility, but is being pushed together with
other save-breaking changes to avoid the need for multiple bumps to
EDITLEVEL.
2026-03-19 05:10:09 +00:00
Alex Smith 4d043a6f9c Monsters require experience using wands before they can hit with them
It takes time for an early-game monster to acclimatize itself to the
power of an attack wand: in much the same way as a nervous human may
quite possibly miss with their first attempt to use a gun in combat,
an early-game monster will always miss on its first use of an attack
wand (but from then on will understand how they work and get over
their nerves, and will hit as normal).

This is a balance change based on observed results from tournaments:
guarding against deaths to early-game attack wands requires an
unusually cautious playstyle which isn't much fun (and might not
always be possible even for the best players), so it is quite common
for them to be the cause of random deaths that it wasn't worth trying
to avoid. Although trying to dodge a monster who found an attack wand
is fun, you only actually get that fun if something makes you aware
of the danger: the monster missing with the wand is a clear way to
demonstrate the danger and let the player know that now is the right
time to take precautions.

This change could theoretically have broken saves, but probably
doesn't due to there having been a spare bit in struct monst.  Just
in case, it is being pushed together with other save-breaking changes
to avoid the need for multiple bumps to EDITLEVEL.
2026-03-19 03:55:10 +00:00
Alex Smith 07fc4904c6 Add a new wand, the wand of stasis
A wand of stasis prevents teleportation (even in some cases where
it would normally not be prevented, e.g. the hero teleporting a
monster, or covetous monsters teleporting). This is intended to
provide an alternative tactic against covetous monsters (and their
AI has been adjusted to handle being under a stasis effect), but
might also be useful in other situations. It does not prevent
teleportation of objects, only the hero / monsters, and does not
at present prevent level teleportation (although I'm not sure about
this and it might well change in the future).

This breaks save compatibility, but is being pushed together with
other save-breaking changes to avoid the need for multiple bumps to
EDITLEVEL.
2026-03-19 01:16:30 +00:00
Alex Smith 6886b199be Teleport traps don't teleport you on no-teleport levels
In previous versions of NetHack, this wasn't a problem because
teleport traps didn't *generate* on such levels, but more recent
changes have made this situation possible (e.g. a demon lord
migrates to a Gehennom filler level that already had a teleport
trap on it).

This change causes a "wrenching sensation", like stepping onto a
teleport trap with magic resistance does.
2026-03-19 01:01:46 +00:00
nhmall 85e3d721fb Increase the value range of corpse weights
This breaks save compatibility, but is being pushed together with
other save-breaking changes to avoid the need for multiple bumps to
EDITLEVEL.
2026-03-18 23:32:26 +00:00
Alex Smith 5d3a1e684b Add shields of shock resistance and of drain resistance
These both appear as "wooden shield" when unidentified; so does the
small shield.
2026-03-18 23:27:54 +00:00
Alex Smith ea023677c7 Work around MSVC false positive warning in price-tracking code
The MSVC warning assumes that any attempt to write - followed by an
unsigned number is an attempt to create a negative number (which
produces the wrong data type if you type, e.g., -2147483648).
However, it's also warning when an explicit U is given, e.g. in -1UL,
which is clearly not an attempt to express a negative value.

Suppress the warning by rewriting the number in question as (0UL-1UL)
with a binary rather than unary minus.
2026-03-18 23:27:54 +00:00
Alex Smith 4fae45220e Remember price quotes that have been seen for types of item
These are displayed in discoveries, and a new 'price_quotes' option
allows them to be displayed for un-IDed objects in other contexts
too (the idea is that you turn on the option while identifying
objects and off for general play).

Invalidates existing save files.
2026-03-18 21:08:22 +00:00
Pasi Kallinen 9877e52025 Ring of stealth prevents hero from leaving tracks 2026-03-18 18:04:33 +02:00
Pasi Kallinen 18cb293766 Replace magic number with define 2026-03-18 17:12:01 +02:00
nhmall 8d33cafb3e update tested versions of Visual Studio 2026-03-17 2026-03-17 14:25:24 -04:00
Pasi Kallinen 1c5cf5382b Hellfill variance 2026-03-17 17:29:43 +02:00
Pasi Kallinen 66e7123678 Categorize more commands as general commands
"general commands" tend to be ones which take no game time,
or are non-diegetic.
2026-03-17 13:38:12 +02:00
Alex Smith b6df17f342 Iron shoes protect / partially protect against certain trap types 2026-03-17 00:05:16 +00:00
Pasi Kallinen 13e7d21b93 Replace magic number with define 2026-03-16 15:36:23 +02:00
Pasi Kallinen 619de1ec0e Make monster destroy armor -spell erode armor first
Instead of outright destroying the armor, the spell will instead
first erode the armor.  The spell hits 2-4 times, so if it hits
the same armor 4 times, it will get destroyed.  This does not
hit erodeproof armor.

Also change the scroll of destroy armor, so that blessed one will
destroy a cursed armor, if hero is only wearing that.
2026-03-16 11:24:19 +02:00
PatR b70da87d3e 'onefile' tidbit 2026-03-12 13:17:11 -07:00
PatR c30eea477d Shroedinger's dead cat
Give experience to the hero if opening Shroedinger's Box reveals a cat
corpse rather than releasing a live cat.

It feels a bit odd to assess a bonus rather than a penalty.
2026-03-12 13:12:42 -07:00
nhmall 7cff1696b7 update tested versions of Visual Studio 2026-03-12 2026-03-12 09:28:37 -04:00
Pasi Kallinen 226157004b Make migratemons ignore debug_mongen
Same as wizgenesis, migratemons should create monsters even
when random monster generation is disabled.
2026-03-11 17:35:23 +02:00
PatR d6bff63025 X11 comment thinko
Fix a phrasing mistake that was introduced when unmatched apostrophies
were removed from the sample NetHack.ad file.
2026-03-08 03:17:42 -07:00
PatR be0bed8f3c rephrase comment
Triviality: add a couple of commas so that a comment won't be misread.
2026-03-08 03:14:29 -07:00
PatR c47990d750 fixes3-7-0.txt typo 2026-03-06 13:43:51 -08:00
PatR 98da3a3db6 fix drawbridge + place_monster impossible
Reported via email direct to devteam.

If a monster killed by a drawbridge survives via life-saving and a
second monster also survives (in the reported case, it was a xorn
who will always survive bridge destruction), the second monster will
be placed at the same spot.  That triggers an impossible
"placing <2nd mon> over <1st mon>, at <x,y>, mstates 0 0 at Dlvl N?".
If the first monster survives due to pass_walls rather than due to
life-saving and a second survives too, one of them should end up being
moved to a different spot and not trigger the impossible (not verified
via testing).

When a monster survives via life-saving, kill it again even if there
is no second monster involved.
2026-03-05 12:57:20 -08:00
nhkeni 33a6a9a765 add optionally-built file nhlua to .gitignore 2026-03-04 16:52:04 -05:00
nhmall 7261c848c7 update tested versions of Visual Studio 2026-03-01 2026-03-01 09:25:55 -05:00
PatR ef6e2a9624 fix #15306b - vision blocking sanity check
Update vision affected by invisible mimics if polymorphing hero gains
or loses See_invisibls.  Avoids triggering a sanity_check impossisble
if an invisible mimic is mimicking a boulder.
2026-02-25 18:30:11 -08:00
PatR 398681fd18 fix? #S15277 - Engulfer gets placed over itself
Bug report was that engulfer killed hero who was life-saved and expelled
onto a rolling boulder trap which resulted in the death of a bystanding
monster.  That triggered an impossible about placing the engulfer onto
the map at an already occupied spot (containing the engulfer itself)
while dealing with the dead bystander.

This removes the code in mon_leaving_level() that was putting the
engulfer on the map.  I'm no longer able to reproduce the problem it
was intended to solve, and if that problem (message delivery about the
swallow attack delivered with the engulfer missing from the map) exists,
it would be less severe than the impossible feedback.  I didn't attempt
to reproduce the actual reported problem since the code removal should
make it moot.

Once again, the bug report via the web contact form got misclassified
as spam.
2026-02-20 19:29:55 -08:00
PatR e19f4552e9 pull request #1403 - reset stat abuse/exercise
Pull request from greg-kennedy: when a characteristic is repaired via
restore ability, set exercise and abuse for that characteristic to 0.

Closes #1403
2026-02-17 14:56:52 -08:00
Greg Kennedy 822396c2e0 Attribute adjustment resets abuse / exercise counter 2026-02-17 14:51:37 -08:00
Greg Kennedy 06012e7127 Potion / spell of restore ability resets stat abuse as well 2026-02-17 14:51:37 -08:00
PatR 0d2752d05d more cursed potion of invisibility
Give feedback if a visible monster drinks a potion of invisibility
that happens to be cursed so monster fails to become invisible, or if
hero hits a visible monster with a cursed potion of invisibility and
it fails to become invisible.
2026-02-16 19:51:04 -08:00
PatR b702be4449 more discoveries of unique items
Show the invocation items in the unique items section of the
discoveries list even when they're only flagged as encountered rather
than fully discovered.  The Amulet of Yendor is excluded; it has to
be fully discovered to be shown in that section.
2026-02-16 14:01:59 -08:00
PatR 1bb7146cbd \#knownclass (back-tick) of relics
The ` command already supports selecting 'u' for unique items as a
pseudo-class.  Add support for 'r' as synonym to match the recent
addition of 'relics' to the Guidebook.

The unique item category includes the Amulet of Yendor in addition
to the three invocation items.  'r' shows it too, once it has been
fully IDed.  I'm ambivalent as to whether the Guidebook's Relics
section should mention it.
2026-02-15 12:37:55 -08:00
PatR 651a91f94c explain Amulet wish
In wizard mode, I used ^W to wish for the Amulet of Yendor and was
immediately prompted for another wish.  It was baffling and took a
while to figure out.  Give a message before initiating the wish.
2026-02-15 11:48:40 -08:00
Pasi Kallinen fe7b3ce09d Empty tin hallu msg 2026-02-15 17:01:49 +02:00
PatR f4bb0d93e5 observed objects
This has been laying around for a few weeks.  I meant to do more but
have forgotten what the rest would have been.

Don't mark generic objects as dknown.
2026-02-14 21:03:58 -08:00
Pasi Kallinen 78217c3ebd Allow rogues to backstab sleeping or paralyzed monsters 2026-02-13 12:53:21 +02:00
PatR a561538c2a cursed potions of invisibility for monsters
Extend the recently changed behavior for cursed potion of invisibility.

Monsters won't drink potions of invisibility if already invisible so
can't accidentally or voluntarily make themselves visible again, but
let player make them become visible by hitting them with thrown or
wielded cursed potion of invisibility.

They don't have any concept of temporary invisibility that might let
them remain invisible while losing permanent invisibility, so they
just lose the latter and immediately become visible.
2026-02-12 10:33:09 -08:00
PatR b074657f2b Guidebook.tex tidbit
This should eliminate an unwanted space.

Untested.
2026-02-12 07:37:31 -08:00
Pasi Kallinen bbc3eea066 Make sure negatively enchanted boomerang hits anything 2026-02-12 14:32:58 +02:00
nhmall cccb0303ed update tested versions of Visual Studio 2026-02-12 2026-02-12 07:01:52 -05:00
nhmall a55ca3ab87 Guidebook.txt update 2026-02-12 06:30:54 -05:00
nhw_cron 2487be72f6 This is cron-daily v1-Jan-12-2026. 005manpages updated: makedefs.txt 2026-02-12 06:28:32 -05:00
PatR 3e24fbcc4e Guidebook.tex Artifacts and Relics
Match recent Guidebook.mn addition of two new subsections for Objects.

Untested.
2026-02-11 15:30:40 -08:00
nhmall fcd9f5468c some coordxy follow-up
Return a couple of variables that actually held a direction back
to int from coordxy.

bhit() takes int params instead of coordxy.

boomhit() takes int params instead of coordxy.

xytod() renamed to xytodir(), and takes int params (promotion will handle
coordxy params).

dtoxy(coord *, int) renamed to dirtocoord(coord *, int).
2026-02-11 09:40:25 -05:00
Pasi Kallinen db36ee35de Fix the healer knife bonus
dmgval is also used for monster attacks; move the healer knife
bonus to actual hero-specific code, and make sure it only
applies to hand-to-hand combat.
2026-02-11 08:22:02 +02:00
PatR 1135f5ffe5 Guidebook 'Relics'
List the three invocation items in the same order as the oracularity
about them does.
2026-02-10 13:50:01 -08:00
nhmall b76d4338be avoid a reported obuf reuse in use_misc()
Report: https://github.com/NetHack/NetHack/issues/1486

Resolves #1486
2026-02-09 08:39:21 -05:00
Pasi Kallinen 4b30e3fab8 Healers may get tiny damage increase with knives
Styled as anatomy knowledge, a healer attacking a monster in melee
with a knife gets +1 damage per 6 dead monsters of that type,
capped at +3 damage.

Handwaving away the fact we're not keeping track who actually
killed the monsters...

Idea from aosdict.
2026-02-08 18:11:06 +02:00
Pasi Kallinen 3877e142e7 Add more bustle to bustling town 2026-02-08 17:19:53 +02:00
nhkeni 525ca734ae add checksum for lua 5.5.0 2026-02-07 21:39:03 -05:00
Pasi Kallinen 63dd80f5ec More code style nits 2026-02-07 17:03:54 +02:00
nhmall 8833e670cd Merge branch 'NetHack-3.7-prepare-for-groff-1.24' of https://github.com/g-branden-robinson/NetHack into NetHack-3.7 2026-02-07 08:07:30 -05:00
Pasi Kallinen 74390fb690 Split ray bouncing dir into separate function 2026-02-07 14:51:03 +02:00
g-branden-robinson 2fdfebde0d Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7-prepare-for-groff-1.24 2026-02-07 05:03:15 -06:00
G. Branden Robinson a8253dda00 Update Unix hints to revise groff detection
The existing detection logic was not working on any groff since at least
1.22.3 (November 2014), as could be seen by uncommenting the "$(info
...)" line.  The regex used to match "nroff --version" output was
insufficiently flexible.

Fixes:
$ (cd doc && rm -f Guidebook && PATH=$HOME/groff-1.22.3/usr/bin:/bin make Guidebook) | grep NROFF
NROFFISGROFF=
$ (cd doc && rm -f Guidebook && PATH=$HOME/groff-1.22.4/usr/bin:/bin make Guidebook) | grep NROFF
NROFFISGROFF=
$ (cd doc && rm -f Guidebook && PATH=$HOME/groff-1.23.0/usr/bin:/bin make Guidebook) | grep NROFF
NROFFISGROFF=
$ (cd doc && rm -f Guidebook && PATH=$HOME/groff-HEAD/usr/bin:/bin make Guidebook) | grep NROFF
NROFFISGROFF=

Use a different approach in Make to recording groff detection.  Use
"grep -c" (which is POSIX-conforming) to count the number of matches so
that we can use the contents of the Make macro `NROFFISGROFF` as a sort
of Boolean, which reads more idiomatically (in my opinion).

Further, instead of trying to lexically analyze a matched line in the
output of "nroff --version" and parse components of a version number out
of it, use GNU troff's built-in facility for extracting its minor
version number by storing the output of a tiny *roff document that
reports that datum (and nothing else).

Ignore warnings in category "scale" in any version of groff, because the
`tmac.n` macro package provokes them.

Clarify comments.
2026-02-07 05:00:22 -06:00
G. Branden Robinson b4bd6fb2b8 Guidebook: Improve package loading for groff 1.24
groff 1.24 is in its second release candidate of this writing and
features a noteworthy revision to its syntax.

---snip---
NEWS:
*  If your roff(7) documents follow any of the requests ... `so`, ...
   with a comment after their file name argument, and did not place that
   comment immediately after the file name, you are likely to get a
   diagnostic message resembling the following.

    warning: cannot open macro file 'e.tmac ': No such file or directory

   Or, less likely, the formatter will open the wrong file, one with
   spaces at the end of its name.  That is because these requests are
   now able to process file names containing space characters.  (This
   change also makes the request syntax consistent with that of `ds`,
   `as`, and others.)  A quick fix is to place the comment escape
   sequence as early as possible.  For example, we would change:

     .mso e.tmac \" Load Eric Allman's package.

   to:

     .mso e.tmac\" Load Eric Allman's package.

   to tell the formatter to load the "e.tmac" file rather than
   "e.tmac ".  See the items below for further details.
---end snip---

Work around this change while maintaining with older groff and other
*roff formatters.

1.  Stop using space to separate comments from the argument to `so`.
2.  Temporarily define a `So` macro to wrap the `soquiet` request (for
    groff 1.23 and later) or `so` request (for everything else).
3.  Abort formatting with an error diagnostic if the `nh` macro package
    the Guidebook requires cannot be located.

Fixes:
$ (cd doc && rm -f Guidebook && make Guidebook)
troff:<standard input>:34: error: cannot open 'tmac.nh ': No such file or directory
troff:<standard input>:35: error: cannot open 'doc/tmac.nh': No such file or directory
2026-02-07 05:00:22 -06:00
G. Branden Robinson 6a8edddcb9 doc/tmac.nh: Drop space after \c escape sequence
Fixes warning in category "syntax" from the forthcoming groff 1.24.

troff:<standard input>:790: warning: ignoring a space on input line after output line continuation escape sequence
[94 more occurrences]
2026-02-07 05:00:22 -06:00
G. Branden Robinson f021aca3f7 doc/makedefs.6: Fix formatting error
Starting a text line with leading spaces causes a break when filling.
Usually this is not what is intended.

Fixes:
$ nroff -ww -z -rCHECKSTYLE=4 -man doc/*.[67]
an.tmac:doc/makedefs.6:102: style: 1 leading space(s) on input line
2026-02-07 05:00:18 -06:00
Pasi Kallinen 79c688cc6b Code style nit 2026-02-06 17:26:54 +02:00
Pasi Kallinen 37168ab188 Boomerangs can hit multiple monsters
The number of monsters it can hit depends on the enchantment.
2026-02-04 22:35:22 +02:00
Pasi Kallinen 27adb7c71d Light-spell is clerical, if playing a priest
Ideally the spell adjustment should be in o_init, but by that time
hero's role has not yet been set.
2026-02-03 12:07:12 +02:00
PatR deec8317ce git issue #1467 - selection.match() boundaries
Issue reported by copperwater:
| a = selection.match(some_mapfrag);
| b = selection.match(another_mapfrag);
| c = a + b;
Instead of being a union of all the points that match either mapfrag,
the resulting selection c is empty.

[Report included a choice of two possible fixes.]
I put both in, without adequate testing of either one.

I didn't hit any problems with the existing special levels but didn't
try many theme rooms.

Closes #1467
2026-01-30 14:17:53 -08:00
PatR f7b3337ae1 fuzzer vs highlight menus
From nearly three months ago...
2026-01-30 14:00:32 -08:00
Pasi Kallinen b34b7e08a4 Fix lua reset_level
The lua des.reset_level() call did not reset the special level
coder, so some values were kept and couldn't be changed.
Adjust the movement tests for this change.
2026-01-28 10:06:58 +02:00
Pasi Kallinen 060c3de8eb Lua tests: code coverage for applying some items
Add a new debug flag prevent_pline, which prevents all messages
from going out to the UI. This prevents the tests from stopping
for -more-.
Add rudimentary tests for applying whistles, camera, and stethoscope.
2026-01-27 17:33:08 +02:00
PatR e18f4b65a9 cure sickness feedback
A thread on Reddit mentions that successfully casting the cure sickness
spell when not Sick doesn't provide any feedback.  Change it to report
|You are not ill.
in that situation.  Also, give "you are no longer ill" feedback when
actually curing sickness after status gets updated.
2026-01-26 15:27:54 -08:00
Pasi Kallinen 11bed1f55b Lua tests: generation of each object
Test generation of every object, both via des.object and obj.new.
Expose FIRST_OBJECT and LAST_OBJECT numbers to lua.
Add lua nh.int_to_objname, a function to convert integer value to
object base name and class.
Allow creating new nethack lua object by specifying id and class.
2026-01-26 18:00:33 +02:00
PatR b5ca1a3ed8 fix comment typo 2026-01-25 11:40:08 -08:00
nhmall 2a0d3eea64 a warning bit
Visual Studio build:
src/nhlsel.c(970) : warning C4702: unreachable code
2026-01-25 11:49:36 -05:00
Pasi Kallinen 2dc95dae42 Actually use the lua argc 2026-01-25 18:38:52 +02:00
Pasi Kallinen 92a8d1dab3 Lua tests: monster creation coverage
Expose constants NUMMONS, LOW_PM, and HIGH_PM to lua.
Allow converting an int to monster type name.
Create one of each type of monster in the lua tests.
2026-01-25 18:32:46 +02:00
nhmall 62f3969899 another Lua version bump follow-up 2026-01-25 10:34:27 -05:00
nhmall e1a3180535 update tested versions of Visual Studio 2026-01-25 2026-01-25 09:51:22 -05:00
Pasi Kallinen f73d9ee704 Expose selection size description to lua 2026-01-25 15:18:51 +02:00
Pasi Kallinen 4bf1fb5c68 Lua tests: more special level code coverage 2026-01-25 14:50:02 +02:00
Pasi Kallinen 8ae3d0f6bc Lua tests: code coverage for selection room and gradient 2026-01-25 14:18:01 +02:00
Pasi Kallinen 68ba3955fd Lua tests: more code coverage for rooms 2026-01-25 13:49:10 +02:00
PatR cb8de068ad fix #S15038 - cursed magic whistle
Reported via contact form but misclassified as spam.  Applyin a magic
has a chance to teleport the hero to be adjacent to a pet rather than
vice versa, but it could do so even on no-teleport levels.
2026-01-24 20:03:22 -08:00
nhmall 77ea8de105 attempt 6 to fix CI build issue 2026-01-24 10:51:40 -05:00
nhmall da208a0ac4 attempt 5 to fix CI build issue 2026-01-24 10:49:42 -05:00
nhmall c19fd7d7f8 attempt 4 to fix CI build issue 2026-01-24 10:30:25 -05:00
nhmall f54fc4908f attempt 3 to fix CI build issue 2026-01-24 10:28:42 -05:00
nhmall 33413604a0 attempt 2 to fix CI build issue 2026-01-24 09:49:20 -05:00
nhmall 41ccf8ecb2 attempt 1 to fix CI build issue 2026-01-24 09:47:51 -05:00
nhmall cd9ea45895 Pull request #1473 fixes3-7-0.txt entry 2026-01-24 09:08:16 -05:00
nhmall 7c4437437b Merge branch 'NetHack-3.7' of https://github.com/danielclow/NetHack into pr1473 2026-01-24 09:04:48 -05:00
PatR 595e4720cc Guidebook update: artifacts
Add "objects" subsections for Artifacts and for Relics (invocation
tools).  They aren't very detailed but fill a gap.

I did this a while back but couldn't preview the outcome (aside from
the plain text version).  I used to be able to execute the command
'open Guidebook.ps' to display it with the Preview program.  That
program is still there but Apple has dropped support for Postscript,
presumably to stop paying royalties to Adobe or whoever owns it.
I've used ghostview for this before but encountered unexplained
trouble this time.  It eventually worked; I don't know what changed.

I haven't attempted to update the LaTeX version of the Guidebook, in
order to avoid merge issues with the pending Pull Request in case
anyone decides to incorporate that.  (I won't; I still don't have
tools to test it.)
2026-01-24 00:20:24 -08:00
Pasi Kallinen b5dd0eb894 Lua tests: more code coverage for traps 2026-01-23 18:24:28 +02:00
Pasi Kallinen 3b4ce60df4 Lua tests: more code coverage 2026-01-23 17:43:54 +02:00
Pasi Kallinen c8712fa288 Free the cmdq in getlin 2026-01-22 18:42:11 +02:00
Pasi Kallinen 49a87bd09c Lua pushkey and getlin
Allow lua nh.pushkey to push multiple keys,
make getlin return the keys in the command queue.
2026-01-22 18:16:55 +02:00
Pasi Kallinen b9f8f845fc Test for drawbridge 2026-01-21 20:21:12 +02:00
Pasi Kallinen c5dc08d23a Tests for gas_cloud, exclusion, levregion 2026-01-21 20:15:14 +02:00
Pasi Kallinen e9f57281f8 Expose flip_level to lua 2026-01-20 17:50:27 +02:00
Pasi Kallinen ae452e04b9 Don't discover generic objects
Potion of object detection and then looking at a generic object glyph
on the map would try to "discover" the generic object, and the loop
in discover_object would go too far, overwriting the exclusion_zones
pointer.

Take the easy route and just prevent discovery of generic objects;
there are probably other places where the generic objects should
be handled too, but the fuzzer hasn't hit them.
2026-01-16 21:17:19 +02:00
nhmall 8b6ba69fd8 linux.370 hints: validate sysconf GDBPATH
With sys/unix/hints/linux.370, if GDBPATH doesn't exist, comment out
the GDBPATH line in sysconf during 'make install' or 'make update'.

[ macOS apparently uses sys/unix/hints/macosx.sh to do its sysconf manipulation,
so there is no corresponding change for sys/unix/hints/macOS.370 ]

Closes #1477
2026-01-15 17:02:38 -05:00
Pasi Kallinen eed952a095 Add more death drops to leather golems
In addition to the leather armor, leather golems can now drop
leather cloaks and saddles.
2026-01-15 19:02:44 +02:00
Pasi Kallinen a4e032762f Rope golems may death drop grappling hooks 2026-01-15 18:44:46 +02:00
Alex Smith 5d7b7b823a Monster-slowing effects work better against faster enemies
Based on the principle that there should always be at least two
solutions to any given problem, this allows monster-slowing magic
to be an effective solution to fast low-monMR monsters (in
particular home-plane air elementals, who after recent commits
could reasonably be dealt with using good AC, but I want a second
good option to be available, in addition to the existing mediocre
options).  This helps to make playing with bad AC (for whatever
reason) more viable.
2026-01-15 01:01:07 +00:00
Alex Smith b4a3ec49e4 Make the "totally digested" instadeath timer much faster
This is one of the fairest instadeaths in the game (it gives
multiple warnings and there are reliable ways to escape it), but
is also where most of the threat of purple worms comes from. It
was also pretty much nonfunctional: the previously used formula set
the timer to somewhere around 50 turns (for a typical character in
Gehennom, which is where purple worms are normally encountered).

This new formula (which affects only purple worms, as the only
monster that engulfs and digests) is based on the same inputs, but
produces much smaller numbers, meaning that the instadeath is
relevant sometimes. A typical character at purple worm depth will
be able to kill faster than the timer if they focus on the purple
worm and put some damage on it before they get engulfed, but it is
much closer if the purple worm gets the first hit in (possibly
requiring the use of escape items, but the common wand of digging
works).

Hopefully this brings purple worms closer to their intended threat
level: previously they were somewhat more nonthreatening than they
should have been.
2026-01-15 00:40:42 +00:00
Alex Smith 253aea33fc Elemental Planes balance adjustments
The previous commit caused air elementals to become almost totally
nonthreatening in the endgame (even the buffed ones on the Plane of
Air). This commit fixes that (whilst still leaving them somewhat
weaker than they were before against characters with good AC), by
doubling the damage of home-plane air elementals.

The damage of the other home-plane elementals was doubled too,
because they were mostly nonthreatening previously. On Fire, this
has no real effect as almost any character would be fire-resistant
by this point. On Earth, it makes the elementals more of a threat,
when they previously weren't.

However, it made Water too difficult (albeit more fun, because it
became important to avoid letting water elementals swam you). As
such, water elementals are made slightly slower to compensate.
(My own playtesting indicates that 6 is slightly too fast, but 4 is
too slow, so I'm hoping that 5 is the correct value.)
2026-01-15 00:10:59 +00:00
Alex Smith 7881d5b4b2 Make air elementals respect damage reduction from AC
Players of both 3.4.3 and 3.7 have observed for a long time that
air elementals are disproportionately dangerous compared to other
endgame threats. (In particular, playtester feedback from 3.7 was
that the Plane of Air was much more dangerous than it should be,
with playtesters treating it similarly to Astral with respect to
the use of high-quality escape items.)

It turns out that this was because damage from air elementals while
engulfed was entirely ignoring AC, meaning that regardless of your
stats, you would be taking around 16.5 damage per turn while
engulfed (half physical damage helped, but nothing else did).

This commit purely fixes the bug, but does not balance around it,
which means that it causes the endgame air elementals to become
almost entirely nonthreatening. In a future commit, I plan to
balance around this change.
2026-01-14 23:21:40 +00:00
nhmall 239286e1fb update tested versions of Visual Studio 2026-01-14 2026-01-14 14:27:15 -05:00
nhmall 96fedbdeab update generated files from cron daily 2026-01-14 09:34:50 -05:00
PatR 4e0a91907b fix pull request #1476 - engraving punctuation
Pull request from entrez:  reading an engraving added a terminal period
after the quoted text even when that text already ended in one.

That should be conditional like it already is (post-3.6) for T-shirts.

Fixes #1476
2026-01-13 11:04:03 -08:00
Michael Meyer c92014bf3c Follow-up to engraving punctuation
Skip the terminal period only if there is true punctuation at the end of
the engraving, not degraded text.  This feels a bit janky because the
way engravings are malloced and structured uses this manual offset to
access the space allocated for text.  I used a macro to unify all those
accesses so that it will be harder to screw it up if something changes
in that respect, since repeating (ep + 1) as a magic number across
engrave.c seems quite brittle.
2026-01-13 10:32:08 -08:00
Michael Meyer e18cf594d3 Avoid redundant punctuation in engraving message
Change the formatting of reading an engraving to include a terminal
period only if the engraving does not already include punctuation, to
avoid messages like:

| You feel the words: "Please don't feed the animals.".

This brings the formatting of the read_engr_at() message in line with
doread().

One minor concern with this is that degraded engravings can use
punctuation to represent "chicken scratch" degraded text rather than as
actual punctuation, and ideally it might be better to include the final
period if you're reading an engraving like "Hc| ?  |?".

This is true of burnt T-shirts already, but it's much more common with
engravings.  It should be possible to identify "real punctuation" by
checking whether (ep->engr_txt[pristine_text] == et[elen - 1]) -- but
this doesn't actually work without more tinkering, since trimming
initial whitespace in u_wipe_engr() updates the actual_text pointer so
the indices stop matching.
2026-01-13 10:32:08 -08:00
nhmall c5f0e7642b generated files updated 2026-01-12 20:35:01 -05:00
Alex Smith 9bd8fcf82a Cursed potions of invisibility remove intrinsic invisibility
They still have their other current effects (aggravating monsters
and granting temporary invisibility). This is mostly meant as a way
of counteracting the "turn permanently invisible" effect of magic
traps, for players who would rather their characters remained
visible.

Thanks to paxed for helping with this commit.
2026-01-12 18:09:35 +00:00
nhmall 4546603eb5 fixes3-7-0.txt catch-up
Related to:
    96394394b8 Fix comment typo
    c016367d8c an old comment typo
    6459d44461 some spelling and inconsistency corrections;
	                                     comments and elsewhere
    c62d76b776 more spelling and inconsistency corrections;
                                             comments and elsewhere
    8b280d6108 whitespace follow-up
    9a26f9d37d new typo fix

Reference:
    https://groups.google.com/g/rec.games.roguelike.nethack/c/F28kIo9HOsA/m/6IYW7YRXSJsJ
2026-01-12 07:17:21 -05:00
nhmall 9a26f9d37d new typo fix 2026-01-11 21:28:15 -05:00
nhmall 8b280d6108 whitespace follow-up 2026-01-11 21:23:37 -05:00
nhmall c62d76b776 more spelling and inconsistency corrections; comments and elsewhere 2026-01-11 21:12:25 -05:00
Alex Smith 904e3ffe67 Clarify in the #quit prompt that it doesn't save the game 2026-01-12 00:52:24 +00:00
Alex Smith ceaffcbd47 Large polyforms unequip cloaks rather than destroying them
This commit is intended to achieve two things: a) making Vlad's
throne a little less dangerous, b) making polymorph traps less
dangerous for players who don't have magic resistance. (At present,
uncontrolled polymorph is too dangerous in the late game for most
players to consider risking it, so they take care to avoid things
that have even a small chance of it, cutting out a lot of potential
strategies. Toning down polymorphs should make them happen more
often by increasing the chance that players will be willing to go
without precautions.)

Body armor is still destroyed (with the existing exception of
dragon armor), in order to mostly preserve the balance effect of
polymorph traps in the early game.
2026-01-11 22:19:43 +00:00
Alex Smith 6de59927a2 Vlad's throne rebalance
This removes the container-cursing effect (which is too specific
and too easy to work around) and replaces it with an effect that
greases everything (largely but not entirely positive).
2026-01-11 22:12:35 +00:00
nhmall fd9f8cfd60 Update submodule lua to v5.4.8 2026-01-11 12:08:32 -05:00
nhmall 6459d44461 some spelling and inconsistency corrections; comments and elsewhere 2026-01-11 11:31:34 -05:00
nhmall c016367d8c an old comment typo 2026-01-11 10:11:30 -05:00
Pasi Kallinen d0b9846367 Move item actions into separate src file
Haven't tested compilation on Windows and VMS ...
2026-01-11 14:46:25 +02:00
PatR ac7f0d3615 context sensitive item action for candles
When picking candles from an inventory display, expand the 'a' choice
if carrying the Candelabrum of Invocation.
2026-01-11 01:49:06 -08:00
Pasi Kallinen 96394394b8 Fix comment typo 2026-01-11 11:42:16 +02:00
Alex Smith 09b879d7ad Give a message when throwing ammo without a launcher
This is primarily intended to help new players understand the
mechanics (the "wield the launcher, throw the arrow" sequence may
be unfamiliar to newer players), so the message is worded to
indicate the correct way to use the ammo.
2026-01-10 20:00:59 +00:00
Alex Smith f2a958e7e8 Make dragonhide affectable by rotting attacks
Dragon corpses are capable of rotting, so it's plausible that the
skin of a dead dragon might also be possible to rot.

This is unlikely to come up in actual play at present (unless
wishing for rotten DSM, it can only end up rotting as a consequence
of brown pudding attacks): the primary motivation is to open up new
possibilities for armor-damaging attacks, which in current NetHack
aren't very relevant in the late game because everyone is wearing
dragon scale mail.
2026-01-10 18:56:56 +00:00
Pasi Kallinen 40b39c1026 Bigroom 13: Add few more pillar arrangements 2026-01-10 17:47:34 +02:00
Alex Smith 3edd07b23e Changes to the scroll of enchant armor
After discussing with paxed, I decided that instead of reducing the
safe enchantment limit for magical armor, it is instead better to
make the scrolls less effective on it.  So this commit restores the
previous rules for the safely-enchant-from level and changes the
effectiveness of the scrolls to compensate.

Non-elven magical armor now only gets +1 from blessed scrolls of
enchant armor when enchanted from +3, coming to a total of +4. But
scrolls of enchant armor are now more effective on nonmagical and
elven and previously unenchanted armor, giving more of an incentive
to use them in the early game.

Cursed and uncursed scrolls of enchant armor are now also more
powerful than they were (but less powerful than blessed scrolls),
hopefully making it a more interesting decision as to whether to use
scrolls of enchant armor even if you don't have the means to bless
them.
2026-01-10 15:16:02 +00:00
Pasi Kallinen e93f0dedbf Make lyncanthropy less crippling
Now, the were-creature instincts will keep the hero from
unintentionally changing shape while next to hostile creatures.
2026-01-10 14:05:06 +02:00
Pasi Kallinen e504d44de2 Add "snake wall" to bigroom variant 1
Also increase the chances of having walls in bigrm-1 from 75% to 80%
2026-01-10 11:19:52 +02:00
Pasi Kallinen 99b893c786 Add a new bigroom variant "pillars"
Some variants have a bigroom variant called "Mines of Moria";
this one is very much that, but has several different arrangements
of the pillars.
2026-01-09 19:39:45 +02:00
Pasi Kallinen b19db444c5 No wish resuming for the fuzzer 2026-01-09 16:13:30 +02:00
nhmall 4a4b0e60f9 whitespace style in a generated file 2026-01-07 11:21:46 -05:00
Pasi Kallinen 8d87886458 Fix vision when vampire changes form on a door 2026-01-07 13:07:07 +02:00
nhmall e724711f46 Lua version bump follow-up 2026-01-06 15:41:36 -05:00
Pasi Kallinen b9d781e0b2 Fix segfault when carried box explodes
Opening a trapped box in inventory, if the box exploded and was
not destroyed, then temporary variable otmp was pointing to null.
2026-01-06 21:00:33 +02:00
nhmall 4b5b146674 should_displace() does not modify mfndposdata struct pointed at by data param 2026-01-04 11:54:28 -05:00
nhmall 44fcbb180d bump COPYRIGHT_BANNER_A 2026-01-04 11:16:45 -05:00
nhmall 642cf9a93e bump Lua references from 5.4.6 to 5.4.8 2026-01-04 11:12:50 -05:00
nhmall aec4504337 let build be possible with current (5.5.0) Lua
Lua 5.5.0 became the most-current Lua version on December 22, 2025
2026-01-04 10:37:19 -05:00
Pasi Kallinen f2cd27551d Just pass a mfndposdata pointer to should_displace 2026-01-04 16:34:28 +02:00
Pasi Kallinen 37df18b59c Use struct to pass data out of mfndpos
Instead of passing two array pointers to mfndpos, fold the data
into a specific struct.
2026-01-04 14:00:43 +02:00
danielclow d924ec0ae4 Replace deprecated styles bf, it & remove verbatims
This replaces deprecatd styles with the modern LaTeX
equivalent (it - textit, etc.) and removes some verbatim
content that was not needed. More special characters
are cleaned up as well.
2026-01-04 01:29:27 +08:00
danielclow 465a9b1fbc Remove unneeded aliases
After changing the list styles in the previous commit,
it is no longer necessary to define aliases for these styles.
2026-01-03 23:52:28 +08:00
danielclow ea925fa502 Refactor description lists using enumitem
This replaces the custom blist with the LaTex built-in description list
and adds enumitem to style the lists more easily. A default style for
the description list is defined instead of specifying the font in every
list item. Some special characters in list items are also replaced
with textcomp options such as textasciigrave, etc.
2026-01-03 23:44:46 +08:00
danielclow 2f4595bb9d Use geometry package to define page layout
This sets the size of the text on the page by using the geometry
package, which is now essentially standard procedure.
2026-01-03 21:26:23 +08:00
danielclow d59add7100 Remove underscore hack
The redefinition of the underscore's category code is replaced with
textunderscore as needed throughout to prevent future confusion.
2026-01-03 21:10:37 +08:00
danielclow 71d7b1e587 Update LaTeX guidebook to use 2e documentclass
This is essentially the minimum required to start modernizing the LaTeX
code for the guidebook. Because this breaks the way that underscores
and straight single quotation marks were implemented, this also replaces
those with textunderscore and textsinglequote.
2026-01-03 20:57:31 +08:00
Pasi Kallinen 01928276d5 Monsters use wand of teleportation more 2026-01-03 11:04:13 +02:00
Pasi Kallinen 5b22feb795 Reduce the effect of luck on to-hit
Luck has a massive effect on the to-hit chance; maximum luck alone
(which almost everyone has past the midpoint of the game) gives
10 points to to-hit, so accounts for 50% chance alone, excluding all
other effects.

Multiple variants do something similar to this, so it is well tested.
This version comes from xNetHack by copperwater <aosdict@gmail.com>,
and allows the +1 or -1 luck adjustments of early game, such as full moon,
to have an effect.
2025-12-31 12:47:20 +02:00
Pasi Kallinen 0dac2b5fa0 TTY: add support for the palette config option
For now, terminal colors are not reset back when exiting NetHack.
Depends on CHANGE_COLOR compile-time option.
2025-12-30 19:26:07 +02:00
Pasi Kallinen 6707d3bfba Safe armor enchantment limits
The safe armor enchantment limit is lowered by one, if the armor
is innately magical.  This takes off 3-7 points of AC from
a typical ascension kit, but should not really have any effect
for early game.

Also clean up the relevant code a bit.
2025-12-27 18:24:26 +02:00
PatR 5030de7343 fix #1466 fix - stacking in inventory
The earlier fix from a couple of days ago was mislabeled as #1455
but was actually #1466.  It fixed picking up a thrown stack into
hero's empty quiver but broke keeping thrown items, dropped items,
and stolen items separate on the floor.  This repairs that.
2025-12-26 14:53:59 -08:00
nhmall 4d33d00ad2 update tested versions of Visual Studio 2025-12-26 2025-12-26 12:37:28 -05:00
PatR 5bda026acb fix issue #1455 - fully thrown quiver stack won't
autoquiver when picked back up

Issue reported by ars3niy:  empty quiver used to be refilled when
picking a thrown item or stack up.  Bug introduced by a previous fix
(commit 593a93d254) dealing with the
post-3.6 obj->how_lost field.

As with the last time I dealt with this, there was a lot of trial
and error involved.  This fixes the quiver issue without bringing
the earlier problem back.  This time the problem was that how_lost
got cleared before it was used to check whether an item being picked
up had been thrown.

Dropping part of a stack and throwing another part of the same stack
may behave oddly if a monster picks both up.  I am not going to try
to figure that out.

Fixes #1466
2025-12-24 22:11:16 -08:00
PatR aae7778d66 github issue #1472 - elven monster bow bonus
Issue reported by Tomsod: monster elves were intended to get a small
bonus to to-hit and damage when shooting arrows with bows, but the
check for that tested the arrows for skill P_BOW which never matches.
It should be -P_BOW.

[Pretty minor: +1 to-hit for any bow, another +1 to-hit if elven bow;
+1 damage for elven arrow; against hero and against other monsters.]

Fixes #1472
2025-12-23 23:28:58 -08:00
PatR 45766db520 pull request #1471 - winter wolf cub
Pull request by umbire:  the list of monsters which had lycanthrope
forms includes winter wolf but was missing winter wolf cub.  Affects
cannibalism check when hero is a werewolf and eats a winter wolf cub
corpse.

One-line fix entered manually rather than using the git commit.

Fixes #1471
2025-12-23 23:13:08 -08:00
Alex Smith 9828a05bbb Don't treat low monster-form HP while polymorphed as a major trouble
Running low on HP in monster form isn't the same sort of critical
problem that running low on HP while not polymorphed is, because the
character changes back when the monster form HP runs out rather than
dying. (Indeed, running out of HP in monster form is often
intentional.)

The exception is when wearing unchanging (which implies both that the
monster form is intentional and that running out of monster HP would
be fatal), so low monster-form HP is treated as a major trouble in
that case.

Inspired by <https://nethack-yanis.github.io/yanis/4724.html>.
2025-12-21 10:44:50 +00:00
Pasi Kallinen 91cc3e3f12 Replace a weight magic number 2025-12-14 20:23:22 +02:00
Pasi Kallinen 758528f094 Grimtooth and Sunsword invoke can be paid with magic power
If the invoke timeout hasn't run out, the effect will take 25 pw,
the same as a lvl 5 spell.
If hero doesn't have that much, then the invoke fails.
2025-12-14 12:00:30 +02:00
Pasi Kallinen b92cccbbcd A line added, a space removed 2025-12-12 17:57:58 +02:00
Pasi Kallinen e68c5826d3 Remove extra space 2025-12-12 17:44:59 +02:00
PatR 020abc9cbc partial fix for #K4317 - monster grudge behavior
A band-aid for monster-vs-monster aggression.  Prevent monsters in
the Wizard's tower from attacking each other unless the hero is inside
the tower too, and those outside the tower from attacking each unless
the hero is outside.
2025-12-11 23:11:35 -08:00
PatR 842c595dcf Guidebook.mn fix
Fix the font manipulation bug that Keni pointed out.  The \fP that
is next-to-last could be eliminated but I've left it, at least for
now.
2025-12-11 21:37:57 -08:00
nhmall 99c888f393 update tested versions of Visual Studio 2025-12-10 2025-12-10 07:21:47 -05:00
PatR 12bd63a3a6 tweak mail daemon vs deaf hero
Turn an instance of "Never mind" into a sentence.  Unlike various
others, this one isn't a direct result of something the player has
initiated.
2025-12-09 17:26:11 -08:00
PatR bc13a42ce3 fix issue #1469 - glitches with type-naming
Issue reported by ars3niy:  assigning names to types of objects,
or clearing such, did not update persistent inventory window.  Also,
the sequence
  assign-a-name,
  name-as-' '-to-unname,
  assign-a-name again,
  unname again
would result in impossible: "named object not in disco".

This fixes the impossibility.  The fix for #1470 has already taken
care of the presistent inventory issue.

Fixes #1469
2025-12-09 17:24:33 -08:00
nhmall 7dc4512bb3 follow-up: just use existing carrying() 2025-12-09 15:25:10 -05:00
nhmall 6ba053669e follow-up for #name permanent inventory update
Using extended #name for an object on the floor (for example)
wasn't updating the permanent inventory to reflect the updated
object type name if there was also one in inventory.
2025-12-09 14:17:42 -05:00
nhmall 68aaa5a3ae call update_inventory() after #name inventory obj
Resolves #1470
2025-12-09 13:47:11 -05:00
nhmall b1329137eb update commit for submodules/pdcursesmod 2025-12-06 15:55:06 -05:00
nhmall 80cb9d03ce updated Guidebook.txt 2025-12-06 08:48:48 -05:00
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 497c5dec90 Do not count wizkits as part of starting inventory
Counting wizkits as starting inventory causes side effects (giving
you skills from them, making the wizkit items formally identified,
etc.). Some of these side effects are undesirable (because, e.g.,
it can give you skill in a weapon you're restricted in), and the
others are mostly neutral (because wizard-mode players can identify
anything they want to). As such, it's better to treat the wizkit as
something you obtain immediately after entering the dungeon, rather
than something you had all along.
2025-12-03 22:01:05 +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 373560c69a Delete an accidentally left in line of code
This wasn't meant to be there.
2025-12-02 19:57:49 +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 cfdee27498 pauper versus wizard spellbook auto-ID
These two enhancements were interacting with each other in weird
ways (paupers would start with no auto-IDs but force bolt, but
gain the level 1 auto-IDs upon training any skill). Change the
interaction so that paupers don't get the level 1 auto-IDs (which
wizards get to start with), but do get the level 3 auto-IDs in
skills that they manage to advance.
2025-12-02 15:23:50 +00:00
nhmall 727608411a a follow-up bit
package up debug symbols for sfctool if SFCTOOL=1
2025-12-02 09:48:10 -05:00
nhmall 44f6a779a7 follow-up for Makefile.nmake
Fix package error

Closes #1468
2025-12-02 08:39:17 -05:00
nhmall 089424fef2 update Makefile.nmake
don't include sfctool unless explicitly sought via SFCTOOL=1 on the make
command line.

add [optional]
    nmake fetch-ctags
    nmake build-ctags
2025-12-01 09:01:33 -05:00
PatR 56c1048489 pull request #1460 - lspo_gold() 'y' parameter
Pull request by huttarl:  fix a typo in lspo_gold() which was causing
it to use the x coordinate for both x and y.

It appears to only be used for the Fort Ludios level (knox.lua) which
seems to be working as intended, so I'm not sure what is really going
on.

git decided to be a big hassle so I ended up just typing the one
character change and ignore the commit(s).  Issue #1461 is about the
same situation.

Fixes #1460
Fixes #1461
2025-11-30 14:43:43 -08:00
PatR db5d77e8be intemple() nitpick
Alignment 'pious' is 20 but intemple() used that term for 14.  Change
intemple() to use the term 'devout' which is 14 (see enlightenment).

Also, add a comment about verbalize() usage in priest_talk().
2025-11-30 13:47:45 -08:00
Alex Smith 77ac6e51d5 Remove stray "static"
This is a globally-visible function, so it shouldn't be marked as
static.
2025-11-30 14:25:10 +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
Alex Smith e428046ffa Restructure u_init to allow for inventory rerolling
This doesn't implement inventory rerolling, just adds the
infrastructure: it's now possible to call u_init_inventory_attrs
multiple times and the starting inventory/attributes replace those
from the previous call rather than compounding.
2025-11-30 04:52:13 +00:00
Alex Smith d41cea8286 Make the inventory-initialisation arrays constants
This is helpful for if we ever allow playing multiple games in the
same session: because the arrays are not modified, they can now be
used more than once.
2025-11-30 02:59:23 +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 4d55e1de79 Make saving grace also work against repeated damage sources
For example, being hit by the bounce of a wand of fire means that
the main character could take damage twice in a turn, which would
kill even through saving grace; and scrolls and potions could burn
up after that and finish off the last HP, even if the wand only hit
once. This commit changes it to track all damage done during the
turn, and prevent HP dropping below 1 from damage until the next
player action or the next turn boundary, whichever comes first.
2025-11-26 05:45:45 +00:00
Alex Smith 6eb2eb7df7 Accurate dknown when writing scrolls while blind
If you write the scroll by description, you obviously know what the
label is because you specified the label (even if you didn't know
what the scroll was). When writing an unidentified scroll by type,
though, and getting lucky, you don't necessarily know the label of
the resulting scroll.
2025-11-25 23:01:46 +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
nhmall 53247ec474 Makefile.nmake update 2025-11-24 19:27:59 -05: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
nhmall 88256d895a update CHKSUMS to add entry for current Lua 5.4.8 2025-11-24 08:54:32 -05:00
nhmall 9e08bf8159 submodules update for pdcurses 2025-11-24 08:45:45 -05: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
nhmall ae516ddc67 follow-up: reverse one warning-related change 2025-11-23 09:49:49 -05:00
nhmall b3db46fd71 clear up some warnings in win/win32/NetHackW.c 2025-11-23 09:40:39 -05:00
nhmall 0faa3a70cc clear up some warnings in sys/windows/consoletty.c 2025-11-23 09:28:38 -05:00
nhmall f78e0d0caf MSYS CLANGARM64 bit 2025-11-22 10:39:37 -05:00
nhmall 113607823d Windows warning bit in windsys.c
windows/windsys.c:263:15: warning: format string is not a string literal
      (potentially insecure) [-Wformat-security]
  263 |         msmsg(buf);
      |               ^~~
../sys/windows/windsys.c:263:15: note: treat the string as an argument to avoid this
  263 |         msmsg(buf);
      |               ^
      |               "%s",
../sys/windows/windsys.c:267:20: warning: format string is not a string literal
      (potentially insecure) [-Wformat-security]
  267 |         raw_printf(buf);
      |                    ^~~
2025-11-22 10:34:45 -05: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 6466b47fc1 miscellaneous formatting of zap.c
Just to clear zap.c modifications out of my working directory.
2025-11-20 14:54:57 -08:00
nhmall 69886bd3d1 typo fix 2025-11-20 14:32:23 -05:00
nhmall 57ccb6208e another documentation update build-vs.txt 2025-11-20 14:28:59 -05:00
nhmall edc04fbf77 documentation update build-vs.txt 2025-11-20 14:15:00 -05:00
nhmall 7e7f393aef update tested versions of Visual Studio 2025-11-20 2025-11-20 10:45:35 -05:00
nhmall e3a00c2ce3 roll back changes to 2 files; issue in CI 2025-11-18 20:36:15 -05:00
nhmall be10b30914 more Visual Studio vcxproj tweaking 2025-11-18 20:03:05 -05:00
nhmall ec04123a71 lualib.vcxproj bit 2025-11-18 19:10:28 -05:00
nhmall 2b0c083894 nmake trailing slash fix 2025-11-18 19:04:07 -05:00
nhmall df54c155b2 yet another Visual Studio follow-up
yet another path correction
2025-11-18 18:56:35 -05:00
nhmall 9221247e24 another Visual Studio follow-up
path fix
2025-11-18 18:54:14 -05:00
nhmall 6de1f39c38 follow-up Visual Studio package fix 2025-11-18 18:27:45 -05:00
nhw_cron 8f52d51bd2 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-11-18 18:24:48 -05:00
nhmall a9d11db853 visual studio project tweaks 2025-11-18 13:44:55 -05:00
nhmall b1cffe11f9 Cross-compiling on Windows 11 with Visual Studio
Cross-compiling NetHack with Visual Studio from an x64 platform to an ARM64
target presents some new build challenges.

In the current nethack.sln solution, the build attempts to execute the
several just-built tools during the build of various subprojects.

For example, when cross-compiling on a typical Windows 11 x64 machine
to build a target ARM64 Windows 11 package, the build process tries to
run the following just-built target tools:

(under a Debug build)
    "$(ToolsDir)\Debug\ARM64\uudecode.exe"
    "$(ToolsDir)\Debug\ARM64\makedefs.exe"
    "$(ToolsDir)\Debug\ARM64\tilemap.exe"
    "$(ToolsDir)\Debug\ARM64\tile2bmp.exe"
    "$(ToolsDir)\Debug\ARM64\dlb.exe"

(under a Release build)
    "$(ToolsDir)\Release\ARM64\uudecode.exe"
    "$(ToolsDir)\Release\ARM64\makedefs.exe"
    "$(ToolsDir)\Release\ARM64\tilemap.exe"
    "$(ToolsDir)\Release\ARM64\tile2bmp.exe"
    "$(ToolsDir)\Release\ARM64\dlb.exe"

Those fail to execute successfully on Intel x64 (or x86) since they
are actually ARM64 executables, and the build attempts to execute
them on the host Intel x64 hardware.

The situation is a little different if the cross-compile is carried out
on a Windows 11 ARM64 machine (such as SnapDragon).

On an ARM64 machine, the cross-compile to build a target Intel x64
Windows 11 package, tries to execute the following:

(under a Debug build)
    "$(ToolsDir)\Debug\x64\uudecode.exe"
    "$(ToolsDir)\Debug\x64\makedefs.exe"
    "$(ToolsDir)\Debug\x64\tilemap.exe"
    "$(ToolsDir)\Debug\x64\tile2bmp.exe"
    "$(ToolsDir)\Debug\x64\dlb.exe"

(under a Release build)
    "$(ToolsDir)\Release\x64\uudecode.exe"
    "$(ToolsDir)\Release\x64\makedefs.exe"
    "$(ToolsDir)\Release\x64\tilemap.exe"
    "$(ToolsDir)\Release\x64\tile2bmp.exe"
    "$(ToolsDir)\Release\x64\dlb.exe"

Those actual do succeed in executing on ARM64, because of the
"prism emulation" that is available on Windows 11 ARM64 operating
systems to allow x64 and x86 executables to run.

The following change adds some detection to build environment, leading
to the definition of a "HostTools" macro that leads to the native host
tools for those steps.

There is a catch:

It means that the native build of the interim tools for Windows 11 must
be executed prior to attempting a cross-compile build to a non-native
target. That ensures that the native x64 interim uudecode, makedefs,
tilemap, tile2bmp and dlb tools are available on the disk for use by
a subsequent cross-compile.

This change consistently switches to the use of the host-native
interim tools for uudecode, makedefs, tilemap, tile2bmp and dlb tools.

Technically, this change would not be strictly necessary on an
ARM64-hosted build that was targeting x64 or x86, because of the
available prism-emulation that allows ARM64, x64, and x86 images to
execute, but this maintains consistency of the build process on
either platform. It is also likely that the native host versions execute
more quickly than versions requiring the prism emulation, although
that isn't really a concern for a NetHack build.

The use of native host uudecode, makedefs, tilemap, tile2bmp and
dlb tools is done with the Unix-hosted cross-compiles to other
target platforms as well (on Linux or macOS).
2025-11-18 10:10:32 -05:00
nhmall a6801b004c use lowercase platform name in zip file name 2025-11-17 21:02:45 -05:00
nhmall 8f97b824d5 visual studio build update
address warning disparity between ARM64 and x64
2025-11-17 20:44:08 -05:00
nhmall 7dbc0ac6b8 visual studio Makefile variable 2025-11-16 15:48:05 -05:00
nhmall 043b867da7 yet-another follow-up for NetHackW.vcxproj 2025-11-16 15:31:41 -05:00
nhmall f790458587 follow-up bit for NetHackW.vcxproj
Remove a resource compiler architecture conditional, since it does not vary between
the different architectures. This is simpler.
2025-11-16 15:26:49 -05:00
nhmall 4f59f24485 some vcxproj fixes 2025-11-16 15:16:10 -05:00
nhmall 3885638934 update suppressed warnings in NetHack vcxproj
Also be more consistent on preprocessor #define entries between
Visual Studio builds and command line nmake Makefile builds.
2025-11-16 14:12:14 -05:00
nhmall d7e4f2e2b1 Windows build support for Windows 11 arm64 (snapdragon) 2025-11-14 21:24:24 -05:00
nhmall eb4496c575 vcxproj updates
define HAS_INTTYPES_H alongside HAS_STDINT_H in the visual studio projects
2025-11-13 09:11:49 -05:00
nhw_cron b5792107a1 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-11-12 21:33:21 -05:00
nhmall 2b845066fa update naming for generated Files 2025-11-12 21:14:42 -05:00
nhmall cd98047de4 update tested versions of Visual Studio 2025-11-12 2025-11-12 20:40:01 -05:00
nhmall c12344cd48 build dos in CI but skip faltering Terminus font steps 2025-11-10 12:56:49 -05:00
nhmall d4a04b2632 turn off msdos build in CI for now 2025-11-10 09:21:22 -05:00
nhmall 2c747b079e revert some CI test changes 2025-11-10 09:19:47 -05:00
nhmall efbc0d8f8f more troubleshooting Terminus font use in CI environment 2025-11-10 08:52:06 -05:00
nhmall 157fcad161 troubleshoot Terminus font download in CI environment 2025-11-10 08:24:39 -05:00
nhmall a55a7f785c CI update 2025-11-10 07:20:32 -05: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
PatR 33401b0d08 spell selection tweak
For Z command, prevent an arbitrary number of reprompts when choosing
which spell to cast under menustyle:Traditional.
2025-11-08 18:13:31 -08:00
nhmall 4dfdeb8e92 follow-up in seldom-used places 2025-11-08 14:53:50 -05: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 6fa324d52a more hallucinatory genocide
Reorganize the recent livelog/#chronicle fix.
2025-11-08 01:06:13 -08: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
nhmall 0f01260605 Revert "blank perm_invent after repeating spell cast"
This reverts commit 7763f4c5b0.
2025-11-06 18:44:12 -05:00
nhmall 4574738c48 Revert "follow-up: program_state field isn't boolean"
This reverts commit 6af5a906bc.
2025-11-06 18:43:48 -05:00
nhmall 6af5a906bc follow-up: program_state field isn't boolean 2025-11-06 01:38:06 -05:00
nhmall 7763f4c5b0 blank perm_invent after repeating spell cast
add mechanics to ensure display_inventory() refreshes perm_invent as
expected when update_inventory() is called from a repeat command.

Resolves #1454
2025-11-06 01:34:52 -05:00
Michael Allison 58c7d2fb3e macOS QT6 doc tidbit 2025-11-05 13:20:45 -05:00
Michael Allison 350c80dd3d Merge branch 'pr1456' into NetHack-3.7 2025-11-05 13:03:04 -05:00
Hector Denis 4e29db079b Fix QTCXXFLAGS and WINLIB when compiling with WANT_WINT_QT6.
The previous code made incorrect assumptions about Qt6's file hierarchy. Reuse automatic configuration (with pkg-config) for Qt5, and replace '5' by '6'.
Also fix a typo in multiw-2.370.
2025-11-05 18:20:55 +01:00
Alex Smith db8e76ffd1 Changelog entry for 0-damage nonweapon changes 2025-11-01 16:11:22 +00:00
Alex Smith 317282c469 Paper objects (except books) also do no damage
These are even flimsier than vegetables are.
2025-11-01 16:09:25 +00:00
Alex Smith 177a5bcaf7 Wielded vegetables do no damage
It makes sense that a vegetable would do less damage than a hard
object would, as they're generally fairly soft, so it seems like a
likely thing for players to try if they're *intentionally* trying
to hit for zero damage (which could be useful in certain niche
cases, e.g. to wake up a sleeping monster without damaging it).
2025-11-01 10:09:30 +00:00
nhmall efe0b1197d update tested versions of Visual Studio 2025-10-27 2025-10-27 11:55:20 -04:00
nhkeni 5c0137a6a5 comment/documentation typos 2025-10-26 12:26:11 -04:00
nhmall b72d4af837 correct a few minor typos in sys 2025-10-25 10:14:28 -04:00
nhmall a03b2c763b documentation URL fix 2025-10-25 09:57:04 -04: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
nhmall 58beb25d1c Cross-compiling doc typos 2025-10-24 12:32:34 -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 8b69a5aabb a few constants that don't need to be octal at all 2025-10-23 11:18:42 -04:00
nhmall f636749ea2 suppress dozens of new compiler warnings with clang-21
Turn off default -Wdeprecated-octal-literals warning with clang-21

One example of many:

In file included from objects.c:22:
../include/objects.h:137:1: warning: octal literals without a '0o' prefix are deprecated
      [-Wdeprecated-octal-literals]
  137 | PROJECTILE("arrow", NoDes,
      | ^
../include/objects.h:119:48: note: expanded from macro 'PROJECTILE'
  119 |            BITS(kn, 1, 1, 0, 0, 1, 0, 0, 0, 0, PIERCE, sub, metal), \
      |                                                ^
../include/objclass.h:79:18: note: expanded from macro 'PIERCE'
   79 | #define PIERCE   01 /* pointed weapon punctures target */
      |                  ^
In file included from objects.c:22:
../include/objects.h:140:1: warning: octal literals without a '0o' prefix are deprecated
      [-Wdeprecated-octal-literals]
  140 | PROJECTILE("elven arrow", "runed arrow",
      | ^
../include/objects.h:119:48: note: expanded from macro 'PROJECTILE'
  119 |            BITS(kn, 1, 1, 0, 0, 1, 0, 0, 0, 0, PIERCE, sub, metal), \
      |                                                ^
../include/objclass.h:79:18: note: expanded from macro 'PIERCE'
   79 | #define PIERCE   01 /* pointed weapon punctures target */
      |                  ^
In file included from objects.c:22:
../include/objects.h:143:1: warning: octal literals without a '0o' prefix are deprecated
      [-Wdeprecated-octal-literals]
  143 | PROJECTILE("orcish arrow", "crude arrow",
      | ^
../include/objects.h:119:48: note: expanded from macro 'PROJECTILE'
  119 |            BITS(kn, 1, 1, 0, 0, 1, 0, 0, 0, 0, PIERCE, sub, metal), \
      |                                                ^
../include/objclass.h:79:18: note: expanded from macro 'PIERCE'
   79 | #define PIERCE   01 /* pointed weapon punctures target */
      |                  ^
2025-10-22 12:52:10 -04:00
PatR 7e3586acad ring item action bit for 'P'
If the hero is in a form without fingers but is wearing two rings (put
on before shape change), examining inventory and selecting a third
ring shows an item action menu entry of "P - [both ring fingers in use]"
(as of a couple of days ago).  Change that to plug in appropriate body
part for finger.
2025-10-21 14:06:16 -07:00
PatR 966145a61d item action 'T' against covered armor
Using 'i'+menu choice for suit+'T' to try to take off a suit that is
covered by a cloak (or shirt covered by suit and/or cloak) wouldn't
do anything.  It should report that you need to take off the outer
garment first and then not take the chosen item off.

There is probably a simpler fix.  It took me a long time to figure
where things were going wrong and them cobble this together.

A big chunk of the diff for invent.c is just identation, surrounding
a one-line change there.
2025-10-20 13:29:42 -07:00
PatR a9f84bfe9a item action for towel
Change the menu entry for putting on a towel to "Put this on to blindfold
yourself" since "Use this ..." seems ambiguous.

Also, for the 'P' and 'R' item actions, list amulets before rings like
most other routines that can deal with both.
2025-10-18 10:20:13 -07:00
PatR da20b839b5 item actions for accessories
Update item actions for rings, amulets, and eyewear.  Make 'P' for an
accessory that isn't worn behave similarly to recently modified 'W',
and make 'R' for an accessory that is worn be more specific.
2025-10-15 23:49:52 -07: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 6f8c1127ed item action 'W' for armor
In the context-sensitive menu when picking an item of armor from an
inventory listing, distinguish between wear-this-armor from could-
wear-this-armor-if-something-else-wasn't-already-worn-in-its-slot.
2025-10-13 23:13:15 -07: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
nhmall d75ffe4b34 distinguish magical and auditory scares
Github issue #1326 states:
"https://github.com/NetHack/NetHack/commit/dc9fe0d8bc96e006c119fa183c9c9a7c4cde2f53
 aims to nerf scrolls of scare monster a bit, making humans and uniques immune.
 But in actuality this change also affects all elves, and also makes them immune
 to musical instruments, including the objectively scary drums of earthquake.
 This is possibly unintentional (I don't see why elves would be immune to bugles
 but dwarves wouldn't), and in my experience (playing EvilHack which ports this
 commit) it makes elves really annoying, and seems to contradict the commit's
 message about getting "most of the effect in the early game when you're usually
 dealing with normal monsters" (elves are fairly common starting from around Sokoban).
 [...]
 Also the commit has a comment saying "humans aren't monsters" presumably referring
 to the scroll of scare monster, but read scrolls can still scare most @, or uniques
 for that matter."

Resolves #1326
2025-10-09 09:52:30 -04:00
nhmall 38161f3e4a relocate customization application
Resolves #1450
2025-10-06 11:49:31 -04: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
nhmall 9b375ea488 revert a couple of unintended vcxproj changes 2025-10-05 10:18:24 -04:00
nhmall 41f8cee117 Merge branch 'mklev' of https://github.com/argrath/NetHack into pr1412 2025-10-03 16:00:18 -04:00
nhmall 489bd8e320 Merge branch 'pr1451' into NetHack-3.7 2025-10-03 15:41:27 -04:00
nhmall f3277da2d2 Merge branch 'patch-1' of https://github.com/alebahn/NetHack into pr1451 2025-10-03 15:40:25 -04:00
nhmall a3b60ba36f build bit for CROSS_TO_WASM=1
../win/shim/winshim.c:194:23: error: unused parameter 'wri' [-Werror,-Wunused-parameter]
  194 |     win_request_info *wri) {
      |                       ^
1 error generated.
2025-10-03 10:00:48 -04:00
Aaron Lebahn bdffed390c Fix typo in encyclopedia 2025-10-02 11:36:49 -05:00
nhmall c0686d1795 clear pair of warnings re: not initialized 2025-09-30 12:41:55 -04:00
nhmall bbc8578375 get rid of a visual studio build warning
lnt-arithmetic-overflow	A sub-expression may overflow before being assigned to a wider type
2025-09-30 12:35:18 -04:00
nhmall ef1174ed1b clean up a warning about missing function def 2025-09-30 12:06:48 -04:00
nhw_cron c96297c052 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-09-26 09:30:51 -04:00
nhmall ea4ffba1ce another visual studio follow-up 2025-09-26 09:13:38 -04:00
nhmall 976aca6530 follow-up bit for visual studio 2025-09-26 08:59:49 -04:00
nhmall 32873218cd update tested versions of Visual Studio 2025-09-26 2025-09-26 08:57:31 -04:00
PatR b857899afc issue #1449 - fake explorer corpses on land mines
Issue reported by AndrioCelos:  the corpse of an early-level fake
explorer supposedly killed by a trap would leave land mines intact.

Change land mines with a fake explorer's corpse into discovered pits.

Fixes #1449
2025-09-25 11:39:08 -07: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
nhmall 9b7b2421ac update tested versions of Visual Studio 2025-09-17 2025-09-17 12:39:32 -04:00
nhw_cron e219a60465 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-09-07 13:28:13 -04:00
nhmall 349fbe93b1 less verbose compiler command lines during build
If using hints file sys/unix/hints/linux.370 or sys/unix/hints/macOS.370
allow the majority of the boilerplate compile switches to reside in a
compiler response file, instead of on the command line.

Include one of the following on your make command line:

make response=1
  or
make resp=1

It can be combined with other make command line options. See
sys/unix/README-hints for further information about those.

The response files that it uses are:
    CC   (clang or gcc)    src/nethack_cc.rsp
    CXx  (clang++ or g++)  src/nethack_cxx.rsp

Note: I think the reduced clutter should actually become the default,
and the override should be noresponse=1 to NOT use it, but I'm
not sure how others feel, so for now, it requires
    make resp=1
Feedback on whether that should become the default or not
is welcome.

Tested on Linux with gcc-15 and on Linux with clang-20.

I haven't had a chance to test it on macOS yet.
2025-09-07 12:50:54 -04:00
nhmall d5d40b322c fix broken Windows GUI ascii mode text color
Issue identified in
https://github.com/NetHack/NetHack/issues/1359

Resolves #1359
2025-09-05 16:38:56 -04:00
nhmall e8e1868b70 part3 of 3 for GitHub issue #1441
> Perhaps related: when a wand of sleep hits a disguised already-sleeping
> mimic (about which it is a separate question if they should go into
> disguise when sleeping, is it supposed to be automagic or conscious
> effort for them? but I digress), the mimic is not revealed (should it?)
> but the message says "hits a mimic".

Adjust restrap() so that a revealed mimic won't disguise itself while
sleeping. This seems to be in keeping with mimic lore.

Also, normal shop sounds (chime of register etc.) will wake a
mimic up from indeterminate sleep.

Closes #1441
2025-09-05 12:37:40 -04:00
nhmall 602678aa5a follow-up: function name 2025-09-05 09:26:00 -04:00
nhmall d3db5ce4f1 yet_another: !mimic_disguised_as_mon(mtmp)
would be true for a non-mimic

(mimic_disguised_as_non_mon(mtmp) would also have
worked okay)
2025-09-04 23:01:29 -04:00
nhmall 774129df11 another #1441 follow-up bit 2025-09-04 22:52:36 -04:00
nhmall 88eb33f198 more #1441
Address the second part of the GitHub issue:
"Finally, when a wand of striking (or a shift+F melee attack for that
matter, but the latter gives no tactical advantage compared to just
bumping them) misses a disguised mimic, it is revealed. I don't know
what to make of it"
2025-09-04 22:38:49 -04:00
nhmall fe357a6f04 avoid telling hero they missed a monster they aren't aware of
Resolves #1441
2025-09-04 22:13:07 -04:00
PatR e4f0d1a3e2 fix #4341 - jousting while trapped 2025-09-01 13:35:05 -07:00
nhmall e880b08be3 offmap initial setting 2025-09-01 10:49:17 -04:00
nhmall 6fade4b184 don't split pudding that got jousted into a hole 2025-09-01 10:34:38 -04:00
nhmall 475134cfa5 comment update 2025-09-01 09:53:20 -04:00
nhmall 137c028200 bug diagnostic comment 2025-09-01 09:47:03 -04:00
nhmall 7e44aad627 address a static analyzer complaint
mthrowu.c: In function ‘hit_bars’:
  mthrowu.c:1419:25: warning: ‘maybe_unused’ attribute ignored [-Wattributes]
  1419 |            static enum sound_effect_entries se[] SOUNDLIBONLY = {
  mthrowu.c:1419:46: warning: unused variable ‘se’ [-Wunused-variable]
  1419 |            static enum sound_effect_entries se[] SOUNDLIBONLY = {
2025-08-31 10:30:23 -04:00
PatR 6f5aba00cd fix issue #1440 - spurious sanity check warning
Issue reported by NullCGT:  if the spot in front of a drawbridge held
water and got frozen, sanity checking for ice-melt timer would issue
complaints about melt timer for non-ice whenever the bridge was open.

Ice in front of closed bridge was handled ok, but ice beneath an open
bridge issued a spurious warning each turn if the sanity_check option
(wizard mode-only) was on.

Fixes #1440
2025-08-29 14:20:49 -07:00
PatR bfff247462 suppress a static analyzer complaint for o_init.c
This should fix one of the three new complaints.  It compiles but has
not actually been through the analyzer.
2025-08-29 11:14:01 -07:00
nhmall 506e9cdd8f follow-up build bit for OpenVMS 2025-08-28 12:13:12 -04:00
nhmall b576ead25a follow-up after changing normalize_pointers_ to norm_ptrs_ 2025-08-28 11:53:50 -04:00
nhmall f110db02fc updates for build on OpenVMS 2025-08-28 11:43:47 -04:00
PatR 6a086c7725 PR #1439 - fix regex in sample config file
Pull request from Feyorsh:  in the sample run-time configuration
ile, doc/config.nh, the regular expression for "cursed" has bare
arentheses that should be quoted.

Fixes #1439
2025-08-27 12:30:20 -07: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
nhmall ab26a2e851 strip some outdated info from sys/windows/porthelp 2025-08-19 20:37:43 -04:00
nhmall 16c723f0be update tested versions of Visual Studio 2025-08-19 2025-08-19 13:21:56 -04:00
nhmall 6c3e70ad77 remove stray tabs from *.c files and config.h 2025-08-19 08:35:39 -04:00
nhmall 070730d845 Qt6 wasn't exiting as expected after saving the game
Reported by email to devteam on Feb 1, 2025.
2025-08-17 01:33:24 -04:00
nhmall 16716c2d3a update tested versions of Visual Studio 2025-08-16 2025-08-16 12:38:58 -04:00
Alex Smith 8f4c0f2215 You can throw objects at mimics if you know there's a monster there
Part of the reasoning behind thrown objects not hitting mimics is
that a character who doesn't know there's a mimic there wouldn't
aim at it. But if you know there's a monster there (e.g. via
telepathy or monster detection), you would aim at it. Pushing a
boulder at it and hearing a monster works too (which is important
in cases where a mimic is trapped behind a boulder in the Sokoban
corridors).
2025-08-16 01:24:58 +01:00
PatR 351ed094b4 fix? github issue #1431 - init_role_redist()
Issue reported by vultur-cadens:  3.7's revised handling for initial
characteristic allocation included an unintended change from 3.6's.

I don't pretend to understand how characteristic allocation really
works.  This should restore handling for values which are too low.

Fixes #1431
2025-08-11 15:28:11 -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 4bde4b439d 'opthelp' tidbit
Data typo affecting '?' command's "longer explanation of game options".
Change the indication of menu_objsym's default value from [5] to [4]
since 4 is the actual default value in the code and the Guidebook.
2025-08-08 13:41:27 -07:00
nhmall b876381b72 add support for [[maybe_unused]] if available 2025-08-07 21:47:40 -04:00
nhmall 93803de413 work around an X11 build issue under C23 2025-08-07 21:41:25 -04:00
nhmall dc48ff9f1e remove UNUSED from prototype in util/sfexpasc.c 2025-08-07 20:05:38 -04:00
nhmall 70510f1dbc update visual studio sys/windows/vs/cpp.hint 2025-08-06 21:27:54 -04:00
nhmall 5fe7c4d12e update tested versions of Visual Studio 2025-08-06 2025-08-06 21:27:25 -04:00
PatR 2d6f0d74f2 fix pull request #1433 - silver mace
Pull request from Umbire:  starting gear for angelic beings should
use recently added silver mace instead of old ordinary mace.

It's simpler to just type in the change than to merge the commit.

Fixes #1433
2025-08-06 15:33:57 -07:00
Michael Allison b0076decae more Xcode follow-up 2025-08-06 14:25:50 -04:00
Michael Allison 2b399d1739 more follow-up (for Xcode) 2025-08-06 14:12:10 -04:00
nhmall 80e11c287d more follow-up (for visual studio) 2025-08-06 13:55:41 -04:00
nhmall 75a2a61653 some Makefile follow-up 2025-08-06 13:51:22 -04:00
nhw_cron 52573394f0 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-08-06 13:28:49 -04:00
nhmall a0275e2696 consolidate some duplication into sfmacros.h
:  #include "sfmacros.h"
:  from sfstruct.c and sfbase.c
2025-08-06 12:56:07 -04:00
nhmall 6607b48dd1 sfctool build bit 2025-08-06 12:52:55 -04: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
PatR c08f79b26e more photographing monsters
Don't record hallucinated monsters as having been seen up close or as
photographed.

Treat a tourist's starting pet has having been photographed prior to
bringing the camera and dog or cat into the dungeon.

No extra points to tourist when first long worm tail is photographed.

EDITLEVEL is incremented again, for extra context to track starting
pet.
2025-07-29 15:45:11 -07:00
nhmall f145cc02f4 photograph experience gains often counted only prior to first move
More details in https://github.com/NetHack/NetHack/issues/1430

track photographed monsters using a distinct bit

also adds a pair of new context fields to track the total number of monsters seen up close,
and the total number of monsters photographed.

So, if somebody wants to add unique end-of-game disclosure statements for tourists that relate to
those, the groundwork should be there.

NOTE: This increments EDITLEVEL, so existing save and bones files will become outdated.

Fixes #1430
2025-07-26 11:03:20 -04:00
nhmall 36dcb92288 MSYS2 package fix: include lua-5.4.6.dll in zip 2025-07-19 18:22:35 -04:00
PatR 58d377e81e uhitm.c warning fix
From "Monsters trapped in pits cannot kick" two weeks ago.  Avoid
uhitm.c:5505:9: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Recent clang wants C23's [[fallthrough]] attribute rather than just
the lint '/*FALLTHRU*/' comment.
2025-07-17 16:29:27 -07:00
nhmall f58b7a8269 update tested versions of Visual Studio 2025-07-16 2025-07-16 21:04:04 -04:00
nhmall dcef128290 control-v on curses using pdcursesmod 2025-07-13 23:46:50 -04:00
nhmall 0db013c08e adjust levitation wand engraving wording slightly 2025-07-13 21:37:35 -04: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
nhkeni 65774372e6 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2025-07-11 15:44:43 -04:00
nhkeni 03415bc595 fix typo 2025-07-11 15:44:23 -04:00
Pasi Kallinen 8570421449 Create familiar spell can create harder creatures 2025-07-11 13:04:25 +03:00
nhmall 6c22e7af45 attempt to ensure the correct curses.h is used on Linux
OpenSUSE Tumbleweed ncurses 6.5 requires the one in
/usr/include/ncursesw/curses.h, if ncursesw is being used.

Otherwise, several needed function prototypes are not there.

Fixes #1427
2025-07-10 22:44:56 -04:00
Pasi Kallinen e5bd185ab5 Tutorial: untrapping traps 2025-07-10 13:48:16 +03:00
Pasi Kallinen 588dc6b73f Tutorial: quaffing potions 2025-07-10 13:40:04 +03:00
Pasi Kallinen 06ab2ce604 Tutorial: Knight jumping 2025-07-10 11:07:45 +03:00
Pasi Kallinen 44b9ffe245 Tutorial: tip containers 2025-07-10 11:01:30 +03:00
Pasi Kallinen 3440193a5a Tutorial: spellcasting
Add some basic spellcasting stuff to the tutorial: read a spellbook,
cast a spell.  If the hero doesn't have enough energy, just adds
a note saying so.

Remove/restore the known spells when entering/leaving the tutorial.
2025-07-09 18:30:58 +03:00
nhmall b4f2ef853a add more fallback values to allow basic build to proceed 2025-07-07 12:43:27 -04:00
nhw_cron adef0707f7 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-07-07 10:35:36 -04:00
nhmall 69cf9ad689 aim for successful build even without using hints file 2025-07-07 10:32:47 -04:00
nhmall ce8c4c3ca2 fix reported missing closing '%' in fetch.cmd
Reported directly to devteam by email in K4336 (thank you).
2025-07-07 10:07:02 -04:00
nhmall da132e3bb0 Revert "remove extraneous script file (Windows)"
This reverts commit 33652b8288.
2025-07-07 10:00:25 -04:00
Pasi Kallinen 079dca27f2 Tutorial: clear user-given obj type names 2025-07-07 13:08:07 +03:00
Pasi Kallinen 0da45c1e74 Fix Snickersnee attack
Adding the extra attack to Snickersnee made the weapon always
attack from range, even when it was used in melee.
2025-07-05 19:59:26 +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
Pasi Kallinen 76de716d2d Tutorial: squeezing through small gaps 2025-07-03 10:09:51 +03:00
Pasi Kallinen 04e651ca34 Allow kelp in walls of water 2025-07-02 17:24:15 +03:00
Pasi Kallinen 79bbd33675 Add a false rumor
... but is it false?
2025-07-01 21:04:45 +03:00
Pasi Kallinen 47e95a126e Tutorial: wrong secret door
Some first time players have gotten stuck here. Give them a hint.
2025-07-01 16:19:01 +03:00
Pasi Kallinen 751b296e3b Tutorial: boulders and a trapdoor 2025-06-30 18:00:08 +03:00
Pasi Kallinen 20b03ec0c5 Fix wrong key code in binding keys 2025-06-30 17:59:38 +03:00
nhmall fed5be6943 another follow-up bit for X11 2025-06-30 09:21:17 -04:00
nhmall 1ece615eb2 fixes3-7-0.txt catch-up; also replace some magic hex numbers 2025-06-30 09:04:41 -04:00
Pasi Kallinen 2b0530a5ed Tutorial: iron bars to show hidden stairs
Seems like several new players did not find the "hidden" stairs.
Add iron bars to show a glimpse of them - the hero still needs
to find the secret door in to the room.
2025-06-30 12:41:20 +03:00
Pasi Kallinen a89d6b3bae Tutorial: fix non-alt keys shown as alt-combos
Lua doesn't have regexes, and "-" has special meaning in match;
escape the minus with "%", so it actually matches a minus sign.
2025-06-30 12:34:47 +03:00
nhmall a93397e286 follow-up bit
This may not be required, but it won't hurt.
2025-06-29 20:43:28 -04:00
nhmall 459a339a95 X11: strip extra bits off color when used as index 2025-06-29 13:31:02 -04:00
nhmall 34b42d2354 recent qt6 requires c++20
There are warnings within the qt6 header files if c++20 is not used, for example:

usr/include/x86_64-linux-gnu/qt6/QtCore/qfuturesynchronizer.h:21:5: warning: use of the 'nodiscard' attribute is a C++20 extension [-Wc++20-attribute-extensions]
   21 |     Q_NODISCARD_CTOR_X("Use future.waitForFinished() instead.")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:972:43: note: expanded from macro 'Q_NODISCARD_CTOR_X'
  972 | #    define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
      |                                           ^
1 warning generated.

qmake6 --version
QMake version 3.1
Using Qt version 6.8.3 in /usr/lib/x86_64-linux-gnu
2025-06-29 11:59:07 -04:00
Pasi Kallinen 8d8867007f Typofix 2025-06-27 00:28:27 +03:00
PatR 02885dfccf X11 xrdb complaints
Three instances of "'s" were triggering warnings due to unmatched
apostrophe in the X11 application defaults file.  Reword the affected
comments.
2025-06-21 22:16:35 -07:00
nhmall 1e5a132fa1 update tested versions of Visual Studio 2025-06-19 2025-06-19 13:44:06 -04:00
Pasi Kallinen 7122c0cb0a Add a literary reference to genetic engineer database entry 2025-06-19 12:01:00 +03:00
PatR 92f02d73a4 github issue #1416 - regression of towel's weight
The blindness overhaul branch was created before towel weight got
changed, then unintentionally put the old weight back when it was
finally merged.

Increase weight to towel from 2 to 5 again.

Fixes #1416
2025-06-04 13:27:24 -07:00
nhmall c384f6acb6 macro whitespace cleanup in util/sfexpasc.c 2025-06-04 07:39:12 -04:00
nhmall 8d0b284dc6 update tested versions of Visual Studio 2025-06-04 2025-06-04 07:37:34 -04:00
nhmall b8aa0a507c warning in cfgfiles.c while building sfctool
../src/cfgfiles.c:457:9: warning: variable 'nsep' set but not used [-Wunused-but-set-variable]
  457 |     int nsep = 1;
      |         ^
1 warning generated.
2025-06-04 05:51:03 -04:00
PatR 45f751989a fix #K4331 - sticking from distance
Stop attacking if target isn't there anymore.  Already handled for
two-weapon in normal form, not for multi-attacks in poly'd form and
for multi-attack monster vs hero or monster vs other monster.

I didn't attempt to reproduce the reported problem.  This fix is
based on code inspection.

Also prevent monsters that have hug or engulf attacks from knocking
target back with other attacks since that prohibits the grab/engulf
from being able to hit.
2025-06-03 22:13:22 -07:00
nhmall 28af1d6410 whitespace cleanup in sfbase.c 2025-06-03 20:45:08 -04:00
nhmall 356f451b1b prevent a double free() 2025-06-03 07:35:34 -04:00
nhmall 6c6d8afb8f fix a warning during sfctool build 2025-06-02 22:37:48 -04:00
nhmall cb12423a2e sys/unix/Makefile.utl update for sfctool 2025-06-02 21:52:38 -04:00
nhmall d25e016140 typo fix again 2025-06-02 21:38:21 -04:00
nhmall c85b3f87d1 GNUmakefile follow-up 2025-06-02 21:33:05 -04:00
nhmall 34c010579b update sys/windows/Makefile.nmake for sfctool 2025-06-02 21:20:47 -04:00
nhmall 5d9656c801 typo fix in sys/windows/GNUmakefile 2025-06-02 21:17:40 -04:00
nhmall 1fb403f299 sfctool MSYS2 build 2025-06-02 21:08:38 -04:00
PatR 1aafd7dfcd monster weapon sanity check
In the context of sanity checking, an extra pass though the inventory
of every monster wielding a weapon is completely negligible, but it
is trivial to avoid so take it out.
2025-06-02 13:20:55 -07:00
nhmall f385f36c06 more Windows CI testing 2025-06-02 12:35:31 -04:00
nhmall 436b26c699 Revert "CI remove msbuild@1 task"
This reverts commit c7484730cc.
2025-06-02 12:32:28 -04:00
nhmall c7484730cc CI remove msbuild@1 task
Per https://devblogs.microsoft.com/devops/upcoming-updates-for-azure-pipelines-agents-images/
2025-06-02 12:25:30 -04:00
nhmall e33cf7a6d6 more CI, GNUmakefile interaction 2025-06-02 12:07:11 -04:00
nhmall 4fcbd91d22 fix a CI warning
-> ##[warning]The windows-2019 runner image is being deprecated, consider switching to windows-2022(windows-latest) or windows-2025 instead. For more details see https://github.com/actions/runner-images/issues/12045.
2025-06-02 12:03:30 -04:00
nhmall f262b8b015 CI mingw update 2025-06-02 12:00:42 -04:00
nhmall 4e93cfc825 CI update for mingw 2025-06-02 11:13:43 -04:00
nhmall 40c1842010 update Windows Makefile.nmake 2025-06-02 10:42:21 -04:00
nhmall a9c0cd624f a build fix, due to compile issue for pdcursesmod
GCC15 switched its default to -std=gnu23 and there's a bug in
pdcursesmod as a result. That impacts MSYS2/Mingw64 NetHack builds.
See: https://github.com/Bill-Gray/PDCursesMod/issues/333

The suggestion there is to force --std=gnu17 as a workaround.
2025-06-02 10:32:36 -04:00
nhmall afafc69eed MSYS2 build fixes 2025-06-02 08:50:10 -04:00
nhmall a0da9168b7 remove a debugging bit in restore.c 2025-06-01 22:43:34 -04:00
nhmall 8d5ffbd6e3 permapoisoned follow-up
otmp can be 0 in mk_artifact. In fact, it is explicitly
being set to 0 three lines above the recently added call
to permapoisoned().

The static analyzer was griping also.
2025-06-01 22:31:09 -04:00
Michael Allison 2414e56646 Xcode project update to include: cfgfiles.c sfbase.c 2025-06-01 22:04:44 -04:00
nhmall 66007e6783 remove duplicated code from sfctool.c, sftags.c
Link with hacklib to provide them instead
2025-06-01 15:32:55 -04:00
PatR 79be47b1ad montraits of weapon-wielding monsters
Have save_mtraits() clear wielded weapon when attaching monster
attributes to a corpse object.

And have monster sanity check verify that wielded weapon is in the
monster's inventory.
2025-05-31 16:41:43 -07:00
PatR 468be966fe wishing for "<shape> amulet"
I saw a mimic disguised as an octagonal amulet and wished for an
amulet of that shape to see what it was trying to tempt me with.
I got a random amulet instead of one with the requested description.
That was happening for any valid shape (it's expected behavior for
invalid descriptions, where only "amulet" matches).
2025-05-31 09:15:25 -07:00
nhmall 32e8aa1068 more descriptive message in sfctool for outdated savefile 2025-05-31 11:19:46 -04:00
Michael Allison 3aef3eef86 try to prevent a segfault on macOS 2025-05-31 10:55:06 -04:00
nhmall 31369c2101 more free_nhfile() will already call init_nhfile() 2025-05-31 07:36:44 -04:00
nhmall c05766e99f get_freeing_nhfile() comment 2025-05-31 07:17:40 -04:00
nhmall aa50f30653 free_nhfile() will already call init_nhfile() 2025-05-31 07:11:36 -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
PatR 4533208473 killer ants and soldier bees
This started out as an indentation fix but ended up tweaking a couple
of comments.  The other value adjustments all use 'n += X' rather than
directly modify 'tmp', so this changed more than just the indentation.
2025-05-30 19:50:14 -07:00
nhmall 9ef5e886ee consistent ATTRNORETURN prefix and NORETURN suffix 2025-05-30 22:01:20 -04:00
nhmall 50e5715ca5 fix X11 warning with gcc-15
../win/X11/winX.c: In function ‘init_standard_windows’:
../win/X11/winX.c:2769:46: warning: passing argument 2 of ‘XtAppSetErrorHandler’ makes ‘__attribute__((noreturn))’ qualified function pointer from unqualified [-Wdiscarded-qualifiers]
 2769 |     (void) XtAppSetErrorHandler(app_context, X11_error_handler);
      |                                              ^~~~~~~~~~~~~~~~~
In file included from ../win/X11/winX.c:27:
/usr/include/X11/Intrinsic.h:1771:5: note: expected ‘__attribute__((noreturn)) void (*)(char *)’ but argument is of type ‘void (*)(char *)’
 1771 |     XtErrorHandler      /* handler */ _X_NORETURN
      |     ^
2025-05-30 21:17:07 -04:00
nhmall e365b5b18f more static analyzer adjustments 2025-05-30 14:01:41 -04:00
nhmall 1bf92496f4 follow-up 2025-05-30 10:00:42 -04:00
nhmall 8a2b8796cd file descriptor leak reported by analyzer 2025-05-30 09:46:19 -04:00
nhmall 9ed1e6201a try to help out onefile 2025-05-30 09:09:10 -04:00
Alex Smith 308c5ab237 The Amulet of Yendor gives a wish when initially picked up
Part 4 of implementing wish spreading. (This is now a complete
implementation, although the details are likely to change - but it
makes sense to commit something with the right balance properties,
and then tweak it based on feedback from playtesting.)

This helps to make the Amulet of Yendor feel special, and restores
approximately the same average number of wishes per game as existed
prior to the nerf to wands of wishing.

Placing the wish in allmain helps to avoid the wish happening at an
awkward place in the game's control flow, and is simpler than
testing every possible mechanism for gaining items for bugs (message
order is a common issue when trying to place it in addinv-related
functions, and this also avoids issues with the wished-for item
immediately invalidating an assumption that was made by the calling
code).

It is possible that this would be better as an invoke effect,
although I like the impact of picking up the Amulet and immediately
being given a wish.
2025-05-30 02:10:58 +01:00
Alex Smith a8800a9acd Add a potion of gain level to the Castle chest
This is partly for balance reasons (so that clearing the Castle
helps towards the level 14 Quest unlock) and partly as a clue to
players spoiled on previous versions that the Castle wand now works
differently.
2025-05-30 01:45:30 +01:00
Alex Smith b92b0bbc69 Add a random magic marker or magic lamp to Orcustown
Part 3 of implementing wish spreading. These items are each worth
most of a wish for non-illiterate games (most games wish for a
magic marker, and a magic lamp gives a wish 80% of the time).

The placement of the random item could be better (currently it is
purely random, which is occasionally interesting but often boring),
but this will serve as a base for experimenting with the balance
properties of the moved wishes.
2025-05-30 01:40:42 +01:00
Alex Smith 615edb1c76 Wands of wishing start at (0:1) and can recharge only one charge
Part 2 of implementing wish spreading. This reduces the average
number of wishes at the Castle from 6 to 3.
2025-05-30 01:23:43 +01:00
Alex Smith 3fd30c4ec8 Special effects for Vlad's throne
Part 1 of implementing wish spreading. Vlad's throne is now
guaranteed to eventually give a wish, but has a range of other
powerful (and mostly bad) effects, like removing intrinsics, that
can be much harder to deal with than typical throne effects.
2025-05-30 01:11:41 +01:00
Alex Smith 0e50adcc1e Restore monsters.h to its previous order
This causes the difficulties to get out of sequence, but we agreed
that this is a less important rule than keeping monster IDs stable.

Breaks save and bones files, because it changes monster IDs.
2025-05-29 19:14:10 +01:00
Alex Smith 2bf00395f1 Vault guards are more reluctant to turn up if they keep dying
This is primarily meant as a fix for a farming strategy, although
it also makes sense in terms of the decisions the guards would
likely make.
2025-05-29 19:04:42 +01:00
Alex Smith 45bd98f10e Change #wizmondiff to account for soldier ant, killer bee changes 2025-05-29 18:58:40 +01:00
Alex Smith 90e3abdf9b Hidden (object-form) mimics aren't hit by thrown objects
This is both a bugfix (the hero would be unlikely to aim their
throw at what appeared to be an object) and a balance fix (it was
possible to, somewhat tediously, defend yourself from mimics by
throwing gold pieces at them, and for many players this became
standard strategy in shops, negating the threat from mimics).
2025-05-29 18:15:24 +01:00
Alex Smith 47724f0137 Increase generation depth of soldier ants and killer bees
These two types of monster were extreme outliers in terms of where
they appeared versus how lethal they were (3-4 times as deadly as
other monsters that appeared at similar depth, based on statistics
from actual play), so their generation depth has been manually
modified.

Breaks save and bones files (because monster type IDs have to be
sorted numerically by difficulty, and changing difficulties thus
changes the IDs, but the IDs are used to identify the monsters in
save files).
2025-05-29 17:53:38 +01:00
Alex Smith 228870706b Balance fixes to monster/monster zombie creation attacks
These were unbalancing the game a) in the Castle and b) if they
woke up unique monsters (most notably the Wizard of Yendor).

I considered adding a difficulty check, but this commit instead
just directly fixes the symptoms. (It doesn't make sense for the
Castle to contain a monster that would kill or be killed by its
inhabitants: they should have died long before the hero arrived.
So for liches/zombies to exist in the Castle at all, there must be
a truce.)
2025-05-29 15:57:29 +01:00
nhmall 789d0e6676 fix a warning in sfctool build 2025-05-29 10:02:05 -04:00
nhmall a99944fb09 improve sfctool messages 2025-05-29 09:59:29 -04:00
SHIRAKATA Kentaro 13f46e585f remove redundant assignments on join()
The values assigned there are overwritten by later code.
2025-05-29 18:53:09 +09:00
nhmall c258011fbc update tested versions of Visual Studio 2025-05-28 2025-05-28 21:32:21 -04:00
nhmall 8f1bab8c8d CI yml typo fix 2025-05-27 03:57:34 -04:00
nhmall fb4c4e16b6 CI change brew install to groff 2025-05-27 03:52:58 -04:00
nhmall 90b674c1eb CI include nroff on latest macOS 2025-05-27 03:41:49 -04:00
nhmall 8207d66a16 follow-up 2025-05-27 03:05:27 -04:00
nhmall 41aee443c0 vcxproj bit for sfctool 2025-05-26 22:03:49 -04:00
nhmall df602f5d31 fix Qt issue 2025-05-26 20:33:06 -04:00
nhmall 35e35b2cbd fix paste error 2025-05-26 20:18:00 -04:00
nhmall 317490b49d correct preprocessor comments 2025-05-26 20:12:54 -04:00
nhmall 62f9b0d15c fix some reported warnings 2025-05-26 20:06:20 -04:00
nhmall 956c826223 Makefile.src bit 2025-05-26 13:34:31 -04:00
nhmall 1d42aaf96a follow-up build fix 2025-05-26 13:18:32 -04: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 86a7bfa7e9 Windows visual studio vs gcc long and ulong
The visual studio compiler behaves diffently with _Generic than with
gcc on Linux _Generic around long and ulong.

On Windows they aren't recognized as one of the stdint types.

On Linux gcc, it considers them equivalent to int64_t and uint64_t.

Leave it out of the _Generic to avoid the behaviour difference between
platforms/compilers.
2025-05-26 11:50:23 -04:00
nhw_cron aa5c325bd4 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-05-25 21:42:27 -04:00
nhmall 92f4e191d9 follow-up: fix a warning
files.c:2004:28: warning: unused parameter ‘filename’ [-Wunused-parameter]
 2004 | doconvert_file(const char *filename, int sfstatus, boolean unconvert)
      |                ~~~~~~~~~~~~^~~~~~~~
2025-05-25 20:47:33 -04:00
nhmall a654d08c3b save/restore changes - part 3
This is the third of a series of savefile-related changes.

    This adds early-days experimental support for a completely optional
    'sfctool' utility (savefile conversion tool), to be able to export
    a savefile's contents into a more portable format. There are likely
    to be bugs at this stage. In this initial first-attempt, the export
    format is a very simple ascii output.

    NetHack can be built entirely, without also building this tool.
    NetHack has no dependencies on the tool.

    Attempts were made to minimize duplication of existing NetHack code.
    To achieve that, unfortunately, #ifdef SFCTOOL and #ifndef SFCTOOL
    had to be sprinkled around through some of the existing NetHack
    source code, so that it could be re-used for building the utility.

    The process for building the sfctool typically recompiles the source
    files with #define SFCTOOL and a distinct object file with SF- is
    produced.

sfctool notes:

    Universal ctags is used and required to produce the sfctool utility.

    Some targets were added to the Unix and Windows Makefiles to
    facilitate the build process.

         make sfctool

    That should build a copy in util.

    Note: At present, the Unix Makefiles do not copy sfctool over to the
          NetHack playground during 'make install' or 'make update'.
          Until that gets resolved by someone, The tool will
          have to be manually copied there by the builder/admin if
          desired.
          cp util/sfctool ~/nh/install/games/lib/nethackdir/sfctool

    Also, a separate Visual Studio sfctool.sln solution was written and
    placed in sys/windows/vs. That has has only very limited testing.

    Usage:

      i)  To convert an existing savefile to an exportascii format
          that co-resides with the savefile:

          sfctool -c savefile

          That *must* be executed on the same platform / architecture /
          data model that produced the save file in the first place.

     ii)  To unconvert an existing exportascii format export file to a
          historical format savefile that can then be used by NetHack:

          sfctool -u savefile

          That must be executed on the same target platform / architecture /
          data model that was used to build the NetHack that will
          utilize the save file that results.

     A Windows example:

          sfctool -c Fred.NetHack-saved-game

          That should result in creation of Fred.NetHack-saved-game.exportascii
          from existing savefile:
              %USERPROFILE%\AppData\Local\NetHack\3.7\Fred.NetHack-saved-game

     A Unix example:

          sfctool -c 1000wizard

          That should result in creation of 1000wizard.exportascii.gz
          from existing savefile in the playground save directory:
              1000wizard.gz

  Current Mechanics:
     1. Makefile recipe, or script uses universal ctags to produce
        util/sf.tags.

     2. util/sftags is built and executed to read util/sf.tags and
        generate: include/sfproto.h and src/sfdata.c.

     3. util/sfctool is built from the following:
        generated file compiled with -DSFCTOOL:
                    src/sfdata.c       -> sfdata.o
        existing files compiled with -DSFCTOOL:
                    util/sfctool.c     -> sfctool.o
                    util/sfexpasc.c    -> sfexpasc.o
                    src/alloc.c        -> sf-alloc.o
                    src/monst.c        -> sf-monst.o
                    src/objects.c      -> sf-objects.o
                    src/sfbase.c       -> sfbase.o
                    src/sfstruct.c     -> sfstruct.o
                    src/nhlua.c        -> sf-nhlua.o
                    util/panic.c       -> panic.o
                    src/date.c         -> sf-date.o
                    src/decl.c         -> sf-decl.o
                    src/artifact.c     -> sf-artifact.o
                    src/dungeon.c      -> sf-dungeon.o
                    src/end.c          -> sf-end.o
                    src/engrave.c      -> sf-engrave.o
                    src/cfgfiles.c     -> sf-cfgfiles.o
                    src/files.c        -> sf-files.o
                    src/light.c        -> sf-light.o
                    src/mdlib.c        -> sf-mdlib.o
                    src/mkmaze.c       -> sf-mkmaze.o
                    src/mkroom.c       -> sf-mkroom.o
                    src/o_init.c       -> sf-o_init.o
                    src/region.c       -> sf-region.o
                    src/restore.c      -> sf-restore.o
                    src/rumors.c       -> sf-rumors.o
                    src/sys.c          -> sf-sys.o
                    src/timeout.c      -> sf-timeout.o
                    src/track.c        -> sf-track.o
                    src/version.c      -> sf-version.o
                    src/worm.c         -> sf-worm.o
                    src/strutil.c      -> strutil.o
2025-05-25 20:38:17 -04:00
nhmall 82fd29c429 cron update 2025-05-25 15:47:05 -04:00
nhw_cron b036f1a3d9 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-05-25 15:46:43 -04:00
nhmall e747935975 msdos build fix 2025-05-25 15:43:14 -04:00
nhmall 2cf7acc93b Windows Makefile follow-up 2025-05-25 15:37:46 -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 15ced6f1ff Fix pet apport value
Fuzzer encountered a case where a pet apport ended up being zero:
the reviving tame troll already had edog structure, so it was not reset.
2025-05-23 17:21:27 +03:00
nhmall ec8fab9d7a more config-file code relocations 2025-05-22 14:04:10 -04:00
nhmall 3c25b83121 visual studio project file updates 2025-05-22 10:13:44 -04:00
nhmall c5946c6a43 Windows GNUmakefile library update 2025-05-22 10:07:29 -04:00
nhmall 0c765ce207 move some Windows code: windmain.c -> windsys.c 2025-05-22 10:04:54 -04:00
nhw_cron d019542669 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-05-22 01:01:14 -04:00
nhmall 78a4fd2fb8 split config file processing into its own src file 2025-05-21 23:58:01 -04:00
Pasi Kallinen a4b971c744 Allow monsters to use Snickersnee like a polearm 2025-05-20 20:06:28 +03:00
Pasi Kallinen ab4f70b448 Monsters were bashing with Snickersnee
Side effect of allowing Snickersnee to attack like a polearm,
monsters were bashing with it in melee.
2025-05-20 19:59:28 +03:00
Pasi Kallinen 68ef0b49c1 Split arti_invoke code into smaller functions 2025-05-14 18:30:55 +03:00
nhmall 1a0ef41406 fix a warning
invent.c
.\invent.c(3668): warning C5287: operands are different enum types 'inv_modes' and 'inv_mode_bits'; use an explicit cast to silence this warning
.\invent.c(3669): warning C5287: operands are different enum types 'inv_modes' and 'inv_mode_bits'; use an explicit cast to silence this warning
2025-05-13 20:02:13 -04:00
nhmall 6f1bf6ec69 update tested versions of Visual Studio 2025-05-13 2025-05-13 19:49:38 -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
nhmall 8ac31b24f6 libnh build
The macOS.370 has not yet been tested, but it is patterned after
the linux.370 changes.
2025-05-12 08:45:26 -04:00
Pasi Kallinen c90cc53ab3 Ogresmasher gives a higher chance of knockback 2025-05-12 10:24:36 +03:00
Pasi Kallinen bd98dda8c1 Unpolyed hero can knockback too
Noticed a strange oversight in knockback: Hero hitting a monster
did not cause knockback, unless polymorphed into a monster.
Add knockback chance if we're using a weapon, not twoweaponing,
and dealing some damage.
2025-05-11 21:23:43 +03:00
Pasi Kallinen 6d374f9306 No knockback with flimsy or non-blunt weapon
Weapons that can do knockback are lucern hammer, bec de corbin,
dwarvish mattock, (silver) mace, morning star, war hammer,
club, quarterstaff, aklys, flail, pick-axe, and grappling hook.
2025-05-11 20:32:29 +03:00
Pasi Kallinen af6c53ac7c m_respond code reorg and splitting 2025-05-10 18:42:42 +03:00
Alex Smith d88f0cfeee Change level difficulty formula for the ring of aggravate monster
+15 wasn't very impactful in the late game and late mid-game, but
was much too lethal in the early game (wearing the ring for a while
near the start of the game would make the game unwinnable as very
out-of-depth monsters spawned, and they would still be there even
after removing the ring and usually capable of one-shotting an
early-game character). This commit changes it to a doubling of
level difficulty rather than a flat increase: that makes it more
relevant in the late-game where a +25 or +50 might potentially have
an impact, and more survivable in the early game (although it still
spawns monsters that are difficult for the point in the game, there
is now a chance that you might survive long enough to be able to
take the ring off and clear off all the out-of-depth monsters that
spawned).
2025-05-05 01:22:29 +01: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
PatR ba4f90eefb PR #1406 = use_menu_glyphs for curses and tty
Pull request from NullCGT:  add 'use_menu_glyphs' option to be able
show the object class symbol in menus of objects.
tty:
|a ? scroll of identify  (instead of 'a - scroll of identify'),
curses:
| a) ? scroll of identify  (instead of ' a) scroll of identify').

This commit fixes a bit of formatting in wintty.c.

Closes #1406
2025-04-26 12:50:48 -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
Pasi Kallinen 31e03f1c68 Fix vision on plane of air
We can't just unconditionally unblock vision when the cloud moves,
as there could be a temporary poison cloud at that location.
2025-04-26 20:38:50 +03:00
nhmall 2c6172a10d follow-up bit to savefile changes - part 1
o_init.c restnames got missed
2025-04-24 22:45:49 -04:00
PatR 92255708f3 stone-to-flesh vs mimics
Handle a FIXME in zap.c:  stone-to-flesh spell hitting a mimic that
is disguised as a stone object or stone furniture should bring it out
of hiding.
2025-04-24 12:47:00 -07:00
PatR c6906a78a4 fuzzer vs do-again
Try to exercise ^A more when running the fuzzer.  Also ^P, although
that is tty-centric.

I couldn't notice any difference in behavior so this doesn't seem to
be very useful.
2025-04-24 11:34:35 -07:00
PatR 81e72dd0cc notice_all_mons()
Process monsters more consistently.
2025-04-24 11:19:20 -07:00
PatR f653356144 monst.h comments
End of line comments split across lines should start with '*' on the
continuation lines.  Otherwise clang-format, if we ever run it again,
will mangle them by shifting the start of the comment from the end
of its line to be a new block comment on the next line.

[There are lots of these which ought to be fixed; I just happended to
be looking at monst.h.]
2025-04-24 11:11:55 -07:00
PatR 3c70918c52 disclosure of geno'd and/or extinct species
If there is at least one genocided or extinct type of monster, final
disclosure asks if you want to see the list.  It was using "ynaq"
for the choice of answer, where 'a' is used to prompt for sort order
rather than "all".  Change it to only include the 'a' choice if there
are more than 1 of either category or 1 each of both categories (since
they're listed interspersed with each other, sorting is relevant for
the one-of-each situation).
2025-04-21 07:16:04 -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
nhmall ec5fe78b64 apparently gcc-9 wonn't work on latest Linux in CI 2025-04-20 21:07:38 -04:00
PatR 9f04269ec4 couple of formatting bits 2025-04-20 17:18:49 -07:00
PatR 617b7588cc more obj panic feedback 2025-04-20 15:07:11 -07:00
PatR f9af1aa0cf splitobj() panic feedback
In case the splitobj() panic gets triggered again, provide some more
info about why that has happened.
2025-04-20 14:31:33 -07:00
PatR e21a5c6ac3 curses band-aid
heaputil reported an attempt to free a null pointer at line 1314 of
cursdial.c (in menu_display_page()).

curses_break_str() can return Null but its callers aren't prepared
for that.  Make it return an empty string that can be passed to
free() instead.
2025-04-20 14:19:40 -07:00
Pasi Kallinen 079566cad9 Fix memory leak in lua selection iterate
Iterating over a large set of locations in a selection caused a memory leak.
Lua couldn't do garbage collection in the middle of the iterator function,
so it eventually ran out of space, and just quietly dropped stuff.
2025-04-20 20:19:05 +03:00
nhmall 8f38267775 use documented SIG_RET_TYPE for Linux with gcc 2025-04-20 13:13:30 -04:00
PatR d32c8c63bd Mention reading scrolls while blind in Guidebook 2025-04-19 17:53:22 -07:00
PatR 4b7e330f3a secret doors in Garden filled rooms, take two
A comment in rm.h claimed that secret doors can't be trapped so I
used door flag D_TRAPPED to handle secret doors that should be shown
as trees instead of walls.  But the comment was inaccurate and secret
doors can be trapped.

Such trapped secret doors in ordinary rooms ended up being shown as
trees too.  Switch from using D_ARBOREAL in levl[][].doormask to new
levl[][].arboreal_sdoor which overloads levl[][].candig.

Also, wizard mode wishing for secret doors needed updating to allow
creating trapped ones (at wall or door locations).

This ought to update EDITLEVEL but I think existing save files can
live with secret door display issues.  Untrapped secret doors in
garden-fill rooms will end up becoming trapped.

Replaces the fix for github issue #1309
2025-04-19 11:23:29 -07:00
PatR 96a750d99e undo commit 050846ada9 - lua memory allocator
Commit 050846ada9 checked for
re_alloc(NULL,n) and returned alloc(n) for that case.  After testing
MONITOR_HEAP and heaputil, the original code worked as intended.
I'm not sure what was going wrong yesterday.

Switch back to the previous code.  I could have used 'git revert'
but haven't.
2025-04-18 20:29:27 -07:00
Pasi Kallinen 3d5b7f1f51 Killing quest leader angers the guardians 2025-04-18 14:40:10 +03:00
Pasi Kallinen f12108c5c5 Fix memory leak when setting autocompletions 2025-04-18 11:40:48 +03:00
PatR 050846ada9 lua memory allocated vs MONITOR_HEAP
I hope this is temporary.  nhrealloc() intends to deal with
realloc(NULL, size) but something isn't working correctly.  The
code in alloc.c looks right so the problem might be in heaputil.
However, the code there looks ok too.
2025-04-17 17:04:20 -07:00
PatR 7c40819202 free CRASHREPORT option data
Plug a straightforward memory leak.
2025-04-17 17:00:39 -07:00
PatR 07b59e783e object deletion during save operations
Not sure why my earlier attempt was unsuccessful.  This one isn't as
comprehensive but is simpler and better yet, works as intended.

When saving a level or exiting the program, objects can be deleted
directly rather than having to pass though the objs_deleted list.
2025-04-17 16:59:49 -07:00
PatR 8b7cbbdb0f yn_function() band-aid
If the yn_function() delivers its impossible about returning a result
that isn't considered to be viable, put the prompt into paniclog.

The updated comment contains my guess about what it going wrong, and
I'm fairly sure it is correct.  But I don't know how to fix it unless
we change ^A to just repeat the last command without attempting to
also repeat whatever followed.

At the moment, users will occasionally get strange outcome from ^A.
2025-04-17 13:49:45 -07:00
PatR 1dfbfa12e6 undo earlier change to freedyanmicdata()
Freeing objects early brought back an old issue with unfreed memory.
2025-04-17 11:57:02 -07:00
PatR a6ffebf320 another MONITOR_HEAP bit
'heaputil' complains about free(NULL) because that wasn't handled
consistently back in the pre-standard days.  Avoid using that.
2025-04-17 11:40:07 -07:00
PatR b03e1ee3cb purging deleted objects
I don't think that this fixed any of the 'heaputil' complaints, but
it makes deleted object handling more consistent with dead monster
clearup.
2025-04-17 10:17:28 -07:00
PatR f307f05afd another MONITOR_HEAP
'unsigned long' isn't big enough to hold a pointer in my configuration,
and the old "only micros are sure to support %p format" is long out of
date.  Just assume that everyone has %p these days, and provide a hook
to avoid it for anyone who doesn't.  (Opt-out instead of opt-in.)
2025-04-17 10:10:52 -07:00
PatR f1ba320cb3 memory tracking fix
'heaputil' is producing a lot of complaints.  This fixes one of them,
about freeing memory that was never allocated.  In this case, it's
when removing an overview annotation for a level.  The annotation
is using dupstr_n() and not being recorded due to dupstr_n() being
placed after MONITOR_HEAP undefines the macro that overrides alloc().

There's only one use of dupstr_n(), and its length checking isn't
needed there, so just switch to dupstr() and comment out the
implementation of dupstr_n().  I left the prototype in extern.h;
that's harmless.

If dupstr_n() needs to be resurrected, a second MONITOR_HEAP-aware
version should be implemented, with corresponding macro to choose
which one to use.
2025-04-17 10:06:46 -07:00
Pasi Kallinen 178bd3a988 Wielding Trollsbane grants hungerless regeneration 2025-04-17 17:28:07 +03:00
nhmall c88b288329 yet another stale ZEROCOMP bit 2025-04-16 17:04:45 -04:00
nhmall 16fc4aacb1 another stale ZEROCOMP bit 2025-04-16 17:00:21 -04:00
nhmall 830e18f52e some cleanup of stale bits 2025-04-16 16:56:17 -04:00
PatR d4008772ac build fix for SCORE_ON_BOTL
Warning about missing parantheses when mixing '+' and '?:'.  It didn't
cause 'make' to quit but resulted in incorrect score-in-progress values
eing generated.
2025-04-16 13:17:36 -07:00
PatR f887ba7704 build fix for MONITOR_HEAP
Compile of alloc.c failed when MONITOR_HEAP is defined.
2025-04-16 13:14:42 -07:00
PatR a7412dc835 add '--debug:fuzzer' command line option
Provide a way to bypass a debugger when initiating fuzzing.
 nethack -D --debug:fuzzer        # run fuzzer in wizard mode
 nethack --debug:fuzzer           # run it in normal mode
 nethack [-D] -@ --debug:fuzzer   # skip role/race/&c selection
2025-04-16 12:46:28 -07:00
nhmall 15fa0758f2 put added comment in the correct place 2025-04-16 13:39:32 -04:00
nhmall e024cbc57a go.omoves to svo.omoves since it is read from savefile 2025-04-16 12:45:32 -04:00
Pasi Kallinen 86bfb3e2f9 Avoid map accessibility notices when map isn't updated 2025-04-16 18:08:33 +03:00
nhmall 01e031e639 visual studio recover project update 2025-04-16 10:10:34 -04:00
nhmall 799e252c21 GNUmakefile requires slashes between macro and file 2025-04-15 21:08:03 -04:00
nhmall 8c23cfe4e4 some cleanup 2025-04-15 21:03:59 -04:00
nhmall c2a2d5e344 fix some issues with recover unrelated to today's changes 2025-04-15 21:02:16 -04:00
nhmall dcb0fc7654 remove unused target from Makefile.utl 2025-04-15 20:03:28 -04:00
nhmall 6cf9415b72 add define to GNUmakefile build 2025-04-15 20:01:02 -04:00
nhmall 28d2ff516c sys/windows/GNUmakefile recover 2025-04-15 19:58:25 -04:00
nhmall 5560bdb27c msdos recover 2025-04-15 19:53:50 -04:00
nhmall 46d4639d66 visual studio build fix (for recover) 2025-04-15 18:56:34 -04:00
nhmall 44af2a96a5 recover utility updates 2025-04-15 18:02:44 -04:00
nhmall 502b60d210 follow-up bit
oextra should have been included in the critical bytes
2025-04-15 15:49:36 -04:00
nhmall a3e12550ea savefile changes - part 1
This is the first of several savefile-related changes to
follow later. This one is groundwork for those later changes.

Remove internal compression schemes (RLECOMP and ZEROCOMP)
and discard the savefile_info struct that was primarily used to
convey which internal compression schemes had been in use.

Relocate some struct definitions into appropriate header files
for use by code to come in later changes.

Remove the two struct size-related fields from version_info and
from the nmakedefs_s. Instead, include a series of bytes near the
beginning of the savefile, representing the size of each
struct or base data type that impacts the historical savefile
content. Those are referred to as the "critical bytes".
(Related note: the "you" struct required two bytes, low and high,
due to its size).

Compare those critical bytes in a savefile against the NetHack
build that is reading the savefile. This allows mismatch detection
early in the savefile-reading process, and a clean exit, rather than
proceeding to read nonsensical values from the file. Include some
feedback on what the first mismatch was when encountering
one.

For arrays stored in the savefile, use loop-logic in the core
to write/read the array elements one at a time, rather than in
a single blob. This will be required for changes to follow later.
(impacts artiexist[], artidisco[], svd.dungeons[], svl.level_info[],
svl.level.locations[][], msrooms[] field of mapseen, svb.bases[],
svb.disco[] objects[], svm.mvitals[], svs.spl_book[], svd.doors[],
go.oracle_loc[], utrack[], wgrowtime[])

This also adds data model to the long version information.

This invalidates existing save and bones files due to the changes in
the information at the start of the file.
2025-04-15 15:35:17 -04:00
Pasi Kallinen af3e601ff7 Remove melting ice timer when breaking digging wand 2025-04-15 14:45:51 +03:00
Pasi Kallinen d6dd5c743c Reinstate some of the mind flayer amnesia
When I reworked amnesia to not forget levels or objects, I removed
the forgetting from the mind flayer attacks.  I intended to add
something to replace it, but forgot ...
2025-04-13 20:16:00 +03:00
nhmall 932f598689 follow-up bit 2025-04-13 12:23:09 -04:00
nhmall a70db6dafb WIN_MAP==WIN_ERR on a code path to tty_wait_synch 2025-04-13 12:14:38 -04:00
Pasi Kallinen a185c270bb Expose trap once-field to lua 2025-04-13 17:32:14 +03:00
nhmall eeb96c4151 update tested versions of Visual Studio 2025-04-13 2025-04-13 10:22:59 -04: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 e26a496088 fix issue #1309 - secret doors in Garden rooms
Issue reported by elunna:  when a room gets converted into a theme
room with fill type Garden, its walls are changed to trees but any
secret doors in those walls are still displayed as regular walls.

This adds a new D_ARBOREAL flag for secret doors, used to force them
to be displayed as a tree instead of a wall.

Fixes #1309
2025-04-12 17:21:40 -07:00
PatR 8f344a30b5 github PR #1399 - add "Murphy" to ghost names
Pull request from greg-kennedy:  add "Murphy" to the list of random
ghost names.

Closes #1399
2025-04-12 12:33:10 -07:00
PatR efee4553b6 github PR #1394 - "Mine's End" epitaph
Pull request from chappg:  add "I have reached Mine's End" to the set
of epitaphs.

Blame the explantory comment on me.

Closes #1394
2025-04-12 12:19:50 -07:00
Greg Chappell 9821caf984 Add "I have reached Mine's End" epitaph 2025-04-12 12:10:11 -07: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
rbsec 6a74f46c25 Fix a couple of incorrect names in the Terry Pratchett tributes 2025-04-12 10:36:37 -07:00
PatR ab8ab7b344 more THEMERM and THEMERMFILL
Give a little more information if environment variable THEMERM or
THEMERMFILL has an invalid value.
2025-04-12 10:22:52 -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 48d1b8617e themerms.lua formatting
Do some reformatting of dat/themerms.lua.  I didn't try to reproduce
the changes that were in the reverted commit, and didn't slow through
to the end.
2025-04-11 17:07:55 -07: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
copperwater 3427c43df2 Guard against no themed rooms or fills being eligible to generate
The themed room code previously assumed that on any given level, at
least one room or fill would resolve as OK to generate there. However,
that's not a great assumption to make, and if it happened to be broken,
the first themed room or fill would arbitrarily be executed, even though
it wasn't eligible. Fix that by setting the initial pick to nil, and
raising an impossible if it's still nil after trying to choose a random
room.
2025-04-11 16:27:34 -07:00
copperwater 47e6edc663 Enable generating specific themed rooms for debugging
A common pain point I encounter when working on themed rooms is making
specific rooms generate. The only ways to do this were mass commenting
out the rooms not being tested, or hacking in different room frequency
values (even more annoying when testing a fill, not a room, or testing
pure-function rooms/fills that have no frequency).

This change solves that problem by allowing a wizard-mode user to define
THEMERM or THEMERMFILL environment variables to make specific rooms or
fills generate.

The first part of this change is converting all themed rooms and fills
that were plain functions into tables, and converting their comment
names into actual names in those tables. The names are not intended to
be shown during gameplay, but instead serve as values that THEMERM or
THEMERMFILL can be matched to to generate those rooms. It's no longer
possible to have a function themeroom; this will raise an impossible.
As far as I'm concerned, this is a good change because it allows some
code simplification of themerooms_generate and makes it easier to add
difficulty or eligibility parameters to rooms.

The second part of this change is adding a new nh.debug_themerm function
to make the environment variable values accessible to themerms.lua. I
looked for an existing way to do this but didn't see one (nh.variable
is the closest but appears to be for variables that get saved).

The final part is inserting behavior into the actual themeroom
generation code that changes how they generate when either a room or a
fill is set. I don't think it's safe to generate every single room with
the requested type or fill - that might lead to cases where the stairs
or a magic portal cannot generate. So it creates ordinary rooms half of
the time, which still results in plenty of themed rooms on levels.

Another thing to note is that any themed room using filler_region will
still only pick a fill 30% of the time. If one specifies both a fill and
a room that uses filler_region, many of those rooms will appear without
a themed fill.
2025-04-11 16:27:34 -07:00
PatR 5a910f3df7 Revert "whitespace cleanup for themerms.lua"
This reverts commit eee5a1698b.
Easier to commit PR #1384.
2025-04-11 15:19:06 -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 197e6af78c Increment EDITLEVEL for silver maces 2025-04-09 21:26:22 +03:00
Pasi Kallinen fa229439d4 Fixes entry for silver mace
Fixes #1405
2025-04-09 21:05:59 +03:00
disperse c271f878f9 Fixed tile numbering in objects.txt 2025-04-09 19:46:05 +03:00
disperse b5768d676c Added tile for silver mace
Copied the mace tile and added more blue and white and softened the
shadows on the head of the mace.
2025-04-09 19:46:05 +03:00
disperse 67d58202ad Silver maces
Added the silver mace to be the base weapon type of Demonbane.  It is appropriate that an artifact weapon designed to slay Demons would be made of (or plated with) silver.  This helps to offset the damage reduction when Demonbane was changed from a longsword to a mace and makes it more specialized against silver-haters.
Set the probability to 2, equal to that of a silver spear.
Increased the weight of the silver mace by 120% -- equal to the weight increase from a normal spear to a silver spear. (Assuming the weapon is silver plated rather than made entirely out of silver.)
Increased the base cost to 60, a similar increase as spear to silver spear, to be an even number between silver spear and silver saber.
Monsters will prefer silver maces over regular maces.
Otherwise, identical in function to a normal mace.
2025-04-09 19:46:05 +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
PatR 3aecc90b2d commit 46b98bab5b951c16f3c6766f23acb22c3046608c
Author: PatR <rankin@nethack.org>
Date:   Mon Apr 7 13:58:28 2025 -0700

    fix issue #1404 - re-tamed feral pet starves

    Issue reported by k21971:  changes in 'struct edog' initialization
    resulted in re-taming of a feral former pet producing a tame monst
    that immediately dies of starvation.

    I didn't look at the earlier behavior, just forced hunger to be
    initialized separately from other edog fields.

    Fixes #1404
2025-04-07 14:11:58 -07:00
PatR afc34c9873 mon throw-and-return cleanup
Fix up a few comments in the monster throwing code.  And change a
couple 'if (!Blind)' checks to use 'if (canseemon(magr))' instead
of that the player won't be told about a returning aklys hitting an
invisible monster ("it") on the arm.
2025-04-05 09:50:38 -07:00
PatR 500af49dd3 fix issue #1407 - mon throw-and-return crash
Issue reported by k21971:  a gnome throwing a wielded aklys at the
hero was killed when failing to catch its return.  Bookkeeping for
dead monsters got messed up, then a crash occurred.

This fixes things.  Instead of a comment stating that the thrower
might be dead, kill it off.
2025-04-05 09:44:02 -07:00
PatR 4afb9254e1 fuzzer vs yn_function()
This has been sitting around for a long time.  It prevents at least
one fuzzer exit.

Before adding this, I did trigger one yn_function() 'impossible'
while doing ordinary testing but wasn't able to reproduce that, so
am still not sure what is going on.
2025-04-03 20:07:31 -07:00
PatR 0ecd573152 escape_from_sticky_mon()
Reorganized a 'switch' statement in order to eliminate a 'goto'.
There should be no changed in behavior.
2025-04-03 15:26:05 -07:00
PatR eee5a1698b whitespace cleanup for themerms.lua
I hope this doesn't break anything.  There seemed to be one or two
misplaced 'end' statements, but after some massaging I'm not sure
about this anymore.

There were lots of wide lines; those are easy.  The Water-surrounded
vault had very inconsistent indentation so was harder to untangle.
2025-03-30 14:43:09 -07:00
copperwater b32ce258e3 Fix: buffer overflow in gamelog with an extremely long wish string
This was discovered when a game of xNetHack crashed with stack smashing
detected during dumplog creation after an ascension. I traced the
problem to a wish with a very long string the player had made much
earlier in the game ("greased very blessed holy rustproof unlit historic
thoroughly +5 very cloak of protection named it would be a shame if
something happened to me wearing this cloak"), which is further recorded
in an even longer form in the chronicle as 'wished for "X", got "Y"'.
That string does get truncated, but since the gamelog strings are
dynamically allocated, they can be longer than BUFSZ.

When show_gamelog was subsequently called, it didn't use any bounds
checking, which allowed its stack-allocated buffer to overflow. Changing
the offending sprintf to snprintf and limiting it to the buffer size
appears to fix this issue. It will truncate the string at BUFSZ-1
characters and therefore will be expressed in the dumplog as an
incomplete string, but 1) that was happening anyway because the gamelog
string already doesn't capture the entire "wished for X, got Y" message
on such a wish, and 2) this should only ever happen for very long
wishes.
2025-03-29 07:21:04 -04:00
nhmall da197df75e comment typo 2025-03-22 12:17:12 -04:00
PatR 1df8fd8b3b cutting down closed doors
Most things that can be dug or chopped can only have that done by one
of the two types of digging/chopping tools:  pick-axe or axe.  Since
closed door can be broken open via either type, mention the type of
implement in the final "you break through the door" message by adding
"with your <uwep>."
2025-03-20 16:09:15 -07:00
nhmall 9e2a0f977e fixes entry update 2025-03-20 14:39:04 -04:00
nhmall 3ed63f9be4 more Xcode cleanup 2025-03-19 21:20:39 -04:00
nhmall f30780e42e clean up absolute paths 2025-03-19 21:16:46 -04:00
PatR d7f107eaf9 still more 'nethack --dumpweights'
After updating the --dumpweights code in hack.c to insert "pair of"
for gloves and boots and "set of" for dragon scales, I've switched
it to use simple_typename() instead.

Turns out that that routine also lacked handling for 'pair|set of'.
And it was generating "coin of gold piece".  Fix those.

Roughly half of the gems are "<gem>" and the others "<gem> stone",
so the --dumpweights output is different by more than just pair/set.
2025-03-19 17:30:56 -07:00
nhmall b55162a605 more file name change follow-up for weight.h 2025-03-19 19:46:11 -04:00
nhmall 872a9778ed Xcode project update 2025-03-19 19:26:27 -04:00
nhw_cron 5cc94c74c8 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-03-19 17:57:02 -04:00
PatR b237337806 streamline domove_core()
Split handling for paranoid_confirm:Trap out of domove_core() into
a separate routine.  There should be no change in behavior.
2025-03-19 14:33:13 -07:00
nhmall e70b92e200 paste error in Makefile.nmake 2025-03-19 17:31:19 -04:00
nhmall 1f99638bbf ren nhconst.h -> weight.h
The speed related values were not used, except for NORMAL_SPEED,
which has been moved back to permonst.h
2025-03-19 17:14:07 -04:00
nhw_cron 601d03b71d This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-03-19 14:33:00 -04:00
nhmall 526571b1f7 another follow-up for magic number replacement 2025-03-19 14:12:03 -04:00
nhmall e8c401acb3 follow-up: numeric values in comment fix 2025-03-19 13:38:12 -04:00
nhmall a943c4c10b replace some weight-related magic numbers
adds a header file include/nhconst.h  (I'm open to a better name)
2025-03-19 13:29:58 -04:00
PatR 00a5d811ee monmove.c: remove a couple of trailing spaces 2025-03-19 07:48:12 -07:00
PatR ef9734f1c1 another 'nethack --dumpweights' tweak
Don't suppress slime mold.
2025-03-19 01:39:01 -07:00
PatR ec6632352f 'nethack --dumpweights' tweak
In the generated comments accompanying weights, show /* a novel */
rather than /* a spellbook of novel */.
2025-03-18 11:53:58 -07:00
Pasi Kallinen a64796e64d Flip monster goal when flipping the level 2025-03-17 14:33:01 +02:00
nhmall 8c0c33aa1f another follow-up bit 2025-03-17 08:09:00 -04:00
nhmall ed406dafe7 follow-up: store square of dist in arwep table
Also includes some additional unrelated #undef's since one was
being added.
2025-03-17 07:38:37 -04:00
Greg Kennedy 4e42ae27b4 Add "Murphy" to list of random ghost names
"Murphy's Ghost" is a recurring fixture of the long-running "Wizardry" series of classic dungeon crawler video games.
2025-03-16 21:43:49 -05:00
PatR f7a390db11 fix #K4324 - Xp and Exp highlit after restore
Experience-level and experience-points, if enabled, could be
highlighted via 'up' or 'changed' rules in initial display after
restore.  I tried 'down' rule too but didn't produce with that.

I don't understand what was going on but was able to reproduce it
and then fix it via the trial and error method....
2025-03-16 19:37:40 -07:00
nhmall d53698baea whitespace at end-of-line 2025-03-16 15:39:22 -04:00
nhmall 0bdf9830e6 throw-and-return weapons used by monsters
Resolves #1338
2025-03-16 15:37:49 -04:00
Pasi Kallinen 7c43654580 Lua: allow functions for some optional strings
Those places that use get_table_str_opt() to get an optional string
value can instead use a function that returns a string.
This can be used for example in quest data lua table, or some table
fields in the lua api bindings, or the dungeon definition.

For example, in quest.lua

text = "You again sense %l pleading for help.",

could be replaced with

text = function() return "You again sense %l pleading for help."; end,

which of course allows using lua to build the string.
2025-03-16 20:29:28 +02:00
nhmall 53cbccdb86 warning bit from the door fix earlier
mklev.c(97,14): warning C4389: '!=': signed/unsigned mismatch
2025-03-16 08:42:42 -04:00
nhmall e164ce0af4 rings were missed in --dumpweights text 2025-03-16 08:41:08 -04:00
Pasi Kallinen b2c071bc66 Fix rare door in corner of room bug
There were couple reports of doors being generated in a corner
of a room.  This happened for randomly generated irregular rooms,
because the code that was deciding if a corridor starting or
ending location was good did not handle irregular rooms at all.

This changes the corridor code so it can now generate start and
end points properly for any valid position in irregular rooms,
instead of only on the edges.  This means the corridor sometimes
meanders a bit more than before, because it tries to find
the end point away from the edge of the room rectangle.

Also added is sanity checking for the randomly generated rooms
and corridors level, testing for door placement and room connectivity.

And another fix for a rare special case where dig_corridor
created a zero-tile long corridor; the entrance door was placed,
but there was nothing behind it.

Fixes github #1269 and #1385
2025-03-16 09:46:53 +02:00
nhmall ef6ca6c5fa follow-up for --dumpweights
Use a string compare for the sort and encode the weight
at the beginning of the string
2025-03-15 23:18:01 -04:00
nhmall b169b79d36 dump monster and obj weights using --dumpweights 2025-03-15 19:55:49 -04:00
Pasi Kallinen 488011571a Fix vision when vault guard corridor vanishes 2025-03-15 22:20:59 +02:00
nhmall ef4cd7608d follow-up for pull-request #1397
Fix warnings
objnam.c: In function ‘wizterrainwish’:
objnam.c:3536:54: warning: variable ‘didblock’ set but not used [-Wunused-but-set-variable]
 3536 |     boolean madeterrain = FALSE, badterrain = FALSE, didblock, is_dbridge;
      |                                                      ^~~~~~~~
2025-03-14 10:34:22 -04:00
nhmall 57825b170d pull request #1397 by copperwater
Closes #1397
2025-03-14 10:00:35 -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
nhmall 9b0724f8f2 update tested versions of Visual Studio 2025-03-13 2025-03-13 12:57:55 -04:00
nhkeni 67dc6662ac remove bogus content from template file 2025-03-13 12:48:07 -04:00
nhmall dfe2a967fc fix a recent typo 2025-03-13 07:40:20 -04:00
PatR 31d86a8c41 trapped box->tknown
If 'autounlock' is set to test a chest for traps, skip "check for
traps?" when tknown is set; go directly to "disarm trap?" if the
chest is trapped, skip that too if it isn't.

If wand of probing hits a chest, set the tknown bit.
2025-03-12 01:28:05 -07:00
nhmall 8f84f76f09 stop a warning when compiling util/stripbs.c 2025-03-11 10:46:08 -04:00
nhmall 4a67caf3d7 document musl=1 in README-hints 2025-03-11 10:27:18 -04:00
PatR 1d22a396d4 fixes3-7-0 typo 2025-03-10 21:54:22 -07:00
nhmall 8abd9e9564 comment wording bit 2025-03-10 20:29:38 -04: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
nhw_cron e300c205c6 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-03-10 17:25:28 -04:00
nhmall fbb8ef2fa6 follow-up: set STRIPBS in Makefiles 2025-03-10 17:18:58 -04:00
nhmall bddca2ded5 musl libc build, rather than glibc
We've had reports of a couple of issues building against musl libc.

Issues reported:
  - build procedures utilize cat for Guidebook-creation, and cat
    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'.

Closes #1393
2025-03-10 17:14:24 -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
PatR 0a180c52ef more issue #1362 - carrying Mitre of Holiness
Protect carried items as well as hero when carrying the Mitre of
Holiness.  Already handled when wearing that artifact.

This might make it be too strong.  At the time that it was given
the carrued attribute, there was no such thing as carried items
providing any protection to other carried items.
2025-03-09 14:28:50 -07:00
nhmall 3b15e4fff2 a pair of duplicate #include statements in hack.h 2025-03-09 09:51:12 -04:00
PatR a3c6eec5c0 enlightenment about bones
"You have disabled loading of bones levels" (during play) and
"You disabled loading of bones levels" (end of game disclosure)
both clearly refer to the player rather than the hero.
"You have never encountered a bones level" is accurate for current
hero but not necessarily accurate for the player.  Rephrase it.

Also, if OPTIONS=!bones is set and the hero just died, extend
"You disabled loading of bones levels" during disclosure to
"You disabled loading and storing of bones levels" (even in the
case where bones wouldn't be saved anyway).
2025-03-08 13:16:27 -08:00
nhmall d0d77ed5f4 related comments were not updated with parameters 2025-03-08 12:51:53 -05:00
copperwater 49b43f760f Fix: a number of unblock_points shouldn't unblock unconditionally
Initially diagnosed in an xnethack fuzzer crash - unblock_point
shouldn't be called when a closed door becomes non-closed, because it's
possible that there's a gas cloud on the space which means it still
blocks vision. These always need to be recalc_block_point. A number of
them were fixed, but when I went through all the xnethack ones, I found
some that were unchanged from upstream NetHack. I reproduced the sanity
check impossibles usually by breathing gas at a door as an iron golem
and then opening or destroying the door to trigger the unblock_point
call.

The use of recalc_block_point in wizterrainwish was not triggering this
bug, but the previous code there basically duplicated
recalc_block_point.
2025-03-08 07:53:57 -05:00
PatR a6a1e1b365 nasty() tuning
Another old stash.  Slighty weakens genocide of high level monsters.
2025-03-07 12:14:22 -08:00
PatR 6a24d5ac04 report.c tweaks
The report.c bit committed today reminded me that I had an old stashed
change for that file.  There should be no change in behavior.
2025-03-07 12:07:17 -08:00
nhkeni adeb69ba82 report.c: fix HASH_BINFILE typo 2025-03-07 13:34:53 -05:00
nhmall ceee6aff31 pointer decl style consistency; use any_types enum 2025-03-06 07:20:16 -05:00
nhmall 78ca37290b cast style tidbit 2025-03-05 10:29:50 -05:00
nhmall fd49242015 botl.c follow-up 2025-03-05 08:55:27 -05:00
nhmall 90d240cbb8 revert assert addition 2025-03-05 08:17:09 -05:00
nhmall 3ef8ae3cc1 Merge branch 'parse_status_hl2' of https://github.com/argrath/NetHack into NetHack-3.7 2025-03-05 08:08:27 -05:00
nhmall 2202b9b8ab Merge branch 'swallowit' of https://github.com/argrath/NetHack into NetHack-3.7 2025-03-05 08:06:38 -05:00
nhmall ebeebcc427 Merge branch 'removemagic' of https://github.com/mkuoppal/NetHack into NetHack-3.7 2025-03-05 07:59:43 -05: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
copperwater 50d80b5183 Fix: map random y-placement used its width instead of height
Not sure how long this has existed without triggering any issues, but
when I was testing out a themed room wider than it was tall, I ran into
rn2-of-a-negative-number impossibles. Traced it to here, where it was
trying to subtract the width of the mapfrag from ROWNO to figure out
which y-value it should place the map on. The correct behavior is to
subtract the height of the mapfrag.
2025-03-04 18:46:31 +02:00
copperwater 55c3a7c6c5 Fix: sitting on bidirectional teleportation traps
It is possible to create a bidirectional teleportation trap by making a
pair of teleportation traps with a fixed destination of each other's
coordinate. Moving or hurtling onto such a trap correctly materializes
the hero on top of the other trap without triggering it, but for some
reason I didn't dig into, sitting down to trigger the first trap does
also trigger the second one at the destination end, causing you to
counterintuitively teleport twice and end up back where you started.

Fix this by stopping tele_trap() from doing anything if it's called
recursively, using a static variable like spoteffects() does for the same
purpose. I had to adjust a bit of other tele_trap code to remove its
sole early return.
2025-03-04 18:43:14 +02:00
copperwater 71e562def8 Livelog when a player breaks petless conduct
If a player initially goes petless then later obtains a pet, it's absent
from the game chronicle. Fix that by adding a livelog for it.

This required a bit of restructuring in create_familiar() that I wanted
to do anyway: removing the kludge of decrementing u.uconduct.pets when a
figurine has been deployed but isn't actually going to come out tame.
Calling initedog() /after/ deciding whether it's needed or not prevents
a first-pet livelog being produced for a figurine that didn't come out
tame.

The guardian angel code, which avoids calling initedog(), can never be
the hero's first pet anyway because it only appears tame when the hero
has already broken petless conduct. But while checking, I noticed a
duplicate comment, so I removed that.
2025-03-04 18:41:02 +02:00
copperwater cbd45afa5a Make pline_mon work if youmonst is passed to it
I was working on another patch involving a message that could be printed
for either a monster or the player (using a struct monst * variable that
either holds the monster or &gy.youmonst), but wasn't able to easily use
pline_mon for the message since the mx and my of youmonst aren't kept
updated as the hero moves. (In my testing, they were always 0, but it's
not clear if they will remain 0 throughout the game, or if that's a bad
assumption to make.)

Allow this in the future by checking for youmonst in pline_mon and
setting the coordinates to 0,0 explicitly so no relative coordinate
message gets printed when it's about the hero.

I'm not sure if it's a reasonable assumption that no messages that could
ever be passed to pline_mon for a player would ever need to note
"(here)" when accessiblemsg is turned on. If that's the case, the
correct thing would be to set the coordinates to u.ux, u.uy instead of
0,0.
2025-03-04 18:38:30 +02:00
SHIRAKATA Kentaro d2af1afb52 split "swallowit" on throwit() into a separate function 2025-03-04 21:31:17 +09:00
nhw_cron 121e12085b This is cron-daily v1-Apr-1-2024. 000files updated: Files 2025-03-01 07:33:43 -05:00
SHIRAKATA Kentaro bcf7bfc52e add a short README for test/ 2025-03-01 15:01:14 +09:00
nhmall 963ee14528 remove references to lev_main.c from comments 2025-02-28 19:20:36 -05:00
PatR 518842ce19 typo fix 2025-02-28 11:37:05 -08:00
PatR 82c6804516 X11: avoid null-pointer-subtraction warnings
Most recent version of XQuartz, same as before.  Unfortunately,
newer version of macOS => newer version of Xcode and its command
line tools => newer version of clang => emulating newer version of
gcc which defaults to a more recent version of StdC, I suppose, or
perhaps our hints are specifying that.  Whichever, it has resulted
in a bunch of complaints about XtOffset() used in win/X11/winX.c:
|warning: performing pointer subtraction with a null pointer has\
 undefined behavior [-Wnull-pointer-subtraction]

Adding -wno-null-pointer-subtraction to X11FLAGS silences them,
but that would require figuring out which versions of gcc and
clang added -Wnull-pointer-subtraction and its negation.  Revising
XtOffset() to include the ptrdiff_t casts eliminates the warnings,
avoiding the need for version conditionals to deal with X11FLAGS.
2025-02-28 10:38:50 -08:00
nhmall 18063d149f Resolve #1387 on GitHub - Makefile.nmake typo
Merge branch 'fix_makefile' of https://github.com/argrath/NetHack into NetHack-3.7

Resolves #1387
2025-02-28 12:58:51 -05:00
nhmall ce7b7710d8 a fix for issue #1386 - impossible to gen ';' mon
Bug description of #1386 by @copperwater on GitHub:

  "When generating a random monster from a class using des.monster(),
  the G_NOGEN in their statblock is suppressed, but because every monster
  of this class has frequency 0, none of them are actually eligible to get
  picked. mkclass ends up returning a null pointer and create_monster has
  to pick a random monster instead.

  This affects the following levels (all the ones that use random sea monsters):

  Healer quest start
  Healer quest locate
  Plane of Water (difficult to notice, since it has lots of specific sea monsters and only 5 random ones)

  This can be pretty easily viewed by going to the Healer quest start and
  detecting monsters: there is a shark and a giant eel, which are
  specifically defined, but the remaining random sea monster that should
  be there is absent."

Add a tracking array mclass_maxf[MAXMCLASSES] (about 61 entries, the
first not being used), and fill it one time in init_mongen_order() with
the maximum frequency value seen of any monster in that class.

Any mclass_maxf[] entry of zero represents that entire class of monsters
having no positive frequency value.

Detect that in mkclass_aligned(), and use it to work around the situation
to produce the monster being sought by the Lua level description file.
2025-02-28 12:40:34 -05:00
SHIRAKATA Kentaro 83bb81c624 fix Makefile.nmake when USE_DLB=N 2025-03-01 00:12:03 +09:00
nhmall d56b0a3b7a follow-up bit for Windows console 2025-02-26 23:14:52 -05:00
nhmall 1eaafddca3 fix dolook() on Windows console
usemap boolean wasn't being set to TRUE when it should have been
2025-02-26 23:10:30 -05:00
nhmall 56ebf05324 convert some tabs to spaces in util 2025-02-26 21:51:44 -05:00
nhmall 6ff2bf0993 convert some tabs that crept in to spaces 2025-02-26 21:44:21 -05: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
PatR 1fd3bb661f fix issue #1378 - brain eaten after flayer's death
Issue reported by Umbire:  if a mind flayer got turned to stone by
hitting a hero who is polymorphed into a cockatrice and the first
tentacle drain missed but a subsequent one hit, any remaining ones
would keep being applied even though the mind flayer was dead.

This works but doesn't feel right to me.  A more substantial change
to mhitm_ad_drin() didn't work as expected so I've settled for this.

Fixes #1378
2025-02-25 09:54:14 -08:00
PatR 76b5bbe693 fix issue #1382 - stoning resistance
Issue reported by elunna:  nethack has become confused about
resistances held by poly'd hero.

resists_xxxx() got changed to check worn and carried equipment
so was no longer accurate for use when changes shape.

Fixes #1382
2025-02-25 09:49:55 -08:00
PatR 1102a77777 feedback about config file name on MacOS
When hunting for player's run-time config file under MacOS/OSX,
nethack looks for .nethackrc (or $HOME/.nethackrc), then if not
found it looks for
 "$HOME/Library/Preferences/NetHack Defaults", and finally for
 "$HOME/Library/Preferences/NetHack Defaults.txt".
When none of those exists, the last choice has been being left in
configfile[] and can get used in messages.

The menu for entering the tutorial includes a tip about setting
OPTIONS=!tutorial in the config file, but it was showing the third
choice rather than the first when none of them are found.  Change
config file name setup to remember the first name rather than the
last when it represents a non-existant/not-yet-existent file, so
that the tip recommnends the standard Unix name rather than the
Mac-specific one.
2025-02-25 09:44:03 -08:00
Keni 372ebd9d80 NOSTATICFN/NONOSTATICFN typos and logic fixes 2025-02-17 11:50:55 -05:00
nhmall 6b2f24a443 Fix out-of-bounds
makemon.c: In function 'init_mongen_order':
makemon.c:1806:25: warning: iteration 383 invokes undefined behavior [-Waggressive-loop-optimizations]
 1806 |         mongen_order[i] = i;
      |         ~~~~~~~~~~~~~~~~^~~
makemon.c:1805:24: note: within this loop
 1805 |     for (i = LOW_PM; i <= NUMMONS; i++)
      |                      ~~^~~~~~~~~~
2025-02-17 07:24:32 -05:00
nhmall 679094ff93 keep tameness at or above its existing level
Resolves #1380
2025-02-16 07:30:22 -05:00
nhmall 1da02b1025 remove a cast that isn't doing anything now 2025-02-16 06:57:53 -05:00
Pasi Kallinen 495a7e7898 Silence a suggested parenthesis warning 2025-02-16 10:50:04 +02:00
Pasi Kallinen 3cb7819c81 Split monster goal coordinate out of mstrategy field
Instead of packing a coordinate into unsigned long, store the goal in
a coord struct, making the code a bit cleaner.  Monster struct is
of course slightly bigger, but that should not really matter.
No change in monster behaviour.

Breaks saves and bones.
2025-02-16 10:46:21 +02:00
nhmall 8672807a5e cmp_init_mongen_order() qsort comparison function tweaks
The array was ending up ordered the same on different qsort
implementations.

This incorporates the mlet value into the sort value for comparison.
That guarantees that everything stays ordered by mlet, followed by
difficulty (and would even if something ever got misplaced in
monsters.h). It means the "they are equal" zero return for differing
mlet values is not required, and has been removed.

This removes the "they are equal" zero returns for G_NOGEN | G_UNIQ
monsters, so they will still get sorted rather than left at the
whatever array element they happened to be at (which I don't think
should be an issue?).
2025-02-14 19:30:34 -05:00
nhmall f1be2eaffa add --dumpmongen to view mongen_order[] array 2025-02-14 09:38:29 -05:00
Pasi Kallinen 027bf78f28 Sort monsters for mkclass
An assumption of monster generating code is that monsters within a class
appear in increasing order of difficulty.  This wasn't the case with
some monsters, but swapping the monsters around is rather intrusive,
and doesn't really lend to changing monster difficulties when needed.

As a result, for example ghouls would not randomly generate when they
should have at certain level difficulties (where a ghoul is weak enough
to generate but an ettin zombie would be too strong).

Keep a separate array of monster indexes sorted correctly, generate it
when required by mkclass()

Description of this bug via copperwater <aosdict@gmail.com>
2025-02-13 17:17:00 +02:00
nhmall e26102f66d leashed food ration fix
Noticed while testing an earlier fix - after your pet consumes a large mimic
corpse don't have it remain leashed once it begins to mimic something
that isn't leashable
2025-02-13 00:18:39 -05:00
nhmall a68bc3b3fb fix tamed pet issue #1379
fixes #1379
2025-02-12 23:26:03 -05:00
nhmall f8773f65db update tested versions of Visual Studio 2025-02-11 2025-02-11 19:50:08 -05:00
nhmall 907c0fbece follow-up: put back a comment that got removed 2025-02-11 09:29:32 -05:00
nhmall 563340093c stop keeping 5 arrays in sync in dumpenums code 2025-02-11 08:50:30 -05:00
nhmall 1317c850b3 fix output of --dumpenums 2025-02-11 08:02:10 -05:00
Pasi Kallinen d1f0cfce92 No hangup save while in tutorial
Tutorial code doesn't handle saving and reloading the game gracefully,
and manually saving has been disabled in there already.
Also disable automatic saving in the tutorial when the terminal goes away.
2025-02-10 17:48:01 +02:00
nhmall 10e5d2121c fix typo reported in b9ff8068 from Sept 2024 2025-02-09 10:52:21 -05:00
copperwater 6c9d4df4a6 Fix: gremlin cry of pain could be heard while deaf
Main problem was there was no condition applied to this message, so
anyone would hear it even if they were deaf. Even assuming a cry of pain
is something that could be seen, the message was still printed when the
hero couldn't see the gremlin.

This puts both a deafness check and a range check on that cry (if a
gremlin somehow takes light damage on the other side of the map behind
many walls, it doesn't make much sense to hear its cry), and provides an
alternate message if the hero can't hear it, but can see it. The
alternate message does rely on the hero being able to /see/, not just
spot, the gremlin and the light it's shying away from -- if you can only
sense it, there is no special message.
2025-02-09 14:01:05 +02:00
copperwater f228a790b0 Clean up hardcoded material constant in water vault themerm
This implements a TODO to return an object's material as text rather
than as an int when a Lua file requests all the details about an
object's objclass. That is as simple as looking it up in materialnm[].

With that done, it's possible to clean up the one use where a Lua file
looks up the material of an object it generated, in the
"water-surrounded vault" themed room, previously an inflexible 19 but
which can now be compared directly to "glass". It also enables
shortening the comments that follow since the branches of the if
statement are now obvious.
2025-02-09 13:57:25 +02:00
nhkeni e358f37863 Merge remote-tracking branch 'origin/keni-fetchdocs' into NetHack-3.7 2025-02-07 15:36:19 -05:00
nhmall fe4cb7a626 make rank() static again 2025-02-05 20:03:06 -05:00
nhmall c1516666b3 ebones follow-up fix #1 2025-02-05 17:26:15 -05:00
nhmall c9729bf838 one more follow-up 2025-02-05 08:18:29 -05:00
nhmall a065ced14a follow-up for gw.were_changes 2025-02-05 08:13:35 -05:00
nhmall 0d543a8fae remove a set_uasmon() call from iter_mons() processing
Reported by hackemslashem.
2025-02-05 07:57:25 -05:00
PatR d611da42cc enlightenment for armor's effect on spell casting
Report the effect of suit and/or robe on spell casting during
attribute enlightenment.

Doesn't attempt to include other armor slots.  That's complicated
and would end up being too verbose.
2025-02-05 00:01:07 -08:00
nhmall 88107193db another follow-up, in commented-out code 2025-02-04 15:36:36 -05:00
nhmall 6c0e755573 follow-up for ebones 2025-02-04 15:33:38 -05:00
nhmall 33954f7973 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2025-02-04 15:19:51 -05:00
nhmall c24786430f 'struct former' -> 'struct ebones'
Some variants were already using a similar approach
using a struct called 'ebones', so adopt the same naming
so NetHack-3.7, hardfought, and some variants are using
the same name.

As before there are fields in the struct that are not
currently used by NetHack-3.7, but the intent is that
hardfought save and bones files can be loaded by
NetHack-3.7 without code modification, for debugging
bug reports.

This invalidates existing save and bones files.
2025-02-04 15:16:42 -05:00
PatR 3d02eb45d3 resistance checking again
Another attempt to straighten out resistance checking....
2025-02-04 11:06:53 -08:00
PatR b44a547153 fix resistance breakage
The Mitre of Holiness commit broke resistance handling.  This seems
to work correctly.
2025-02-03 23:20:07 -08: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
nhmall d65d0062a9 follow-up: evolve placeholder content to match variant
suggestion by paxed

Increments EDITLEVEL again.
2025-02-02 12:53:58 -05:00
nhmall d331029b03 more clobber-detection 2025-02-02 09:08:48 -05:00
nhmall bda3437eab bump EDITLEVEL 2025-02-02 09:00:21 -05:00
nhmall d785f7a649 add two unused fields for hardfought save compatability
There are two hardfought code additions that render save and bones files incompatible
with the upstream NetHack-3.7, and that makes testing with hardfought
save and bones files more challenging than it needs to be, when
investigating and troubleshooting bug reports.

Add some unused fields to advance towards achieving save file parity with
hardfought, which is a significant source of play-testing for NetHack-3.7.

1) the elbereth field addition to u_conduct

This adds an unused placeholder field named 'hf_reserved1', at the appropriate
place in u_conduct to achieve struct field parity with the one in use on
hardfought.

2) hardfought adds a field to struct monst:
    char former_rank[25]; /* for bones' ghost rank in their former life */

Instead of adding that to every monst, this adds a new mextra struct
named 'former', which currently contains the equivalent 25-character
field called 'rank' which can hold the content that was in the
former_rank[25] field. That way, the field will only be added when it
is needed.

A pull request https://github.com/k21971/NetHack37/pull/2 has been
done on hardfought to do it the same way (untested there as of yet).

Even though NetHack-3.7 does not utilize that information presently,
this will be a further step toward allowing hardfought-generated save
and bones files to be used for troubleshooting, without modification,
on a similar architecture running stock NetHack-3.7 code.

That savefile parity won't be achieved until the after the
hardfought pull-request mentioned above (or equivalent) is merged.

As this change will not be compatible with existing save and bones
files, it will be accompanied with an EDITLEVEL increment.
2025-02-02 09:00:05 -05:00
nhmall d74624abbd add mexta field to simplify detection of overwrite
Because this invalidates existing save and bones files,
an increment of EDITLEVEL will accompany this.
2025-02-02 08:30:48 -05:00
nhmall 6431f4727c comment instructions in mextra.h updated 2025-02-01 14:09:58 -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 3ffbfc724c Fix another impossible no_charge object
Tame earth elemental picked up a no_charge object from a shop and moved
it out of the shop, causing "no_charge obj not inside tended shop"
impossible.  Non-tame monsters picking up no_charge items cleared that
bit, so make the same happen for pets.
2025-01-28 21:26:10 +02:00
nhmall 7ff7679a76 remove a redundant check for NULL
mksobj is declared to have a NONNULL return:
extern struct obj *mksobj(int, boolean, boolean) NONNULL;

Remove an unnecessary if block.
2025-01-27 10:12:10 -05:00
PatR b6eda14368 obj->tknown comments 2025-01-27 00:37:35 -08:00
nhmall f75e4a13b7 more follow-up for mk_artifact() 2025-01-26 21:38:37 -05:00
nhmall ee0d955050 follow-up: make definition match proto staticfn 2025-01-26 12:25:27 -05:00
nhmall 3cca4f2707 avoid mk_artifact()-related memory leaks
Reported directly to devteam after being discovered in nerfhack.
2025-01-26 11:57:01 -05:00
nhmall ed44da351e more follow-up, less hiding of illegal values
Catch it prior to the rn2() call instead. We need to
be aware of the issue.
2025-01-24 18:26:56 -05:00
nhmall dc938b7acf don't hide the zero value of apport
It was pointed out that it might not be a good idea to hide the illegal value of apport.
2025-01-24 18:24:26 -05:00
PatR 3c824cd866 fix incorrect lint fix
>  if (strlen(simpleoname) > BUFSZ - sizeof "the ")
>    simpleoname[sizeof "the "] = '\0';

The second line should have been
|    simpleoname[strlen(simpleoname) - sizeof "the "] = '\0';
but fixing that isn't adequate.  The BUFSZ limit is not valid when
dealing with object names since xname() leaves room for a prefix so
doesn't return the start of a BUFSZ-sized buffer.

Strangely enough, the complaint that caused me to add those two lines
isn't being triggered any more.  Some other change at the same time,
perhaps splitting
  Strcpy(simpleoname, obufp = the(simpleoname));
into
  obufp = the(simpleoname);
  Strcpy(simpleoname, obufp);
pacified the analyzer.  However, it didn't resolve the valid complaint
that inserting "the " might result in overflow.

I've added a comment about simpleonames(), ansimpleoname(), and
thesimpleoname() about the possible overflow, but I don't think that
such overflow can actually happen when user-applied object name is
being suppressed.
2025-01-24 14:50:53 -08:00
nhmall 02102de396 attempt to resolve issue #1368
Resolve #1368
2025-01-24 17:06:17 -05:00
Pasi Kallinen c9abc92dd7 Fix lua.adoc 2025-01-24 19:04:17 +02:00
nhkeni 9313e819de nhgitset.pl: leftover tid 2025-01-24 10:57:40 -05:00
PatR 858bf3b30d analysis lint for tilemap.c 2025-01-23 20:15:40 -08:00
PatR 6ac0be46f6 last analyzer bit for win/curses/cursmesg.c
I got confused and thought that this one (actually pair) was more
complicated than it actually is.  have_mixed_leadin is used in an
ordinary way, but resetting it to false happens in spots where it
can't be used again.  The analyzer complains that the assignments
don't do anything useful.
2025-01-23 17:30:27 -08:00
nhmall 349f3871be preproc fix 2025-01-23 19:37:19 -05:00
PatR 150b331189 analyzer lint for win/curses/*.c
There is still an issue in cursmesg.c.

The last diff band (curses_putch) isn't related to static analysis.
2025-01-23 13:52:19 -08:00
PatR 29f7580fc1 analyzer lint for sys/unix/*.c sys/share/*.c win/tty/*.c
Actually only ioctl.c for sys/share.  And with all of these, only
for the conditionals used by MacOS.
2025-01-23 12:01:46 -08:00
PatR bac7cd7365 analyzer lint for v*.c 2025-01-22 16:58:04 -08:00
PatR ffc43610f0 analysis lint for u*.c
One actual bug:  mhitm_ad_ench() could pass Null to drain_item()
which was not prepared to deal with that.
2025-01-22 16:34:05 -08:00
PatR f86bb9b7b6 analysis lint for s*.c
shk.c was dealt with previously.
2025-01-22 13:29:44 -08:00
PatR 5cd20d5389 finding data.base entry for stairs
When testing the analyzer lint fixes for pager.c, I noticed that //
wasn't finding the data.base entry for stairs when examining the up
stairs on level 1.  It is labelled "branch stairs up" which doesn't
match "stair*".
2025-01-22 13:16:42 -08:00
PatR 9a88efb20b analysis lint for r*.c 2025-01-22 12:39:35 -08:00
PatR c1d9ba9ce7 analyzer lint for p*.c 2025-01-22 12:15:39 -08:00
PatR 3109e706e9 static analysis for o*.c
This construct triggered several complaints about passing Null to
  Strcpy(simpleoname, obufp = the(simpleoname));
Changing that to
  obufp = the(simpleoname);
  Strcpy(simpleoname, obufp);
prevents it, but the original complaint is bogus and the "fix"
doesn't do anything to deal with Null arguments.

A couple of other changes introduce different code in order to get
different behavior.  I updated from llvm-16 to llvm-19 but didn't
eliminate any of the spurious complaints.
2025-01-21 22:42:23 -08:00
PatR dc5c098cb5 analyzer lint for n*.c 2025-01-21 19:39:35 -08:00
PatR 2c1f2c1cb1 clear "next" from "next boulder" sooner
Clear "next" boulder so that when pushing a pile of boulders, only
the first message for each of the 2nd, 3rd, &c will be formatted as
"next boulder".  If any of them trigger additional messages, those
messages will use normal "boulder".
2025-01-21 14:55:05 -08:00
nhmall 61f969e88b follow-up for put_saddle_on_mon()
Commit 1acc2727 helped ensure that the which_armor(mtmp, W_SADDLE)
test at the top of put_saddle_on_mon() wouldn't lead to an obj
leak.

This commit covers off the adjacent can_saddle() test in
put_saddle_on_mon(), because if that failed, it could also lead
to a memory leak of the saddle obj passed by the caller.

- have put_saddle_on_mon() create and use its own saddle obj
  if a NULL saddle obj is passed, instead of having to do that
  in the caller.
- where an existing saddle obj needs to be passed from the caller,
  ensure that the caller has done its own can_saddle(mon) check prior
  to calling put_saddle_on_mon(), so that the can_saddle() test
  in put_saddle_on_mon() won't fail.
- lastly, add an impossible() to put_saddle_on_mon() to catch
  a failure when a saddle obj is passed from the caller and either
  test has failed, just in case. That should not happen with any of
  the existing cases now, but it will provide some bullet-proofing
  for new code, new callers.
2025-01-20 14:37:46 -05: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
Pasi Kallinen 991a1dbe43 Fix exploding landmine and boulders next to lava
Same issue as with breaking a wand of digging in commit 7ce0751a
2025-01-20 19:26:12 +02:00
Pasi Kallinen 0c18792916 Fix vision when vault guard clears corridor 2025-01-20 19:24:09 +02:00
PatR 8fe02c2a7c analyzer "lint" for muse.c fix
Overzealous change yesterday.  For use_defensive(), the unicorn
horn case already has guards for Null item and the added one
issues bogus panic() when a unicorn or ki-rin uses its own horn.
2025-01-20 08:39:33 -08:00
PatR df06fc36f2 analyzer lint for m[o-u]*.c
The changes to muse.c are more extensive that most.  The many new
panic calls could be simplified by assigning a dummy object for the
trap cases.
2025-01-20 00:58:06 -08:00
PatR f2c4396641 analyzer lint for m[a-k]*.c 2025-01-19 23:31:26 -08:00
PatR 41f6582690 analyzer lint for hack.c 2025-01-19 23:06:38 -08:00
PatR 6368bf2e73 analyzer lint for i*.c 2025-01-19 22:53:03 -08:00
nhmall 3a64b404e3 Remove an unused macro that conflicts with pdcursesmod
In file included from ../include/config.h:723:0,
                 from ../include/hack.h:10,
                 from files.c:8:
../include/global.h:519:24: error: expected ')' before '<=' token
 #define unctrl(c) ((c) <= C('z') ? (0x60 | (c)) : (c))
                        ^
../lib/pdcursesmod/curses.h:1686:16: note: in expansion of macro 'unctrl'
 PDCEX  char   *unctrl(chtype);
                ^~~~~~
2025-01-19 22:36:38 -05:00
nhmall 8de3aa564f update tested versions of Visual Studio 2025-01-19 2025-01-19 22:02:43 -05:00
nhmall 9da836fb4a more follow-up: Qt build fix 2025-01-19 21:55:36 -05:00
nhmall d992155f1f follow-up for tradstdc.h
remove a duplicate comment
2025-01-19 21:20:52 -05:00
nhmall 3221665f5a updates to tradstdc.h
Define a macro NH_C to provide a shorter & simpler way to test for
which C standard the build is being carried out under (c99 or c23).

 NH_C > 202300L     Being compiled under C23 or greater
 NH_C > 199900L     Being compiled under C99 or greater
 NH_C > 198900L     Being compiled under C89 or greater,
                    or C std could not be determined.

While NetHack only requires c99, we've been taking advantage
of some c23 features (attributes), if they are available,
to allow the use of ATTRNORETURN/NORETURN and FALLTHROUGH on
compilers other than gcc.

Also add some comment documentation to tradstdc.h about NetHack's
use of c99.

The sys/unix/Makefile.top change overcomes a warning in the
Makefile-generated nhlua.h. That warning arises under some compilers
that rely on attribute [[noreturn]] ahead of a declaration
(NetHack macro ATTRNORETURN), rather than the trailing gcc
__attribute((noreturn)) (NetHack macro NORETURN). The sed command
is modified to include ATTRNORETURN at the start of the declaration
in addition to the NORETURN at the end of the declaration, in the
generated file. That's the same combination that's used for the
declaration of other functions that don't return.
2025-01-19 20:51:46 -05:00
PatR e317436e8d static analyzer lint for glyphs.c 2025-01-19 12:40:28 -08:00
PatR e0f6c6987b analyzer lint for files.c
Not sure about 'do_historical' since it isn't used--or implicitly
is always used--without the field-by-field save and restore as an
alternative.
2025-01-19 12:16:16 -08:00
PatR 1907dd9cd8 analyzer lint for e*.c 2025-01-19 11:59:48 -08:00
PatR ec855a93c2 static analyzer lint for w*.c 2025-01-19 11:52:44 -08:00
PatR 047ae6f68e analyzer lint for zap.c 2025-01-19 11:42:02 -08:00
PatR 49a2851882 static analyzer fix for dungeon.c
I'm not really sure about this one.  insert_branch(branch,) is
specified as not accepting a Null pointer and doesn't have any
defense against it, but the know level setup seems to allow a null
pointer through.  I'm not sure whether this is the right fix.
2025-01-19 11:24:40 -08:00
PatR d8d4f18a00 analyzer lint for do_wear.c, dothrow.c 2025-01-19 11:23:05 -08:00
Pasi Kallinen 663ab8aa89 Fix wall spines outside map bounds 2025-01-19 21:16:27 +02:00
Pasi Kallinen 7ce0751a6c Fix breaking wand of digging and boulders next to lava
If one or more boulders were next to lava and hero broke a wand of digging
next to that location, the boulder(s) stayed over the lava causing a sanity
checking error.
2025-01-19 19:34:58 +02:00
PatR 9e2d862ba9 static analyzer fix for dog.c
The missing break meant that executation fell through to the default
case and reset xlocale and ylocale to 0.  The comment states that
this is for the fuzzer; I have no idea whether this fix matters to it.
2025-01-18 20:04:26 -08:00
PatR c97bb2c0a4 static analyzer lint for dig.c, do.c 2025-01-18 19:58:30 -08:00
PatR e8d9331f14 static analyzer lint for coloratt.c 2025-01-18 19:36:06 -08:00
PatR 3418c871b1 static analyzer lint for cmd.c 2025-01-18 18:35:21 -08:00
PatR ba8076b142 static ananlyzer issue for alloc.c
Verifying that strlen(string) isn't too long, then allocating and
copying strlen(string)+1 draws a complaint about strcpy() overflowing
its output buffer.

Not an issue for regular play, but could matter for config file and
sysconf manipulation.
2025-01-18 18:04:09 -08:00
PatR 6a457056a3 analyzer lint and stale comment for apply.c 2025-01-18 16:36:51 -08:00
Pasi Kallinen 7f36a5db3c Fix vision when guard moves a monster 2025-01-18 19:30:10 +02:00
PatR 34dc5d7acf static analyzer changes for trap.c
Picked arbitrarily; there weren't any unresolved analyzer complaints
for trap.c.  I wonder why the onefile analysis isn't complaining here.

'in_sight' may have been relevant before the trapeffect_xyz() code
was split apart, but it isn't useful for trapeffect_hole() despite
the comment about it.

release_holding_trap() is fairly convoluted and the complaints being
addressed here were relevant.
2025-01-17 21:26:32 -08:00
PatR e48824223f fix static analyzer complaints for shk.c
This cleans up analyzer feedback in shk.c, based on the set of
warnings specified by hints/MacOS.370 and the lower level hints it
applies, rather than anything specified during periodic 'onefile'
processing.

shk.c is the only file I've analyzed, to try again to figure out
how to suppress the old complaint that has been causing a special
case in Genonefile.  It isn't triggering during my testing but that
might be due to something in use by onefile but not by normal hints.
I'm running ccc-analyzer from llvm-16; I don't know whether that
matches Genonefile.
2025-01-17 13:20:59 -08:00
nhmall fc7fdd7f08 get rid of a compiler gripe 2025-01-17 14:26:03 -05:00
Pasi Kallinen 6df83cb677 Fix pet data being reset when charm monster was cast
Casting charm monster with pets nearby could reset the edog struct.
If the pet ate a mimic corpse and was pretending to be something else
when that edog reset happened, the sanity checking would issue an impossible.
The error happened because meating was reset, but the pet appearance was not,
but the edog struct reset is the part being wrong.  Lets not do that.

To reproduce, turn on sanity checking, create a tame dog, give it a mimic corpse
to eat, #wizcast charm monster next to it.
2025-01-17 17:07:07 +02:00
PatR c0a1ed9c41 another stab at stumble_onto_mimic
The unreliable sanity check is removed.
2025-01-16 12:51:40 -08:00
PatR b4f912e3c4 add a couple cf comments 2025-01-15 15:44:09 -08:00
SHIRAKATA Kentaro 88a571fab8 add sanity check on parse_status_hl2()
dt is initialized with -1, and it's not so obvious that it will be always overwritten later.
2025-01-16 01:41:48 +09:00
nhmall d2aff9a9b2 remove some xchar vestiges 2025-01-14 12:13:39 -05:00
nhmall b2f4b687c1 yet another coordxy bit 2025-01-14 11:33:30 -05:00
nhmall a513b41748 more coordxy consistency, mklev.c 2025-01-14 11:17:41 -05:00
nhmall 2354fef2d6 be more consistent with coordxy in mkmap.c
Also closes #1365
2025-01-14 10:32:36 -05:00
PatR f32e32d447 still more PR #1364
Earlier commit left out an intended line, resulting in the sanity
check being bogus because the incomplete test wasn't impossible.
2025-01-13 16:55:58 -08:00
nhmall 1b8bc6fc29 finished CI testing; put things back 2025-01-13 13:12:40 -05:00
nhmall ea647f3adb test custom warning filter in CI 2025-01-13 12:52:32 -05:00
nhmall 3c224fc49d update azure-pipelines.yml 2025-01-13 12:31:57 -05:00
nhmall fd919c1560 Revert "Revert "Revert "eliminate a couple of build warnings (noticed with clang)"""
This reverts commit 6dad19a4f6.
2025-01-13 12:13:06 -05:00
nhmall 92340296ad azure-pipelines warning filter take 2 2025-01-13 12:01:16 -05:00
nhmall 6dad19a4f6 Revert "Revert "eliminate a couple of build warnings (noticed with clang)""
This reverts commit 1a8395002f.
2025-01-13 11:48:46 -05:00
nhmall 1a8395002f Revert "eliminate a couple of build warnings (noticed with clang)"
This reverts commit 7e8a04b35a.
2025-01-13 11:47:57 -05:00
nhmall 0a401253ce test CI warnings 2025-01-13 11:47:00 -05:00
nhmall 7e8a04b35a eliminate a couple of build warnings (noticed with clang)
2025-01-12T19:08:53.4759829Z ../win/curses/cursinvt.c:191:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
2025-01-12T19:08:53.4760198Z   191 |     case KEY_RIGHT:
2025-01-12T19:08:53.4767986Z       |     ^
2025-01-12T19:08:53.4967354Z ../win/curses/cursinvt.c:191:5: note: insert '__attribute__((fallthrough));' to silence this warning
2025-01-12T19:08:53.4967860Z   191 |     case KEY_RIGHT:
2025-01-12T19:08:53.4968026Z       |     ^
2025-01-12T19:08:53.4968219Z       |     __attribute__((fallthrough));
2025-01-12T19:08:53.4968404Z ../win/curses/cursinvt.c:191:5: note: insert 'break;' to avoid fall-through
2025-01-12T19:08:53.4968583Z   191 |     case KEY_RIGHT:
2025-01-12T19:08:53.4968709Z       |     ^
2025-01-12T19:08:53.4968820Z       |     break;
2025-01-12T19:08:53.5099063Z 1 warning generated.

2025-01-12T19:08:53.8002074Z ../win/X11/winX.c:995:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
2025-01-12T19:08:53.8008155Z   995 |     case NHW_TEXT:
2025-01-12T19:08:53.8008513Z       |     ^
2025-01-12T19:08:53.8032511Z ../win/X11/winX.c:995:5: note: insert '__attribute__((fallthrough));' to silence this warning
2025-01-12T19:08:53.8032899Z   995 |     case NHW_TEXT:
2025-01-12T19:08:53.8033057Z       |     ^
2025-01-12T19:08:53.8033219Z       |     __attribute__((fallthrough));
2025-01-12T19:08:53.8033395Z ../win/X11/winX.c:995:5: note: insert 'break;' to avoid fall-through
2025-01-12T19:08:53.8033644Z   995 |     case NHW_TEXT:
2025-01-12T19:08:53.8033783Z       |     ^
2025-01-12T19:08:53.8033912Z       |     break;
2025-01-12T19:08:53.8800783Z 1 warning generated.
2025-01-13 09:36:48 -05:00
PatR 34159d42e5 more PR #1364 2025-01-13 05:48:20 -08:00
nhmall 1bb0f89b82 Merge branch 'check_version' of https://github.com/argrath/NetHack into NetHack-3.7 2025-01-13 08:24:15 -05:00
nhmall 62fe9e83c6 Merge branch 'xytod' of https://github.com/argrath/NetHack into NetHack-3.7 2025-01-13 08:23:52 -05:00
nhmall 8ee014f5d1 update credits 2025-01-12 23:57:56 -05:00
SHIRAKATA Kentaro 36443c965b second argument of check_version() can take NULL
There is a code path starting at restore.c line 830.

    (void) validate(nhfp, (char *) 0, FALSE);
2025-01-13 13:57:40 +09:00
nhmall e08a9671dc another follow-up: another bit is needed
breaks savefiles and bones.
2025-01-12 14:08:15 -05:00
nhmall 25558e1e01 follow-up
Check the correct bits before returning.
2025-01-12 13:58:13 -05:00
nhmall bee21e3447 fix K4318
Reported by paxed. A potion of oil, that was already in the midst of exploding,
got picked up through spot_effects(), which led to it merging with
another potion of oil and the freeing of the original obj.

The original obj pointer was still held by breakobj(), and breakobj()
proceeded to delete the obj (again).

Function nesting:

 1    spelleffects()
 2     -> weffects()
 3      -> bhit()
 4       -> bhitpile()
 5        -> bhito(obj ...)
 6         -> hero_breaks(obj ...)
 7          -> breakobj(obj ...)
 8           -> explode_oil(obj ...)
 9            -> splatter_burning_oil()
10             -> explode()
11              -> zap_over_floor()
12               -> melt_ice()
13                -> spot_effects()
14                 -> pickup()
15                  -> pickup_object(obj ...)
16                   -> pick_obj(obj ...)
17                    -> addinv(obj ...)
18                     -> addinv_core0(obj ...)
19                      -> merged(obj ...)
20                       -> obfree(obj ...)
21                        -> dealloc_obj(obj ...)

 8           -> delobj(obj ...)
 9            -> delobj_core(obj ...)
10             -> obfree(obj ...)
11              -> dealloc_obj(obj ...)
12               -> impossible("obj already deleted)

This marks the exploding potion with LOST_EXPLODING, so that it won't
get picked up, or merged with another object during the long
sequence of functions, and that should take care of 15-21 above.
2025-01-12 13:50:25 -05:00
Alex Smith a8be021913 Change monster regeneration over time to use healmon(), too
I missed this one.
2025-01-12 18:28:59 +00:00
Alex Smith 97e0e934e8 Use a common funcion for all monster healing
Previously, the code for monster healing was repeated every time it
was needed; this commit sends it all through a common function, which
will make it easier to make changes to how monster healing works in
the future.

This is just a code reorganisation and won't have any gameplay
effect unless I made a mistake.
2025-01-12 18:20:13 +00:00
Pasi Kallinen f0a0a74dcc Hero polyed into slithy monster and sitting 2025-01-12 16:42:33 +02:00
SHIRAKATA Kentaro 9b7bcf67ba change the type of xytod()'s return value to int
xytod()'s return value is an index, so its type should be int, not coordxy.
2025-01-12 14:37:13 +09:00
PatR 59f49fda1b replace the mimic-as-monster fix
The new EXTRA_SANITY_CHECK for a monster mimicking a monster.  It
falsely triggered if the hero was hallucinating.  Just add an
assertion that the monster index is within valid range.
2025-01-11 12:24:54 -08:00
PatR cba032d187 another mimic fix
The report (sent directly to devteam) stated that the bump-into-mimic
code might crash when bumping into a mimic that is masqueraing as
some other monster.  Mimics don't actually do that, but the Wizard
of Yendor mimics another monster via Double Trouble.  All I got from
it though is
 |Wait!  That's <other monster>!
which won't crash but is a fairly useless message.

This changes it to be
 |Wait!  That <other monster> is <the Wizard of Yendor>!
which seems a bit bland but provides useful information.
2025-01-11 02:22:23 -08:00
PatR 0fe42a67d0 eshkp->bill_p vs eshkp->bill
Use ESHK(shkp)->bill_p consistently.  The bill[] array field is used
to initialize the bill_p pointer field rather than be used directly
when manipulating shop bills.

While in there, get rid of some '#if DUMB' from pre-standard C days.
2025-01-10 20:52:25 -08:00
PatR 539f039a83 maybe fix #K4316 - segfault stumbling onto mimic
I couldn't reproduce the reported problem but the backtrace suggests
that defsyms[monst->mappearance] was probably out of bounds so that
nh_snprintf() got bad data.  That might conceivably happen if the
glyph didn't match the mimic's mappearance, but I not sure how that
would occur.

This avoids using mappearance as an index into defsyms[] and should
give an impossible if that situation does come up.
2025-01-10 14:14:00 -08:00
Pasi Kallinen aa12620376 Fix vision with temporary clouds over pools
Vision wasn't cleared correctly when a temporary [poison] cloud
was over a pool and hero was under water while the cloud disappeared.
2025-01-10 15:49:20 +02:00
Pasi Kallinen 0e04988fec Fix another no_charge in untended shop
This time the no_charge object was being carried by a pet.

To trigger, drop an object into shop, decline to sell it,
pick up an object belonging to shopkeeper, decline to buy it,
wait for your pet to pick up the no_charge object you dropped,
teleport out of the shop, wait for shopkeeper to walk out of
the shop.
2025-01-10 15:46:09 +02:00
PatR 1928a3e12b get rid of trailing space in generated tile.c 2025-01-10 01:40:02 -08:00
PatR a490ce5759 remove trailing spaces from src/*.c, include/*.h 2025-01-10 01:30:49 -08:00
PatR 5d7d004846 fix issue #1352 - another try at #1339
The attempt to simplify shop handling of containers keeps getting
more complicated.

Fixes #1352
2025-01-09 21:40:46 -08:00
Pasi Kallinen de38ce2c90 Fix vision: force bolt breaking door with temp cloud 2025-01-09 19:44:21 +02:00
Pasi Kallinen 843b02ec1d Add vision sanity checking, fix more vision
- Add a vision sanity checking routine

- Recalc block point when digging a door for temporary clouds

- Add recalc_block_point after cvt_sdoor_to_door, because doorways
  on the Rogue level have no doors, and otherwise the sanity checking
  would complain.  This doesn't actually change how the Rogue level
  vision works, as it uses a different vision system

- Monster using a trap in a secret corridor revealed the corridor,
  but didn't unblock the vision unless you saw the location
2025-01-09 17:28:24 +02:00
PatR 83c0d430c9 suppress sanity_check after invalid command
Entering an invalid command, particularly <space>, while there is
some circumstance triggering sanity check warnings, becomes too
verbose.
2025-01-08 13:46:28 -08:00
Pasi Kallinen c956e3e215 Fix vision when applying a wand of digging 2025-01-08 13:59:50 +02: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
nhmall 06e0eb0616 Merge pull request #1351 from https://github.com/g-branden-robinson/NetHack into NetHack-3.7 2025-01-07 10:43:37 -05:00
Pasi Kallinen ae1a86d7be Fix vision when door is destroyed by ray effect
A door was destroyed and vision unblocked without considering
temporary (poison) clouds.
2025-01-07 17:39:46 +02:00
nhmall 85965b1b32 Visual Studio project files:directory name cleanup 2025-01-07 10:00:28 -05:00
Pasi Kallinen b27c9102f6 Fix vision when opening a door
If a monster or hero opened a door with a temporary (poison) cloud
on it, the location could be seen through even with the cloud.
2025-01-07 15:14:27 +02:00
Pasi Kallinen 108d975694 Fix vision in guard created corridor
... when hero angers the guard, the guard's previous location
didn't get the vision blocking fixed.
2025-01-07 10:52:01 +02:00
PatR a118869262 rephrase a recent fixes entry 2025-01-06 11:01:18 -08:00
Pasi Kallinen f4cd5ed065 Fix vision with pushing a boulder and temp clouds
remove_object cleared the vision when the last boulder was removed
from a location, without considering temporary [poison] clouds.
This particular case happened when pushing a boulder.
2025-01-06 20:22:56 +02:00
Pasi Kallinen 274b15cd77 Fix vision when xorn digs down on a wall
A xorn inside a wall using a wand of digging to dig down, the vision
was still blocked at that location.
2025-01-06 20:11:35 +02:00
Pasi Kallinen 4392f5fa4e Fix vision in some cases with boulder falling into pool
We can't just unconditionally unblock vision for a location when a boulder
falls into a pool, because the location may also have a (poison) cloud on it.
2025-01-06 19:46:38 +02:00
nhmall d807436c10 Windows: broken saved game restore
Apparently, restoring of saved games on Windows has been
broken since 1f36b98b, 'selectsaved' extension from Oct 10.
That change was altering the names of the files saved on disk
to a new format introduced at that time, but the game was not
opening a savefile with that same name, and the restore failed.

The code that renamed the savefile to match the internal name
was not part of 1f36b98b, it already existed prior to the new
internally-stored format.

To get things functional, this commit disables the code that
carries out the renaming of the on-disk savefile to match the
internal name in the savefile entirely, at least for now.

This relates to GitHub issue #1346 item 2.
2025-01-06 03:28:44 -05:00
nhmall 7cc118365c quiet down mips cross-compile
Even though most of these are cast to void (but not all), the
mips cross-compiler seems determined to warn about them anyway.

Suppress that particular warning altogether to quiet the build.
That is not the ideal approach, but if the normal way of whitelisting
individual cases isn't working, I'm not sure of another course of
action.
2025-01-05 15:51:11 -05:00
PatR b2c108b416 teleporting of engulfer
Commit ba731a346b "fix shop steal when
teleporting your engulfer" mentioned that there was no longer any
message given if engulfer+hero got teleported.  Add such.  It is a
bit lame but the situation is rare enough that it should suffice.
2025-01-05 10:19:31 -08:00
Pasi Kallinen 57bf003c26 Fix rolling boulder not unblocking sight at wall of water
A rolling boulder that destroys a wall of water did not unblock
the vision at that point.
2025-01-05 13:35:21 +02:00
nhmall a7152ad54e CROSS_TO_WASM build fix
A couple of option processing functions, one of which was called in file.c, were
recently added to sys/unix/unixmain.c, but the wasm build does not include unixmain.c,
it uses sys/libnh/libnhmain.c.

Transcribe the functions into sys/libnh/libnhmain.c.

Also, do not #include "wintty.h" for NOTTYGRAPHICS builds.
2025-01-05 05:42:24 -05:00
nhmall ffadd254d7 follow-up: missed comment and an outdated interface 2025-01-04 23:51:34 -05:00
nhmall be5143bb74 window-port updates
Remove start_screen() and end_screen() from the
Window-port interface.

They were only ever used by tty, and there was a comment
carried to several window-ports about how they "really
should go away. They are tty-specific"

term_start_screen() and term_end_screen() are part of
terminal/NO_TERMS supporting routines now.
2025-01-04 23:38:34 -05:00
nhmall 63dfb84d00 follow-up: whitespace clean-up for wintty.c
Some tabs to spaces.

Also restore a comment that was inadvertantly deleted.
2025-01-04 19:32:06 -05:00
nhmall 428665c613 fixes entry update for another part of commit 37758c7e 2025-01-04 19:16:02 -05:00
PatR b767e1e070 missing gw.wasinwater comment 2025-01-04 16:03:56 -08:00
nhmall 37758c7e48 some tty updates
Add a note about NO_TERMS to include/wintty.h for clarity.

Rename tty_startup and tty_shutdown to term_startup() and
term_shutdown(). They are found in termcap.c for !NO_TERMS
like most of the other term_ routines, as well as having
versions for several of the NO_TERMS platforms. They aren't
part of the tty_interface called from the core. The tty
implementation does call and rely on them.

Remove some conditional #ifdef's around term_shutdown()
(formerly tty_shutdown()) and just ensure that all the
tty platforms have an implementation that they can link
with, even if it is just a stub presently.

Put the protype for nethack_exit in extern.h to reduce
maintenance to a single spot, and remove it from other
locations. A warning in the msdos cross-compile led to
this change.
2025-01-04 19:01:34 -05:00
PatR 7982c72e8b fix github issue #1360 - autounlock=Kick
Issue reported by ostrosablin:  having Kick enabled as one of the
values for the 'autounlock' option succeeded it prompting "kick it?"
when walking into a locked closed door, but answering "yes" behaved
the same as answering "no".

There's bound to be a better way of fixing this, but this works.

Fixes #1360
2025-01-04 13:59:06 -08:00
copperwater 2a50234565 Remove dented pot encyclopedia matching on 'helmet'
Dented pots got their own encyclopedia entry, so they shouldn't still
match to "helmet". Even without this change, they match the "dented pot"
entry correctly, but only by virtue of it appearing earlier in the
encyclopedia.

Inverting the match to "~dented pot" isn't necessary since it isn't
something that would otherwise match "helmet", so just remove it.
2025-01-04 16:48:05 +02:00
copperwater e8ad3b4c19 Fix: quantum mechanics' tele attack had inverted negation check
Noticed when I summoned a quantum mechanic in wizard mode with a
starting character who should have no armor protection against their
teleport attack, but every touch resulted in "You are not affected". It
turns out the if statement checking for armor protection is backwards,
so you were never affected when you have no protection and were almost
always affected when you had good protection.

This appears to date back to when the all-purpose 'negated' variable was
removed and "You are not affected" moved to after the negation check;
the new conditional kept the ! by mistake.
2025-01-04 16:46:22 +02:00
Pasi Kallinen 1ef3167ca0 Steed #monster breath feedback
Using #monster to make the steed use the breath weapon often
failed because the steed did not want to breathe at weak or
too strong monsters.
Make #monster force the steed use the breath, and if there is
no targets available, make the steed make some noise as feedback.
2025-01-04 16:37:14 +02:00
Pasi Kallinen 2ebe8915f6 Prevent melting ice destroying necessary traps
A magic portal ended up on a melting ice.
2025-01-04 16:05:07 +02:00
Pasi Kallinen 9313fb7747 Clear tin-eating struct when object goes away
The tin-eating context was pointing to a non-existent object,
causing an error when the fuzzer somehow managed to continue eating
the freed tin object.
Clear the pointer when the tin leaves inventory or the object
is deleted.
2025-01-03 22:21:14 +02:00
Pasi Kallinen ba731a346b Fix shop steal when teleporting your swallower
Picking up a shop item and not paying it, getting swallowed
by a monster, and then teleporting the monster out of the shop
with you in it, the shopkeeper didn't notice the theft.
But the object was not marked as paid either.

Also prevent giving a message of the swallower disappearing
and appearing when it was teleported.  (Although now there's
no message given, so something should be added ...)
2025-01-03 20:58:26 +02:00
PatR bf3654dbe2 \#wizintrinsic bit 2025-01-03 08:33:03 -08:00
PatR ce947600e5 discoverying water walking boots
If water walking boots haven't been discovered yet and underwater
hero rises to the surface when putting a pair on, discover them.

(Sinking while removing such on water already discovers them.)
2025-01-02 23:12:15 -08:00
nhmall d3c57e1b42 fix reported crash of TTY_PERM_INVENT segfaulting
Options processing can be early, even before ttyDisplay is allocated.
If we find that TTY_PERM_INVENT initialization is happening too early,
just set a marker (iflags.perm_invent_pending) to try again a bit later.

The changes in win/share are just to be able to sucessfully
reproduce the original issue on Windows. It was easily reproduced
on Unix, just by building with TTY_PERM_INVENT in include/config.h
and setting OPTIONS=perm_invent in config file.
2025-01-02 11:46:15 -05:00
copperwater 2d4f9893ad Enable more ways to specify monster inventory in special levels
This originated with a bug in NerfHack in which the developer specified
an inventory for a quest nemesis, but neglected to include the Bell of
Opening in it. Since monsters' inventory contents from makemon() were
tossed out completely, this caused a situation where the Bell was
deleted and the game was unwinnable. The first part of this change is
guarding against that by adding mdrop_special_objs before discarding the
inventory. This does create a possibility where if the programmer *does*
specify a nemesis get the Bell item in their inventory, while neglecting
to remove its special case generation in makemon.c, it would generate
twice - but two Bells is better than none.

Working on that fix led me to think about a limitation of the current
sp_lev.c behavior. You could either have a monster generate with its
species-typical inventory by not specifying an inventory for it, or you
could have it generate with custom inventory but then have to use that
to clumsily reproduce the normal inventory's complex chances and
conditionals in mongets(). So the remainder of this commit implements
another flag for des.monster(), keep_default_invent, that allows for
more flexibility in two ways:

1. When des.monster() contains an inventory function and
   keep_default_invent is true, the monster will retain everything it
   gets from makemon() and the objects in the inventory function are in
   ADDITION to those. This is useful for augmenting a monster's default
   kit with something to make them more threatening, or just more loot.
2. When des.monster contains no inventory function and
   keep_default_invent is false, the monster will get NO inventory even
   if its species is normally supposed to. I'm not sure where exactly
   this would be used, but it doesn't hurt to have it available.

When keep_default_invent is not specified at all, the behavior remains
the same as it is now - if inventory is provided, default items are
discarded, and if not, they are kept.
2025-01-02 08:07:50 +02:00
copperwater 171d48c881 Fix: brides of Dracula not generating in their niches
When the des.monster() statements for the vampire ladies were changed to
use the lua-table form, the coordinate argument was not given the coord=
name in the table, so the lua loader was ignoring it and the vampire
ladies were placed on random spaces on the level. Fix this by supplying
the coord=; testing shows that they now appear back in the niches.

Also lowercase the monster species id "Vampire Lady" to "vampire lady".
The uppercase didn't affect the species being generated but having the
id be the same case as in monsters.h is consistent with how it's done
everywhere else.
2025-01-02 08:06:53 +02:00
copperwater 292957407f Fix: ravens specified as hostile on Medusa's Island could be peaceful
Noticed when testing the recent bec de corbin change which makes ravens
generate as peaceful; if you happened to enter medusa-3 while wielding
one, all the ravens are peaceful. Even without one, if you entered the
level as a neutral character, some of them would randomly be peaceful
due to matching alignment. But in the medusa-3.lua file, the ravens are
all unconditionally flagged as hostile.

The reason for this behavior is that the lua loading code does not
recognize "hostile" (instead peaceful=0 needs to be set), so it does
nothing and leaves the ravens to generate as if it had been unspecified.
It appeared to affect only these ravens; no other des.monster() uses
hostile=1 instead of peaceful=0.

This bug has been around in the 3.7 development branch since the change
to Lua, but doesn't happen in 3.6 because the des parser does interpret
"hostile" as meaning never peaceful.

I considered augmenting lspo_monster so that it could handle "hostile"
and treat it like peaceful=0, but figure it's probably better not to
have two different booleans that control the same flag (what if someone
specified peaceful = 1 and hostile = 1?)
2025-01-02 08:05:31 +02:00
copperwater 41d95d4325 Fix some bigroom wall corners to how they display in-game
Noticed a few corners in some bigroom maps were | instead of -, which
doesn't have any gameplay effect but was mildly annoying for what I was
doing at the time (copying the maps out into documentation that is
supposed to show what the maps look like in-game).

There are other special levels out there that still use | for corners;
this doesn't address those, only the bigrooms.
2025-01-02 08:03:21 +02:00
Pasi Kallinen 114f99867e Fix unicorn movement special handling
My commit 82f0b1e8ea to make monsters which had nowhere
to move would panic attack the hero if possible, broke the
special unicorn handling; they avoid being in-line with hero,
so often had nowhere to move...

Fixes #1344
2025-01-01 23:43:15 +02:00
Pasi Kallinen 0a58b7a540 Tweak tourist xp gain from new monsters
Remove the XP gain for tourist seeing a new type of monster
nearby, as it apparently made tourists a bit harder by forcing
early level gains.

Monsters next to hero are still marked as seen close-up, but
fix the code so it doesn't count undetected monsters.

Tourists still gain XP from "taking photos" of new types of monsters,
but only if they haven't seen the monster close up before.
(No actual photos are taken.)
2025-01-01 21:43:31 +02:00
nhmall 35f2ca44e2 update year in COPYRIGHT_BANNER_A to 2025 2025-01-01 08:46:41 -05:00
PatR fea3c85471 fix issue #1350 - shop purchasing
Aka issue #1339 take II

For hero-owned container with some unpaid items, the itemized
shopping bill had a spurious index into the traditional shopping
bill (since it wasn't in that bill due not being unpaid).  When mixed
with unpaid items that weren't in the container, that could cause
bill corruption while updating the traditional bill during payment,
leading to impossible warnings.

Fixes #1339
Fixes #1350
2024-12-31 18:54:27 -08:00
keni d329a4ce8a update tamc.nh docs (mnh.7) 2024-12-31 17:15:11 -05:00
G. Branden Robinson a6a32170ee doc/dlb.6: Revise description
Content:
* Document that the command has a default file list.
* Demote "COMMANDS" section to "Operations" subsection.  The former term
  is (1) too easily confused with Unix commands and (2) not a widely
  used section heading in man pages.

Style:
* Italicize command names.
* Italicize file names.
* Use idiomatic man page cross references.
* Present operation and option letters in alphabetical order.
* Render option descriptions as full sentences.
* Set bug list as a bulleted list.

Markup:
* Break input lines at sentence boundaries.
* Favor use of man(7) font selection and alternation macros over roff(7)
  font selection escape sequences.
* Drop numerous extraneous paragraphing macro calls.  See subsection
  "Horizontal and vertical spacing" of groff_man(7).
* Replace use of *roff requests to break lines and vertically space with
  calls of paragraphing macros, which is what they're for.  Two things
  the page author didn't know: `.sp 1` already implies a break, so the
  preceding `.br` was redundant.  `.sp 1` without an argument already
  means to vertically space by 1 vee; that is, the "1" argument was
  superfluous.  It was a bad idea anyway because the default
  inter-paragraph spacing in man(7) is not one vee, but 0.4v--this
  matters when typesetting.  It has also been the case since 1979.
* Use `RS` and `RE` macros instead of a literal tab to achieve a
  relative inset.  Use of the macros is more idiomatic.
* Use `EX` and `EE` to attempt to set the examples in a monospaced font
  family.  These are extensions and are silently ignored by formatters
  that don't support them.

  groff_man(7):
     .EX
     .EE    Begin and end example.  After .EX, filling is disabled and a
            constant‐width (monospaced) font is selected.  Calling .EE
            enables filling and restores the previous font.

            .EX and .EE are extensions introduced in Ninth Edition Unix.
            Documenter’s Workbench, Heirloom Doctools, and Plan 9
            troffs, and mandoc (since 1.12.2) also support them.
            Solaris troff does not.  See subsection “Use of extensions”
            in groff_man_style(7).
* Kill off useless trailing space on input line.
2024-12-31 06:52:27 -06:00
G. Branden Robinson 0dc5d8c2f1 doc/dlb.6: Revise synopsis
Follow Unix idioms and the guidelines presented in groff_man_style(7).[1]

* Present multiple synopses since the command has multiple operation
  modes accessed via mutually inexpressible command letters.  See the
  POSIX standard for copious precedent.
* Stop implying that file name arguments are accepted alongside the `I`
  option; see line 236 of util/dlb_main.c.
* Stop spacing around synopsis punctuation where unnecessary.
* Set metasyntactic variables (parameters) in italics, not roman or
  bold.
* Spell ellipsis idiomatically for pleasant typesetting.
* Use `\c` escape sequence to force adjacency of tar-like option letters
  to the mandatory operation letter.
* Use singular, not plural, for repeatable argument.  The ellipsis does
  the grammatical work of pluralization for us.

[1] Full disclosure: I wrote much of (the current form of) that man page.
2024-12-31 06:52:27 -06:00
G. Branden Robinson dc14fb131f doc/{dlb,recover}.6: Disable dead dynamic code
Portions of these man pages seem at one time to have been dynamically
selected, but the mechanism for doing so appears to be commented out in
the source tree: see "NHGREP" in sys/{unix,vms}/Makefile.doc.

Wrap them in *roff "ignore blocks" to keep their noise from cluttering
the man page actually seen by the users.
2024-12-31 06:52:27 -06:00
G. Branden Robinson 01b2ea12f7 doc/dlb.6: Use correct scaling unit for ems
In *roff numeric expressions, ems are spelled "m", not "em".

https://www.gnu.org/software/groff/manual/groff.html.node/Measurements.html
2024-12-31 06:52:27 -06:00
nhmall e20908fa4f remove an unused part of msdos cross-compile 2024-12-30 12:59:00 -05:00
nhmall eacfa202d9 soundlib selection in config file wasn't working
When there was more than one option #define'd
selection was not working correctly.
2024-12-30 12:54:12 -05:00
nhmall ac50b7fecc update the msdos cross-compile
date.c wasn't always being recompiled.
A couple of other bits.
2024-12-30 12:52:35 -05:00
nhmall a65c012f45 shorten up a Makefile.src line 2024-12-30 12:48:52 -05:00
PatR ecbb7cff4d fix issue #1339 - shop purchase warnings
Issue reported by ars3niy:  with the relatively new container
handling, buying multiple items when some were inside a container
sometimes triggered impossible "unpaid_cost: object wasn't on any
bill" warnings and not buy all intended items.  Once that occurred,
subsequent inventory display would repeat the warning.

A couple weeks back, I managed to produce a save file which would
reproduce the problem when 'p' was issued, but failed to figure
out why that was happening.  I accidentally deleted that save file
and it took quite a lot of further attempts to get another one.

I still don't understand why this fix is needed, but with it in
place the save file no longer triggers any problems.  I'm marking
the issue fixed but that could be premature.

Fixes #1339
2024-12-30 03:12:06 -08:00
nhmall 50aff17f94 follow-up bit for sys/msdos/fetch-cross-compiler.sh 2024-12-29 13:54:06 -05:00
nhmall 42b9693829 Merge branch 'msdos2' into NetHack-3.7 2024-12-29 12:16:20 -05:00
nhmall 7b4445f040 make msdos lib/djgpp/target folder more hierarchical
Instead of flat, have bin, lib and include folders for
the native DOS pieces.

If you have been cross-compiling for MSDOS, you will
need to carry out the following to bring things up-to-date:

    sys/msdos/fetch-cross-compiler.sh
    make CROSS_TO_MSDOS=1 WANT_DEBUG=1 package
2024-12-29 12:11:03 -05:00
Pasi Kallinen 1282863f5c Fix breaking wand of digging not touching boulders
Applying a wand of digging skipped all the affected locations
with any boulders on them.
2024-12-29 18:17:57 +02:00
Pasi Kallinen 6c895ab6f6 Boulder-over-pit sanity when breaking wand of digging 2024-12-28 20:54:36 +02:00
Pasi Kallinen 5f95831526 Creating a pit in a wall message tweak
"A pit appears in the wall" sounds a bit silly, so change it to
"The wall crumbles into a pit"
2024-12-28 20:52:39 +02:00
Pasi Kallinen 767a20e21f Hacky fix for pline recursion outputting raw_print
When glyph updates are on, pline can be called recursively
when the vision is being fully recalculated.  This caused
the recursively called pline to output raw_pline text.

Not sure if this is the correct way to fix it, but can't really
turn off or block the glyph update notices either ...
2024-12-28 20:41:43 +02:00
Pasi Kallinen 454978fadd Avoid boulder-over-pit sanity when filling empty maze
This shouldn't happen unless doing special level commands in
strange order, but handle it anyway...
2024-12-28 20:33:18 +02:00
Pasi Kallinen 72fb06a40a Unhide monster moving over to teleport trap 2024-12-28 20:31:45 +02:00
Pasi Kallinen d11747899e Fix boulder-over-pit sanity after landmine blows up 2024-12-28 20:30:11 +02:00
Pasi Kallinen 66d0307e95 Impossible timer after vault guard entered
Fuzzer encountered impossible "timer sanity: melt timer on non-ice",
when vault guard entered the vault, changing the vault wall unconditionally
into room floor; in this case the vault wall was ice with a melting timer
attached.

Delete any melting ice timers on that location when turning it into floor.
2024-12-28 19:43:14 +02:00
Pasi Kallinen 6530951fd5 Impossible timer after dipping a lit potion of oil
Dipping a lit potion of oil into another potion could
turn the potion of oil into another potion; this resulted
in "burn_object: unexpected obj" impossible after the lit timer
ran out.

Just make an explosion if trying to dip a lit potion of oil.
2024-12-28 19:39:02 +02:00
nhkeni bb57c38e24 Option formatting cleanup. 2024-12-27 18:17:49 -05:00
nhmall 959cc47665 set but not used warning in reveal_paths() 2024-12-26 19:55:08 -05:00
nhmall 556f1c9839 Windows: remove troublesome template lines
Closes #1345
2024-12-26 17:38:03 -05:00
nhmall e6e0913878 doc/* from cron job 2024-12-26 17:34:18 -05:00
keni 47ccaf3f26 more .gitattributes 2024-12-25 20:23:00 -05:00
keni a331a667e5 3.7 setup for autodocs 2024-12-25 14:58:48 -05:00
nhkeni 09693f618f Fix header spelling error "DATE" -> "Date"; force update dates. 2024-12-24 19:24:15 -05:00
nhmall 4507323a42 more doc updates 2024-12-24 13:41:17 -05:00
nhkeni c27cb28ec5 Use old-style --int flag to git to work with older gits. 2024-12-24 12:51:23 -05:00
nhkeni bdff809099 Update hyphenation for *.mn and *.6 files. 2024-12-24 12:37:20 -05:00
nhmall 95cf46c102 update Guidebook and some generated files 2024-12-24 10:27:12 -05:00
nhmall e32ac5a7c7 fixes3-7-0.txt update for showpaths option tweaks 2024-12-23 00:50:38 -05:00
nhmall 9ba20d0e22 more follow-up tweaking for missing sysconf --showpaths 2024-12-23 00:33:12 -05:00
nhmall 1a6847ca15 follow-up tweaking for missing sysconf --showpaths 2024-12-23 00:16:52 -05:00
nhmall 1746f57f37 avoid double free
If freedynamicdata() gets called twice, for whatever reason, a "double free" can occur.

warning: 44     ./nptl/pthread_kill.c: No such file or directory
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7c8b26e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff7c6e8ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7c6f7b6 in __libc_message_impl (fmt=fmt@entry=0x7ffff7e148d7 "%s\n")
    at ../sysdeps/posix/libc_fatal.c:132
#6  0x00007ffff7ceefe5 in malloc_printerr (str=str@entry=0x7ffff7e17bf0 "free(): double free detected in tcache 2")
    at ./malloc/malloc.c:5772
#7  0x00007ffff7cf154f in _int_free (av=0x7ffff7e49ac0 <main_arena>, p=<optimized out>, have_lock=0)
    at ./malloc/malloc.c:4541
#8  0x00007ffff7cf3d9e in __GI___libc_free (mem=0x555555ad82a0) at ./malloc/malloc.c:3398
#9  0x00005555557c12e9 in free_rect () at rect.c:48
#10 0x00005555557d77a2 in freedynamicdata () at save.c:1240
#11 0x0000555555682754 in nh_terminate (status=0) at end.c:1671
#12 0x000055555589af15 in opt_terminate () at ../sys/unix/unixmain.c:768
#13 0x000055555589af7a in after_opt_showpaths (dir=0x0) at ../sys/unix/unixmain.c:796
#14 0x0000555555693dd9 in do_deferred_showpaths (code=0) at files.c:4491
#15 0x0000555555778405 in initoptions () at options.c:6948
#16 0x0000555555899cd9 in main (argc=2, argv=0x7fffffffdad8) at ../sys/unix/unixmain.c:151
2024-12-22 23:20:04 -05:00
nhmall a62c62fd96 follow-up for --showpaths
Ensure that memory allocations are freed up.

Windows:
  Fix a Windows compiler warning.
  Fix an undefined link symbol.
2024-12-22 20:45:55 -05:00
nhmall 57f86662fd try harder to have --showpaths succeed
This helps avoid a potential chicken-and-egg scenario
with the system configuration file (sysconf).

If sysconf wasn't accessible at the expected location, it
caused an immediate exit, without relaying any helpful
information. That happened even when using:
    'nethack --showpaths'

That's particularly unhelpful, because the --showpaths
output might have been useful towards understanding where
NetHack was looking for such things.

That left you without an easy recourse to identify where
the game is looking for the sysconf file. That might be
especially troublesome if you didn't build the game
yourself.
2024-12-22 19:58:52 -05:00
Pasi Kallinen 8b11bda6cb Open cavern -style Gehennom filler level 2024-12-22 18:14:12 +02:00
nhmall f12d755ba2 Makefile.nmake updates
Be more consistent in the use of path separators.

Add a second version of Makefile variables that contain paths,
one with a trailing separator, and one without (prefixed with R_
for use in Makefile rules).

Also, in dat/luahelper,

Updates due to correspond to the Makefile.nmake changes.

Add Makefile variable AWK to use $(AWK) instead of hardcoded awk.
2024-12-22 09:43:00 -05:00
Pasi Kallinen 0079bf87bb fixes update 2024-12-21 18:19:42 +02:00
Pasi Kallinen 6b0e21dc1a Wish alias "tripe" for tripe ration 2024-12-21 14:11:00 +02:00
Pasi Kallinen f7e86aa150 Add a new bigroom variant "two hexagons" 2024-12-21 12:19:26 +02:00
Pasi Kallinen e7a714849e luahelper doc nit 2024-12-21 12:06:20 +02:00
nhmall d42c4faea0 suppress "Entering directory" messages from the output 2024-12-21 01:19:34 -05:00
nhmall f490e54d88 update target all in dat/luahelper 2024-12-21 01:15:54 -05:00
nhmall 7c54d9e651 add support for vs files.props to dat/luahelper 2024-12-21 01:13:45 -05:00
nhmall 20511564f7 utility to help maintain lua files on platform builds
Use by:

  make -f dat/luahelper [target]

  Target examples:

      Visual Studio nmake  : make -f dat/luahelper devhelp-nmake >file.txt

      msys2 GNUmakefile    : make -f dat/luahelper devhelp-msys >file.txt

      Xcode project.pbxproj: make -f dat/luahelper devhelp-xcode >file.txt

      all: generate txt files for all the above
2024-12-21 00:47:18 -05:00
nhmall f6a5236beb follow-up to #1343 fix for telepathic hero
telepathic hero can discern which particular monster just
read a scroll, even though he cannot see the monster
2024-12-20 15:30:37 -05:00
nhmall a35e5779f6 heard incantation: don't trump telepathy with 'I'
GitHub 1343 report by @ars3niy:
"When you are blind and see with telepathy a monster whom you then hear read
a scroll, said monster turns into an "I". While it reveals which one exactly
read the scroll, it is strange that you can no longer see it with telepathy
until it moves to another square."

Fixes #1343
2024-12-20 13:04:08 -05:00
Pasi Kallinen cc31017265 Use NO_MATERIAL instead of a magic number 2024-12-20 19:39:16 +02:00
nhmall 45b2a6c49a more C standard progress
There was a transcription error in the comments in cstd.h for
the standard list of header files, where only the description
remained for <stdlib.h>, not the name of the file itself.

Remove several extraneous inclusions of the standard C99 headers.

Tested on the following afterwards:
Linux (using hints/linux.370) including tty, curses, qt6, and X11
macOS (using hints/macOS.370) including tty, curses, qt5, and X11
Windows MSYS2 using sys/windows/GNUmakefile
Windows Visual Studio using sys/windows/Makefile.nmake
msdos cross-compile on Ubuntu using djgpp cross-compiler
2024-12-20 10:32:38 -05:00
PatR 837da48621 fix issue #1340 - winter wolf, hellhound alignment
Issue reported by k21971:  winter wolf cub and hellhound pup were
defined with alignment -5 (chaotic) while winter wolf and hellhound
were 0 (neutral).

K2 suggested that winter wolf plus cub both be neutral and hellhound
plus pup both be chaotic but I've gone another way:  both cub and
pup are now 0 and both adults are -5.

Fixes #1340
2024-12-19 19:59:13 -08:00
PatR 8a7f3b2b6b more issue #1303
Various bits I had in progress before Michael's commit.

Mainly forget engravings when bones are saved instead of leaving them
flagged as seen for the next hero who gets the level.
2024-12-19 18:18:11 -08:00
nhmall 21d35e768c bump EDITLEVEL for previous two commits DEC19-2024 2024-12-19 17:54:55 -05:00
nhmall 111ef1e1a5 consume a bit in obj.h for future resolution of a TODO in bones.c
Since EDITLEVEL is being incremented for the previous patch anyway,
add the "name_from" bit to the obj struct now, as groundwork for
the code change mentioned in a TODO comment in bones.c:

            /* strip user-supplied names */
            /* Statue and some corpse names are left intact,
               presumably in case they came from score file.
               [TODO: this ought to be done differently--names
               which came from such a source or came from any
               stoned or killed monster should be flagged in
               some manner; then we could just check the flag
               here and keep "real" names (dead pets, &c) while
               discarding player notes attached to statues.] */
            if (has_oname(otmp)
                && !(otmp->oartifact || otmp->otyp == STATUE
                     || otmp->otyp == SPE_NOVEL
                     || (otmp->otyp == CORPSE
                         && otmp->corpsenm >= SPECIAL_PM))) {
                free_oname(otmp);
            }

Also, the bitfield per-byte groupings identified in the struct
weren't accurately reflected, so rearrange the Bitfields,
and correct the per-byte groupings.

This invalidates existing save files and bones.
2024-12-19 17:54:14 -05:00
nhmall f7853be3dc fix GitHub issue 1303 related to engravings
GitHub issue reported by ars3niy:
https://github.com/NetHack/NetHack/issues/1303

@ars3niy commented on Oct 27:
Stepping on a square with a dust or "graffiti" engraving while blind
produces no message because presumably you can't read them by swiping
the floor with your hands, however the engraving glyph still shows up on
the map afterwards. While this helps zen players, it looks like a bug.

@ville-v commented 3 days ago:
Searching while blind also reveals the engravings. Here is a save file
demonstrating the issue.
[...]

This adds an erevealed bit to engravings, to accompany the the eread
bit that is already there.

eread:      refers to the text of the engraving
erevealed:  refers to the engraving map symbol

Hopefully, this resolves issue 1303 without creating additional bugs.

This invalidates existing save files and bones.

Fixes #1303
2024-12-19 17:53:43 -05:00
PatR 1e431139b4 fix issue #1342 - garbled iron bars message
Issue reported by elunna:  the message given when zap_over_floor()
hits iron bars with lightning or acid was substituting a couple of
words or phrases in the wrong order, resulting in
|The {melt|dissolve} iron bars somewhat but remain intact.
when the iron bar location is flagged as non-diggable.  It should be
|The iron bars {melt|dissolve} somewhat but remain intact.

Not mentioned:  the corresponding message for locations that aren't
flagged as non-diggable used "melt" unconditionally.  Change it to
keep "melt" for lightning but switch to "corrode away" for acid.

Fixes #1342
2024-12-19 13:11:01 -08:00
Pasi Kallinen 5de7f986a0 Forget obj trap known in bones file 2024-12-19 15:29:29 +02:00
Pasi Kallinen 87694e1a95 Hero remembers trapped boxes
After finding a trap on a chest or a large box, remember it
as trapped: "You see here a trapped large box."
Randomly generated chests and boxes can be obviously trapped.
Allow defining obviously trapped containers via lua.

Invalidates saves and bones.
2024-12-19 13:11:25 +02:00
PatR 27a03ef75b more /e /E
Discovered but covered engravings weren't being shown by /e and /E.
2024-12-19 01:11:14 -08:00
PatR 01e781fff3 /e /E lint
In look_engrs(), 'sym' isn't used anymore.
2024-12-18 18:14:30 -08:00
PatR 65070b7462 fix /e and /E
A fix in Janurary to avoid appending engraving text or headstone
text when examining a map location where a monster or object covers
the engraving or headstone inadvently broke the /e and /E variations
of the '/' command, which is intended to list such text even when
covered.
2024-12-18 02:15:09 -08:00
Pasi Kallinen faf2267aba Use correct variables, not where we are trying to go 2024-12-18 10:35:54 +02:00
nhmall f32e766728 MIPS cross-compile bit
Use 3 additional Makefile variables
2024-12-17 19:16:00 -05:00
PatR 6e587fb282 fix out-of-bounds not in test_move()
Commit 0381e61624 fixed a problem
for mon vs hero in test_move(), but the situation can also happen
with mon vs mon which doesn't use test_move().
2024-12-17 13:46:25 -08:00
Pasi Kallinen 80a0a309ea Don't advance spell skills when using wizcast 2024-12-17 22:55:22 +02:00
nhmall 6ce2ae956e simplify inclusion of debugging capability in msdos package
This build command will include line number info, gdb.exe or nhgdb.bat in the package:

        make CROSS_TO_MSDOS=1 WANT_DEBUG=1 package

This build command will not include line number info, gdb.exe or nhgdb.bat in the package:

        make CROSS_TO_MSDOS=1 package
2024-12-17 15:33:39 -05:00
Pasi Kallinen 20c456cbbb Avoid using doopen return value in test_move
We can't rely on doopen_indir return value to
check whether hero moved and opened a door.
Instead, explicitly check whether the door is still
closed, and whether hero moved.
2024-12-17 20:58:02 +02:00
nhmall 8da4f74dcf revisit some coordxy casts inherited from time of xchar
The ones below marked "left,revisit" might be worthy of code changes

explode.c:removed: arg sx,sy passed to breaks() are coordxy and so are the parameters
invent.c: removed: discover_artifact() parameter is xint16, so change cast to match
mail.c: removed: gv.viz_rmin[] contains coordxy's, and enexto() 2nd param is too
mkmaze.c: removed: x, y are coordxy and so are cc->x, cc->y
mkroom.c: removed: tx, ty are coordxy and so are parameters to occupied()
mplayer.c: left,revisit: x,y declared int, but mk_mplayer() params are coordxy
sp_lev.c 2890: left alone: x,y declared int, but is_ok_location() params coordxy
sp_lev.c 4114: left alone: cast from lua_Integer
sp_lev.c 4123: left alone: cast from lua_Integer
sp_lev.c 4650: left alone: cast from lua_Integer returned from lua_tointeger
sp_lev.c 4765: left alone: cast from int_Integer returned from lua_tointeger
sp_lev.c 4772: left alone: cast from int_Integer returned from get_table_int
teleport.c 366: left alone: cast from int returned from rn2()
timeout.c 2171: left alone: cast from long
vault.c: left,revisit: guardx,guardy declared int, but bestcc fields are coordxy
worm.c 791: left,revisit: wseg.wx, wseg.wy are coordxy, so are nx, ny, but not
                          ox, oy; why are ox, oy needed at all?
worm.c 955: left alone: wx, wy are coordxy, wseg_at() params are int x, int y
zap.c 5061: left alone: cast from long
2024-12-17 13:02:05 -05:00
Pasi Kallinen 0381e61624 Fix out-of-bounds in test_move
Hero was on the top-left of an open map at (1,0), and
a monster was trying to knock them back to (0,-1).
2024-12-17 18:23:01 +02:00
nhmall 5a3795184f use bash for sys/msdos/fetch-cross-compiler.sh
bash allows arrays thus preventing duplication during fetching
2024-12-16 13:35:05 -05:00
nhmall 0a5948fffc follow-up on msdos cross-compile
Obtain gdb.exe during the execution of sys/msdosfetch-cross-compiler.sh
ahead of the build, so that the Makefile just has to move it into place.
2024-12-15 20:08:10 -05:00
nhmall 69600c3f38 add an optional deploy-to-dosbox target for msdos cross-compile
The WANT_DEBUG=1 will cause the cross-compile to include line
number information in the NetHack executable, useful for
backtraces and gdb debugging sessions.

How a developer can use the optional deploy-to-dosbox target:
    make CROSS_TO_MSDOS=1 WANT_DEBUG=1 dosbox=/mnt/c/dosbox deploy-to-dosbox

where dosbox= points to the directory which will be mounted for
your drive in dosbox

THe deploy-to-dosbox recipe ensures that a target copy of gdb.exe
ends up alongside nethack.exe at the target, including:
  - placing the source code that gdb requires on the target
    in the nhsrc subfolder.
  - an nhgdb.bat that supplies the right switches to gdb
    for locating the NetHack sources.
2024-12-15 10:26:49 -05:00
nhmall fd7c314e9e adjust compiler switches in msdos cross-compile 2024-12-15 10:15:23 -05:00
nhmall 2965ce4bc5 msdos build correction
ENHANCED_SYMBOLS is defined by default in config.h.
The msdos build tried to #undef ENHANCED_SYMBOLS
in tilemap.c, but doing it in there created a mismatch
between the data struct definition for glyph_map in wintype.h
and the initializers generated in tilemap.c

Move the msdos build catch for ENHANCED_SYMBOLS to
one single place in config1.h so that the code and data agree.
2024-12-15 09:53:50 -05:00
Pasi Kallinen e778d95ace Accessibility: more message locations pt 7 2024-12-14 16:37:49 +02:00
Pasi Kallinen 79affad312 Accessibility: more message locations pt 6 2024-12-14 16:28:20 +02:00
Pasi Kallinen 141d24bdeb Accessibility: more message locations pt 5 2024-12-14 16:19:14 +02:00
Pasi Kallinen 1849985214 Accessibility: more message locations pt 4 2024-12-14 15:51:55 +02:00
Pasi Kallinen 369f1ff959 Accessibility: more message locations pt 3 2024-12-14 15:36:05 +02:00
Pasi Kallinen 055c0d5954 Accessibility: more message locations pt 2 2024-12-14 15:30:12 +02:00
Pasi Kallinen 8e186fd5e6 Accessibility: more message locations 2024-12-14 15:24:24 +02:00
Pasi Kallinen 7fa38eb7b3 Use pline_mon instead of pline_xy
Forgot about this function. Whoops.
2024-12-14 15:20:17 +02:00
Pasi Kallinen 4f37795f96 Accessibility: pet message locations 2024-12-14 15:00:46 +02:00
Pasi Kallinen fd23463941 Sparkle shield effect and accessibility
When sparkle is turned off, there are some places where
a monster resisting the effect did not give any message.

This fixes some of those.
2024-12-14 14:34:22 +02:00
PatR b2b9b685c5 fix issue #1305 - failed #untrap from doorway
Issue reported by loggersviii:  attempting #untrap from an adjacent
doorway can move the hero diagonally out of the doorway.

A followup comment by elunna pointed out that a monster's attack that
results in knockback can produce similar result.

Fixes #1305
2024-12-13 22:48:32 -08:00
PatR bbb4bfa938 fix issue #1337 - 'fireassist' vs 'f'iring aklys
Issue reported by elunna:  if the 'fireassist' option is on and the
quiver contains ammo, 'f' while wielding an aklys switches to the
ammo's launcher instead of throwing the aklys.

Fixes #1337
2024-12-13 12:30:48 -08:00
nhmall c7739171a2 follow-up: consoletty.c 2024-12-12 22:46:44 -05:00
nhmall c7276bcf67 more MSYS2 warning clean-up 2024-12-12 22:35:38 -05:00
nhmall 8bb764e624 follow-up: leading tab to spaces 2024-12-12 17:06:12 -05:00
nhmall 1b607d1757 deal with some MSYS2 warnings 2024-12-12 17:02:37 -05:00
Alex Smith 3491535548 More bugfixes for the recent artifact gifting changes 2024-12-12 07:35:50 +00:00
Alex Smith 459c456838 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-12-12 07:01:35 +00:00
Alex Smith 3d8081c748 Bugfixes for the recent artifact gifting changes 2024-12-12 06:58:43 +00:00
PatR 9768677f91 comment tweak 2024-12-11 20:53:08 -08:00
Alex Smith c2c797fa35 Artifact and #offer rebalance, part 2: luck from sacrificing
Luck from sacrificing is now limited by the value of the sacrifice.

This fixes two exploits, both of which rely on getting luck up to
maximum as soon as you have an altar, a luckstone, and a few
rations, via altar-camping until you accumulate enough luck. One of
them is to use the resulting luck to throw off the balance of combat
via using it to make hit chance calculations irrelevant. The other
is to use it to get crowned early in the game; in particular,
getting crowned pre-Sokoban is often viable and, especially for
chaotic characters, solves most of the game's difficulty at that
point (because the intrinisics and weapon are enough to carry a
character to the Castle given even mediocre luck with finding armor).

After this commit, becoming crowned very early in the game is more
difficult (likely requiring unicorns and identified gems), and the
hit chance gain from luck becomes a more gradual gain over the
course of the game rather than all happening immediately upon
finding the altar and luckstone.

In addition to making the game more balanced, this also discourages
grinding by reducing the incentive for altar-camping, so it will
hopefully make it more fun as well.
2024-12-12 03:37:02 +00:00
Alex Smith d87cadaf73 Artifact and #offer rebalance, part 1: sacrifice gifts
In 3.6, artifact gifts are often either a) entirely useless or
b) gamebreaking, neither of which is really ideal from a balance
perspective.

This commit aims to make artifact gifts more useful in the early
game by greatly increasing the chance for situational artifacts to
generate positively enchanted.  However, the most powerful
artifacts will now only be gifted if you offer a high-value corpse,
meaning that they are only likely to be accessible later in the
game.  The selection of which artifact to gift has become more
complicated in order to a) increase the chance that it fits the
character and b) reduce cheese strategies (e.g. it is no longer
possible for elves to force the gifting of Stormbringer as the
first sacrifice gift).
2024-12-12 03:14:47 +00:00
PatR aedb24d343 partly fix issue #1336 - pets vs floating eyes
Issue reported by ars3niy:  pets with reflection or ranged attacks
would only attack floating eyes when rolling the 10% random chance
that other pets have even though they could have always safely
attacked.

This fixes the situation for melee attacks by pets who have
reflection.

dog_move() is too complicated for my feeble brain to cope with the
ranged attack aspect.  Pets still won't use ranged attacks against
floating eyes.

With the fix for reflection, I discovered that silver dragons
would be subjected to floating eyes' passive paralysis even when
their breath attack was suppressed.  (It wouldn't impact them, due
to reflection, but the message about the floating eye being hit by
its reflected gaze was being delivered without being preceded by
any message since no attack had taken place yet.)  This fixes that.

\#1336 is still open
2024-12-11 12:38:28 -08:00
nhmall e08bd9ef8a Windows NetHackW memory leak bit 2024-12-10 14:49:56 -05:00
nhmall 323359ed83 rework a #migratemons change from yesterday 2024-12-10 14:01:10 -05:00
nhmall 175260807b wiz mode teleport starting destination selection
Ensure that the destination selection for intentional
teleport begins at the hero, rather than starting at
a place on the map stored from a prior travel command.
2024-12-10 13:39:55 -05:00
nhmall 548c021049 freedynamicdata() adjustment
The location of the call to dobjsfree() in freedynamicdata()
appears to have been non-ideal.

After getting complaints from a leak-sensing tool after
#quit, the source of the leaks was investigated.

The call to dobjsfree() had been placed immediately following
a call to dmonsfree(), and it did clear out the go.objs_deleted
chain at that point.

Further investigation revealed that the following functions
later on in freedynamicdata() were then adding more deleted
objects to the go.objs_deleted chain:
    free_current_level();
    freeobjchn(gi.invent);
    freeobjchn(gm.migrating_objs);

Move the call to dobjsfree() to a location after those listed
above.
2024-12-10 13:33:42 -05:00
nhmall ce8cef7906 get rid of spurious warning on Microsoft compiler 2024-12-09 23:29:38 -05:00
nhmall c897f3a950 a comment for the obj side of discard_migrations() 2024-12-09 22:59:56 -05:00
nhmall d99a24843b deal with light sources in discard_migrations()
Otherwise, when discard_migrations() purges monsters,
their stale monster pointers can be left inside the light source data
structure.
2024-12-09 21:41:26 -05:00
nhmall 64d41e10de update #migratemons for debugging purposes
For the wizard-mode command #migratemons at the
"How many random monsters to migrate to next level? [0]" prompt,
allow a negative number to cause it to use existing monsters
already on the level for the forced migration, up until the
absolute value of the number, instead of random new monsters
as it does for a positive number.

For example, specify -20 to force-migrate 20 existing monsters
already on the map.
2024-12-09 21:14:14 -05:00
nhmall 1f8b75b8c6 different ls content values, so bump EDITLEVEL 2024-12-09 16:21:31 -05:00
nhmall b744ad41d9 follow-up correct ordering of impossible() fmt 2024-12-09 16:07:27 -05:00
nhmall 02259dd1d0 light source troubleshooting
I don't think this solves the recent light source reports,
but it changes a couple of things in an attempt to get more
information.

1. Having gy.youmonst.m_id field always be zero makes it tough
to distinguish it from uninitialized memory, or a random memory
value. This changes the m_id for the hero's gy.youmonst.m_id
to always hold the identifier 1, instead of 0.

2. write_ls was taking the stashed pointer in the light source,
and using it to immediately extract the m_id field and search
for that m_id. This changes the approach slightly, to actually
try and locate the stashed pointer itself in one of the monster
chains. Only if the monster pointer is located, do we dereference
it to obtain the m_id field.

3. For the interim, mark the saved ls with another set bit when
there has been a failure to locate the monst. At this time,
no code is acting on that bit, but it can be seen in a debug
session.

Hopefully, the next report will provide enough information to
understand the scenario a little better.
2024-12-09 15:52:29 -05:00
Pasi Kallinen cbb0f9079d Wand of striking strikes the ground
... if dropped while levitating/flying.
2024-12-09 14:36:14 +02:00
Pasi Kallinen 57abae29e8 Don't switch away from polearm if monster in range
Using 'f', if hero is wielding a polearm, and a monster is in range,
don't switch away even if we do have ammo in quiver and a launcher
in the inventory.
2024-12-08 22:19:36 +02:00
Pasi Kallinen dafd854993 Gelatinous cubes eat organic objects inside them 2024-12-08 17:57:59 +02:00
Pasi Kallinen 78289a7f83 Archeologists' fedora is lucky 2024-12-08 16:17:35 +02:00
PatR 13b8725ac2 combine taming of already tame monsters
Merge the recent change in the effect of blessed scroll of taming on
already tame monsters with the earlier change of any taming on already
tame monsters.  Non-blessed has a chance of boosting monst->mtame by 1
when it is less than 10, more likely the lower the current value is.
For blessed, boost by 2 after that, so possibly by 3 if it is very low.

Make spell of charm monster when skilled or expert in enchantment
spells behave the same as blessed scroll of taming.  [I'm not too sure
about this; it may make the spell too powerful.]
2024-12-07 19:38:01 -08:00
Pasi Kallinen a3f0b54aea Healers gain experience by healing pets 2024-12-07 12:50:59 +02:00
Pasi Kallinen 9d68d171fb Typofix 2024-12-07 11:37:15 +02:00
Pasi Kallinen 863d455e1d Tourists gain experience by using camera flash on monsters
This counts as seeing the monster up close, so the tourist
doesn't need to get next to the monster
2024-12-07 11:24:30 +02:00
Pasi Kallinen 12228cac49 Tourists gain experience by going to new dungeon levels 2024-12-06 22:10:17 +02:00
Pasi Kallinen 89c4c3a722 Tourists gain experience by seeing new types of creatures up close
Experience equivalent to killing a monster is gained when starting a turn
adjacent to and being able to see the monster.

Breaks saves.

Idea and parts of code via dNetHack
2024-12-06 21:30:23 +02:00
Pasi Kallinen 5eb7566eba Prevent two possible ways to die in the tutorial 2024-12-06 17:36:34 +02:00
Pasi Kallinen d318d2a489 Code formatting nit 2024-12-06 16:58:01 +02:00
Pasi Kallinen e23e6ef235 Blessed scroll of destroy armor asks which armor to destroy
via xNetHack with some slight modifications.
2024-12-06 11:09:27 +02:00
Pasi Kallinen 9b4f38eebe Blessed scroll of taming increases tameness of pets 2024-12-05 16:44:05 +02:00
Pasi Kallinen 4b15085bb1 Avoid naming Vlad's entourage if vampires are genocided 2024-12-05 16:16:55 +02:00
Pasi Kallinen b73581b745 Looking around the map in tutorial 2024-12-05 15:42:15 +02:00
Pasi Kallinen 08be1bafdd Explain ctrl-key combos in tutorial
When tutorializing a command that uses a ^X notation, show Ctrl-X
instead.  Also show an explanation of the ^X nearby.

The only ctrl-key combination that can currently happen in the tutorial,
without rebinding keys, is the kick-command.

Fixes #1327
2024-12-05 15:36:30 +02:00
nhmall bdeddbe63b update sys/msdos/Install.dos 2024-12-04 15:12:27 -05:00
nhmall 0409ce01a3 cross compile to msdos in CI - fix 3 2024-12-04 15:01:30 -05:00
nhmall f7cff6c0eb cross compile to msdos in CI - fix 2 2024-12-04 14:55:35 -05:00
nhmall b33369fc22 cross compile to msdos in CI - fix 1 2024-12-04 14:47:04 -05:00
nhmall 3a044c56a9 more CI cross compile to msdos - compiler bit 2024-12-04 14:31:42 -05:00
nhmall 2d38d05c6b correct bad edit in CI yml file 2024-12-04 14:17:04 -05:00
nhmall e120abe696 switch msdos cross-compile in CI to Ubuntu 24.04 2024-12-04 14:13:44 -05:00
Pasi Kallinen b96c59e9b1 Angry god may remove an intrinsic 2024-12-04 20:54:47 +02:00
nhmall 6813e51945 Use newer mingw-w64 UCRT build in CI 2024-12-04 09:51:51 -05:00
Pasi Kallinen c868119a33 Add missing full stop 2024-12-04 16:46:05 +02:00
nhmall 7c28fa1828 test newer software versions in CI 2024-12-04 09:25:12 -05:00
Pasi Kallinen 53f43ab00b Qt: show main window normally instead of maximized
Sidenote: The main window size calculations are getting stupid.
It would be better to find out the widget sizes and shift
the splitter up, instead of letting it just take up half of the main window.

Idea and part of the code by Richard Henschel
2024-12-03 19:52:30 +02:00
nhmall c434b73e94 fix a comment typo 2024-12-02 19:43:56 -05:00
nhw_cron dd66009cc1 This is cron-daily v1-Apr-1-2024. 000files updated: Files 2024-12-02 19:28:16 -05:00
nhmall fec6320e68 rename sys/windows/Makefile.mingw32 to GNUmakefile
GNU make looks first for a file called GNUmakefile, ahead of
looking for Makefile and then makefile.

Renaming sys/windows/Makefile.mingw32 to sys/windows/GNUmakefile
allows:

o src/GNUmakefile (for use by GNU make) and src/Makefile (for use
  Microsoft nmake) to both reside in the src folder during build.

o src/GNUmakefile will be used by GNU make, without having to
  explicitly specify "-f GNUmakefile" on the GNU make command line.

o src/Makefile will be used by Microsoft nmake, without having to
  explicitly specify "-f Makefile" on the Microsoft nmake command line.

For the gcc build, the movemement of sys/windows/GNUmakefile needs
to be copied to src/GNUmakefile as part of the build process (see
sys/windows/build-msys2.txt).

For the Microsoft Visual Studio command line build with nmake,
sys/windows/Makefile.nmake needs to be copied to src/Makefile as
part of the build process (see sys/windows/build-nmake.txt).

They are both copied to the src folder from their respective
repository source file names when the nhsetup.bat file is used.
2024-12-02 19:04:08 -05:00
PatR 1301234039 mimic feedback tuning
When a mimic in door form is hit by a wand of locking or wand of
opening or corresponding spell, bring it out of concealment like
was recently done for being zapped while in chest form.  And give
some feedback rather than just changing the mimic's form to 'm'.

Give more detailed feedback when bumping into a mimic while moving.
2024-12-02 11:37:04 -08:00
nhmall 86679ebddb typo in englightenment for stealth when mounted
reported as internal#K4306: typo in englightenment for stealth when mounted
2024-12-02 11:11:48 -05:00
Keni d0d179efcb Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-12-01 11:45:21 -08:00
Keni 9777e7785a rename local ctxp -> contextp to avoid global ctxp 2024-12-01 11:25:16 -08:00
nhmall 8b08244c9b Cross-compile build fixes
recover was not being built correctly under cross compilation
2024-12-01 13:24:30 -05:00
nhmall dda5d03d91 update Cross-compiling documentation 2024-12-01 2024-12-01 09:13:21 -05:00
nhmall c81af23c8c place MIPS cross-compile game in targets subfolder 2024-12-01 09:10:33 -05:00
nhmall 763ed61af7 a pair of analyzer bits 2024-11-30 22:07:18 -05:00
nhmall 211178d084 fixes3-7-0.txt entry: WASM pull request 1331
The pull request was:
    https://github.com/NetHack/NetHack/pull/1331
by @guillaumebrunerie

The text by @guillaumebrunerie that accompanied the pull request was:

I have been working on a browser/mobile port of NetHack 3.7 using
cross-compilation to WebAssembly (it is very playable already, you can
try it at https://guillaumebrunerie.github.io/nethack/).

[screen shot]

The existing code for compiling to WebAssembly was a great help, although
it wasn't fully up to date and was missing a number of things in order
to be able to create a proper window port (for instance there was no way
to set 'iflags.window_inited' to true, 'print_glyph' was not working
properly as its signature changed, and various other things).

This pull request contains various fixes and additions that I found were
needed/helpful.

Changes:

 * export more constants/pointers/globals.
 * fix various types that are incorrect.
 * disable compression of save files, as it uses fork which isn't supported
   in WebAssembly.
 * include 'genl_player_setup' when 'SHIM_GRAPHICS' is defined, in order to
   make it possible to reuse the existing player selection code.
 * move initialization of JavaScript global constants up, as I was running
   in some issue when 'raw_print' was being called before initialization.
 * change various compilation options for Emscripten, in particular it now
   generates an ES6 module (easier to use in a modern Javascript project)
   and exports more methods from Emscripten (for instance to be able to use
   the virtual file system when saving).
 * simplify the implementation of the main loop to avoid 'setTimeout' which
   can be pretty slow in the browser when called many times.
 * change the way pointer arguments are being sent to JavaScript in 'getArg'
   (they were being sent as a pointer to the pointer itself on the stack,
   which doesn't really make sense, now the pointer itself is sent).
2024-11-30 21:06:16 -05:00
nhmall 9f33d1cf7a Merge branch 'newsym_worm' of https://github.com/entrez/NetHack into NetHack-3.7 2024-11-30 20:14:40 -05:00
nhmall 079da0fcba update Files 2024-11-30 19:38:44 -05:00
nhmall c2c2e84485 remove some tabs that snuck in unintentionally 2024-11-30 19:35:25 -05:00
nhmall cd032881ad Windows pdcurses: suppress fallthrough warnings
Avoid warning about issues in 3rd party code
2024-11-30 19:19:54 -05:00
nhmall b89e792873 Some Windows gcc fixes 2024-11-30 19:06:05 -05:00
Michael Meyer 92d931f190 Refresh worm segments when (un)taming
Because newsym() would be called only on the head position of the worm,
if hilite_pet was on, the segments and head of a long worm would have
mismatched highlighting in the immediate aftermath of taming or
untaming.
2024-11-30 17:30:52 -05:00
nhmall bc88266081 NetHack's regex function prototypes into nhregex.h
There was an issue with Windows mingw build because the function
prototypes were not available. Place them into a distinct
header file nhregex.h and include it from extern.h, and
available for cppregex.cpp to include without the rest of
extern.h (which can give some problems with c++).
2024-11-30 17:08:54 -05:00
nhmall 8f2b979f32 Windows: nmake lualib build bit 2024-11-30 17:05:23 -05:00
nhmall f8d9b288b9 Merge branch 'NetHack-3.7' of https://github.com/guillaumebrunerie/NetHack into NetHack-3.7 2024-11-30 15:54:21 -05:00
nhmall df86614318 Windows Visual Studio: another follow-up
Missed a couple of configuration options in previous fix
2024-11-30 15:51:30 -05:00
nhmall 36227fcb6d follow-up: build fix when using VS 2019 2024-11-30 15:47:40 -05:00
nhmall d94f728a9f Windows visual studio: lualib as separate entity 2024-11-30 15:42:06 -05:00
nhmall 88301902f8 remove a left-over piece of a test 2024-11-30 14:47:04 -05:00
nhmall 0792e5fe9e expand implicit fallthrough detection to non-gcc compilers
gcc has recognized various "magic comments" for white-listing
occurrences of implicit fallthrough in switch statements for
a long time:

    The range and shape of "falls through" comments accepted are
    contingent upon the level of the warning. (The default level is =3.)

    -Wimplicit-fallthrough=0 disables the warning altogether.
    -Wimplicit-fallthrough=1 treats any kind of comment as a "falls through" comment.
    -Wimplicit-fallthrough=2 essentially accepts any comment that contains something
     that matches (case insensitively) "falls?[ \t-]*thr(ough|u)" regular expression.
    -Wimplicit-fallthrough=3 case sensitively matches a wide range of regular
     expressions, listed in the GCC manual. E.g., all of these are accepted:
        /* Falls through. */
        /* fall-thru */
        /* Else falls through. */
        /* FALLTHRU */
        /* ... falls through ... */
       etc.
    -Wimplicit-fallthrough=4 also, case sensitively matches a range of regular
     expressions but is much more strict than level =3.
    -Wimplicit-fallthrough=5 doesn't recognize any comments.

Plenty of other compilers did not recognize the gcc comment convention,
and up until now the compiler warning for detecting unintended
fallthrough had to be suppressed on other compilers. That's because the code
in NetHack has been relying on the gcc approach, and only the gcc approach.

The C23 standard introduces an attribute [[fallthrough]] for the
functionality, when implicit fallthrough warnings have been enabled.

Several popular compilers already support that, or a very similar attribute
style approach, today, even ahead of their C23 support:

       C compiler                       whitelist approach
       ---------------------------   -------------------------------------
       C23 conforming compilers         [[fallthrough]]

       clang versions supporting
       standards prior to
       C23                              __attribute__((__fallthrough__))

       Microsoft Visual Studio
       since VS 2022 17.4.
       The warning C5262 controls
       whether the implict
       fallthrough is detected and
       warned about with
       /std:clatest.                    [[fallthrough]]

This adds support to NetHack for the attribute approach by inserting a
macro FALLTHROUGH to the existing cases that require white-listing, so
other compilers can analyze things too.

The definition of the FALLTHROUGH macro is controlled in include/tradstdc.h.

The gcc comment approach has also been left in place at this time.
2024-11-30 14:16:27 -05:00
nhmall d6beba7b6a Windows: fix hacklib subproject settings in VS 2024-11-30 11:57:20 -05:00
Guillaume Brunerie 52876c4798 WASM fixes 2024-11-30 17:07:10 +01:00
PatR 149cb96020 github issue #1299 - sleeping mimics
Issue reported by elunna:  sleeping mimics can grab the hero, and
zapping a concealed mimic with a wand of sleep describes the target
as a mimic but doesn't bring it out of concealment.

The grab-when-asleep case is reasonable.  It's a reflexive counter-
attack by a magical creature.  And the mimic wakes up in the process.
But the mimic wasn't being brought out of concealment.  Do that.

Unconceal mimics hit by wand of sleep unless already sleeping.

Fixes #1299
2024-11-29 23:30:04 -08:00
PatR 689f6c4c82 prayer lint 2024-11-28 14:24:27 -08:00
PatR cbc93a0555 github issue #1312 - prot from shape changers
Issue reported by youkan700:  shape change anomalies.  Shapechangers
could change shape despite active protection-from-shape-changers if
hero wore two rings of protection from shape changers and took one
off.  Shapechangers who migrated to a not-yet-visited level that
eventually got visited with protection from shape changers in effect
would be stuck in their current shape, even if the PfSC attribute
got toggled off and back on.

The issue included suggested fixes and those are what I've used.  I
noticed a third case that only applies to wizard mode:  if player
used #wizintrinsic to set a timed value for PfSC, monsters wouldn't
resume changing shape after it timed out, unless/until it got toggled
on and back off via a PfSC ring or hero left the level and returned.

Fixes #1312
2024-11-28 11:33:26 -08:00
nhkeni 755b70de69 Make documentation of nhgitset.pl easier to find and
find out about.
2024-11-27 14:06:27 -05:00
PatR c255dc4bc4 paranoid_confirm:trap when flying or levitating
Avoid asking the player whether to _step_ on a trap when flying or
levitating.  locomotion() isn't the right routine for handling that.
2024-11-27 10:37:55 -08:00
PatR 5c0834e9d9 hurtle_step() streamlining
Eliminate some code duplication in hurtling.
2024-11-27 10:32:09 -08:00
PatR 9c0e47785a digging in ice
If the spot in front of a closed drawbridge was ICE, digging there
had issues....
2024-11-27 08:41:55 -08:00
nhmall c1c74db90c update tested versions of Visual Studio 2024-11-27 2024-11-27 09:48:35 -05:00
PatR 1fe23ff4d9 vampshifters vs closed doors
If a vampire in fog cloud form moves under a closed door and then
before moving further gets killed and revives in vampire form,
destroy the door instead of moving the vampire to a nearby open
spot (which might be a distant spot if the map is crowded).  If the
door is trapped, explode the trap.  That will damage the vampire but
usually not by enough to kill it.

This probably ought to be generalized to be done for any shape change
at a closed location but I ran out of gas.
2024-11-26 22:15:41 -08:00
PatR 6a6378d886 some termcap.c bits
Clear out the tempcap.c portion of an old stash entry.  Only the
combination of conditionals used for OSX has been exercised.
2024-11-26 22:12:05 -08:00
PatR dab4784842 Unix 'make spotless' - remove lev_comp + dgn_comp
In case someone switches from NetHack-3.6 to NetHack-3.7 and does
'make spotless' after the switch instead of before, get rid of out
of date lev_comp and dgn_comp.
2024-11-26 21:52:47 -08:00
PatR 1c888b3b07 noit_mon_nam()
Change noit_mon_nam() to work as if it was noit_y_monnam() (without
renaming it or adding yet another monster naming routine) to use
"your <mon>" rather than "the <mon>" when <mon> is a pet that can
be seen (so not the case where "it" gets replaced by "someone" or
"something").
2024-11-26 21:51:00 -08:00
PatR 1d0b8dfca0 Demonbane revisited
Commit c4a1f298e8 two and a half
months ago gave lawful Angels and Archons a chance to start with
a mace instead of a long sword so that they might get Demonbane.
It was a bit convulted; this redoes it to be more straightforward.
2024-11-26 21:40:19 -08:00
nhmall 70284521e6 follow-up: paste bit 2024-11-27 00:35:27 -05:00
PatR ea6cdd3f39 Amulet_on() & Amulet_off()
Fix a FIXME in Amulet_off() for removing an amulet of magical
breathing when within a poison gas cloud.

Redo message sequencing for both Amulet_on() and Amulet_off().

Use up an amulet of change if put on while the Unchanging attribute
is active (via #wizintrinsic) instead of wearing it with no effect.

Don't discover amulet of strangulation if put on while already
Strangled (via #wizintrinsic).
2024-11-26 21:20:30 -08:00
PatR d32ab55b84 new property: BLND_RES
Add enlightenment feedback for Sunsword's blocking of becoming blind
from light flashes.  It uses an extra property so that wizard mode
can report the reason.

EDITLEVEL is being incremented, so existing save and bones files are
invalidated.
2024-11-26 20:57:11 -08:00
nhmall 15e70035d0 Remove unnecessary macro that wasn't ideally named
Also add a comment that states the intent.
2024-11-26 23:27:29 -05:00
PatR 3615b17b62 'O' feedback when toggling 'accessiblemsg'
When accessiblemsg is Off, coordiates supplied for various messages
stayed put after becoming stale.  If you used 'mO' to toggle that
option On, you could see things like
 (2east):'accessiblemsg' option toggled on.
After that, accessibility message coordinates behaved as intended.

Clear a11y.msg_loc.x,y for every pline instead of just when they
are used to augment the current message.

Most players who use accessiblemsg are bound to set it in their
config file rather than toggle it interactively so never noticed.

Misc 1:  option.c doesn't need '#include <ctype.h>' because
cstd.h includes it unconditionally.  Several other src/*.c are in
the same situation but I didn't touch them.

Misc 2:  move set_msg_dir() and set_msg_xy() out of a warning
suppression block that isn't relevant to them.
2024-11-26 19:28:30 -08:00
PatR 1c5b295097 tin consumption edge cases
If eating a tin killed the hero (choked, turned to stone, poly'd into
a new man with new Xp too low to survive) and bones were saved, the
tin remained intact in them.

When hero who is poly'd into metallivore form eats a tin, give a
little extra nutrition for the tin itself.  Also, eat it immediately
by skipping the "It smells like <creature>" message and "Eat it? [yn]"
prompt.  (The message while eating it also reports <creature>, so
skipping the 'smells' one doesn't end up hiding anything.)
2024-11-26 18:01:19 -08:00
Anhijkt d93704a154 change CHDIR definition conditions 2024-11-23 19:04:12 +02:00
nhmall 37793be6eb more quieting of Qt6 build warnings 2024-11-20 09:56:01 -05:00
nhmall 3e903fd79a quiet warnings on recent Qt, macOS Sequoia 15.1, latest Xcode 2024-11-17 10:03:04 -05:00
nhkeni 4f3c463d69 remove some testing junk that escaped 2024-11-16 17:39:40 -05:00
nhmall 7932497450 follow-up for Makefile.nmake 2024-11-16 10:45:22 -05:00
nhmall 21b495f835 Makefile.nmake build fix when no curses options
Resolves #1325
2024-11-16 10:10:10 -05:00
nhkeni d493d31aec Remove "*.txt NHSUBST" from .gitattributes because it's too general.
Specifically, it was marking Guidebook.txt for substitution, but
it's a derived file, not a source.
2024-11-15 19:00:31 -05:00
SHIRAKATA Kentaro aba2bda159 split eval_offering() into a separate function 2024-11-16 04:10:11 +09:00
nhmall 13db1aed0d replace stray tabs that have crept in 2024-11-14 11:54:39 -05:00
Pasi Kallinen 62971c6f09 Qt: add support for the palette config option
Depends on CHANGE_COLOR compile-time option.
2024-11-14 17:25:44 +02:00
nhmall c7591c0e08 remove redundant zeroing 2024-11-13 17:36:47 -05:00
nhmall b8083733de some sys.c orphaned pointer prevention 2024-11-13 17:14:47 -05:00
nhmall 7ff17845c6 Windows MSYS2 build fix 2024-11-13 16:14:49 -05:00
nhmall c16c87a897 Merge branch 'early_return' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-13 14:54:34 -05:00
nhmall 52a9af7278 early_init() was being called twice on Windows GUI 2024-11-13 13:57:18 -05:00
nhmall fa9210aa65 Windows: free more allocated memory before exit
This gets rid of the final leak complaint on Windows as of Nov 13, 2024
2024-11-13 13:48:50 -05:00
nhmall c85b5d3e56 rearrange function layout in Windows windmain.c 2024-11-13 13:48:03 -05:00
nhmall 5c28b9e987 fix another memory leak
In sys_early_init(), the values for sysopt.gdbpath and
sysopt.greppath were being assigned by calling dupstr()
without ensuring that a value previously assigned by
dupstr() were free()'d.

Also, the sysopt struct definition is changed to sysopt_s,
not because there's anything wrong with the original
    struct sysopt sysopt;
but because I couldn't convince the debugger to use the
correct thing when trying to track down the leak.
2024-11-13 09:07:10 -05:00
nhmall 277a0e4464 Windows NetHackW.c bit 2024-11-12 19:30:43 -05:00
nhmall 724f8f865c more memory freeing before exit on Windows 2024-11-12 18:51:04 -05:00
nhmall 0e52eac184 update tested versions of Visual Studio 2024-11-12 2024-11-12 18:00:37 -05:00
SHIRAKATA Kentaro 2ee31972a5 unify to early return on offer_corpse()
* remove redundant `else`
 * reduce indent
2024-11-12 22:50:17 +09:00
nhmall 7414b906b2 release some memory before exit under Windows 2024-11-11 16:50:57 -05:00
nhkeni fd0b67de4d Fix leak in crashreport_init() under Windows 2024-11-11 15:21:59 -05:00
nhkeni 91c38355e7 Merge branch 'keni-gitset2' into NetHack-3.7 2024-11-11 11:27:27 -05:00
nhkeni 36e8d9e6fc nhgitset version 4
To update, run "perl DEVEL/nhgitset.pl"

Fixes:
- "nhcommit -a" has been fixed
- NHDT was hardwired in places
- no longer complain about a missing dat directory outside of the
    NetHack source tree
- make update of gitinfo atomic
- Replace some hardwired directory separators with OS-dependent constructs

Backwards Incompatibilities:
- NH_DATESUB's DATE() is now Date() to match the other variables
- MSYS2 requires an additional Perl package - the MSYS2 docs have
    been updated

New Help System:
- git nhhelp
   This command mirrors "git help" for nh* commands.
- See git nhhelp nhsub for general help on substitution variables

New Substitution Variables:
-Brev()
    An aBREViation of $PREFIX-Branch$:$PREFIX-Revision$ - this
    may help get line length under control in file headers.
-Assert(TYPE=VALUE)
    If TYPE does not match VALUE, do not substitute on this line.
    TYPE P checks VALUE against nethack.substprefix
-Project(arg)
    Returns nethack.projectname if there is no arg and an uppercase
    version if arg is uc.

Other New Features:
- Add nethack.projectname
- Documentation updates - see "git nhhelp nhsub"
- On checkout or merge of a branch, check for nhgitset version updates
  and provide an optional message to the user.
- Move NH_DATESUB substitutions here from cron job to keep dates in sync
- PREFIX-* keywords now available in NH_DATESUB templates
- Support use of nhgitset.pl from a different repo; note that update
  checks will be dependent on keeping the original source repo up-to-date
  and in the same location.
2024-11-11 09:15:49 -05:00
SHIRAKATA Kentaro 93072b8784 shrink scopes of some vars on offer_corpse() 2024-11-11 17:34:32 +09:00
nhmall e83e04dbb3 fix some memory leaks 2024-11-10 22:24:45 -05:00
nhmall d428beb8dd remove an unused prototype 2024-11-10 17:58:04 -05:00
nhmall 9a7dcf16a3 rm.h comment update 2024-11-10 17:49:54 -05:00
nhmall dacad054cc Merge branch 'offer_corpse' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-10 10:35:13 -05:00
nhmall bbcd161e5f follow-up: prompt message bit 2024-11-10 10:19:58 -05:00
nhmall c87a373b11 more follow-up related to #1320 2024-11-10 10:06:07 -05:00
SHIRAKATA Kentaro e23095a829 omit return value of offer_corpse(), as it is always ECMD_TIME 2024-11-10 22:46:31 +09:00
nhmall 5cc529efc8 follow-up related to #1320
This is additional groundwork related to
https://github.com/NetHack/NetHack/issues/1320

This additional groundwork just puts some safeguards
in place to make it rather tough to end up with an
instant death from handling a cockatrice corpse in
your inventory without appropriate protection.

At this point, still no actual petrification will occur.
2024-11-09 23:49:10 -05:00
nhmall a40d85a430 Merge branch 'offer_corpse' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-09 14:47:33 -05:00
nhmall 9c554895b1 adjust wish for cockatrice corpse
Wishing is powerful, so if you cannot safely handle a cockatrice
corpse, then have a wish for one result in the corpse materializing
on the floor rather than in your inventory.

Resolves #1320
2024-11-09 14:06:43 -05:00
nhmall 36d8998edb try not including trees when check_pos() returns it's 3rd argument.
Related to #1309
https://github.com/NetHack/NetHack/issues/1309

K2 commented: "This might help - k21971/EvilHack@afed641"

A comment in there states:
"Fix: sections of wall being visible when they shouldn't yet.
This has been a long-standing bug for as long as I can remember, and qt
appears to have figured it out. What was happening: the player would all
of the sudden see a section of wall in an area that they hadn't explored
yet. It was discovered that this was only occurring if that section of
wall had any type of tree up against it."

The fix there attempts to leave trees out of the check_pos non-zero return,
so give that a shot.

I didn't attempt to reproduce the situation myself,
and therefore cannot confirm that this does resolve it.

Feedback on effectiveness or side-effects are welcomed. If someone is
able to confirm that this resolves the issue without creating new
issues, we can close it, otherwise this can be reverted.
2024-11-09 11:40:09 -05:00
nhmall 1dbba0f63b rename IS_ROCK() macro to IS_OBSTRUCTED()
It has included trees since they were added, so give it a
more fitting name.
2024-11-09 11:12:42 -05:00
nhmall f1743d0e5c more rm.h comment updates 2024-11-09 10:58:58 -05:00
nhmall a74badd271 rm.h comment updates 2024-11-09 10:53:48 -05:00
SHIRAKATA Kentaro db460a4fcf split offering a corpse into a separate function 2024-11-09 02:35:19 +09:00
nhmall aaf324bcb4 comment bit in polyself.c 2024-11-07 16:29:45 -05:00
nhmall 9e75dec8f3 Merge branch 'negative_valued' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-07 10:37:38 -05:00
nhmall e863583c56 iterating gi.invent (github issue #1315)
GitHub issue #1315 points out that it is possible for
a downstream function to change an object's nobj field
to point to a completely different chain.

The cited example by @vultur-cadens was:

     for (obj = gi.invent; obj; obj = obj->nobj)
         if (obj->oclass != COIN_CLASS && !obj->cursed && !rn2(5)) {
             curse(obj);
             ++buc_changed;
         }

    curse() drops the weapon with drop_uswapwep(),
        which calls dropx(),
            which calls dropy(),
                which calls dropz(),
                    which calls place_object().

place_object alters the nobj pointer, to point to the floor chain:
    otmp->nobj = fobj;
    fobj = otmp;

The result was that the next loop iteration was then using floor
objects from the floor chain.

This alters several for-loops to use a more consistent approach,
particularly when the obj is being handed off to a function,
where a downstream function might, or might not, alter the nobj
field.

References:

https://github.com/NetHack/NetHack/issues/1315
https://www.reddit.com/r/nethack/comments/1gkc9ub/even_if_you_drop_an_item_before_drinking_from_the/
2024-11-06 16:59:51 -05:00
SHIRAKATA Kentaro ffe2dfc17c split offering negative valued items into a separate function 2024-11-07 03:30:13 +09:00
SHIRAKATA Kentaro b953625e5b early return when value == 0 on dosacrifice()
`calc_value()` returns a non-negative value, and there is no code that sets `value` to 0 after this point.
2024-11-05 15:30:07 +09:00
SHIRAKATA Kentaro 955c2c5faf early return on dosacrifice()
... to reduce indents and prepare further refactorings.
2024-11-05 00:50:19 +09:00
nhmall 091a709cdb follow-up: NetHack typically passes ptr to coord 2024-11-03 09:21:19 -05:00
nhmall 82bca3d78a Merge branch 'use_leash' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-03 09:16:09 -05:00
nhmall e4b334e8b9 Merge branch 'sacrifice_value' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-03 09:12:01 -05:00
nhmall aba796bb08 Merge branch 'rock_disppear_msg' of https://github.com/argrath/NetHack into NetHack-3.7 2024-11-03 09:10:16 -05:00
nhmall f46cd2732a W_NONDIGGABLE collisions with overloaded rm flags fields
Resolves #1308
2024-11-03 09:08:11 -05:00
nhmall 9a42d70901 ranged attack in repertoire might not be used
Commit 22884522, ported (from Sporkhack, Evilhack), added the ability
for monsters to maintain awareness of player resistances that they
observed.

Since they will refrain from using a ranged attack that they deem
futile, take the specific monster's seen_resistance field into consideration
when choosing code paths based on the availability of ranged attacks.

Resolves #1307
2024-11-03 09:03:04 -05:00
SHIRAKATA Kentaro ce41d32c2c split "got_target" on use_leash() into a separate function 2024-11-03 03:06:17 +09:00
nhmall 70a5b06c45 Makefile.nmake fix for target spotless under x64 2024-11-02 09:15:20 -04:00
SHIRAKATA Kentaro 3f3e1cc49a split calculating sacrifice value into a separate function 2024-10-30 13:36:42 +09:00
nhmall fec99bfb86 follow-up: parameter UNUSED as in most of NetHack 2024-10-29 19:30:09 -04:00
Mika Kuoppala 9294239197 util: match fopen_datafile function prototype
The prototype for fopen_datafile() is different if
it is used for util/dlb. Add the missing integer parameter.
2024-10-28 21:40:50 +02:00
SHIRAKATA Kentaro bb401fcb38 split a message of a rock disappearing into a separate function
... to prepare further refactoring
2024-10-27 00:48:01 +09:00
Alex Smith 4c49239940 Update a comment in config.h to allow for gnome-terminal updates
gnome-terminal was recently fixed to work correctly with
TTY_TILES_ESCCODES (and other similar private-use terminal code
sequences), and thus this isn't an incompatible combination any
more.
2024-10-25 01:34:48 +01:00
nhmall 79c889502c follow-up: remove trailing whitespace 2024-10-24 08:40:44 -04:00
nhmall f40c81d2fd Merge branch 'passiveum' of https://github.com/argrath/NetHack into NetHack-3.7 2024-10-24 08:39:09 -04:00
nhmall 2cf52c0374 Merge branch 'dopush' of https://github.com/argrath/NetHack into NetHack-3.7 2024-10-24 08:38:33 -04:00
Mika Kuoppala 25061dbce4 Remove magic members from instance globals.
We ought to trust compiler and we have other
tools to check oob access.
2024-10-23 23:41:24 +03:00
nhmall 5eefeaf009 msghandler follow-up: msdos cross-compile warnings
pline.c: In function 'execplinehandler':
pline.c:631:17: warning: unused variable 'args' [-Wunused-variable]
  631 |     const char *args[3];
      |                 ^~~~
pline.c:626:30: warning: unused parameter 'line' [-Wunused-parameter]
  626 | execplinehandler(const char *line)
      |                  ~~~~~~~~~~~~^~~~
2024-10-19 08:02:03 -04:00
Pasi Kallinen 945ccff1ff Allow changing command autocompletions via #optionsfull 2024-10-19 14:46:11 +03:00
nhmall 64bb0e2144 msghandler follow-up: fix mingw/MSYS2 build 2024-10-19 07:28:12 -04:00
Pasi Kallinen 696af89299 Change MSGHANDLER from compile-time to sysconf 2024-10-19 10:47:53 +03:00
Pasi Kallinen d35aa35c3f Don't put the unknown command message into history
Even with Norep, it was cluttering the message history buffer.
2024-10-18 17:54:05 +03:00
Pasi Kallinen 0530ca0758 Fix the undiggable/nonpasswall stuff
wall_info (aka flags) is overloaded with other stuff.
2024-10-18 16:52:29 +03:00
Pasi Kallinen c33a6e7c0b Wizmode wishing for undiggable/unphaseable walls 2024-10-18 14:20:24 +03:00
Pasi Kallinen f12635ccd9 Prevent monster generation in the sokoban trap hallway
Makes Sokoban far less tedious when you don't have to worry about
monsters randomly popping up in the trap hallway while you're pushing
the boulder.

Adds a new exclusion zone for monster generation, and the goodpos
routine avoids the zones when GP_AVOID_MONPOS is used.
2024-10-18 13:30:51 +03:00
Pasi Kallinen 9e4b2c121b Improve the exclusion zone code
I forgot to add the code to flip the exclusion zones when implementing them.
Also improve the zone coordinates so they're correct outside of map contents.
2024-10-17 12:34:06 +03:00
SHIRAKATA Kentaro d2b7c2f5c5 split "assess_dmg" on passiveum() into a separate function 2024-10-15 03:21:08 +09:00
PatR 546c1101b0 more 'selectsaved'
If the saved game menu has more than 13 games, it won't be able to
use 'n' for "new game" and 'q' for "quit".  Switch to 'N' and 'Q'
instead of just using the next letters in sequence.  Only resort to
next-letters if there are more than 39 games.

tty and curses handle a list of many save files via menu pagination.
X11 does so with one long page possessing a scroll bar.  If there
are more than 52 entries, selection via mouse is needed beyond 'Z'.

Qt has one page without any scroll bar so won't provide access to
the full set of save files when there are too many to fit on the
screen.
2024-10-12 15:03:54 -07:00
PatR 35cf713988 fix part of #S11588 - mons eating poisoned items
Prevent non-poison resistant monsters that eat items from eating
poisoned items.
2024-10-12 14:39:48 -07:00
nhmall 3885949c5b resolve a static analyzer complaint in glyphs.c
src/glyphs.c(680): warning: Dereferencing NULL pointer.
                   'other' contains the same NULL value as 'obj_glyphs[idx].u' did.
2024-10-12 15:28:44 -04:00
nhmall 67cfdf6843 get rid of a static analyzer warning
src/pager.c(696): warning: Reading invalid data from 'def_warnsyms'
2024-10-12 14:56:36 -04:00
PatR 10498b1535 monster swapping armor simplification
Slightly simplify yesterday's message adjustment made when a monster
takes off a piece of armor and puts on a different instance of the
same type of armor.  ("a|an <something>" -> "another <something>")
2024-10-12 11:09:50 -07:00
nhmall 57fc8f10a6 replace fuzzer state magic numbers 2024-10-12 10:14:44 -04:00
nhmall 87af3a8cac fuzzer under Windows GUI hangs on minimize window
On the Windows GUI (nethackw.exe), while running the fuzzer,
if the NetHack window gets minimized, or someone minimizes all
desktop windows, the NetHack window stops responding and won't
even repaint itself. The NetHack process continues to use the
CPU.

A break in the debugger shows that it is caught in a do loop.

I didn't delve into the issue of why minimizing the window
triggers a condition that leads to the endless loop. This
just adds a kludge to exit the loop while fuzzing.
2024-10-12 09:28:29 -04:00
PatR e1dbad9194 monster swapping armor
While testing the Demonbane change, I saw
| The Angel of Crom removes a robe and puts on a robe.

which looks a bit silly.  Change that to be
| The Angel of Crom removes a robe and puts on another robe.

when the two items have the same formatted description.  (The second
robe evidently has a better enchantment than the first one.)
2024-10-12 00:17:58 -07:00
PatR c4a1f298e8 lawful minions vs Demonbane
Back then Demonbane was a long sword, lawful Angels and Archons
could get either it or Sunsword as part of their starting equipment.
After it got changed into a mace instead, they could only get
Sunsword.  Rather than always giving them a long sword, sometimes
give them a mace so that they get back the chance to start with
Demonbane.

Since mace is quite a bit weaker that long sword against large
opponents, provide a better enchantment for maces given to lawful
minions.
2024-10-11 23:34:26 -07:00
PatR 11a4fe42de 'selectsaved' again - update EDITLEVEL again
The role, race, gender, and alignment string values are 3 letters
preceded by a dash.  I was looking at "name-race-role-gend-algn"
and mistakenly treated them as 4 letters preceded by a dash.

Fixing that changes PL_NSIZ_PLUS and there is one item of that size
written into save files, so the fix invalidates existing save files.
2024-10-11 22:35:38 -07:00
PatR 1f36b98b8f 'selectsaved' extension
Instead of a menu listing
 a - hero1
 b - hero2
 n - New game
 q - Quit
show
 a - hero1-role1-race1-gend1-algn1
 b - hero2-role2-race2-gend2-algn2
 n - New game
 q - Quit
or
 a - - hero1-role1-race1-gend1-algn1
 b - X hero2-role2-race2-gend2-algn2
 c - D wizard-role3-race3-gend3-algn3
 n - New game
 q - Quit
when any game in the list wasn't saved during normal play.  (Those
are sorted by character name; the playmode is just coincidence.)

The dash for 'normal' doesn't look great but -/X/D are codes used in
entries written to paniclog.  The whole playmode prefix doesn't look
particularly good but I suspect that most players relying on restore
via menu won't see it.

It should work when the character name has dashes in it but that
hasn't been properly tested.

The gender and alignment suffices reflect their value at the time of
save rather than at the start of the game.  That might be considered
a bug but it was easiest.

Increments EDITLEVEL; existing save and bones files are invalidated.
2024-10-10 23:14:25 -07:00
nhmall ac3031932f update tested versions of Visual Studio 2024-10-10 2024-10-10 18:14:57 -04:00
SHIRAKATA Kentaro 666b053c09 split "dopush" on moverock_core() into a separate function 2024-10-09 23:00:16 +09:00
nhmall a70ad42d22 address Windows windsys.c analyzer complaints
sys/windows/windsys.c(419): warning C6387: 'hMod' could be '0':
  this does not adhere to the specification for the function 'GetProcAddress'.

sys/windows/windsys.c(437): warning C28159:
  Consider using 'GetTickCount64' instead of 'GetTickCount'.
  Reason: GetTickCount overflows roughly every 49 days.  Code that does not
          take that into account can loop indefinitely.
          GetTickCount64 operates on 64 bit values and does not have that
          problem
2024-10-08 11:57:46 -04:00
nhmall 19d8ec6d12 address Windows consoletty.c analyzer complaints
sys/windows/consoletty.c: warning C6388: '&reserved' might not be '0':
  this does not adhere to the specification for the function 'WriteConsoleA'.
sys/windows/consoletty.c(2514): warning C28159:
  Consider using 'IsWindows*' instead of 'GetVersion'. Reason: Deprecated.
Use VerifyVersionInfo* or IsWindows* macros from VersionHelpers.
2024-10-08 11:32:58 -04:00
493 changed files with 44867 additions and 22094 deletions
+2
View File
@@ -56,6 +56,7 @@ Makefile.gcc-orig
*.lastcodeanalysissucceeded
# VS 2017 caches data into the hidden directory .vs
.vs
win/win32/vs/obj/*
# Win32-specific ignores end
.DS_Store
# ms-dos
@@ -95,3 +96,4 @@ bundle/*
util/*.lib
util/*.exp
submodules/CHKSUMS.tmp
sys/amiga/regex/
+85 -83
View File
@@ -361,41 +361,45 @@ Using the cross-compiler, build the following targets:
cross-compile and link with these compiler switches:
-DCROSSCOMPILE and -DCROSSCOMPILE_TARGET
core sources (2019): src/allmain.c, src/alloc.c, src/apply.c,
core sources (2024): src/allmain.c, src/alloc.c, src/apply.c,
src/artifact.c, src/attrib.c, src/ball.c,
src/bones.c, src/botl.c, src/cmd.c, src/dbridge.c,
src/bones.c, src/botl.c, src/calendar.c,
src/coloratt.c, src/cmd.c, src/dbridge.c,
src/decl.c, src/detect.c, src/dig.c, src/display.c,
src/dlb.c, src/do.c, src/do_name.c, src/do_wear.c,
src/dog.c, src/dogmove.c, src/dokick.c,
src/dothrow.c, src/drawing.c, src/dungeon.c,
src/eat.c, src/end.c, src/engrave.c, src/exper.c,
src/explode.c, src/extralev.c, src/files.c,
src/fountain.c, src/hack.c, src/hacklib.c,
src/insight.c, src/invent.c, src/isaac64.c,
src/light.c, src/lock.c, src/mail.c,
src/makemon.c, src/mcastu.c,
src/earlyarg.c src/eat.c, src/end.c, src/engrave.c,
src/exper.c, src/explode.c, src/extralev.c,
src/files.c, src/fountain.c, src/getpos.c,
src/glyphs.c, src/hack.c, src/hacklib.c,
src/iactions.c, src/insight.c,
src/invent.c, src/isaac64.c, src/light.c,
src/lock.c, src/mail.c, src/makemon.c, src/mcastu.c,
src/mdlib.c, src/mhitm.c, src/mhitu.c, src/minion.c,
src/mklev.c, src/mkmap.c, src/mkmaze.c, src/mkobj.c,
src/mkroom.c, src/mon.c, src/mondata.c,
src/monmove.c, src/monst.c, src/mplayer.c,
src/mthrowu.c, src/muse.c, src/music.c,
src/nhlsel.c, src/nhlua.c, src/nhlobj.c,
src/o_init.c, src/objects.c, src/objnam.c,
src/options.c, src/pager.c, src/pickup.c,
src/pline.c, src/polyself.c, src/potion.c,
src/pray.c, src/priest.c, src/quest.c,
src/nhlua.c, src/nhlsel.c, src/nhlobj.c,
src/nhmd4.c, src/objects.c, src/o_init.c,
src/objnam.c, src/options.c, src/pager.c,
src/pickup.c, src/pline.c, src/polyself.c,
src/potion.c, src/pray.c, src/priest.c, src/quest.c,
src/questpgr.c, src/read.c, src/rect.c,
src/region.c, src/restore.c, src/rip.c, src/rnd.c,
src/role.c, src/rumors.c, src/save.c, src/sfstruct.c,
src/shk.c, src/shknam.c, src/sit.c, src/sounds.c,
src/sp_lev.c, src/spell.c, src/steal.c, src/steed.c,
src/region.c, src/report.c, src/restore.c,src/rip.c,
src/rnd.c, src/role.c, src/rumors.c, src/save.c,
src/selvar.c, src/sfstruct.c, src/shk.c,
src/shknam.c, src/sit.c, src/sounds.c, src/sp_lev.c,
src/spell.c, src/stairs.c, src/steal.c, src/steed.c,
src/symbols.c, src/sys.c, src/teleport.c,
src/timeout.c, src/topten.c, src/track.c,
src/trap.c, src/u_init.c, src/uhitm.c, src/vault.c,
src/version.c, src/vision.c,
src/weapon.c, src/were.c, src/wield.c, src/windows.c,
src/wizard.c, src/worm.c, src/worn.c, src/write.c,
src/zap.c, sys/share/cppregex.cpp
src/trap.c, src/u_init.c, src/uhitm.c,
src/utf8map.c, src/vault.c, src/version.c,
src/vision.c, src/weapon.c, src/were.c, src/wield.c,
src/windows.c, src/wizard.c, src/wizcmds.c,
src/worm.c, src/worn.c, src/write.c, src/zap.c,
sys/share/cppregex.cpp
tty sources: win/tty/getline.c, win/tty/termcap.c,
win/tty/topl.c, win/tty/wintty.c
@@ -410,7 +414,7 @@ Using the cross-compiler, build the following targets:
b) Lua (mandatory in 3.7)
lib/lua-5.4.6/src
lib/lua-5.4.8/src
from sources: lua.c, lapi.c, lauxlib.c, lbaselib.c, lcode.c,
lcorolib.c, lctype.c, ldblib.c, ldebug.c,
@@ -469,10 +473,10 @@ Cross-compiler pre-built binary downloads:
or pdcursesmod from:
https://github.com/Bill-Gray/PDCursesMod.git
- A shell script to download that djgpp cross-compiler and associated
- A bash script to download that djgpp cross-compiler and associated
pieces for either linux or macOS is available:
sh sys/msdos/fetch-cross-compiler.sh
bash sys/msdos/fetch-cross-compiler.sh
That script won't install anything, it just does file fetches and stores
them in subfolders of lib. The linux.370 and macOS.370 hints files are
@@ -480,7 +484,7 @@ Cross-compiler pre-built binary downloads:
CROSS_TO_MSDOS=1
on your make command line.
Note: Both the fetch-cross-compiler.sh script and the msdos
Note: Both the fetch-cross-compiler.sh bash script and the msdos
cross-compile and package procedures require unzip and zip to be available
on your host build system.
@@ -525,11 +529,11 @@ Cross-compiler pre-built binary downloads:
Disclaimer: This is a minimal recipe, just to help someone else get
started if they have a desire to get a full cross-compile of
NetHack going for the Amiga.
See CAVEATS below.
Cross-compiler used: bebbo's amiga-gcc
Cross-compiler url: https://github.com/bebbo/amiga-gcc
Cross-compiler url: https://github.com/AmigaPorts/m68k-amigaos-gcc
Author of 3.7 support: Ingo Paschke
To our knowledge, a pre-built copy of the cross-compiler isn't available,
so you will likely have to obtain the cross-compiler sources via git and
build it on your system.
@@ -539,86 +543,84 @@ Cross-compiler url: https://github.com/bebbo/amiga-gcc
sudo apt install make wget git gcc g++ lhasa libgmp-dev \
libmpfr-dev libmpc-dev flex bison gettext texinfo ncurses-dev \
autoconf rsync
autoconf rsync libreadline-dev
The build prerequisite packages for macOS via homebrew are documented but
not tested by us any of us to date.
brew install bash wget make lhasa gmp mpfr libmpc flex gettext \
texinfo gcc make autoconf
gnu-sed texinfo gcc@12 make autoconf bison
After installing the prerequite packages and the cross-compiler
it was a straightforward build:
After installing the prerequisite packages and the cross-compiler
the build is straightforward:
git clone https://github.com/bebbo/amiga-gcc.git
Create the /opt/amiga directory for holding the compiler and tools.
sudo mkdir /opt/amiga
sudo chgrp users /opt/amiga
sudo chmod 775 /opt/amiga
sudo usermod -a -G users username
(you may have to log off and back on)
Build the cross-compiler.
git clone https://github.com/AmigaPorts/m68k-amigaos-gcc.git amiga-gcc
cd amiga-gcc
make update
[Note that you may have to take ownership of the files in the bebbo
repo via chown before successfully carrying out the next steps]
The compiler pieces are installed in /opt/amiga by default, and the
NetHack Makefiles expect them there.
make clean
make clean-prefix
date; make all -j3 >&b.log; date
If you prefer, you can alter the prefix before you build if you want.
The instructions for doing so were spelled out at the time of this writing at:
The compiler pieces are installed in /opt/amiga by default. If you prefer,
you can alter the prefix before you build if you want. The instructions
for doing so were spelled out at the time of this writing at:
https://github.com/AmigaPorts/m68k-amigaos-gcc
Makefile adjustments will be needed, however.
https://github.com/bebbo/amiga-gcc
On your linux host:
On your linux host:
cd sys/unix ; sh setup.sh hints/linux.370 ; cd ../..
# Clone NetHack 3.7 source
cd NetHack
sys/unix/setup.sh sys/unix/hints/linux.370
make fetch-lua
On your macOS host:
cd sys/unix ; sh setup.sh hints/macOS.370 ; cd ../..
make fetch-lua
The Amiga cross-compile can then be carried out by specifying
CROSS_TO_AMIGA=1 on the make command line:
make CROSS_TO_AMIGA=1 fetch-regex
make CROSS_TO_AMIGA=1 all
make CROSS_TO_AMIGA=1 package
You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build. The SDL1 pdcurses
support has not been tested.
The distribution ZIP is created at targets/amiga/NH370AMI.ZIP.
make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_AMIGA=1 all
On your macOS host, the Amiga cross-compile can be carried out by specifying
CROSS_TO_AMIGA=1 on the make command line:
# Clone NetHack 3.7 source
cd NetHack
sys/unix/setup.sh sys/unix/hints/macOS.370
make fetch-lua
make CROSS_TO_AMIGA=1 fetch-regex
make CROSS_TO_AMIGA=1 all
make CROSS_TO_AMIGA=1 package
Result: The "make package" target will bundle the (hopefully) necessary
components to run NetHack on msdos into a folder:
components to run NetHack on an Amiga into a folder:
targets/amiga/pkg
and then it zips the contents of that folder into:
targets/amiga/nh370ami.zip
targets/amiga/NH370AMI.ZIP
Also note that building the amiga targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_AMIGA=1 from the make
command line.
Display Modes
-------------
Two display modes are available, selected in nethack.cnf:
The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.
Text mode (AMII):
OPTIONS=symset:AmigaFont
CAVEATS: The original NetHack Amiga build steps included the source for
some utilities that were built and executed on the amiga:
txt2iff and xpm2iff
as part of the NetHack build procedure on amiga.
Those did not compile out-of-the-box on the linux host. They
will either have to be:
- ported to build and run on the linux or macOS cross-compile
host
or
Tile mode (AMIV):
OPTIONS=windowtype:amiv
- their functionality will have to be rolled into amiga NetHack
itself and executed on the target Amiga the first time the game
is run, perhaps.
Tile mode auto-selects tiles32.iff (32 colors, 5 bitplanes) when the
screen supports 32+ colors, otherwise tiles16.iff (16 colors, 4 planes).
For further details about playing the game, and setting up your NetHack
configuration, please see the following file:
sys/amiga/README.amiga
If you make headway, or are successful getting a working copy of
NetHack going on the amiga, drop us a note at devteam@nethack.org.
+--------------------------------+
| B6. Case sample: Web Assembly |
@@ -643,7 +645,7 @@ Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html
For macOS, you will need to install Xcode, git, cmake, Python 3.5 or new
(at time of this writing).
After installing the prerequite packages above, obtain the cross-compiler
After installing the prerequisite packages above, obtain the cross-compiler
via git and build it from the directory of your choice using steps similar
to these:
@@ -695,7 +697,7 @@ Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html
+--------------------------------+
| B7. Case sample: mips |
| B7. Case sample: mips |
+--------------------------------+
Cross-compiler used: gcc-mipsel-linux-gnu, g++-mipsel-linux-gnu
+11 -5
View File
@@ -58,6 +58,11 @@ NOTE: These instructions assume you are on the default branch; this _is_
NOTE: The following instructions require perl. If you do not have perl on
your system, please install it before proceeding.
NOTE: More information on nhgitset.pl is available before installation via:
perldoc DEVEL/nhgitset.pl
After installation, the same information is available with:
git nhhelp nhgitset
A. If you have never set up git on this machine before:
(This assumes you will only be using git for NetHack. If you are going to
use it for other projects as well, think before you type.)
@@ -69,7 +74,7 @@ A. If you have never set up git on this machine before:
git config --global credential.helper osxkeychain
Linux:
(This will vary by distribution.)
cd /usr/share/doc/git/contrib/credentail/libsecret
cd /usr/share/doc/git/contrib/credential/libsecret
sudo apt-get install libglib-2.0-dev libsecret-1-dev
sudo make
git config --global credential.helper `pwd`/git-credential-libsecret
@@ -92,10 +97,11 @@ B. Specify the prefix for variable substitution:
tree you cloned from git. I use ~/nethack/GITADDDIR; for that base,
create the needed directories and edit the file:
~/nethack/GITADDDIR/DOTGIT/PRE
Put this in it (if your OS is not Unix-like you may need to change
the first line):
Put this in it, adapting it to your variant (if your OS is not Unix-like
you may need to change the first line):
#!/bin/sh
git config nethack.substprefix MINE
git config nethack.projectname MineHack
Now make it executable:
chmod +x ~/nethack/GITADDDIR/DOTGIT/PRE
C. Configure the repository:
@@ -169,8 +175,8 @@ A. Introduction
The PREFIX is the value in the git config variable nethack.substprefix.
VARNAME is one of:
Date
Branch (experimental)
Revision (experimental)
Branch
Revision
other names will give a warning.
B. Enabling variable expansion
+4
View File
@@ -0,0 +1,4 @@
5
Please see "git log DEVEL" for previous changes.
Make documentation of nhgitset.pl easier to find and
find out about.
+23 -2
View File
@@ -12,11 +12,32 @@ die "Bad subcommand '$ARGV[0]'" unless $ok{$ARGV[0]};
# we won't fail on a failure, so just system()
$rv = system('.git/hooks/nhsub',"--$ARGV[0]",@ARGV[1..$#ARGV]);
if($rv){
print "warning: nhsub failed: $rv $!\n";
print "warning: nhsub failed: $rv $!\n";
}
if(length $ENV{GIT_PREFIX}){
chdir($ENV{GIT_PREFIX}) or die "Can't chdir $ENV{GIT_PREFIX}: $!";
chdir($ENV{GIT_PREFIX}) or die "Can't chdir $ENV{GIT_PREFIX}: $!";
}
exec "git", @ARGV or die "Can't exec git: $!";
__END__
=for nhgitset nhadd Add file contents to the index with NetHack additions
=for nhgitset nhcommit Record changes to the repository with NetHack additions
=head1 NAME
C<NHadd> - NetHack internal common code for nhadd and nhcommit
=head1 SYNOPSIS
C<git nhadd E<lt>git add optionsE<gt>>
C<git nhcommit E<lt>git add optionsE<gt>>
=head1 DESCRIPTION
Run nhsub with the given arguments, then run C<git add> or C<git commit>
with the given arguments. Note that only basic arguments for those commands
are understood; more complex situations may be handled by running C<git nhsub>
manually before running C<git add> or C<git commit>.
+230 -81
View File
@@ -16,9 +16,11 @@ my $tracefile = "/tmp/nhgitt.$$";
# OS hackery
my $DS = quotemeta('/');
my $PDS = '/';
if ($^O eq "MSWin32")
{
$DS = quotemeta('\\');
$PDS = '\\';
}
our %saved_env;
@@ -26,25 +28,23 @@ our @saved_argv;
our $saved_input;
sub saveSTDIN {
@saved_input = <STDIN>;
@saved_input = <STDIN>;
if($trace){
print TRACE "STDIN:\n";
print TRACE $saved_input;
print TRACE "ENDSTDIN\n";
}
if($trace){
print TRACE "STDIN:\n";
print TRACE $saved_input;
print TRACE "ENDSTDIN\n";
}
tie *STDIN, 'NHIO::STDIN', @saved_input;
tie *STDIN, 'NHIO::STDIN', @saved_input;
}
# XXX this needs a re-write (don't tie and untie, just set NEXT=0)
# (the sensitive thing is @foo = <STDIN> )
sub resetSTDIN{
my $x = tied(*STDIN);
my %x = %$x;
my $data = @$x{DATA};
untie *STDIN;
tie *STDIN, 'NHIO::STDIN', $data;
my $x = tied(*STDIN);
my %x = %$x;
my $data = @$x{DATA};
untie *STDIN;
tie *STDIN, 'NHIO::STDIN', $data;
}
# don't need this now
@@ -55,21 +55,142 @@ sub resetSTDIN{
#}
sub PRE {
&do_hook("PRE");
&do_hook("PRE");
}
sub POST {
&do_hook("POST");
&do_hook("POST");
}
###
### versioning for nhgitset and friends
###
# values of nethack.setupversion and DEVEL/VERSION:
# 1 is reserved for repos checked out before versioning was added
# 2 used clean/smudge filter, poorly
# 3 was first production version
# 4 added the version file and version checking; nhhelp, NH_DATESUB support, etc.
sub version_in_devel {
# (1) check for a non-null nethack.setuppath - this handles
# any repo that has already been set up (but NOT checking
# out <v4 over >=v4 since nethack.setuppath will exist but
# DEVEL/VERSION will not).
# XXX if the source repo has been removed, we'll fall back to
# the third case - hopefully that's ok.
# XXX there's no way to recover from a missing source repo
# without editing .git/config.
my $path = `git config --local nethack.setuppath`;
chomp $path;
$path =~ s/DEVEL$//; # NOP if config not set
# (2) else check the local directory; that will be correct for NHsource.
if(0 == length $path){
$path = `git rev-parse --show-toplevel`;
chomp $path;
$path = '' unless(-d "$path${PDS}DEVEL");
}
# (3) If that doesn't exist, check using the invocation path; that will be
# correct for other repos during nhgitset (but will also fail for
# checking out 3 over 4).
if(0 == length $path){
# strip out "DEVEL"
$path = ($0 =~ m!^(.*)${PDS}DEVEL${PDS}.*?(*nla:DEVEL)!)[0];
}
# Uh oh?
if(0==length($path) or (! -d "$path${PDS}DEVEL")){
die "Can't locate DEVEL directory in '$path'.";
}
# Handle checking out version <4 over version >=4. If
# this seems to be the situation, don't revert the code.
return 0 if(! -f "$path${PDS}DEVEL${PDS}VERSION");
my $version;
my $verfile = "$path${PDS}DEVEL${PDS}VERSION";
open VERFH,"<",$verfile or die "xCan't open $verfile: $!";
$version = 0+<VERFH>;
my $message = join('',<VERFH>);
close VERFH;
die "Valid version not found in $verfile" unless($version >= 4);
return ($version,$message) if($version > 0);
return 0;
}
sub version_in_git {
my $vtemp = `git config --local --get nethack.setupversion`;
chomp($vtemp);
return $vtemp if($vtemp > 0);
return 0;
}
sub version_set_git {
my $version_new = $_[0];
system("git config nethack.setupversion $version_new");
if($?){
die "Can't set nethack.setupversion $version_new: $?,$!\n";
}
}
###
### store githash and gitbranch in dat/gitinfo.txt
###
# CAUTION! This is run not just from git hooks, but also from
# sys/unix/gitinfo.sh
sub nhversioning {
use strict;
use warnings;
# See if we're (probably) in a "git pull", in which case we need to
# check for upgrades.
my $check_upgrade = 1 if($_[0]);
# Check for pre-v4 source repo.
my $is_sourcerepo;
{
chomp($is_sourcerepo = `git config --int --get nethack.is-sourcerepo`);
if(0 == length $is_sourcerepo){ # not set - assume old repo
$is_sourcerepo = 1;
}elsif($is_sourcerepo==1){
;
}elsif($is_sourcerepo==0){
;
}
}
# Skip the skipping tests if we're being called directly.
# NB: post-commit has no args, but that will be caught by
# the next test for non-source repos.
if($#ARGV != -1){
# Skip this if we didn't change branches, but see if we need to warn.
if(defined($ARGV[2]) and ($ARGV[2] == 0)){
# Because we can create an out of sync state, possibly warn.
my $ref = $ARGV[1];
if($is_sourcerepo and (0 != 0+`git diff --name-only $ref $ref^ |grep ^DEVEL|wc -l`)){
warn "WARNING: DEVEL directory changed. Versioning may be inconsistent\n";
}
return
}
}
if($check_upgrade){
my $current_version = version_in_git();
my($new_version,$message) = version_in_devel();
if($new_version > $current_version){
warn "nhgitset.pl and/or related programs have changed.\n";
warn "Please re-run nhgitset.pl to update from version $current_version to $new_version.\n";
if(length $message){
warn "Additional information\n$message\n";
}
}
}
# Skip versioning if we aren't in a source repo.
return if(0==$is_sourcerepo);
my $git_sha = `git rev-parse HEAD`;
$git_sha =~ s/\s+//g;
my $git_branch = `git rev-parse --abbrev-ref HEAD`;
@@ -77,7 +198,14 @@ sub nhversioning {
die "git rev-parse failed" unless(length $git_sha and length $git_branch);
my $exists = 0;
if (open my $fh, '<', 'dat/gitinfo.txt') {
no strict 'refs';
no strict 'subs';
my $file_gitinfo = "dat${PDS}gitinfo.txt";
my $file_gittemp = "dat${PDS}TMPgitinfo.txt";
use strict 'subs';
use strict 'refs';
if (open my $fh, '<', $file_gitinfo) {
$exists = 1;
my $hashok = 0;
my $branchok = 0;
@@ -91,61 +219,71 @@ sub nhversioning {
}
close $fh;
if ($hashok && $branchok) {
print "dat/gitinfo.txt unchanged, githash=".$git_sha."\n";
print "$file_gitinfo unchanged, githash=".$git_sha."\n";
return;
}
} else {
print "WARNING: Can't find dat directory\n" unless(-d "dat");
warn "WARNING: Can't find dat directory\n" unless(-d "dat");
return;
}
if (open my $fh, '>', 'dat/gitinfo.txt') {
if (open my $fh, '>', $file_gittemp) {
my $how = ($exists ? "updated" : "created");
print $fh 'githash='.$git_sha."\n";
print $fh 'gitbranch='.$git_branch."\n";
print "dat/gitinfo.txt ".$how.", githash=".$git_sha."\n";
print "$file_gitinfo ".$how.", githash=".$git_sha."\n";
if(close($fh)){
if(rename($file_gittemp, $file_gitinfo)){
; # all ok
} else {
warn "WARNING: Can't rename $file_gittemp -> $file_gitinfo";
}
} else {
warn "WARNING: Can't close temp file: $!";
}
} else {
print "WARNING: Unable to open dat/gitinfo.txt: $!\n";
warn "WARNING: Unable to open $file_gitinfo: $!\n";
}
}
# PRIVATE
sub do_hook {
my($p) = @_;
my $hname = $0;
$hname =~ s!^((.*$DS)|())(.*)!$1$p-$4!;
if(-x $hname){
print TRACE "START $p: $hname\n" if($trace);
my($p) = @_;
my $hname = $0;
$hname =~ s!^((.*$DS)|())(.*)!$1$p-$4!;
if(-x $hname){
print TRACE "START $p: $hname\n" if($trace);
open TOHOOK, "|-", $hname or die "open $hname: $!";
print TOHOOK <STDIN>;
close TOHOOK or die "close $hname: $! $?";
open TOHOOK, "|-", $hname or die "open $hname: $!";
print TOHOOK <STDIN>;
close TOHOOK or die "close $hname: $! $?";
print TRACE "END $p\n" if($trace);
}
print TRACE "END $p\n" if($trace);
}
}
sub trace_start {
return unless($trace);
my $self = shift;
open TRACE, ">>", $tracefile;
print TRACE "START CLIENT PID:$$ ARGV:\n";
print TRACE "CWD: " . cwd() . "\n";
print TRACE "[0] $0\n";
my $x1;
for(my $x=0;$x<scalar @ARGV;$x++){
$x1 = $x+1;
print TRACE "[$x1] $ARGV[$x]\n";
}
print TRACE "ENV:\n";
foreach my $k (sort keys %ENV){
next unless ($k =~ m/(^GIT_)|(^NH)/);
print TRACE " $k => $ENV{$k}\n";
}
return unless($trace);
my $self = shift;
open TRACE, ">>", $tracefile;
print TRACE "START CLIENT PID:$$ ARGV:\n";
print TRACE "CWD: " . cwd() . "\n";
print TRACE "[0] $0\n";
my $x1;
for(my $x=0;$x<scalar @ARGV;$x++){
$x1 = $x+1;
print TRACE "[$x1] $ARGV[$x]\n";
}
print TRACE "ENV:\n";
foreach my $k (sort keys %ENV){
next unless ($k =~ m/(^GIT_)|(^NH)/);
print TRACE " $k => $ENV{$k}\n";
}
}
BEGIN {
%saved_env = %ENV;
@saved_argv = @ARGV;
&trace_start;
%saved_env = %ENV;
@saved_argv = @ARGV;
&trace_start;
}
###
@@ -153,42 +291,41 @@ BEGIN {
###
package NHIO::STDIN;
sub TIEHANDLE {
my $class = shift;
my %fh;
# XXX yuck
if(ref @_[0]){
$fh{DATA} = @_[0];
} else {
$fh{DATA} = \@_;
}
$fh{NEXT} = 0;
return bless \%fh, $class;
my $class = shift;
my %fh;
if(ref @_[0]){
$fh{DATA} = @_[0];
} else {
$fh{DATA} = \@_;
}
$fh{NEXT} = 0;
return bless \%fh, $class;
}
sub READLINE {
my $self = shift;
return undef if($self->{EOF});
if(wantarray){
my $lim = $#{$self->{DATA}};
my @ary = @{$self->{DATA}}[$self->{NEXT}..$lim];
my @rv = @ary[$self->{NEXT}..$#ary];
$self->{EOF} = 1;
return @rv;
} else{
my $rv = $self->{DATA}[$self->{NEXT}];
if(length $rv){
$self->{NEXT}++;
return $rv;
} else {
$self->{EOF} = 1;
return undef;
}
}
my $self = shift;
return undef if($self->{EOF});
if(wantarray){
my $lim = $#{$self->{DATA}};
my @ary = @{$self->{DATA}}[$self->{NEXT}..$lim];
my @rv = @ary[$self->{NEXT}..$#ary];
$self->{EOF} = 1;
return @rv;
} else{
my $rv = $self->{DATA}[$self->{NEXT}];
if(length $rv){
$self->{NEXT}++;
return $rv;
} else {
$self->{EOF} = 1;
return undef;
}
}
}
sub EOF {
$self = shift;
return $self->{EOF};
$self = shift;
return $self->{EOF};
}
1;
@@ -223,11 +360,20 @@ NHgithook - common code for NetHack git hooks (and other git bits)
(core hook code)
&NHgithook::POST;
__END__
=for nhgitset NHgithook Infrastructure for NetHack git hooks.
=head1 DESCRIPTION
Perl module for infrastructure of NetHack Git hooks.
Buffers call information so multiple independent actions may be coded for
Git hooks and similar Git callouts.
Maintains C<dat/gitinfo.txt>.
Common routines for dealing with nethack.setupversion git config variable.
=head1 SETUP
Changing the C<$trace> and C<$tracefile> variables requires editing the
@@ -247,6 +393,9 @@ may be useful since multiple processes may be live at the same time.
Some features not well tested, especially under Windows.
Not well documented, but almost no one needs to change (or even call)
this code.
=head1 AUTHOR
Kenneth Lorber (keni@his.com)
+98 -84
View File
@@ -17,24 +17,24 @@ my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$";
open TRACE, ">>", $rawin?"/dev/tty":(($debug==0)? $sink : $dbgfile);
print TRACE "TEST TRACE\n";
if($debug){
print TRACE "START CLIENT ARGV:\n";
print TRACE "[0] $0\n";
my $x1;
for(my $x=0;$x<scalar @ARGV;$x++){
$x1 = $x+1;
print TRACE "[$x1] $ARGV[$x]\n";
}
print TRACE "ENV:\n";
foreach my $k (sort keys %ENV){
next unless ($k =~ m/^GIT_/);
print TRACE " $k => $ENV{$k}\n";
}
print TRACE "CWD: " . `pwd`;
&dumpfile($ARGV[0], "[0O]");
&dumpfile($ARGV[1], "[1A]");
&dumpfile($ARGV[2], "[2B]");
print TRACE "L=$ARGV[3]\n";
print TRACE "END\n";
print TRACE "START CLIENT ARGV:\n";
print TRACE "[0] $0\n";
my $x1;
for(my $x=0;$x<scalar @ARGV;$x++){
$x1 = $x+1;
print TRACE "[$x1] $ARGV[$x]\n";
}
print TRACE "ENV:\n";
foreach my $k (sort keys %ENV){
next unless ($k =~ m/^GIT_/);
print TRACE " $k => $ENV{$k}\n";
}
print TRACE "CWD: " . `pwd`;
&dumpfile($ARGV[0], "[0O]");
&dumpfile($ARGV[1], "[1A]");
&dumpfile($ARGV[2], "[2B]");
print TRACE "L=$ARGV[3]\n";
print TRACE "END\n";
}
my $mark_len = $ARGV[3];
@@ -47,37 +47,37 @@ my $mark_end = '>' x $mark_len;
my $PREFIX;
# pick up the prefix for substitutions in this repo
if($rawin){
$PREFIX = "TEST";
$PREFIX = "TEST";
} else {
$PREFIX = `git config --local --get nethack.substprefix`;
chomp($PREFIX);
$PREFIX = `git config --local --get nethack.substprefix`;
chomp($PREFIX);
}
my @out;
my $cntout;
if($rawin){
@out = <STDIN>;
@out = <STDIN>;
} else {
#system "git merge-file -p .... > temp
my $tags = "-L CURRENT -L ANCESTOR -L OTHER"; # XXX should "CURRENT" be "MINE"?
@out = `git merge-file -p $tags $ARGV[1] $ARGV[0] $ARGV[2]`;
#system "git merge-file -p .... > temp
my $tags = "-L CURRENT -L ANCESTOR -L OTHER"; # XXX should "CURRENT" be "MINE"?
@out = `git merge-file -p $tags $ARGV[1] $ARGV[0] $ARGV[2]`;
#NB: we don't check the exit value because it's useless
print TRACE "MERGE-FILE START\n".join("",@out)."MERGE-FILE END\n";
print TRACE "MERGE-FILE START\n".join("",@out)."MERGE-FILE END\n";
}
($cntout,@out) = &edit_merge(@out);
if($rawin){
print "COUNT: $cntout\n";
print @out;
print "COUNT: $cntout\n";
print @out;
} else {
# spit @out to $ARGV[1] (careful: what about EOL character?)
open OUT, ">$ARGV[1]" or die "Can't open $ARGV[1]";
print OUT @out;
close OUT;
# spit @out to $ARGV[1] (careful: what about EOL character?)
open OUT, ">$ARGV[1]" or die "Can't open $ARGV[1]";
print OUT @out;
close OUT;
print TRACE "WRITING START ($ARGV[1])\n".join("",@out)."WRITING END\n";
&dumpfile($ARGV[1], "READBACK");
print TRACE "WRITING START ($ARGV[1])\n".join("",@out)."WRITING END\n";
&dumpfile($ARGV[1], "READBACK");
}
print TRACE "COUNT: $cntout\n";
@@ -95,37 +95,37 @@ exit( ($cntout>0) ? 1 : 0);
# keep failing so we don't need to keep changing the setup while building this script
sub dumpfile {
my($file, $tag) = @_;
print TRACE "FILE $tag START\n";
print TRACE `hexdump -C $file`;
print TRACE "FILE END\n";
my($file, $tag) = @_;
print TRACE "FILE $tag START\n";
print TRACE `hexdump -C $file`;
print TRACE "FILE END\n";
}
sub edit_merge {
my(@input) = @_;
# $::count is a bit ugly XXX
local $::count = 0; # we need the number of conflicts for exit()
my @out;
my(@input) = @_;
# $::count is a bit ugly XXX
local $::count = 0; # we need the number of conflicts for exit()
my @out;
local $_;
while($_ = shift @input){
if(m/^$mark_start /){
print TRACE "FOUND A CONFLICT\n";
my @conflict;
push(@conflict, $_);
while($_ = shift @input){
push(@conflict, $_);
if(m/^$mark_end /){
last;
}
}
push(@out, &edit_conflict(@conflict));
} else {
push(@out, $_);
local $_;
while($_ = shift @input){
if(m/^$mark_start /){
print TRACE "FOUND A CONFLICT\n";
my @conflict;
push(@conflict, $_);
while($_ = shift @input){
push(@conflict, $_);
if(m/^$mark_end /){
last;
}
}
push(@out, &edit_conflict(@conflict));
} else {
push(@out, $_);
}
print TRACE "RETURN count=$::count\n";
return($::count, @out);
}
print TRACE "RETURN count=$::count\n";
return($::count, @out);
}
sub edit_conflict {
@@ -305,41 +305,41 @@ print TRACE "MVM: -$varname-$oursval-$theirval-\n";
package PREFIX;
# Resolve the conflict of a single var's 2 values. Return undef to leave the conflict.
sub Date {
my($PREFIX, $varname, $mine, $theirs) = @_;
my $m = ($mine =~ m/(\d+)/)[0];
my $t = ($theirs =~ m/(\d+)/)[0];
return undef unless ($m>0) && ($t>0);
my($PREFIX, $varname, $mine, $theirs) = @_;
my $m = ($mine =~ m/(\d+)/)[0];
my $t = ($theirs =~ m/(\d+)/)[0];
return undef unless ($m>0) && ($t>0);
return "\$$PREFIX-$varname: " . (($m>$t)?$mine:$theirs) .' $';
return "\$$PREFIX-$varname: " . (($m>$t)?$mine:$theirs) .' $';
}
#sub Header {
#sub Author {
sub Branch {
my($PREFIX, $varname, $mine, $theirs) = @_;
$mine =~ s/^\s+//; $mine =~ s/\s+$//;
$theirs =~ s/^\s+//; $theirs =~ s/\s+$//;
return "\$$PREFIX-$varname: $mine \$" if(length $mine);
return "\$$PREFIX-$varname: $theirs \$" if(length $theirs);
return "\$$PREFIX-$varname\$" if(length $theirs);
my($PREFIX, $varname, $mine, $theirs) = @_;
$mine =~ s/^\s+//; $mine =~ s/\s+$//;
$theirs =~ s/^\s+//; $theirs =~ s/\s+$//;
return "\$$PREFIX-$varname: $mine \$" if(length $mine);
return "\$$PREFIX-$varname: $theirs \$" if(length $theirs);
return "\$$PREFIX-$varname\$" if(length $theirs);
}
sub Revision {
my($PREFIX, $varname, $mine, $theirs) = @_;
my($m) = ($mine =~ m/1.(\d+)/);
my($t) = ($theirs =~ m/1.(\d+)/);
if($m > 0 && $t > 0){
my $q = ($m > $t) ? $m : $t;
return "\$$PREFIX-$varname: 1.$q \$";
}
if($m > 0){
return "\$$PREFIX-$varname: 1.$m \$";
}
if($t > 0){
return "\$$PREFIX-$varname: 1.$t \$";
}
return "\$$PREFIX-$varname\$";
my($PREFIX, $varname, $mine, $theirs) = @_;
my($m) = ($mine =~ m/1.(\d+)/);
my($t) = ($theirs =~ m/1.(\d+)/);
if($m > 0 && $t > 0){
my $q = ($m > $t) ? $m : $t;
return "\$$PREFIX-$varname: 1.$q \$";
}
if($m > 0){
return "\$$PREFIX-$varname: 1.$m \$";
}
if($t > 0){
return "\$$PREFIX-$varname: 1.$t \$";
}
return "\$$PREFIX-$varname\$";
}
__END__
@@ -396,3 +396,17 @@ TEST 8:
===
/* NetHack 3.7 objnam.c $TEST-Date: 1426977394 2015/03/21 22:36:34 $ $TEST-Branch: master $:$TEST-Revision: 1.108 $ */
>>> d3
=for nhgitset NHsubst NetHack merge driver
=head1 NAME
C<NHsubst> - NetHack merge driver
=head1 SYNOPSIS
(called from C<git>, do not invoke directly)
=head1 DESCRIPTION
This is invoked by git through .git/config.
+5 -3
View File
@@ -3,6 +3,8 @@
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
# NetHack may be freely redistributed. See license for details.
# Not in use as of v3, but could come back in the future.
# clean/smudge filter for handling substitutions
use strict;
@@ -54,9 +56,9 @@ if($ARGV[0] eq "--clean"){
exit 1;
}
# XXX for now, there isn't any - if we get called, we subst. No options for now.
# XX for now, there isn't any - if we get called, we subst. No options for now.
# get relevant config info
#XXX
#XX
#git check-attr -a $ARGV[1]
# Process stdin to stdout.
@@ -109,7 +111,7 @@ sub Date {
my($val, $mode, $submode) = @_;
if($mode eq "c"){
if($submode==0){
# we add this to make merge easier for now XXX
# we add this to make merge easier for now XX
my $now = time; # not %s below - may not be portable
# YYYY/MM/DD HH:MM:SS
$val = "$now " . strftime("%Y/%m/%d %H:%M:%S", gmtime($now));
+79
View File
@@ -0,0 +1,79 @@
#!/usr/bin/perl
# $NHDT-Date: 1730238507 2024/10/29 21:48:27 $ $NHDT-Brev: keni-gitset:1.0 $
# Copyright (c) 2024 by Kenneth Lorber, Kensington, Maryland
# NetHack may be freely redistributed. See license for details.
# This deals with a git problem: there is no way to do:
# git help alias-name
# (yes, that will show the definition of the alias, but not show an actual
# help document).
#
# So we implement this:
# nhhelp
# With no arguments, run perldoc on this file.
# nhhelp FOO
# Run perldoc on .git/hooks/FOO (if it exists).
if($#ARGV == -1){
system("perldoc $0")==0 or die "perldoc error: $!\n";
exit 0;
}
if($#ARGV == 0){
if($ARGV[0] eq "-a"){
&listhelp;
exit 0;
}
chomp(my $target = `git config nethack.aliashelp.$ARGV[0]`);
my $file = ".git/hooks/$target";
if(-f $file){
system("perldoc $file")==0 or die "perldoc error: $!\n";
} else {
print "Unknown name '$ARGV[0]'\n";
&usage;
}
exit 0;
}
&usage;
exit 0;
sub usage {
print <<E_O_M;
usage: git nhhelp [<nhcmd>|-a]
E_O_M
}
sub listhelp {
print "nhhelp is available for:\n";
my @namelist = `git config --name-only --get-regexp 'nethack.aliashelp.*'`;
print "NAMELIST $?\n" if($?);
@namelist = map {
if(m/^nethack.aliashelp.(.*)/){
chomp(my $x = `git config 'nethack.aliasdesc.$1'`);
sprintf("%-12s %s",$1,$x);
}
} sort @namelist;
print " " . join("\n ", @namelist)."\n";
exit 0;
}
__END__
=for nhgitset nhhelp Help on NetHack git commands
=head1 NAME
C<nhhelp> - NetHack git command for help on NetHack git commands
=head1 SYNOPSIS
C<git nhhelp [nhcmd|-a]>
=head1 DESCRIPTION
With no arguments, print this message.
With one argument matching a NetHack git command, print the
documentation for that command.
With the argument C<-a>, show all available nhhelp topics with one line
summaries.
+575 -304
View File
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/perl
# $NHDT-Date: 1524689631 2018/04/25 20:53:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.1 $
# NetHack 3.7 post-applypatch $NHDT-Date: 1524689631 2018/04/25 20:53:51 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
# NetHack may be freely redistributed. See license for details.
@@ -24,7 +24,11 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
+7 -2
View File
@@ -24,10 +24,15 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
&NHgithook::nhversioning;
eval { &NHgithook::nhversioning unless($nogithook) };
warn "nhversioning failed: $@" if($@);
&NHgithook::POST;
exit 0;
+9 -2
View File
@@ -24,10 +24,17 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
&NHgithook::nhversioning;
eval { &NHgithook::nhversioning unless($nogithook) };
warn "nhversioning failed: $@" if($@);
&NHgithook::POST;
exit 0;
+7 -2
View File
@@ -25,10 +25,15 @@ BEGIN {
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
&NHgithook::nhversioning;
eval { &NHgithook::nhversioning(1) unless($nogithook) };
warn "nhversioning failed: $@" if($@);
&NHgithook::POST;
exit 0;
+5 -1
View File
@@ -24,7 +24,11 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::saveSTDIN;
+5 -1
View File
@@ -24,7 +24,11 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
+5 -1
View File
@@ -24,7 +24,11 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
+5 -1
View File
@@ -24,7 +24,11 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
+5 -1
View File
@@ -24,7 +24,11 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::saveSTDIN;
+5 -1
View File
@@ -24,7 +24,11 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
+6 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/perl
# $NHDT-Date: 1524689633 2018/04/25 20:53:53 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.1 $
# NetHack 3.7 prepare-commit-msg $NHDT-Date: 1524689633 2018/04/25 20:53:53 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
# NetHack may be freely redistributed. See license for details.
@@ -24,7 +24,11 @@ BEGIN {
chomp $gitdir;
push(@INC, $gitdir.$PDS."hooks");
}
use NHgithook;
eval {use NHgithook;};
if($@){
warn "loading NHgithook failed: $@";
$nogithook = 1;
}
#STARTUP-END
&NHgithook::PRE;
+308 -179
View File
@@ -3,32 +3,29 @@
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
# NetHack may be freely redistributed. See license for details.
# value of nethack.setupversion we will end up with when this is done
# version 1 is reserved for repos checked out before versioning was added
my $version_new = 3;
my $version_old = 0; # current version, if any (0 is no entry ergo new repo)
use Cwd;
use Getopt::Std;
# Activestate Perl doesn't include File::Spec. Grr.
BEGIN {
eval "require File::Spec::Functions";
if($@){
die <<E_O_M;
eval "require File::Spec::Functions";
if($@){
die <<E_O_M;
File::Spec not found. (If you are running ActiveState Perl please run:
cpan File::Spec
and re-run this program.
cpan File::Spec
then re-run this program.
E_O_M
}
File::Spec::Functions->import;
}
File::Spec::Functions->import;
}
exit 1 unless(getopts('nvf')); # TODO: this can probably have better output
# OS hackery
my $DS = quotemeta('/'); # Directory Separator (for regex)
my $DSP = '/'; # ... for printing
BEGIN {
# OS hackery
$DS = quotemeta('/'); # Directory Separator (for regex)
$PDS = '/'; # ... for printing
# Temporarily disabled; there's something weird about msys
# msys: POSIXish over a Windows filesystem (so / not \ but \r\n not \n).
#if($^O eq "msys"){
@@ -37,78 +34,130 @@ my $DSP = '/'; # ... for printing
# # NB: We don't need to do anything about File::Spec. It doesn't know
# # about msys but it defaults to Unix, so we'll be ok.
#}
if($^O eq "MSWin32"){
if($^O eq "MSWin32"){
$DS = quotemeta('\\');
$DSP = '\\';
$PDS = '\\';
}
# Fix @INC so we can 'use NHgithook' before it's installed.
# Set $is_sourcerepo while we're at it - same logic.
{
# Special case for running nhgitset against a different repo.
# Must precede the normal case!
# NB: we use $DEVhooksdir later in the program
$DEVhooksdir = ($0 =~ m!^(.*)$DS!)[0];
chomp($DEVhooksdir);
$DEVhooksdir .= $PDS."hooksdir";
push(@INC, $DEVhooksdir) if(-d $DEVhooksdir);
# This one is for the normal case (in NHsource)
my $topdir = `git rev-parse --show-toplevel`;
chomp $topdir;
$topdir .= "${PDS}DEVEL${PDS}hooksdir";
push(@INC, $topdir) if(-d $topdir);
$is_sourcerepo = 0;
$is_sourcerepo = 1 if(-d $topdir);
}
}
use NHgithook;
# current (installed) version, if any (0 is no entry ergo new repo)
my $version_old = NHgithook::version_in_git;
# version this program will install
my($version_new,$message_new) = NHgithook::version_in_devel;
if(0==$version_new and !opt_f){
# Edge case: this repo has been set up using version >= 4, but now we're running
# nhgitset after checking out DEVEL supporting version <4.
# Use -f to recover from broken DEVEL code.
print STDERR "DEVEL has version <4 code but version >=4 code already installed. Stopping.\n";
print STDERR "(If you need to reinstall the old code, rerun with -f\n";
exit 0;
}
die "Valid version not found in DEVEL/VERSION" unless(0==$version_new or $version_new >= 4);
# make sure we're at the top level of a repo
if(! -d ".git"){
die "This is not the top level of a git repository.\n";
die "This is not the top level of a git repository.\n";
}
my $vtemp = `git config --local --get nethack.setupversion`;
chomp($vtemp);
if($vtemp > 0){
$version_old = 0+$vtemp;
if($version_old != $version_new){
print STDERR "Migrating from setup version $version_old to $version_new\n" if($opt_v);
}
if($version_old >= $version_new and !opt_f){
print STDERR "Nothing to do.\n";
exit 0;
}
# legacy check:
if(length $vtemp == 0){
if(`git config --get merge.NHsubst.name` =~ m/^Net/){
$version_old = 1;
print STDERR "Migrating to setup version 1\n" if($opt_v);
if($version_old > 0){
if($version_old != $version_new){
print STDERR "Migrating from setup version $version_old to $version_new\n";
if(length $message_new){
print STDERR "Additional information:\n$message_new\n";
}
}
}
# legacy check:
if(length $version_old == 0){
if(`git config --get merge.NHsubst.name` =~ m/^Net/){
$version_old = 1;
print STDERR "Migrating to setup version 1\n" if($opt_v);
}
}
my $gitadddir = `git config --get nethack.gitadddir`;
chomp($gitadddir);
if(length $gitadddir){
if(! -d $gitadddir){
die "nethack.gitadddir has invalid value '$gitadddir'\n";
}
if(! -d $gitadddir){
die "nethack.gitadddir has invalid value '$gitadddir'\n";
}
}
print STDERR "nethack.gitadddir=$gitadddir\n" if($opt_v);
# This is (relatively) safe because we know we're at R in R/DEVEL/nhgitset.pl
my $srcdir = ($0 =~ m!^(.*)$DS!)[0];
#XXX do I really want a full path for srcdir? how badly?
if(! -f catfile($srcdir, 'nhgitset.pl')){
die "I can't find myself in '$srcdir'\n";
die "I can't find myself in '$srcdir'\n";
}
print STDERR "Copying from: $srcdir\n" if($opt_v);
if($opt_f || $version_old==0){
print STDERR "Configuring line endings\n" if($opt_v);
unlink catfile('.git','index') unless($opt_n);
system("git reset") unless($opt_n);
system("git config --local core.safecrlf true") unless($opt_n);
system("git config --local core.autocrlf false") unless($opt_n);
print STDERR "Configuring line endings\n" if($opt_v);
system("git reset") unless($opt_n);
&add_config('core.safecrlf', 'true') unless($opt_n);
&add_config('core.autocrlf', 'false') unless($opt_n);
} elsif($version_old <2){
my $xx = `git config --get --local core.safecrlf`;
if($xx !~ m/true/){
print STDERR "\nNeed to 'rm .git${DSP}index;git reset'.\n";
print STDERR " When ready to proceed, re-run with -f flag.\n";
exit 2;
}
my $xx = `git config --get --local core.safecrlf`;
if($xx !~ m/true/){
print STDERR "\nNeed to 'rm .git${PDS}index;git reset'.\n";
print STDERR " When ready to proceed, re-run with -f flag.\n";
exit 2;
}
}
print STDERR "Installing aliases\n" if($opt_v);
$addpath = catfile(curdir(),'.git','hooks','NHadd');
&add_alias('nhadd', "!$addpath add");
&add_help('nhadd', 'NHadd');
&add_alias('nhcommit', "!$addpath commit");
&add_help('nhcommit', 'NHadd');
my $nhsub = catfile(curdir(),'.git','hooks','nhsub');
&add_alias('nhsub', "!$nhsub");
&add_help('nhsub', 'nhsub');
&add_alias('nhhelp', '!'.catfile(curdir(),'.git','hooks','nhhelp'));
&add_help('nhhelp', 'nhhelp');
&add_help('NHsubst', 'NHsubst');
&add_help('NHgithook', 'NHgithook.pm');
&add_help('nhgitset', 'gitsetdocs', '../../DEVEL/nhgitset.pl');
print STDERR "Installing filter/merge\n" if($opt_v);
# XXXX need it in NHadd to find nhsub???
# removed at version 3
#print STDERR "Installing filter/merge\n" if($opt_v);
#if($^O eq "MSWin32"){
# $cmd = '.git\\\\hooks\\\\NHtext';
#} else {
@@ -117,179 +166,211 @@ print STDERR "Installing filter/merge\n" if($opt_v);
#&add_config('filter.NHtext.clean', "$cmd --clean %f");
#&add_config('filter.NHtext.smudge', "$cmd --smudge %f");
if($version_old == 1 or $version_old == 2){
print STDERR "Removing filter.NHtext\n" if($opt_v);
system('git','config','--unset','filter.NHtext.clean') unless($opt_n);
system('git','config','--unset','filter.NHtext.smudge') unless($opt_n);
system('git','config','--remove-section','filter.NHtext') unless($opt_n);
print STDERR "Removing filter.NHtext\n" if($opt_v);
system('git','config','--unset','filter.NHtext.clean') unless($opt_n);
system('git','config','--unset','filter.NHtext.smudge') unless($opt_n);
system('git','config','--remove-section','filter.NHtext') unless($opt_n);
print STDERR "Removing NHtext\n" if($opt_v);
unlink catfile(curdir(),'.git','hooks','NHtext') unless($opt_n);
print STDERR "Removing NHtext\n" if($opt_v);
unlink catfile(curdir(),'.git','hooks','NHtext') unless($opt_n);
}
&add_config('nethack.setuppath',$srcdir);
&add_config('nethack.is-sourcerepo',0+$is_sourcerepo);
$cmd = catfile(curdir(),'.git','hooks','NHsubst');
&add_config('merge.NHsubst.name', 'NetHack Keyword Substitution');
&add_config('merge.NHsubst.driver', "$cmd %O %A %B %L");
print STDERR "Running directories\n" if($opt_v);
foreach my $dir ( glob("$srcdir$DS*") ){
next unless(-d $dir);
# copy directories into .git (right now that's just hooks and nhgitset.pl)
my @gitadd = length($gitadddir)?glob("$gitadddir$DS*"):undef;
foreach my $dir ( (glob("$srcdir$DS*"), @gitadd) ){
next unless(-d $dir);
my $target = catfile($dir, 'TARGET');
next unless(-f $target);
my $target = catfile($dir, 'TARGET');
next unless(-f $target);
open TARGET, '<', $target or die "$target: $!";
my $targetpath = <TARGET>;
# still have to eat all these line endings under msys, so instead of chomp use this:
$targetpath =~ s![\r\n]!!g;
close TARGET;
print STDERR "Directory $dir -> $targetpath\n" if($opt_v);
open TARGET, '<', $target or die "$target: $!";
my $targetpath = <TARGET>;
# still have to eat all these line endings under msys, so instead of chomp use this:
$targetpath =~ s![\r\n]!!g;
close TARGET;
print STDERR "Directory $dir -> $targetpath\n" if($opt_v);
my $enddir = $dir;
$enddir =~ s!.*$DS!!;
if(! &process_override($enddir, "INSTEAD")){
&process_override($enddir, "PRE");
my $fnname = "do_dir_$enddir";
if(defined &$fnname){
&$fnname($dir, $targetpath);
}
&process_override($enddir, "POST");
my $enddir = $dir;
$enddir =~ s!.*$DS!!;
if(! &process_override($enddir, "INSTEAD")){
&process_override($enddir, "PRE");
my $fnname = "do_dir_$enddir";
if(defined &$fnname){
&$fnname($dir, $targetpath);
}
&process_override($enddir, "POST");
}
}
&do_file_nhgitset();
&check_prefix; # for variable substitution
&check_gitvars; # for variable substitution
if($version_old != $version_new){
print STDERR "Setting version to $version_new\n" if($opt_v);
if(! $opt_n){
system("git config nethack.setupversion $version_new");
if($?){
die "Can't set nethack.setupversion $version_new: $?,$!\n";
}
}
if($version_old != $version_new or $opt_f){
print STDERR "Setting version to $version_new\n" if($opt_v);
NHgithook::version_set_git($version_new) if(! $opt_n);
}
exit 0;
sub process_override {
my($srcdir, $plname) = @_;
return 0 unless(length $gitadddir);
# @files: [0] is the name under .git/hooks; others are places to
# check during configuration
sub add_help {
my($cmd, @files) = @_;
my $plpath = catfile($gitadddir, $srcdir, $plname);
#print STDERR " ",catfile($srcdir, $plname),"\n"; # save this for updating docs - list of overrides
return 0 unless(-x $plpath);
print STDERR "Running $plpath\n" if($opt_v);
# current directory is top of target repo
unless($opt_n){
system("$plpath $opt_v") and die "Callout $plpath failed: $?\n";
&add_config("nethack.aliashelp.$cmd", $files[0]);
# pull out =for nhgitset CMD description...
my $desc;
foreach my $file (@files){
open my $fh, "<", "$DEVhooksdir/$file";
if($fh){
while(<$fh>){
m/^=for\s+nhgitset\s+\Q$cmd\E\s+(.*)/ && do {
$desc = $1;
goto found;
}
}
close $fh;
} else {
warn "Can't open: '$DEVhooksdir/$file' ($!)\n";
}
return 1;
}
found:
if($desc){
&add_config("nethack.aliasdesc.$cmd", $desc);
} else {
&add_config("nethack.aliasdesc.$cmd", "(no description available)");
}
}
sub process_override {
my($srcdir, $plname) = @_;
return 0 unless(length $gitadddir);
my $plpath = catfile($gitadddir, $srcdir, $plname);
return 0 unless(-x $plpath);
print STDERR "RunningOverride $plpath\n" if($opt_v);
# current directory is top of target repo
unless($opt_n){
system("$plpath $opt_v") and die "Callout $plpath failed: $?\n";
}
return 1;
}
sub add_alias {
my($name, $def) = @_;
&add_config("alias.$name",$def);
my($name, $def) = @_;
&add_config("alias.$name",$def);
}
sub add_config {
my($name, $val) = @_;
system('git', 'config', '--local', $name, $val) unless($opt_n);
my($name, $val) = @_;
system('git', 'config', '--local', $name, $val) unless($opt_n);
}
sub check_gitvars {
&check_prefix("substprefix");
&check_prefix("projectname");
}
sub check_prefix {
my $lcl = `git config --local --get nethack.substprefix`;
chomp($lcl);
if(0==length $lcl){
my $other = `git config --get nethack.substprefix`;
chomp($other);
if(0==length $other){
print STDERR "ERROR: nethack.substprefix is not set anywhere. Set it and re-run.\n";
exit 2;
} else {
&add_config('nethack.substprefix', $other);
print STDERR "Copying prefix '$other' to local repository.\n" if($opt_v);
}
$lcl = $other; # for display below
my $which = $_[0];
my $lcl = `git config --local --get nethack.$which`;
chomp($lcl);
if(0==length $lcl){
my $other = `git config --get nethack.$which`;
chomp($other);
if(0==length $other){
print STDERR "ERROR: nethack.$which is not set anywhere. Set it and re-run.\n";
exit 2;
} else {
&add_config('nethack.$which', $other);
print STDERR "Copying prefix '$other' to local repository.\n" if($opt_v);
}
print "\n\nUsing prefix '$lcl' - PLEASE MAKE SURE THIS IS CORRECT\n\n";
$lcl = $other; # for display below
}
print "Using $which '$lcl' - PLEASE MAKE SURE THIS IS CORRECT\n";
}
sub do_dir_DOTGIT {
if(1){
# We are NOT going to mess with config now.
return;
} else {
my($srcdir, $targetdir) = @_;
#warn "do_dir_DOTGIT($srcdir, $targetdir)\n";
my $cname = "$srcdir/config";
if(-e $cname){
print STDERR "Appending to .git/config\n" if($opt_v);
open CONFIG, ">>.git/config" or die "open .git/config: $!";
open IN, "<", $cname or die "open $cname: $!";
my @data = <IN>;
print CONFIG @data;
close IN;
close CONFIG;
} else {
print STDERR " Nothing to add to .git/config\n" if($opt_v);
}
# XXX are there other files in .git that we might want to handle?
# So just in case:
for my $file ( glob("$srcdir/*") ){
next if( $file =~ m!.*/TARGET$! );
next if( $file =~ m!.*/config$! );
die "ERROR: no handler for $file\n";
}
}
my($srcdir, $targetdir) = @_;
# not currently in use so just bail
return;
# are there other files in .git that we might want to handle?
# So just in case:
for my $file ( glob("$srcdir/*") ){
next if( $file =~ m!.*/TARGET$! );
next if( $file =~ m!.*/config$! );
die "ERROR: no handler for $file\n";
}
}
sub do_dir_hooksdir {
my($srcdir, $targetdir) = @_;
my($srcdir, $targetdir) = @_;
unless (-d $targetdir){
unless (-d $targetdir){
# Older versions of git, when cloning a repo and
# the expected source templates directory does not
# exist, does not create .git/hooks. So do it here.
mkdir $targetdir;
print STDERR "WARNING: .git/hooks had to be created.\n";
print STDERR " You may want to update git.\n";
mkdir $targetdir;
print STDERR "WARNING: .git/hooks had to be created.\n";
print STDERR " You may want to update git.\n";
}
for my $path ( glob("$srcdir$DS*") ){
next if( $path =~ m!.*${DS}TARGET$! );
my $file = $path;
$file =~ s!.*$DS!!;
$file = catfile($targetdir, $file);
next if($opt_n);
open IN, "<", $path or die "Can't open $path: $!";
open OUT, ">", "$file" or die "Can't open $file: $!";
while(<IN>){
print OUT;
}
close OUT;
close IN;
for my $path ( glob("$srcdir$DS*") ){
next if( $path =~ m!.*${DS}TARGET$! );
my $file = $path;
$file =~ s!.*$DS!!;
$file = catfile($targetdir, $file);
next if($opt_n);
open IN, "<", $path or die "Can't open $path: $!";
open OUT, ">", "$file" or die "Can't open $file: $!";
while(<IN>){
print OUT;
}
close OUT;
close IN;
if(! -x $file){
chmod 0755 ,$file;
}
if(! -x $file){
chmod 0755 ,$file;
}
}
}
sub do_file_nhgitset {
my $infile = "DEVEL/nhgitset.pl";
$infile = "$DEVhooksdir/../nhgitset.pl" unless(-f $infile);
my $outfile = ".git/hooks/gitsetdocs";
open IN, "<", $infile or die "Can't open $infile:$!";
open OUT, ">", $outfile or die "Can't open $outfile:$!";
my $started;
print IN "die \"DO NOT RUN THIS FILE\n\"";
while(<IN>){
m/^__END__/ && do {$started =1; next};
print OUT if($started);
}
close OUT;
close IN;
}
#(can we change the .gitattributes syntax to include a comment character?)
#maybe [comment] attr.c:parse_attr_line
#grr - looks like # is the comment character
__END__
(can we change the .gitattributes syntax to include a comment character?)
maybe [comment] attr.c:parse_attr_line
grr - looks like # is the comment character
=head1 NAME
nhgitset.pl - Setup program for NetHack git repositories
@@ -302,17 +383,36 @@ nhgitset.pl - Setup program for NetHack git repositories
=head1 DESCRIPTION
nhgitset.pl installs NetHack-specific setup after a C<git clone> (or after
changes to the desired configuration, which are installed by re-running
nhgitset.pl).
nhgitset.pl installs NetHack-specific setup after a C<git clone> or after
changes to the setup, which are installed by re-running nhgitset.pl. If
an upgrade is needed, you will be informed during a C<git pull> or similar
operation.
The following options are available:
B<-f> Force. Do not use this unless the program requests it.
=over
B<-n> Make no changes.
=item B<-f>
B<-v> Verbose output.
Force. Do not use this unless the program requests it or the hooks are broken.
=back
=over
=item B<-n>
Dry-run - make no changes.
=back
=over
=item B<-v>
Verbose output.
=back
=head1 CONFIG
@@ -329,8 +429,35 @@ nethack.gitadddir
nethack.setupversion
The version for nhgitset.pl and friends; has no relationship
to NetHack version numbers.
nethack.substprefix
The prefix this repo uses for variable substitution.
nethack.projectname
The name of the game being built - see C<Project()>.
nethack.is-sourcerepo
Does this repo contain NetHack source code? (1 = yes, 0 = no)
nethack.setuppath
Path to (and including) the DEVEL directory used including the
copy of nhgitset.pl used to set up this repo.
nethack.aliashelp.*
The last element of the variable is the name used with C<git nhhelp>
and the value is the name of a file to display with C<perldoc>.
nethack.aliasdesc.*
The last element of the variable is the name used with C<git nhhelp>
and the value is short help displayed with C<git nhhelp -a>.
=head1 EXIT STATUS
@@ -339,3 +466,5 @@ nethack.substprefix
1 Fail.
2 Intervention required.
=for nhgitset nhgitset NetHack git helper installer
+127 -96
View File
@@ -12,8 +12,8 @@ Porting README azure-pipelines.yml
DEVEL:
(files for people developing changes to NetHack)
Developer.txt code_features.txt code_style.txt git_recipes.txt
gitinfo.pl nhgitset.pl
Developer.txt VERSION code_features.txt code_style.txt
git_recipes.txt gitinfo.pl nhgitset.pl
DEVEL/DOTGIT:
(file for people developing changes to NetHack)
@@ -23,11 +23,11 @@ DEVEL/hooksdir:
(files for people developing changes to NetHack)
NHadd NHgithook.pm NHsubst
NHtext TARGET applypatch-msg
commit-msg nhsub post-applypatch
post-checkout post-commit post-merge
post-rewrite pre-applypatch pre-auto-gc
pre-commit pre-push pre-rebase
prepare-commit-msg
commit-msg nhhelp nhsub
post-applypatch post-checkout post-commit
post-merge post-rewrite pre-applypatch
pre-auto-gc pre-commit pre-push
pre-rebase prepare-commit-msg
dat:
(files for all versions)
@@ -47,20 +47,21 @@ Val-strt.lua Wiz-fila.lua Wiz-filb.lua Wiz-goal.lua Wiz-loca.lua
Wiz-strt.lua air.lua asmodeus.lua astral.lua baalz.lua
bigrm-1.lua bigrm-2.lua bigrm-3.lua bigrm-4.lua bigrm-5.lua
bigrm-6.lua bigrm-7.lua bigrm-8.lua bigrm-9.lua bigrm-10.lua
bigrm-11.lua bogusmon.txt castle.lua cmdhelp data.base
dungeon.lua earth.lua engrave.txt epitaph.txt fakewiz1.lua
fakewiz2.lua fire.lua hellfill.lua help hh
history juiblex.lua keyhelp knox.lua license
medusa-1.lua medusa-2.lua medusa-3.lua medusa-4.lua minefill.lua
minend-1.lua minend-2.lua minend-3.lua minetn-1.lua minetn-2.lua
minetn-3.lua minetn-4.lua minetn-5.lua minetn-6.lua minetn-7.lua
nhcore.lua nhlib.lua opthelp optmenu oracle.lua
oracles.txt orcus.lua quest.lua rumors.fal rumors.tru
sanctum.lua soko1-1.lua soko1-2.lua soko2-1.lua soko2-2.lua
soko3-1.lua soko3-2.lua soko4-1.lua soko4-2.lua symbols
themerms.lua tower1.lua tower2.lua tower3.lua tribute
tut-1.lua tut-2.lua usagehlp valley.lua water.lua
wizard1.lua wizard2.lua wizard3.lua wizhelp
bigrm-11.lua bigrm-12.lua bigrm-13.lua bogusmon.txt castle.lua
cmdhelp data.base dungeon.lua earth.lua engrave.txt
epitaph.txt fakewiz1.lua fakewiz2.lua fire.lua hellfill.lua
help hh history juiblex.lua keyhelp
knox.lua license luahelper medusa-1.lua medusa-2.lua
medusa-3.lua medusa-4.lua minefill.lua minend-1.lua minend-2.lua
minend-3.lua minetn-1.lua minetn-2.lua minetn-3.lua minetn-4.lua
minetn-5.lua minetn-6.lua minetn-7.lua nhcore.lua nhlib.lua
opthelp optmenu oracle.lua oracles.txt orcus.lua
quest.lua rumors.fal rumors.tru sanctum.lua soko1-1.lua
soko1-2.lua soko2-1.lua soko2-2.lua soko3-1.lua soko3-2.lua
soko4-1.lua soko4-2.lua symbols themerms.lua tower1.lua
tower2.lua tower3.lua tribute tut-1.lua tut-2.lua
usagehlp valley.lua water.lua wizard1.lua wizard2.lua
wizard3.lua wizhelp
doc:
(files for all versions)
@@ -86,22 +87,23 @@ include:
tile2x11.h winX.h xwindow.h xwindowp.h
(files for all versions)
align.h artifact.h artilist.h attrib.h botl.h
color.h config.h config1.h context.h coord.h
cstd.h decl.h defsym.h dgn_file.h display.h
dlb.h dungeon.h engrave.h extern.h flag.h
fnamesiz.h func_tab.h global.h hack.h hacklib.h
integer.h isaac64.h lint.h mail.h mextra.h
mfndpos.h micro.h mkroom.h monattk.h mondata.h
monflag.h monst.h monsters.h nhmd4.h obj.h
objclass.h objects.h optlist.h patchlevel.h pcconf.h
permonst.h prop.h quest.h rect.h region.h
rm.h seffects.h selvar.h skills.h sndprocs.h
sp_lev.h spell.h stairs.h sym.h sys.h
tcap.h tileset.h timeout.h tradstdc.h trap.h
unixconf.h vision.h vmsconf.h warnings.h winami.h
wincurs.h windconf.h winprocs.h wintype.h you.h
youprop.h
align.h amiconf.h artifact.h artilist.h attrib.h
botl.h color.h config.h config1.h context.h
coord.h cstd.h decl.h defsym.h dgn_file.h
display.h dlb.h dungeon.h engrave.h extern.h
flag.h fnamesiz.h func_tab.h global.h hack.h
hacklib.h integer.h isaac64.h lint.h mail.h
mcastu.h mextra.h mfndpos.h micro.h mkroom.h
monattk.h mondata.h monflag.h monst.h monsters.h
nhmd4.h nhregex.h obj.h objclass.h objects.h
optlist.h patchlevel.h pcconf.h permonst.h prop.h
quest.h rect.h region.h rm.h savefile.h
seffects.h selvar.h sfmacros.h sfprocs.h skills.h
sndprocs.h sp_lev.h spell.h stairs.h sym.h
sys.h tcap.h tileset.h timeout.h tradstdc.h
trap.h unixconf.h vision.h vmsconf.h warnings.h
weight.h winami.h wincurs.h windconf.h winprocs.h
wintype.h you.h youprop.h
(file for tty versions)
wintty.h
@@ -122,8 +124,8 @@ bitmfile.h gem_rsc.h load_img.h wingem.h
winGnome.h
(files for all versions)
amiconf.h beconf.h def_os2.h os2conf.h system.h tosconf.h
trampoli.h wceconf.h
beconf.h def_os2.h os2conf.h system.h tosconf.h trampoli.h
wceconf.h
(files for various Macintosh versions)
mac-carbon.h mac-qt.h mac-term.h macconf.h macpopup.h
@@ -132,12 +134,7 @@ mactty.h macwin.h mttypriv.h
outdated/sys/amiga:
(files for Amiga versions - untested for 3.7)
Build.ami Install.ami Makefile.agc Makefile.ami NetHack.cnf
amidos.c amidos.p amifont.uu amifont8.uu amigst.c
amii.hlp amimenu.c amirip.c amistack.c amitty.c
amiwind.c amiwind.p clipwin.c colorwin.c grave16.xpm
ifchange mkdmake txt2iff.c winamenu.c winami.c
winami.p winchar.c windefs.h winext.h winfuncs.c
winkey.c winproto.h winreq.c winstr.c xpm2iff.c
ifchange mkdmake txt2iff.c xpm2iff.c
outdated/sys/atari:
(files for Atari version - untested for 3.7)
@@ -291,31 +288,43 @@ windsound.c
src:
(files for all versions)
allmain.c alloc.c apply.c artifact.c attrib.c ball.c
bones.c botl.c calendar.c cmd.c coloratt.c date.c
dbridge.c decl.c detect.c dig.c display.c dlb.c
do.c do_name.c do_wear.c dog.c dogmove.c dokick.c
dothrow.c drawing.c dungeon.c eat.c end.c engrave.c
exper.c explode.c extralev.c files.c fountain.c getpos.c
glyphs.c hack.c hacklib.c insight.c invent.c isaac64.c
light.c lock.c mail.c makemon.c mcastu.c mdlib.c
mhitm.c mhitu.c minion.c mklev.c mkmap.c mkmaze.c
mkobj.c mkroom.c mon.c mondata.c monmove.c monst.c
mplayer.c mthrowu.c muse.c music.c nhlobj.c nhlsel.c
nhlua.c nhmd4.c o_init.c objects.c objnam.c options.c
pager.c pickup.c pline.c polyself.c potion.c pray.c
priest.c quest.c questpgr.c read.c rect.c region.c
report.c restore.c rip.c rnd.c role.c rumors.c
save.c selvar.c sfstruct.c shk.c shknam.c sit.c
sounds.c sp_lev.c spell.c stairs.c steal.c steed.c
strutil.c symbols.c sys.c teleport.c timeout.c topten.c
track.c trap.c u_init.c uhitm.c utf8map.c vault.c
version.c vision.c weapon.c were.c wield.c windows.c
wizard.c wizcmds.c worm.c worn.c write.c zap.c
bones.c botl.c calendar.c cfgfiles.c cmd.c coloratt.c
date.c dbridge.c decl.c detect.c dig.c display.c
dlb.c do.c do_name.c do_wear.c dog.c dogmove.c
dokick.c dothrow.c drawing.c dungeon.c earlyarg.c eat.c
end.c engrave.c exper.c explode.c extralev.c files.c
fountain.c getpos.c glyphs.c hack.c hacklib.c iactions.c
insight.c invent.c isaac64.c light.c lock.c mail.c
makemon.c mcastu.c mdlib.c mhitm.c mhitu.c minion.c
mklev.c mkmap.c mkmaze.c mkobj.c mkroom.c mon.c
mondata.c monmove.c monst.c mplayer.c mthrowu.c muse.c
music.c nhlobj.c nhlsel.c nhlua.c nhmd4.c o_init.c
objects.c objnam.c options.c pager.c pickup.c pline.c
polyself.c potion.c pray.c priest.c quest.c questpgr.c
read.c rect.c region.c report.c restore.c rip.c
rnd.c role.c rumors.c save.c selvar.c sfbase.c
sfstruct.c shk.c shknam.c sit.c sounds.c sp_lev.c
spell.c stairs.c steal.c steed.c strutil.c symbols.c
sys.c teleport.c timeout.c topten.c track.c trap.c
u_init.c uhitm.c utf8map.c vault.c version.c vision.c
weapon.c were.c wield.c windows.c wizard.c wizcmds.c
worm.c worn.c write.c zap.c
submodules:
(files in top directory)
CHKSUMS lua pdcurses pdcursesmod
sys/amiga:
(files for Amiga versions)
README.amiga amidos.c amidos.p amifont.uu
amifont8.uu amigst.c amii.hlp amimenu.c
amirip.c amistack.c amitty.c amiwind.c
amiwind.p bmp2iff_host.c clipwin.c colorwin.c
grave16.xpm nethack.cnf winamenu.c winami.c
winami.p winchar.c windefs.h winext.h
winfuncs.c winkey.c winproto.h winreq.c
winstr.c xpm2iff_host.c
sys/libnh:
(files in top directory)
README.md libnhmain.c sysconf
@@ -415,6 +424,7 @@ sys/unix/hints/include:
compiler.370 cross-post.370 cross-pre1.370 cross-pre2.370
gbdates-post.370 gbdates-pre.370 misc.370 multisnd-post.370
multisnd1-pre.370 multisnd2-pre.370 multiw-1.370 multiw-2.370
response.370
sys/vms:
(files for VMS version)
@@ -427,18 +437,18 @@ vmsmain.c vmsmisc.c vmssetup.com vmstty.c
vmsunix.c
sys/windows:
(files for Windows 7/8.x/10/11 version)
Install.windows Makefile.mingw32 Makefile.mingw32.depend
Makefile.nmake build-msys2.txt build-nmake.txt
build-vs.txt console.rc consoletty.c
fetch.cmd guitty.c nethack.def
nethackrc.template nhico.uu nhsetup.bat
porthelp sysconf.template win10.c
win10.h win32api.h windmain.c
windsys.c winos.h
(files for Windows 10/11 version)
GNUmakefile GNUmakefile.depend Install.windows
Makefile.nmake build-msys2.txt build-nmake.txt
build-vs.txt console.rc consoletty.c
fetch.cmd fetch.sh guitty.c
nethack.def nethackrc.template nhico.uu
nhsetup.bat porthelp sysconf.template
win10.c win10.h win32api.h
windmain.c windsys.c winos.h
sys/windows/vs:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
NetHack.sln NetHackPackage.appxmanifest
NetHackPackage.wapproj NetHackProperties.props
Package.StoreAssociation.xml ScreenShot.PNG
@@ -447,14 +457,14 @@ config.props console.props
cpp.hint default.props
default_dll.props default_lib.props
dirs.props dll.props
files.props
files.props sfctool.sln
sys/windows/vs/FetchPrereq:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
fetchprereq.nmake fetchprereq.vcxproj
sys/windows/vs/Images:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
BadgeLogo.scale-100.png
BadgeLogo.scale-125.png
BadgeLogo.scale-150.png
@@ -509,65 +519,86 @@ Wide310x150Logo.scale-200.png
Wide310x150Logo.scale-400.png
sys/windows/vs/NetHack:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
NetHack.vcxproj afternethack.proj
sys/windows/vs/NetHackW:
(file for Visual Studio 2019 or 2022 Community Edition builds)
(file for Visual Studio Community builds)
NetHackW.vcxproj
sys/windows/vs/PDCurses:
(file for Visual Studio 2019 or 2022 Community Edition builds)
(file for Visual Studio Community builds)
PDCurses.vcxproj
sys/windows/vs/PDCursesGui:
(file for Visual Studio 2019 or 2022 Community Edition builds)
(file for Visual Studio Community builds)
pdcursesgui.vcxproj
sys/windows/vs/dlb:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
afterdlb.proj dlb.vcxproj
sys/windows/vs/fetchctags:
(files for Visual Studio Community builds)
fetchctags.nmake fetchctags.vcxproj
sys/windows/vs/hacklib:
(file for Visual Studio 2019 or 2022 Community Edition builds)
(file for Visual Studio Community builds)
hacklib.vcxproj
sys/windows/vs/lualib:
(file for Visual Studio Community builds)
lualib.vcxproj
sys/windows/vs/makedefs:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
aftermakedefs.proj makedefs.vcxproj
sys/windows/vs/nhlua_h:
(file for Visual Studio Community builds)
nhlua_h.vcxproj
sys/windows/vs/package:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
package.nmake package.vcxproj
sys/windows/vs/recover:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
afterrecover.proj recover.vcxproj
sys/windows/vs/sfctool:
(file for Visual Studio Community builds)
sfctool.vcxproj
sys/windows/vs/sftags:
(files for Visual Studio Community builds)
aftersftags.proj sftags.vcxproj
sys/windows/vs/tile2bmp:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
aftertile2bmp.proj tile2bmp.vcxproj
sys/windows/vs/tilemap:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
aftertilemap.proj tilemap.vcxproj
sys/windows/vs/tiles:
(file for Visual Studio 2019 or 2022 Community Edition builds)
(file for Visual Studio Community builds)
tiles.vcxproj
sys/windows/vs/uudecode:
(files for Visual Studio 2019 or 2022 Community Edition builds)
(files for Visual Studio Community builds)
afteruudecode.proj uudecode.vcxproj
test:
(files for testing)
test_cnf.lua test_des.lua test_lev.lua test_obj.lua test_sel.lua
test_shk.lua test_src.lua testmove.lua testwish.lua
README.md test_cnf.lua test_des.lua test_lev.lua test_obj.lua
test_sel.lua test_shk.lua test_src.lua testmove.lua testwish.lua
util:
(files for all versions)
dlb_main.c makedefs.c mdgrep.h mdgrep.pl panic.c recover.c
sfctool.c sfexpasc.c sftags.c stripbs.c
win/Qt:
(files for the Qt 4 or 5 widget library - X11, Windows, Mac OS X)
@@ -611,8 +642,8 @@ win/share:
(files for versions using optional tiles)
bmptiles.c gifread.c giftiles.c monsters.txt nhicns.uu
nhsplash.xpm objects.txt other.txt ppmwrite.c renumtiles.pl
safeproc.c thintile.c tile.doc tile.h tile2bmp.c
tilemap.c tileset.c tiletext.c tiletxt.c
thintile.c tile.doc tile.h tile2bmp.c tilemap.c
tileset.c tiletext.c tiletxt.c
win/shim:
(file in top directory)
@@ -664,7 +695,7 @@ pet_mark.xbm rip.xpm x11tiles
src:
(files for win32 that are moved into src at compile time)
Makefile Makefile.mingw32
GNUmakefile Makefile
(files generated by 'moc' for Qt interface at compile time)
qt_kde0.moc qt_main.moc qt_map.moc qt_menu.moc qt_msg.moc
+1 -1
View File
@@ -201,7 +201,7 @@ need to be included in the packaging of the game.
4.3. Lua
Compile and link into a library, or obtain a prebuilt Lua library for
your platform. Place the Lua source into lib/lua-5.4.6 (or other folder
your platform. Place the Lua source into lib/lua-5.4.8 (or other folder
representing an appropriate Lua version); place the compiled Lua library into
lib.
+7 -6
View File
@@ -57,10 +57,11 @@ considered spoilers:
level once that square's location becomes known (found or magic
mapped); goes away once sanctum temple is found (entered or high altar
mapped)
- savefile: add support to deconstruct internal data structures down into
their individual fields and save those fields instead of the entire
struct
- savefile: use little-endian format for fields where that makes a difference
- savefile: add support for a tool to deconstruct data structures,
that get stored in a savefile, down into their individual fields and
save those individual fields instead of the entire struct. The
intention is to provide a way to export and transport savefiles
between platforms, architectures and data models.
- - - - - - - - - - -
@@ -109,8 +110,8 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code.
Intel Pentium or better running Linux, BSDI
Intel Pentium or better running Windows 10 or 11
Intel-based, or Apple M1, M2, M3 Macs running
macOS 10.11 (El Capitan) to macOS 14 (Sonoma)
Intel-based, or Apple M1, M2, M3, M4, M5 Macs running
macOS 10.11 (El Capitan) to macOS 26 (Tahoe)
(follow the instructions in sys/unix/NewInstall.unx)
Intel 80386 or greater running MS-DOS with DPMI
built via djgpp compiler (native or Linux-hosted cross-compiler)
+44 -44
View File
@@ -1,43 +1,48 @@
strategy:
matrix:
linux_latest_gcc9_minimal:
linux_latest_gcc14_minimal:
imageName: 'ubuntu-latest'
toolchainName: gcc9
toolchainName: gcc14
buildTargetName: minimal
linux_jammy_clang_all:
imageName: 'ubuntu-22.04'
linux_noble_clang_all:
imageName: 'ubuntu-24.04'
toolchainName: clang
buildTargetName: all
linux_jammy_gcc9_all:
imageName: 'ubuntu-22.04'
toolchainName: gcc9
buildTargetName: all
linux_jammy_gcc12_all:
imageName: 'ubuntu-22.04'
toolchainName: gcc12
linux_noble_gcc13_all:
imageName: 'ubuntu-24.04'
toolchainName: gcc13
buildTargetName: all
macOS_latest_clang_all:
imageName: 'macOS-latest'
toolchainName: clang
buildTargetName: all
macOS_Ventura_clang13_all:
imageName: 'macOS-13'
macOS_Sequoia_clang15_all:
imageName: 'macOS-15'
toolchainName: clang
buildTargetName: all
windows-visualstudio:
windows-x64-vstudio:
imageName: 'windows-latest'
toolchainName: vs
buildTargetName: all
windows-arm64-vstudio:
imageName: 'windows-latest'
toolchainName: vs
buildTargetName: all
buildPlatform: 'ARM64' # Targeting Snapdragon
windows-mingw:
imageName: 'windows-2019'
imageName: 'windows-2025'
toolchainName: mingw
buildTargetName: all
linux_focal_cross_msdos:
imageName: 'ubuntu-20.04'
linux_latest_cross_msdos:
imageName: 'ubuntu-latest'
toolchainName: cross
buildTargetName: msdos
linux_jammy_docs:
imageName: 'ubuntu-22.04'
linux_noble_docs:
imageName: 'ubuntu-24.04'
toolchainName: docs
buildTargetName: all
continueOnError: true
@@ -60,30 +65,20 @@ variables:
steps:
- bash: |
if [ "$(toolchain)" == "gcc7" ]
then
echo "##vso[task.setvariable variable=CC]gcc-7"
echo "##vso[task.setvariable variable=CXX]g++-7"
fi
if [ "$(toolchain)" == "gcc9" ]
then
echo "##vso[task.setvariable variable=CC]gcc-9"
echo "##vso[task.setvariable variable=CXX]g++-9"
fi
if [ "$(toolchain)" == "gcc10" ]
if [ "$(toolchain)" == "gcc13" ]
then
echo "##vso[task.setvariable variable=CC]gcc-10"
echo "##vso[task.setvariable variable=CXX]g++-10"
echo "##vso[task.setvariable variable=CC]gcc-13"
echo "##vso[task.setvariable variable=CXX]g++-13"
fi
if [ "$(toolchain)" == "gcc11" ]
if [ "$(toolchain)" == "gcc14" ]
then
echo "##vso[task.setvariable variable=CC]gcc-11"
echo "##vso[task.setvariable variable=CXX]g++-11"
fi
if [ "$(toolchain)" == "gcc12" ]
then
echo "##vso[task.setvariable variable=CC]gcc-12"
echo "##vso[task.setvariable variable=CXX]g++-12"
echo "##vso[task.setvariable variable=CC]gcc-14"
echo "##vso[task.setvariable variable=CXX]g++-14"
fi
if [ "$(toolchain)" == "clang" ]
then
@@ -92,8 +87,8 @@ steps:
fi
if [ "$(toolchain)" == "cross" ]
then
echo "##vso[task.setvariable variable=CC]gcc-9"
echo "##vso[task.setvariable variable=CXX]g++-9"
echo "##vso[task.setvariable variable=CC]gcc-13"
echo "##vso[task.setvariable variable=CXX]g++-13"
fi
displayName: 'Setting variables'
@@ -124,7 +119,7 @@ steps:
condition: eq( variables.toolchain, 'vs' )
displayName: 'Copying store key'
- task: MSBuild@1
- task: VSBuild@1
inputs:
solution: $(Agent.BuildDirectory)/$(netHackPath)/sys/windows/vs/NetHack.sln
platform: Win32
@@ -139,16 +134,18 @@ steps:
export LUASRC=../submodules/lua
export ADD_CURSES=Y
export PDCURSES_TOP=../submodules/pdcursesmod
export LUA_VERSION=5.4.6
export LUA_VERSION=5.4.8
#
# 64-bit
#export CURLSRC=https://github.com/brechtsanders/winlibs_mingw/releases/download/11.2.0-9.0.0-ucrt-r5/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64ucrt-9.0.0-r5.zip
#export CURLSRC=https://github.com/brechtsanders/winlibs_mingw/releases/download/14.2.0posix-19.1.1-12.0.0-ucrt-r2/winlibs-x86_64-posix-seh-gcc-14.2.0-llvm-19.1.1-mingw-w64ucrt-12.0.0-r2.zip
#export CURLSRC=https://github.com/brechtsanders/winlibs_mingw/releases/download/15.1.0posix-12.0.0-ucrt-r1/winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64ucrt-12.0.0-r1.zip
#export CURLDST=mingw-x64.zip
#export MINGWBIN=mingw64
#export MSYSTEM=MINGW64
#
# 32-bit
export CURLSRC=https://github.com/brechtsanders/winlibs_mingw/releases/download/11.2.0-9.0.0-ucrt-r5/winlibs-i686-posix-dwarf-gcc-11.2.0-mingw-w64ucrt-9.0.0-r5.zip
#export CURLSRC=https://github.com/brechtsanders/winlibs_mingw/releases/download/14.2.0posix-19.1.1-12.0.0-ucrt-r2/winlibs-i686-posix-dwarf-gcc-14.2.0-llvm-19.1.1-mingw-w64ucrt-12.0.0-r2.zip
export CURLSRC=https://github.com/brechtsanders/winlibs_mingw/releases/download/15.1.0posix-12.0.0-ucrt-r1/winlibs-i686-posix-dwarf-gcc-15.1.0-mingw-w64ucrt-12.0.0-r1.zip
export CURLDST=mingw-x86.zip
export MINGWBIN=mingw32
export MSYSTEM=MINGW32
@@ -164,10 +161,10 @@ steps:
export
cd ../src
pwd
cp ../sys/windows/Makefile.mingw32* .
mingw32-make -f Makefile.mingw32 CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION clean
mingw32-make -f Makefile.mingw32 CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION depend
mingw32-make -f Makefile.mingw32 CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION
cp ../sys/windows/GNUmakefile* .
mingw32-make -f GNUmakefile CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION clean
mingw32-make -f GNUmakefile CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION depend
mingw32-make -f GNUmakefile CI_COMPILER=1 GIT=1 MSYSTEM=$MSYSTEM LUA_VERSION=$LUA_VERSION
condition: eq( variables.toolchain, 'mingw' )
workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)/src
displayName: 'MinGW Build'
@@ -222,6 +219,7 @@ steps:
workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
- bash: |
brew install groff
cd sys/unix
sh setup.sh hints/macos.370
cd ../..
@@ -232,21 +230,23 @@ steps:
displayName: 'Building mac full build'
- bash: |
sudo apt -qq -y install libfl2
export GCCVER=gcc1220
export IN_CI=SKIP_FONTS_IN_CI=1
cd sys/unix
sh setup.sh hints/linux.370
cd ../..
make fetch-lua
sh sys/msdos/fetch-cross-compiler.sh
sys/msdos/fetch-cross-compiler.sh
retVal=$?
if [ $retVal -eq 0 ]; then
make LUA_VERSION=5.4.6 WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 package
make LUA_VERSION=5.4.8 WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 $IN_CI package
fi
condition: and(eq( variables['Agent.OS'], 'Linux' ), eq( variables.toolchain, 'cross'))
workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
displayName: 'Building MSDOS build'
- bash: |
sudo apt-get install texlive
sudo apt install texlive texlive-latex-extra
make Guidebook
make Guidebook.txt
make Guidebook.pdf
+2 -2
View File
@@ -157,10 +157,10 @@ des.monster({ id = "leprechaun", x=74, y=04, peaceful=0 })
des.monster({ id = "leprechaun", x=25, y=19, peaceful=0 })
des.monster({ id = "water nymph", x=25, y=18, peaceful=0 })
-- Wandering the streets.
for i=1,4 + math.random(1 - 1,1*3) do
for i = 1, math.random(4,7) do
des.monster({ id = "water nymph", coord = streets:rndcoord(1), peaceful=0 })
des.monster({ id = "leprechaun", coord = streets:rndcoord(1), peaceful=0 })
end
for i=1,7 + math.random(1 - 1,1*3) do
for i = 1, math.random(7,10) do
des.monster({ id = "chameleon", coord = streets:rndcoord(1), peaceful=0 })
end
+2 -2
View File
@@ -35,7 +35,7 @@ des.map([[
-- chance to alter above map and turn the wings of the bottom-center into
-- a pair of big (5x15) rooms
for i=1,2 do
for i = 1, 2 do
-- 3.6.[01]: 75% chance that both sides opened up, 25% that neither did;
-- 3.6.2: 60% twice == 36% chance that both sides open up, 24% left side
-- only, 24% right side only, 16% that neither side opens up
@@ -58,7 +58,7 @@ for i=1,2 do
des.terrain(41,18, ".")
end
-- extra monsters; was [6 + 3d4] when both wings were opened up at once
for i=1,3 + math.random(2 - 1,2*3) do
for j = 1, math.random(4,9) do
des.monster({ id="Angel", coord = hall:rndcoord(1), align="noalign", peaceful=0 })
if percent(50) then
des.monster({ coord = hall:rndcoord(1), peaceful=0 })
+10 -2
View File
@@ -28,10 +28,10 @@ des.map([[
]]);
if percent(75) then
if percent(80) then
local terrains = { "-", "F", "L", "T", "C" };
local tidx = math.random(1, #terrains);
local choice = math.random(0, 4);
local choice = math.random(0, 5);
if choice == 0 then
-- one horizontal line
des.terrain(selection.line(10,8, 65,8), terrains[tidx]);
@@ -48,6 +48,14 @@ if percent(75) then
des.terrain(selection.rect(4,4, 70,13), terrains[tidx]);
local sel = selection.line(25,4, 50,4) | selection.line(25,13, 50,13);
des.terrain(sel, '.');
elseif choice == 4 then
-- snake
des.terrain(selection.fillrect(5,5, 69, 12), terrains[tidx]);
for i = 0, 7 do
local x = 6 + i*8;
local y = 5 + (i%2);
des.terrain(selection.fillrect(x, y, x+6, y+6), '.');
end
else
-- nothing
end
+85
View File
@@ -0,0 +1,85 @@
-- NetHack bigroom bigrm-12.lua $NHDT-Date: $ $NHDT-Branch: NetHack-3.7 $
-- Copyright (c) 2024 by Pasi Kallinen
-- NetHack may be freely redistributed. See license for details.
--
-- Two hexagons
des.level_flags("mazelevel", "noflipy");
des.level_init({ style = "solidfill", fg = " " });
des.map([[
....................... .......................
......................... .........................
........................... ...........................
............................. .............................
........PPPPPPPPPPPPPPP........ ........LLLLLLLLLLLLLLL........
........PPPPPPPPPPPPPPPPP........ ........LLLLLLLLLLLLLLLLL........
........PPPWWWWWWWWWWWWWPPP...............LLLZZZZZZZZZZZZZLLL........
........PPPWWWWWWWWWWWWWWWPPP.............LLLZZZZZZZZZZZZZZZLLL........
........PPPWWWWWWWWWWWWWWWWWPPP...........LLLZZZZZZZZZZZZZZZZZLLL........
........PPPWWWWWWWWWWWWWWWPPP.............LLLZZZZZZZZZZZZZZZLLL........
........PPPWWWWWWWWWWWWWPPP...............LLLZZZZZZZZZZZZZLLL........
........PPPPPPPPPPPPPPPPP........ ........LLLLLLLLLLLLLLLLL........
........PPPPPPPPPPPPPPP........ ........LLLLLLLLLLLLLLL........
............................. .............................
........................... ...........................
......................... .........................
....................... .......................
]]);
-- maybe replace lavawalls/waterwalls with stone walls
if percent(20) then
if percent(50) then
des.replace_terrain({ fromterrain = "W", toterrain = "-" });
end
if percent(50) then
des.replace_terrain({ fromterrain = "Z", toterrain = "-" });
end
end
-- maybe replace pools with floor and then possibly walls with pools
if percent(25) then
des.replace_terrain({ fromterrain = "P", toterrain = "." });
if percent(75) then
des.replace_terrain({ fromterrain = "W", toterrain = "P" });
end
end
if percent(25) then
des.replace_terrain({ fromterrain = "L", toterrain = "." });
if percent(75) then
des.replace_terrain({ fromterrain = "Z", toterrain = "L" });
end
end
-- maybe make both sides have the same terrain
if percent(20) then
if percent(50) then
-- both are lava
des.replace_terrain({ fromterrain = "P", toterrain = "L" });
des.replace_terrain({ fromterrain = "W", toterrain = "Z" });
else
-- both are water
des.replace_terrain({ fromterrain = "L", toterrain = "P" });
des.replace_terrain({ fromterrain = "Z", toterrain = "W" });
end
end
des.region(selection.area(00,00,75,19), "lit")
des.non_diggable();
des.wallify();
des.stair("up");
des.stair("down");
for i = 1,15 do
des.object();
end
for i = 1,6 do
des.trap();
end
for i = 1,28 do
des.monster();
end
+82
View File
@@ -0,0 +1,82 @@
-- NetHack bigroom bigrm-13.lua $NHDT-Date: 1652196024 2022/05/10 15:20:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.0 $
-- Copyright (c) 2026 by Pasi Kallinen
-- NetHack may be freely redistributed. See license for details.
--
-- Pillars
des.level_init({ style = "solidfill", fg = " " });
des.level_flags("mazelevel", "noflip");
des.map([[
---------------------------------------------------------------------------
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
|.........................................................................|
---------------------------------------------------------------------------
]]);
local pillar = [[
---
| |
---]];
filters = {
-- 1: all pillars
function(x, y) return true; end,
-- 2: 3 vertical lines
function(x, y) return (x%2 == 1); end,
-- 3: checkerboard
function(x, y) return (((x+y)%2) == 0); end,
-- 4: center row
function(x, y) return (y%2 == 1); end,
-- 5: top and bottom rows
function(x, y) return (y%2 == 0); end,
-- 6: random 50%
function(x, y) return (math.random(0,1) == 0); end,
-- 7: corners and center
function(x, y) return ((x/3)%2 == y%2); end,
-- 8: slanted
function(x, y) return ((x+1)//3 == y); end,
};
idx = math.random(1, #filters);
for y = 0,2 do
for x = 0,6 do
if (filters[idx](x, y)) then
des.map({ coord = {12 + x*9, 4 + y*5}, map = pillar, contents=function() end });
end
end
end
des.region(selection.area(00,00,75,18), "lit");
des.wallify();
des.non_diggable();
des.stair("up");
des.stair("down");
for i = 1,15 do
des.object();
end
for i = 1,6 do
des.trap();
end
for i = 1,28 do
des.monster();
end
+14 -14
View File
@@ -9,20 +9,20 @@ des.level_flags("mazelevel", "noflip");
des.map([[
----------- -----------
|.........| |.........|
|.........|-----------| |-----------|.........|
|-|...................|----------| |----------|...................|-|
-|.............................|-------|.............................|-
-|.................................................................|-
-|...............................................................|-
-|......LLLLL.......................................LLLLL......|-
-|.....LLLLL.......................................LLLLL.....|-
-|.....LLLLL.......................................LLLLL.....|-
-|......LLLLL.......................................LLLLL......|-
-|...............................................................|-
-|.................................................................|-
-|.............................|-------|.............................|-
|-|...................|----------| |----------|...................|-|
|.........|-----------| |-----------|.........|
|.........------------- -------------.........|
---...................------------ ------------...................---
--.............................---------.............................--
--.................................................................--
--...............................................................--
--......LLLLL.......................................LLLLL......--
--.....LLLLL.......................................LLLLL.....--
--.....LLLLL.......................................LLLLL.....--
--......LLLLL.......................................LLLLL......--
--...............................................................--
--.................................................................--
--.............................---------.............................--
---...................------------ ------------...................---
|.........------------- -------------.........|
|.........| |.........|
----------- -----------
]]);
+1 -1
View File
@@ -12,7 +12,7 @@ des.map([[
--...........-- --...........-- --...........-- --...........--
--.............-- --.............-- --.............-- --.............--
-...............- -...............- -...............- -...............-
|-...............---...............---...............---...............--
--...............---...............---...............---...............--
|.................-.................-.................-.................|
|........T.................T.................T.................T........|
|.......................................................................|
+2 -2
View File
@@ -14,11 +14,11 @@ des.map([[
---------.................................---
---------...........................................---
---------.....................................................---
|--------...............................................................--|
---------...............................................................---
|.........................................................................|
|.L.....................................................................L.|
|.........................................................................|
|--...............................................................--------|
---...............................................................---------
---.....................................................---------
---...........................................---------
---.................................---------
+1
View File
@@ -144,6 +144,7 @@ local loc = place:rndcoord(1);
des.object({ id = "chest", trapped = 0, locked = 1, coord = loc ,
contents = function()
des.object("wishing");
des.object("potion of gain level");
end
});
-- Prevent monsters from eating it. (@'s never eat objects)
+14 -4
View File
@@ -1,5 +1,5 @@
# NetHack 3.7 data.base
# $NHDT-Date: 1684001509 2023/05/13 18:11:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.106 $
# $NHDT-Date: 1737609388 2025/01/22 21:16:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.141 $
# Copyright (c) 1994, 1995, 1996 by the NetHack Development Team
# Copyright (c) 1994 by Boudewijn Wayers
# NetHack may be freely redistributed. See license for details.
@@ -2056,6 +2056,16 @@ genetic engineer
immediate mutations in the subject. Far from needing an
elaborate laboratory to accomplish such abominations, a mere
touch seems to be all that is necessary.
[]
"I thought the whole point of genetic engineering was to avoid
the random waste of natural evolution, and replace it with
the efficiency of reason," Miles piped up. All three haut-
women turned to stare at him in astonishment, as if a potted
plant had suddenly offered a critique of its fertilization
routine. "Or ... so it seems to me," Miles trailed off in
a much smaller voice.
[ Cetaganda, Lois McMaster Bujold ]
geryon
Forthwith that image vile of fraud appear'd,
His head and upper part expos'd on land,
@@ -2395,7 +2405,6 @@ hell hound*
~helm of *
~crystal helmet
helm*
dented pot
* helmet
A piece of armor designed to protect the head.
(What were you expecting?)
@@ -3016,7 +3025,7 @@ knight
And was a bugbear in men's eyes;
But had the fortune in his age
To live a fool and die a sage.
[ Don Quixote of La Mancha, by Miquel de Cervantes Saavedra ]
[ Don Quixote of La Mancha, by Miguel de Cervantes Saavedra ]
~kobold ??m*
*kobold*
The race of kobolds are reputed to be an artificial creation
@@ -3135,7 +3144,7 @@ lance
his lance into shivers, carrying him and his horse after it,
and finally tumbled him a good way off from it on the field in
evil plight.
[ Don Quixote of La Mancha, by Miquel de Cervantes Saavedra ]
[ Don Quixote of La Mancha, by Miguel de Cervantes Saavedra ]
land mine
Your heart is intact, your brain is not badly damaged, but the rest
of your injuries are comparable to stepping on a land mine. You'd
@@ -5230,6 +5239,7 @@ squeaky board
additionally gives the wielder the power of regeneration.
When invoked it performs healing magic.
stair*
branch stair*
Up he went -- very quickly at first -- then more slowly -- then
in a little while even more slowly than that -- and finally,
after many minutes of climbing up the endless stairway, one
+1 -1
View File
@@ -70,7 +70,7 @@ dungeon = {
base = 10,
range = 3,
chance = 40,
nlevels = 11
nlevels = 13
},
{
name = "medusa",
+2
View File
@@ -279,6 +279,8 @@ I died laughing
I disbelieved in reincarnation in my last life, too.
I hacked myself to death
I have all the time in the world
#"reached Mine's End": not necessarily true; sounds like "reached my end"
I have reached Mine's End
I knew I'd find a use for this gravestone!
I know my mind. And it's around here someplace.
I lied! I'll never be alright!
+16
View File
@@ -410,6 +410,22 @@ hells = {
end
des.terrain(outside_walls, " "); -- return the outside back to solid wall
end,
-- 7: open cavern, "mines" with more space
function ()
-- walls are either stone or lava
local wter = percent(50) and " " or "L";
des.level_init({ style = "solidfill", fg = " ", lit = 0 });
des.level_flags("mazelevel", "noflip");
des.level_init({ style="mines", fg=".", bg = wter, smoothed=true ,joined=true, lit=0 });
local sel = selection.match("."):grow();
des.terrain({ selection = sel, typ = ".", lit = 0 });
local border = selection.rect(0,0, 78, 20);
des.terrain({ selection = border, typ = wter, lit = 0 });
des.wallify();
end,
};
local hellno = math.random(1, #hells);
+2 -2
View File
@@ -34,8 +34,8 @@ O options set options
/ what-is tell what a map symbol represents
\ known display list of what's been discovered
| perminv interact with persistent inventory window instead of hero+map
v version display version number
V history display game history
v chronicle display a list of important events
V version display version number
^A again redo the previous command
^R redraw redraw the screen
^P prevmsg repeat previous message (consecutive ^P's repeat earlier ones)
+102
View File
@@ -0,0 +1,102 @@
# NetHack 3.7 luahelper $NHDT-Date: $ $NHDT-Branch: NetHack-3.7 $
#
# Makefile to assist developers in adding lines to various build
# Makefiles, or project files, as lua files are added or removed.
# NetHack may be freely redistributed. See license for details.
#
# Must be run while your current directory is the top of the
# NetHack source tree.
#
# make -f dat/luahelper [target]
#
# Target examples:
#
# Visual Studio nmake : make -f dat/luahelper devhelp-nmake >file.txt
#
# Visual Studio project: make -f dat/luahelper devhelp-vstudio >file.txt
#
# MSYS2 GNUmakefile : make -f dat/luahelper devhelp-msys2 >file.txt
#
# Xcode project.pbxproj: make -f dat/luahelper devhelp-xcode >file.txt
#
#
MAKEFLAGS += --no-print-directory
AWK=awk
luanames = asmodeus baalz bigrm-* castle fakewiz? juiblex knox medusa-? \
minend-? minefill minetn-? oracle orcus sanctum soko?-? tower? \
valley wizard? nhcore nhlib themerms astral air earth fire water \
hellfill tut-? ???-goal ???-fil? ???-loca ???-strt \
dungeon quest
alllua = $(wildcard $(addsuffix .lua,$(addprefix dat/, $(luanames))))
#
# generates lines to insert into
# sys/windows/Makefile.nmake
#
devhelp-nmake:
@echo "$(notdir $(alllua))" | \
$(AWK) '{for (i=1; i<=NF; ++i)printf "%s%s%s%s", \
i == 1? "LUA_FILES = " : "", \
"$$(DAT)", \
$$i, \
i % 3? " ": ((i == NF)? "\n" : " \\\n\t")} \
i % 3{print ""}'
@echo ""
#
# generates lines to insert into
# sys/windows/GNUmakefile
#
devhelp-msys2:
@echo "$(basename $(notdir $(alllua)))" | \
$(AWK) '{for (i=1; i<=NF; ++i)printf "%s%s%s", \
i == 1? "LUALIST = " : "", \
$$i, \
i % 5? " ": ((i == NF)? "\n" : " \\\n\t")} \
i % 5{print ""}'
@echo ""
xcodeextra = bogusmon cmdhelp data engrave epitaph help hh \
history keyhelp opthelp optmenu options oracles \
rumors tribute wizhelp
#
# generates lines to insert into
# sys/unix/NetHack.xcodeproj/project.pbxproj
#
devhelp-xcode:
@echo "\t\t\tinputPaths = ("
@echo "$(xcodeextra) $(notdir $(alllua))" | \
$(AWK) '{for (i=1; i<=NF; ++i)printf "%s%s%s%s%s", \
i == 1? "\t" : "", \
"\t\t\t\042$$(NH_DAT_DIR)/", \
$$i, \
"\042", \
i % 1? " ": ((i == NF)? "\n" : ",\n\t")} \
i % 1{print ""}'
@echo "\t\t\t);"
#
# generates lines to insert into
# sys/windows/vs/files.props
#
devhelp-vstudio:
@echo " <ItemGroup>"
@echo "$(notdir $(alllua))" | \
$(AWK) '{for (i=1; i<=NF; ++i)printf "%s%s%s%s%s", \
i == 1? " " : "", \
"<Luafiles Include = \042", \
$$i, \
"\042/>", \
i % 1? " ": ((i == NF)? "\n" : "\n ")} \
i % 1{print ""}'
@echo " </ItemGroup>"
all:
make -f dat/luahelper devhelp-nmake >./luahelp-nmake.txt
make -f dat/luahelper devhelp-msys2 >./luahelp-msys2.txt
make -f dat/luahelper devhelp-xcode >./luahelp-xcode.txt
make -f dat/luahelper devhelp-vstudio >./luahelp-vstudio.txt
# end
+1 -1
View File
@@ -132,7 +132,7 @@ des.monster("water nymph")
des.monster("water nymph")
for i=1,30 do
des.monster({ id = "raven", hostile = 1 })
des.monster({ id = "raven", peaceful = 0 })
end
--#medusa-3.lua
+7 -5
View File
@@ -88,7 +88,7 @@ des.object({ id = "corpse", montype="watchman" })
des.object({ id = "corpse", montype="watch captain" })
-- Rubble!
for i=1,9 + math.random(2 - 1,2*5) do
for i = 1, math.random(10,19) do
if percent(90) then
des.object("boulder")
end
@@ -118,7 +118,7 @@ des.object({ id = "wand of magic missile", coord = place[5], buc="uncursed", spe
local inside = selection.floodfill(18,8)
local near_temple = selection.area(17,8, 23,14) & inside
for i=1,5 + math.random(1 - 1,1*10) do
for i = 1, math.random(5,15) do
if percent(50) then
des.monster({ id = "orc-captain", coord = inside:rndcoord(1), peaceful=0 });
else
@@ -130,12 +130,14 @@ for i=1,5 + math.random(1 - 1,1*10) do
end
end
-- shamans can be hanging out in/near the temple
for i=1,math.random(2 - 1,2*3) do
des.monster({ id = "orc shaman", coord = near_temple:rndcoord(0), peaceful=0 });
-- one of the shamans is higher level
for i = 1, math.random(1,6) do
des.monster({ id = "orc shaman", coord = near_temple:rndcoord(0), peaceful=0,
m_lev_adj = (i == 1) and 3 or 0 });
end
-- these are not such a big deal
-- to run into outside the bars
for i=1,9 + math.random(2 - 1,2*5) do
for i = 1, math.random(10,19) do
if percent(90) then
des.monster({ id = "hill orc", peaceful = 0 })
else
+8
View File
@@ -86,6 +86,14 @@ des.monster("gnome lord")
des.monster("dwarf")
des.monster("dwarf")
des.monster("dwarf")
des.monster({ id = "dwarf", peaceful = 1 })
des.monster({ id = "dwarf", peaceful = 1 })
des.monster({ id = "gnome", peaceful = 1 })
des.monster({ id = "gnome", peaceful = 1 })
des.monster({ id = "hobbit", peaceful = 1 })
des.monster({ id = "goblin", peaceful = 1 })
des.monster({ id = "kobold", peaceful = 1 })
des.monster({ id = "dog", peaceful = 1 })
des.monster({ id = "watchman", peaceful = 1 })
des.monster({ id = "watchman", peaceful = 1 })
des.monster({ id = "watchman", peaceful = 1 })
+16 -1
View File
@@ -3,6 +3,7 @@ Boolean options not under specific compile flags (with default values in []):
option setting, which is reached via the 'O' command.)
acoustics can your character hear anything [True]
armorstatus show extra status field summarizing worn armor [False]
autodescribe describe the terrain under cursor [False]
autodig dig if moving and wielding digging tool [False]
autoopen walking into a door attempts to open it [True]
@@ -40,7 +41,6 @@ mail enable the mail daemon [True]
mention_decor give feedback when walking across stairs, altars, [False]
fountains, and such even when not obscured by objects
mention_walls give feedback when walking against a wall [False]
menu_objsyms show object symbols in menus if it is selectable [False]
menu_overlay overlay menus on the screen and align to right [True]
menucolors enable MENUCOLOR pattern matching to highlight [False]
lines in object menus like inventory; might highlight with
@@ -49,14 +49,17 @@ nudist start your character without armor [False]
null allow nulls to be sent to your terminal [True]
try turning this option off (forcing NetHack to use its own
delay code) if moving objects seem to teleport across rooms
pauper start your character with no possessions [False]
perm_invent keep inventory in a permanent window [False]
pickup_stolen override pickup_types for stolen objects [True]
pickup_thrown override pickup_types for thrown objects [True]
price_quotes show remembered price quotes for unIDed items [False]
pushweapon when wielding a new weapon, put your previously [False]
wielded weapon into the secondary weapon slot
quick_farsight usually skip the chance to browse the map when [False]
randomly triggered clairvoyance takes place
rawio allow the use of raw I/O [False]
reroll allow rerolling of starting inventory [False]
rest_on_space count the space bar as a rest character [False]
safe_pet prevent you from (knowingly) attacking your pet(s) [True]
safe_wait require use of 'm' prefix before '.' or 's' to [True]
@@ -71,6 +74,7 @@ sparkle display sparkly effect for resisted magical [True]
attacks (e.g. fire attack on fire-resistant monster)
standout use standout mode for --More-- on messages [False]
status_updates update the status lines [True]
terrainstatus show extra status field describing current location [False]
time display elapsed game time, in moves [False]
tips show some helpful tips during gameplay [True]
tombstone print tombstone when you die [True]
@@ -81,6 +85,7 @@ travel enables travelling via mouse click if supported; [True]
use_darkgray use bold black instead of blue for black glyphs. [True]
use_inverse display detected monsters in highlighted manner [False]
verbose print more commentary during the game [True]
weaponstatus show extra status field listing wielded weapon(s) [False]
whatis_menu show menu when getting a map location [False]
whatis_moveskip skip same glyphs when getting a map location [False]
@@ -190,6 +195,16 @@ menustyle user interface for selection of multiple objects: [Full]
only the first letter ('T','C','F','P') matters
(With Traditional, many actions allow pseudo-class 'm' to
request a menu for choosing items: one-shot Combination.)
menu_objsyms whether to include object class symbols in menus: [4]
0 - none -- don't add object symbols to menus;
1 - headers -- append object class symbol to menu header lines;
2 - entries -- show object glyphs (same as class symbol
for ASCII interfaces) on each menu entry line;
3 - both -- 1 and 2 combined;
4 - conditional -- as 2 but only if no headers are present;
5 - one-or-other -- 1 and 4 combined;
choices 0 and 1 should work with any interface; 2 through 5
are supported by tty and curses
msg_window behavior of ^P message recall for tty interface: [s]
single -- one message at a time
full -- full window with all saved top line messages
+2 -1
View File
@@ -100,5 +100,6 @@ be old and miserly.
The name of Elbereth may strike fear into the hearts of thine enemies, if
thou dost write it upon the ground at thy feet. If thou maintainest the
utmost calm, thy safety will be aided greatly, but beware lest thy clumsy
feet scuff the inscription, cancelling its potence.
feet scuff the inscription, cancelling its potence, or thy wayward
sword-arm break the truce.
-----
+7
View File
@@ -102,6 +102,13 @@ local orcus1 = des.map({ halign = "right", valign = "center", map = [[
des.object()
des.object()
des.object()
-- An object that's worth most of a wish
-- (this is part of the compensation for the reduced wishes at the Castle)
if math.random(0, 1) == 1 then
des.object("magic marker")
else
des.object("magic lamp")
end
-- The resident nasty
des.monster("Orcus",33,15)
-- And its preferred companions
+1
View File
@@ -28,6 +28,7 @@ All monsters are created evil, but some are more evil than others.
Always attack a floating eye from behind!
An elven cloak is always the height of fashion.
Any small object that is accidentally dropped will hide under a larger object.
Archeologists are very squishy, often found under boulders.
Archeologists find more bones piles.
Austin Powers says: My Mojo is back! Yeah, baby!
Balrogs do not appear above level 20.
+24 -8
View File
@@ -2,6 +2,7 @@ A blindfold can be very useful if you're telepathic.
A candelabrum affixed with seven candles shows the way with a magical light.
A cream pie has two uses: food... and entertainment.
A crystal plate mail will not rust.
A dead body may protect your live body. But only an item can protect an item.
A katana might slice a worm in two.
A magic vomit pump could be useful for gourmands.
A nymph knows how to unlock chains.
@@ -29,7 +30,6 @@ Bandaging wounds helps keep up appearances.
Bashing monsters with a bow is not such a good idea.
Be careful! The Wizard may plan an ambush!
Be nice to a nurse: Put away your weapon and take off your clothes.
Being digested is a painfully slow process.
Blank scrolls make more interesting reading.
Blind? Catch a floating eye!
Booksellers never read scrolls; they might get carried away.
@@ -45,6 +45,7 @@ Don't forget! Large dogs are MUCH harder to kill than little dogs.
Don't lash out at people while blinded.
Don't mess with shopkeepers, or you'll get the Guild after you.
Dragons never whip their children; they wouldn't feel it!
Dwarves use their cloaks to keep their drinks cool.
Eat your carrots. They're good for your eyes.
Eating a freezing sphere is like eating a yeti.
Eating a killer bee is like eating a scorpion.
@@ -56,9 +57,10 @@ Elf corpses are incompatible with the sandman, and at times the gods as well.
Elven cloaks cannot rust.
Elves can help you feel less tired.
Even evil players have a guardian angel.
Even the most powerful heroes sometimes need to quaff away their injuries.
Ever fought with an enchanted tooth?
Ever tried reading while confused?
Ever tried to put a troll into a large box?
Ever tried to lock a troll inside a large box?
Ever wondered why one would want to dip something in a potion?
Expensive cameras have penetrating flash lights.
Extra staircases lead to extra levels.
@@ -74,6 +76,7 @@ Got a question? Try rec.games.roguelike.nethack.
Grave robbers sometimes get rich.
Guy Montag keeps his scrolls in a bag.
Handle your flasks carefully -- there might be a ghost inside!
Heavy-duty boots can protect more than just your feet.
Holy water has many uses.
Horses trust their riders, even when not so deserved.
Hunger is a confusing experience for a dog!
@@ -90,6 +93,7 @@ If you want to hit, use a dagger.
If you want to rob a shop, train your dog.
If you're lost, try buying a map next time you're in a shop.
If your hands are greasy, why not wash them?
If your items get destroyed, you weren't wearing the right ring.
Inside a shop you better take a look at the price tags before buying anything.
It is bad manners to use a wand in a shop.
It is dangerous to visit a graveyard at midnight.
@@ -98,7 +102,7 @@ It is rumored that the Wizard has hired some help.
It is the letter 'c' and not 'e' that changes status to statue.
It might be a good idea to offer the unicorn a ruby.
It would be peculiarly sad were your dog turned to stone.
It's a `d' eats `d' world.
It's a 'd' eats 'd' world.
Just because it says READ ME doesn't mean you should.
Keep your armors away from rust.
Keep your weaponry away from acids.
@@ -119,6 +123,7 @@ Nurses are trained to touch naked persons: they don't harm them.
Nymphs can unlink more than your chain mail.
Once your little dog will be a big dog, and you will be proud of it.
Only female monsters can lay eggs.
Only the most confused adventurers would read cursed destroy armor scrolls.
Opening a tin is difficult, especially when you attempt it bare handed!
Orcs and killer bees share their lifestyle.
Orcs do not procreate in dark rooms.
@@ -155,12 +160,14 @@ Sometimes monsters are more likely to fight each other than attack you.
Spinach, carrot, and jelly -- a meal fit for a nurse!
Surviving the full extent of the mines could mean that your luck is changing.
Tainted meat is even more sickening than poison!
Take your healing potions to the next level!
Telepathy is just a trick: once you know how to do it, it's easy.
The Leprechaun Gold Tru$t is no division of the Magic Memory Vault.
The Wizard finds death to be quite an experience.
The best equipment for your work is, of course, the most expensive.
The gods don't appreciate pesky priesthood.
The gods will get angry if you kill your dog.
The less magic in your armor, the more you can add.
The magic marker is mightier than the sword.
The moon is not the only heavenly body to influence this game.
The orc swings his orcish broadsword named Elfrist at you. You die...
@@ -173,10 +180,10 @@ There is no harm in praising a large dog.
There is nothing like eating a mimic.
There once was a Knight named Lancelot who liked to ride with his lance a lot.
They say a gelatinous cube can paralyze you...
They say that Juiblex is afraid of a wand of digging.
They say that Juiblex is somewhat afraid of a wand of digging.
They say that Medusa would like to put you on a pedestal.
They say that Vlad lives!!! ... in the mazes.
They say that `Elbereth' is often written about.
They say that Vlad lives!!! ... near the mazes.
They say that 'Elbereth' is often written about.
They say that a bag of holding can't hold everything.
They say that a blessed tin of quasit meat is a quick meal.
They say that a cat avoids traps.
@@ -205,6 +212,7 @@ They say that a unicorn might bring you luck.
They say that a wand of cancellation is like a wand of polymorph.
They say that a wand of locking can close more than just doors.
They say that a wand of polymorph can change your game.
They say that a wise choice of donations lets you choose your blessings.
They say that a wizard is even more powerful the second time around.
They say that a xorn knows of no obstacles when pursuing you.
They say that abusing a credit card could shock you sooner or later.
@@ -216,7 +224,6 @@ They say that antique dealers are always interested in precious stones.
They say that bandaging one's wounds helps to keep up one's appearance.
They say that booze can be diluted but not cancelled.
They say that by listening carefully, you can hear a secret door!
They say that calculating your donations lets you choose your blessings.
They say that carrots and carrot juice may improve your vision.
They say that cave spiders are not considered expensive health food.
They say that demigods must leave behind their prized earthly possessions.
@@ -227,11 +234,12 @@ They say that dwarves lawfully mind their own business.
They say that eating a bat corpse will make you batty, for a while.
They say that eating a cram ration is a smart move.
They say that eating blue jelly is cool if you don't fight the feeling.
They say that elven armor can hold the most magic.
They say that escaping a dungeon is only the beginning of the end.
They say that feeling an unexpected draft of air is sort of a breakthrough.
They say that finding a cursed gray stone is always bad luck.
They say that gaining a level is an experience that can raise your sights.
They say that garter snake meat rarely tastes good but it's still healthy.
They say that garter snake meat may not taste good but it's still healthy.
They say that gauntlets of dexterity have a hidden enchanted touch.
They say that going to heaven is just another way of escaping the dungeon.
They say that golden nagas are law-abiding denizens as long as you are too.
@@ -239,6 +247,7 @@ They say that gremlins can make you feel cooler than you are now.
They say that grid bugs only exist in a strictly Cartesian sense.
They say that hackers often feel jumpy about eating nymphs.
They say that having polymorph control won't shock you.
They say that healing potions often come in pairs.
They say that if it's hard getting your food down another bite could kill.
They say that if you don't wear glasses why bother with carrots?
They say that if you notice a loose board beneath you, don't step on it.
@@ -271,6 +280,7 @@ They say that only chaotics can kill shopkeepers and get away with it.
They say that only female monsters can lay eggs.
They say that playing a horn really bad is really good.
They say that prayer at an altar can sometimes make the water there holy.
They say that the right wand may help you chase a nymph.
They say that rubbing a glowing potion does not make it a magic lamp.
They say that scalpels become dull because they're not athames.
They say that shopkeepers don't like pick-axes.
@@ -280,6 +290,7 @@ They say that shopkeepers often have a large amount of money in their purses.
They say that shopkeepers often remember things that you might forget.
They say that sinks and armor don't mix, take your cloak off now!
They say that sinks run hot and cold and many flavors in between.
They say that sitting on a vampire's throne is worth the danger.
They say that snake charmers aren't charismatic, just musical.
They say that soldiers are always prepared and usually protected.
They say that some eggs could hatch in your pack, lucky or not.
@@ -296,6 +307,7 @@ They say that teleport traps are the devil's work.
They say that tengu don't wear rings, why should you?
They say that tengu never steal gold although they would be good at it.
They say that that which was stolen once can be stolen again, ask any nymph.
They say that the best way to fix your injuries is a potion.
They say that the Delphic Oracle knows that lizard corpses aren't confusing.
They say that the Hand of Elbereth can hold up your prayers.
They say that the Leprechaun King is rich as Croesus.
@@ -313,6 +325,7 @@ They say that the view from a fog cloud is really very moving.
They say that the walls in shops are made of extra hard material.
They say that there are at least 15 ways to lose a pair of levitation boots.
They say that throwing glass gems is the same as throwing rocks.
They say that to block a shocking sphere, you need the right shield.
They say that trespassing a boulder is probably beneath you.
They say that true power comes from within...except when it doesn't.
They say that unicorns are fond of precious gems.
@@ -324,6 +337,7 @@ They say that with a floating eye you could see in the dark.
They say that you are lucky if you can get a unicorn to catch a ruby.
They say that you are what you eat.
They say that you can find named weapons at an altar if you're lucky.
They say that you can give potions of extra healing new energy.
They say that you can safely touch cockatrice eggs but why bother?
They say that you can't break an amulet of reflection.
They say that you don't always get what you wish for.
@@ -351,6 +365,7 @@ Vampires hate garlic.
Vault guards never disturb their Lords.
Vegetarians enjoy lichen and seaweed.
Visitors are requested not to apply genocide to shopkeepers.
Want to heal faster? Dip your potions of healing in a potion of speed!
Watch out, the Wizard might come back.
Water traps have no effect on dragons.
What is a cockatrice going to eat when it gets hungry?
@@ -361,6 +376,7 @@ Why would anybody in his sane mind engrave "Elbereth"?
Wishing too much may bring you too little.
You can't bribe soldier ants.
You can't leave a shop through the back door: there isn't one!
You can't reflect explosions. But you might resist them.
You may discover a fine spirit inside a potion bottle.
You may want to dip into a potion of bottled blessings.
You might be able to bribe a demon lord.
+4 -1
View File
@@ -59,8 +59,11 @@ des.object("boulder", 09, 12);
--
des.object("boulder", 03, 14);
-- prevent monster generation over the (filled) holes
des.exclusion({ type = "monster-generation", region = { 07,01, 23,01 } });
-- Traps
des.trap("hole", 08, 01);
des.trap("hole", 07, 01);
des.trap("rolling boulder", 08, 01);
des.trap("hole", 09, 01);
des.trap("hole", 10, 01);
des.trap("hole", 11, 01);
+4 -1
View File
@@ -60,8 +60,10 @@ des.object("boulder",10,08);
des.object("boulder",12,09);
des.object("boulder",11,10);
-- prevent monster generation over the (filled) holes
des.exclusion({ type = "monster-generation", region = { 05,01, 23,01 } });
-- Traps
des.trap("hole",05,01)
des.trap("rolling boulder",05,01)
des.trap("hole",06,01)
des.trap("hole",07,01)
des.trap("hole",08,01)
@@ -79,6 +81,7 @@ des.trap("hole",19,01)
des.trap("hole",20,01)
des.trap("hole",21,01)
des.trap("hole",22,01)
des.trap("hole",23,01)
des.monster({ id = "giant mimic", appear_as = "obj:boulder" });
des.monster({ id = "giant mimic", appear_as = "obj:boulder" });
+3
View File
@@ -46,7 +46,10 @@ des.object("boulder",03,09)
des.object("boulder",05,07)
des.object("boulder",06,06)
-- prevent monster generation over the (filled) holes
des.exclusion({ type = "monster-generation", region = { 07,09, 18,09 } });
-- Traps
des.trap("rolling boulder",07,09)
des.trap("hole",08,09)
des.trap("hole",09,09)
des.trap("hole",10,09)
+22 -18
View File
@@ -7,26 +7,27 @@ des.level_init({ style = "solidfill", fg = " " });
des.level_flags("mazelevel", "noteleport", "premapped", "sokoban", "solidify");
des.map([[
--------
--|.|....|
|........|----------
|.-...-..|.|.......|
|...-......|.......|
|.-....|...|.......|
|....-.--.-|.......|
|..........|.......|
|.--...|...|.......|
|....-.|---|.......|
--|....|----------+|
|................|
------------------
--------
--|.|....|
|........|----------
|.-...-..|.|.......|
|...-......|.......|
|.-....|...|.......|
|....-.--.-|.......|
|..........|.......|
|.--...|...|.......---
|....-.|---|.......+.|
--|....|------------.|
|................+.|
--------------------
]]);
des.stair("down", 06,11)
des.stair("up", 15,06)
des.door("locked",18,10)
des.region(selection.area(00,00,19,12), "lit");
des.non_diggable(selection.area(00,00,19,12));
des.non_passwall(selection.area(00,00,19,12));
des.door("locked",19,09)
des.door("locked",19,11)
des.region(selection.area(00,00,21,12), "lit");
des.non_diggable(selection.area(00,00,21,12));
des.non_passwall(selection.area(00,00,21,12));
-- Boulders
des.object("boulder",04,02)
@@ -46,8 +47,10 @@ des.object("boulder",06,09)
des.object("boulder",05,10)
des.object("boulder",05,11)
-- prevent monster generation over the (filled) holes
des.exclusion({ type = "monster-generation", region = { 06,11, 18,11 } });
-- Traps
des.trap("hole",07,11)
des.trap("rolling boulder",07,11)
des.trap("hole",08,11)
des.trap("hole",09,11)
des.trap("hole",10,11)
@@ -58,6 +61,7 @@ des.trap("hole",14,11)
des.trap("hole",15,11)
des.trap("hole",16,11)
des.trap("hole",17,11)
des.trap("hole",18,11)
-- Random objects
des.object({ class = "%" });
+3
View File
@@ -52,7 +52,10 @@ des.object("boulder",09,09)
des.object("boulder",10,07)
des.object("boulder",10,10)
-- prevent monster generation over the (filled) holes
des.exclusion({ type = "monster-generation", region = { 11,10, 27,10 } });
-- Traps
des.trap("rolling boulder",11,10)
des.trap("hole",12,10)
des.trap("hole",13,10)
des.trap("hole",14,10)
+3
View File
@@ -47,7 +47,10 @@ des.object("boulder",07,10)
des.object("boulder",10,10)
des.object("boulder",03,11)
-- prevent monster generation over the (filled) holes
des.exclusion({ type = "monster-generation", region = { 11,10, 24,10 } });
-- Traps
des.trap("rolling boulder",11,10)
des.trap("hole",12,10)
des.trap("hole",13,10)
des.trap("hole",14,10)
+11 -4
View File
@@ -72,16 +72,23 @@ des.object("boulder",09,09)
des.object("boulder",08,10)
des.object("boulder",10,10)
-- prevent monster generation over the (filled) pits
des.exclusion({ type = "monster-generation", region = { 01,06, 07,11 } });
-- Traps
des.trap("pit",03,06)
des.trap("pit",04,06)
des.trap("pit",05,06)
des.trap("pit",02,06)
des.trap("pit",02,07)
des.trap("pit",02,08)
des.trap("pit",02,09)
des.trap("rolling boulder",02,09)
des.trap("pit",02,10)
des.trap("pit",03,10)
des.trap("pit",04,10)
des.trap("pit",05,10)
des.trap("pit",06,10)
des.trap("pit",07,10)
des.trap("rolling boulder",07,10)
-- A little help
des.object("scroll of earth",02,11)
+8 -2
View File
@@ -41,17 +41,23 @@ des.object("boulder",08,08)
des.object("boulder",09,08)
des.object("boulder",10,08)
-- prevent monster generation over the (filled) pits
des.exclusion({ type = "monster-generation", region = { 01,01, 01,09 } });
des.exclusion({ type = "monster-generation", region = { 01,08, 07,09 } });
-- Traps
des.trap("pit",01,02)
des.trap("pit",01,03)
des.trap("pit",01,04)
des.trap("pit",01,05)
des.trap("pit",01,06)
des.trap("pit",01,07)
des.trap("rolling boulder",01,07)
des.trap("pit",01,08)
des.trap("pit",02,08)
des.trap("pit",03,08)
des.trap("pit",04,08)
des.trap("pit",05,08)
des.trap("pit",06,08)
des.trap("rolling boulder",06,08)
-- A little help
des.object("scroll of earth",01,09)
+217 -13
View File
@@ -803,26 +803,151 @@ start: MACgraphics
S_pool: \xe0
finish
# When using Unicode glyphs, care must be taken with how terminals
# render them and how completely fonts cover them.
#
# Depending on the font, terminal, and operating system, unsupported
# glyphs may be replaced by placeholder symbols (e.g. U+FFFD
# replacement character or □ U+25A1 white square), omitted entirely, or
# substituted from fallback fonts. Such fallback can introduce visual
# inconsistencies due to differences in style, metrics, or alignment.
#
# Support for glyphs defined in the Windows Glyph List 4
# (https://en.wikipedia.org/wiki/WGL4) is generally good across common
# fonts and platforms. Beyond that baseline, coverage becomes less
# predictable and should be evaluated case by case.
#
# Emoji support often is problematic, and wide glyphs occupy two display
# columns, which NetHack does not support.
#
# Symset Enhanced1 should be considered the conservative Unicode symset,
# while Enhanced2 (and any future symsets) may make use of more advanced
# Unicode features.
start: Enhanced1
Description: Enhanced with Unicode glyphs and 24-bit color
Restrictions: primary
Handling: UTF8
S_vwall: U+2502 # BOX DRAWINGS LIGHT VERTICAL
S_hwall: U+2500 # BOX DRAWINGS LIGHT HORIZONTAL
S_tlcorn: U+250c # BOX DRAWINGS LIGHT DOWN AND RIGHT
S_trcorn: U+2510 # BOX DRAWINGS LIGHT DOWN AND LEFT
S_blcorn: U+2514 # BOX DRAWINGS LIGHT UP AND RIGHT
S_brcorn: U+2518 # BOX DRAWINGS LIGHT UP AND LEFT
S_crwall: U+253c # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
S_tuwall: U+2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL
S_tdwall: U+252c # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
S_tlwall: U+2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT
S_trwall: U+251c # BOX DRAWINGS LIGHT VERTICAL AND RIGHT
S_corr: U+2591 # ░ LIGHT SHADE
S_engrcorr: U+2591 # ░ LIGHT SHADE
S_litcorr: U+2592 # ▒ MEDIUM SHADE
S_vwall: U+2502 # │ BOX DRAWINGS LIGHT VERTICAL
S_hwall: U+2500 # BOX DRAWINGS LIGHT HORIZONTAL
S_tlcorn: U+250c # BOX DRAWINGS LIGHT DOWN AND RIGHT
S_trcorn: U+2510 # BOX DRAWINGS LIGHT DOWN AND LEFT
S_blcorn: U+2514 # BOX DRAWINGS LIGHT UP AND RIGHT
S_brcorn: U+2518 # BOX DRAWINGS LIGHT UP AND LEFT
S_crwall: U+253c # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
S_tuwall: U+2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL
S_tdwall: U+252c # ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
S_tlwall: U+2524 # ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT
S_trwall: U+251c # ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT
S_ndoor: U+00b7 # · MIDDLE DOT
S_vodoor: U+2592 # ▒ MEDIUM SHADE
S_hodoor: U+2592 # ▒ MEDIUM SHADE
S_bars: U+2261 # ≡ IDENTICAL TO
S_tree: U+03a8 # Ψ GREEK CAPITAL LETTER PSI
S_room: U+00b7 # · MIDDLE DOT
S_engroom: U+03BE # ξ Greek Small Letter Xi
S_darkroom: U+00b7 # · MIDDLE DOT
S_upladder: U+2264 # ≤ LESS-THAN OR EQUAL TO
S_dnladder: U+2265 # ≥ GREATER-THAN OR EQUAL TO
S_altar: U+03A9 # Ω GREEK CAPITAL LETTER OMEGA
S_grave: U+2020 # † DAGGER
G_fountain: U+2320/0-150-255 # ⌠ TOP HALF INTEGRAL
S_pool: U+224b # ≋ TRIPLE TILDE
S_ice: U+00b7 # · MIDDLE DOT
S_lava: U+224b # ≋ TRIPLE TILDE
S_lavawall: U+2248 # ≈ ALMOST EQUAL TO
S_vodbridge: U+00b7 # · MIDDLE DOT
S_hodbridge: U+00b7 # · MIDDLE DOT
S_water: U+2248 # ≈ ALMOST EQUAL TO
S_web: U+00A4 # ¤ CURRENCY SIGN
S_vbeam: U+2502 # │ BOX DRAWINGS LIGHT VERTICAL
S_hbeam: U+2500 # ─ BOX DRAWINGS LIGHT HORIZONTAL
S_sw_tc: U+2594 # ▔ UPPER ONE EIGHTH BLOCK
S_sw_ml: U+258f # ▏ LEFT ONE EIGHTH BLOCK
S_sw_mr: U+2595 # ▕ RIGHT ONE EIGHTH BLOCK
S_sw_bc: U+2581 # LOWER ONE EIGHTH BLOCK
S_expl_tc: U+2594 # ▔ UPPER ONE EIGHTH BLOCK
S_expl_ml: U+258f # ▏ LEFT ONE EIGHTH BLOCK
S_expl_mr: U+2595 # ▕ RIGHT ONE EIGHTH BLOCK
S_expl_bc: U+2581 # LOWER ONE EIGHTH BLOCK
G_vwall_sokoban: U+2502/blue # │ BOX DRAWINGS LIGHT VERTICAL
G_hwall_sokoban: U+2500/blue # ─ BOX DRAWINGS LIGHT HORIZONTAL
G_tlcorn_sokoban: U+250c/blue # ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT
G_trcorn_sokoban: U+2510/blue # ┐ BOX DRAWINGS LIGHT DOWN AND LEFT
G_blcorn_sokoban: U+2514/blue # └ BOX DRAWINGS LIGHT UP AND RIGHT
G_brcorn_sokoban: U+2518/blue # ┘ BOX DRAWINGS LIGHT UP AND LEFT
G_crwall_sokoban: U+253C/blue # ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
G_tuwall_sokoban: U+2534/blue # ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL
G_tdwall_sokoban: U+252C/blue # ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
G_tlwall_sokoban: U+2524/blue # ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT
G_trwall_sokoban: U+251C/blue # ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT
G_vwall_gehennom: U+2502/red # │ BOX DRAWINGS LIGHT VERTICAL
G_hwall_gehennom: U+2500/red # ─ BOX DRAWINGS LIGHT HORIZONTAL
G_tlcorn_gehennom: U+250c/red # ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT
G_trcorn_gehennom: U+2510/red # ┐ BOX DRAWINGS LIGHT DOWN AND LEFT
G_blcorn_gehennom: U+2514/red # └ BOX DRAWINGS LIGHT UP AND RIGHT
G_brcorn_gehennom: U+2518/red # ┘ BOX DRAWINGS LIGHT UP AND LEFT
G_crwall_gehennom: U+253C/red # ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
G_tuwall_gehennom: U+2534/red # ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL
G_tdwall_gehennom: U+252C/red # ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
G_tlwall_gehennom: U+2524/red # ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT
G_trwall_gehennom: U+251C/red # ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT
G_vwall_knox: U+2502/150-75-0 # │ BOX DRAWINGS LIGHT VERTICAL
G_hwall_knox: U+2500/150-75-0 # ─ BOX DRAWINGS LIGHT HORIZONTAL
G_tlcorn_knox: U+250c/150-75-0 # ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT
G_trcorn_knox: U+2510/150-75-0 # ┐ BOX DRAWINGS LIGHT DOWN AND LEFT
G_blcorn_knox: U+2514/150-75-0 # └ BOX DRAWINGS LIGHT UP AND RIGHT
G_brcorn_knox: U+2518/150-75-0 # ┘ BOX DRAWINGS LIGHT UP AND LEFT
G_crwall_knox: U+253C/150-75-0 # ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
G_tuwall_knox: U+2534/150-75-0 # ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL
G_tdwall_knox: U+252C/150-75-0 # ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
G_tlwall_knox: U+2524/150-75-0 # ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT
G_trwall_knox: U+251C/150-75-0 # ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT
G_vwall_mines: U+2502/113-126-142 # │ BOX DRAWINGS LIGHT VERTICAL
G_hwall_mines: U+2500/113-126-142 # ─ BOX DRAWINGS LIGHT HORIZONTAL
G_tlcorn_mines: U+250c/113-126-142 # ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT
G_trcorn_mines: U+2510/113-126-142 # ┐ BOX DRAWINGS LIGHT DOWN AND LEFT
G_blcorn_mines: U+2514/113-126-142 # └ BOX DRAWINGS LIGHT UP AND RIGHT
G_brcorn_mines: U+2518/113-126-142 # ┘ BOX DRAWINGS LIGHT UP AND LEFT
G_crwall_mines: U+253C/113-126-142 # ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
G_tuwall_mines: U+2534/113-126-142 # ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL
G_tdwall_mines: U+252C/113-126-142 # ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
G_tlwall_mines: U+2524/113-126-142 # ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT
G_trwall_mines: U+251C/113-126-142 # ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT
finish
start: Enhanced2
# contributed in GitHub pull request 1503 by abcbarryn.
# This has double line wall symbols.
Description: Enhanced with more Unicode glyphs and 24-bit color
Restrictions: primary
Handling: UTF8
S_corr: U+2591
S_litcorr: U+2592
S_engrcorr: U+2591
S_amulet: U+2299 # ☉
S_cloud: U+2601 # ☁
S_vwall: U+2551 # ║ BOX DRAWINGS DOUBLE VERTICAL
S_hwall: U+2550 # ═ BOX DRAWINGS DOUBLE HORIZONTAL
S_tlcorn: U+2554 # ╔ BOX DRAWINGS DOUBLE DOWN AND RIGHT
S_trcorn: U+2557 # ╗ BOX DRAWINGS DOUBLE DOWN AND LEFT
S_blcorn: U+255a # ╚ BOX DRAWINGS DOUBLE UP AND RIGHT
S_brcorn: U+255d # ╝ BOX DRAWINGS DOUBLE UP AND LEFT
S_crwall: U+256c # ╬ BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
S_tuwall: U+2569 # ╩ BOX DRAWINGS DOUBLE UP AND HORIZONTAL
S_tdwall: U+2566 # ╦ BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
S_tlwall: U+2563 # ╣ BOX DRAWINGS DOUBLE VERTICAL AND LEFT
S_trwall: U+2560 # ╠ BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
S_ndoor: U+00b7 # MIDDLE DOT
S_vodoor: U+2592 # MEDIUM SHADE
S_hodoor: U+2592 # MEDIUM SHADE
S_bars: U+2261 # IDENTICAL TO
S_tree: U+03a8 # GREEK CAPITAL LETTER PSI
# S_bars: U+2261 # IDENTICAL TO
S_bars: U+2980 #
# S_tree: U+03a8 # GREEK CAPITAL LETTER PSI
# S_tree: U+1F332 # 🌲
S_tree: U+2660 # ♠
S_room: U+00b7 # MIDDLE DOT
S_engroom: U+03BE # Greek Small Letter Xi
S_darkroom: U+00b7 # MIDDLE DOT
@@ -833,6 +958,7 @@ start: Enhanced1
G_fountain: U+2320/0-150-255 # TOP HALF INTEGRAL
S_pool: U+224b # TRIPLE TILDE
S_ice: U+00b7 # MIDDLE DOT
# S_ice: U+2744 # ❄️
S_lava: U+224b # TRIPLE TILDE
S_lavawall: U+2248 # ALMOST EQUAL TO
S_vodbridge: U+00b7 # MIDDLE DOT
@@ -895,4 +1021,82 @@ start: Enhanced1
G_trwall_mines: U+251C/113-126-142
finish
start: AmigaFont
Description: Amiga hack.font line-drawing and effect characters
# Dungeon features
S_stone: \x20
S_vwall: \xc0
S_hwall: \xc1
S_tlcorn: \xc2
S_trcorn: \xc3
S_blcorn: \xc4
S_brcorn: \xc5
S_crwall: \xc6
S_tuwall: \xd8
S_tdwall: \xd6
S_tlwall: \xd7
S_trwall: \xd5
S_ndoor: \xd9
S_vodoor: \x91
S_hodoor: \x92
S_vcdoor: \x93
S_hcdoor: \x94
S_bars: '#'
S_tree: '#'
S_room: '.'
S_darkroom: \x20
S_corr: \xe5
S_litcorr: \xe5
S_upstair: '<'
S_dnstair: '>'
S_upladder: '<'
S_dnladder: '>'
S_altar: '_'
S_grave: \x5c
S_throne: '#'
S_sink: '{'
S_fountain: '}'
S_pool: '*'
S_ice: '}'
S_lava: '*'
S_vodbridge: '*'
S_hodbridge: '#'
S_vcdbridge: '#'
S_hcdbridge: '.'
S_air: '#'
S_cloud: '}'
# Traps: all default to '^' except web
S_web: '"'
# Effects
S_vbeam: \xf1
S_hbeam: \xf0
S_lslant: \xf2
S_rslant: \xf3
S_digbeam: '*'
S_flashbeam: '!'
S_boomleft: '{'
S_boomright: '}'
S_ss1: '@'
S_ss2: '&'
S_ss3: '*'
S_ss4: '#'
S_sw_tl: \xf4
S_sw_tc: \xf5
S_sw_tr: \xf6
S_sw_ml: \xf7
S_sw_mr: \xef
S_sw_bl: \xf8
S_sw_bc: \xf9
S_sw_br: \xfa
S_explode1: \xe6
S_explode2: \xea
S_explode3: \xe7
S_explode4: \xec
S_explode5: \xd4
S_explode6: \xed
S_explode7: \xe8
S_explode8: \xeb
S_explode9: \xe9
finish
# symbols EOF
+647 -454
View File
File diff suppressed because it is too large Load Diff
+8 -3
View File
@@ -37,9 +37,14 @@ des.monster("V",niches[3])
-- gave them titles rather than (or perhaps in addition to) specific names
-- and we use those titles here. Marking them as 'waiting' forces them to
-- start in vampire form instead of vampshifted into bat/fog/wolf form.
des.monster({ id="Vampire Lady", niches[4], name="Madame", waiting=1 })
des.monster({ id="Vampire Lady", niches[5], name="Marquise", waiting=1 })
des.monster({ id="Vampire Lady", niches[6], name="Countess", waiting=1 })
local Vgenod = nh.is_genocided("vampire");
local Vnames = { nil, nil, nil };
if (not Vgenod) then
Vnames = { "Madame", "Marquise", "Countess" };
end
des.monster({ id="vampire lady", coord=niches[4], name=Vnames[1], waiting=1 })
des.monster({ id="vampire lady", coord=niches[5], name=Vnames[2], waiting=1 })
des.monster({ id="vampire lady", coord=niches[6], name=Vnames[3], waiting=1 })
-- The doors
des.door("closed",08,03)
des.door("closed",10,03)
+2 -2
View File
@@ -3665,7 +3665,7 @@ and needs to see in the dark. Strange but true.
%e passage
# p. 218
%passage 9
"He's bound to have done /something/," Noddy repeated.
"He's bound to have done /something/," Nobby repeated.
In this he was echoing the Patrician's view of crime and punishment. If
there was a crime, there should be punishment. If the specific criminal
@@ -6031,7 +6031,7 @@ was mostly unexplored, too.(1)
%e passage
# p. 219 (passage begins mid-sentence)
%passage 12
[...] Sam Vines had learned a lot from watching Lady Sybil. She didn't
[...] Sam Vimes had learned a lot from watching Lady Sybil. She didn't
mean to act like that, but she'd been born to it, into a class which had
always behaved this way: You went through the world as if there was
/no possibility/ that anyone would stop you or question you, and most of
+120 -44
View File
@@ -1,26 +1,53 @@
local tut_ctrl_key = nil;
local tut_alt_key = nil;
function tut_key(command)
local s = nh.eckey(command);
local m = s:match("^^([A-Z])$"); -- ^X is Ctrl-X
if (m ~= nil) then
tut_ctrl_key = m;
return "Ctrl-" .. m;
end
m = s:match("^M%-([A-Z])$"); -- M-X is Alt-X
if (m ~= nil) then
tut_alt_key = m;
return "Alt-" .. m;
end
return s;
end
function tut_key_help(x, y)
if (tut_ctrl_key ~= nil) then
des.engraving({ coord = { x,y }, type = "engrave", text = "Note: Outside the tutorial, Ctrl-key combinations are shown prefixed with a caret, like '^" .. tut_ctrl_key .. "'", degrade = false });
tut_ctrl_key = nil;
end
end
des.level_init({ style = "solidfill", fg = " " });
des.level_flags("mazelevel", "noflip",
"nomongen", "nodeathdrops", "noautosearch");
des.map([[
---------------------------------------------------------------------------
|-.--|.......|......|..S....|.F.......|.............|.....................|
|-.--|.......|......|..S....|.F.......|.............|.......|.............|
|.-..........|......|--|....|.F.....|.|S-------.....|.....................|
||.--|.......|..T......|....|.F.....|.|.......|.....|.....................|
||.|.|.......|......|-.|....|.F.....|.|.......|.....|.....................|
||.--|.......|..T......|....|.F.....|.|.......|.....|.......|.............|
||.|.|.......|......|-.|....|.F.....|.|.......|.....|--------.............|
||.|.|.......|......||.|-.-----------.-.......|-S----.....................|
|-+-S---------..---.||........................|...|.......................|
|......| |.-------------------.......|...|....--S----............|
|......| ###### |.........| |..S.......|...|....|.....|............|
|----.-| -+- # |.....---.|######+..|.......S...|....|.....|............|
|----+----.----+---.|.--|.|.|# ------------...|....|.....|............|
|----+----.----+---.|.--|.|.|# ------------...|....|.....F............|
|........|.|......|.|...F...|# ........|.....+...|....|.....|............|
|.P......-S|......|------.---# .........|.....|...|....-------............|
|..........|......+.|...|.|.S# ..--S-----.....|LLL|.......................|
|.W......---......|.|.|.|.|.|# ..|......|.....|LLL|.......................|
|....Z.L.S.F......|.|.|.|.---# |......+.....|...|.......................|
|........|--......|...|.....|####+......|.....|...+.......................|
|.P......-S|......|------.---# .........|.....|...|....-------........----|
|..........|......+.|...|.|.S# ..--S-----.....|LLL|..................|..| |
|.W......---......|.|.|.|.|.|# ..|......|.....|LLL|..................|..--|
|....Z.L.S.F......|.|.|.|.---# |......+.....|...|..................|..|.|
|........|--......|...|.....|####+......|.....|...+..................||...|
---------------------------------------------------------------------------
]]);
@@ -40,26 +67,30 @@ nh.parse_config("OPTIONS=mention_walls");
nh.parse_config("OPTIONS=mention_decor");
nh.parse_config("OPTIONS=lit_corridor");
local movekeys = nh.eckey("movewest") .. " " ..
nh.eckey("movesouth") .. " " ..
nh.eckey("movenorth") .. " " ..
nh.eckey("moveeast");
local movekeys = tut_key("movewest") .. " " ..
tut_key("movesouth") .. " " ..
tut_key("movenorth") .. " " ..
tut_key("moveeast");
local diagmovekeys = nh.eckey("movesouthwest") .. " " ..
nh.eckey("movenortheast") .. " " ..
nh.eckey("movesoutheast") .. " " ..
nh.eckey("movenorthwest");
local diagmovekeys = tut_key("movesouthwest") .. " " ..
tut_key("movenortheast") .. " " ..
tut_key("movesoutheast") .. " " ..
tut_key("movenorthwest");
des.engraving({ coord = { 9,3 }, type = "engrave", text = "Move around with " .. movekeys, degrade = false });
des.engraving({ coord = { 5,2 }, type = "engrave", text = "Move diagonally with " .. diagmovekeys, degrade = false });
if (u.role == "Knight") then
des.engraving({ coord = { 12,1 }, type = "engrave", text = "Knights can jump with '" .. tut_key("jump") .. "'", degrade = false });
end
--
des.engraving({ coord = { 2,4 }, type = "engrave", text = "Some actions may require multiple tries before succeeding", degrade = false });
des.engraving({ coord = { 2,5 }, type = "engrave", text = "Open the door by moving into it", degrade = false });
des.door({ coord = { 2,6 }, state = "closed" });
des.engraving({ coord = { 2,7 }, type = "engrave", text = "Close the door with '" .. nh.eckey("close") .. "'", degrade = false });
des.engraving({ coord = { 2,7 }, type = "engrave", text = "Close the door with '" .. tut_key("close") .. "'", degrade = false });
--
@@ -69,14 +100,20 @@ des.trap({ type = "magic portal", coord = { 4,4 }, seen = true });
--
des.engraving({ coord = { 5,9 }, type = "engrave", text = "This door is locked. Kick it with '" .. nh.eckey("kick") .. "'", degrade = false });
des.engraving({ coord = { 5,9 }, type = "engrave", text = "This door is locked. Kick it with '" .. tut_key("kick") .. "'", degrade = false });
des.door({ coord = { 5,10 }, state = "locked" });
des.engraving({ coord = { 5,12 }, type = "engrave", text = "Look around the map with '" .. nh.eckey("glance") .. "'", degrade = false });
-- by default, kick is the first command that can be a ctrl-key combo
tut_key_help(6, 8);
des.engraving({ coord = { 5,12 }, type = "engrave", text = "Look around the map with '" .. tut_key("glance") .. "', press ESC when you're done", degrade = false });
--
des.engraving({ coord = { 10,13 }, type = "engrave", text = "Use '" .. nh.eckey("search") .. "' to search for secret doors", degrade = false });
des.engraving({ coord = { 10,13 }, type = "engrave", text = "Use '" .. tut_key("search") .. "' to search for secret doors", degrade = false });
des.engraving({ coord = { 10,15 }, type = "engrave", text = "Wrong secret", degrade = false });
--
@@ -96,21 +133,24 @@ for i = 1, 4 do
coord = locs[i], victim = false });
end
des.engraving({ coord = { 15,15 }, type = "engrave", text = "Some traps can be disabled with '" .. tut_key("untrap") .. "'", degrade = false });
des.trap({ coord = { 15,16 }, type = "web", spider_on_web = false });
--
des.door({ coord = { 18,13 }, state = "closed" });
des.engraving({ coord = { 19,13 }, type = "engrave", text = "Pick up items with '" .. nh.eckey("pickup") .. "'", degrade = false });
des.engraving({ coord = { 19,13 }, type = "engrave", text = "Pick up items with '" .. tut_key("pickup") .. "'", degrade = false });
local armor = (u.role == "Monk") and "leather gloves" or "leather armor";
des.object({ id = armor, spe = 0, buc = "cursed", coord = { 19,14} });
des.engraving({ coord = { 19,15 }, type = "engrave", text = "Wear armor with '" .. nh.eckey("wear") .. "'", degrade = false });
des.engraving({ coord = { 19,15 }, type = "engrave", text = "Wear armor with '" .. tut_key("wear") .. "'", degrade = false });
des.object({ id = "dagger", spe = 0, buc = "not-cursed", coord = { 21,15} });
des.engraving({ coord = { 21,14 }, type = "engrave", text = "Wield weapons with '" .. nh.eckey("wield") .. "'", degrade = false });
des.engraving({ coord = { 21,14 }, type = "engrave", text = "Wield weapons with '" .. tut_key("wield") .. "'", degrade = false });
des.engraving({ coord = { 22,13 }, type = "engrave", text = "Hit monsters by walking into them.", degrade = false });
@@ -131,13 +171,13 @@ des.object({ id = "boulder", coord = {25,12} });
--
des.engraving({ coord = { 27,9 }, type = "engrave", text = "Take off armor with '" .. nh.eckey("takeoff") .. "'", degrade = false });
des.engraving({ coord = { 27,9 }, type = "engrave", text = "Take off armor with '" .. tut_key("takeoff") .. "'", degrade = false });
--
des.object({ class = "?", id = "remove curse", buc = "blessed", coord = {23,11} })
des.engraving({ coord = { 22,11 }, type = "engrave", text = "Some items have shuffled descriptions, different each game", degrade = false });
des.engraving({ coord = { 23,11 }, type = "engrave", text = "Pick up this scroll, read it with '" .. nh.eckey("read") .. "', and try to remove the armor again", degrade = false });
des.engraving({ coord = { 23,11 }, type = "engrave", text = "Pick up this scroll, read it with '" .. tut_key("read") .. "', and try to remove the armor again", degrade = false });
--
@@ -157,14 +197,14 @@ des.object({ coord = {14, 6}, id = "boulder" });
des.door({ coord = { 20,3 }, state = percent(50) and "open" or "closed" });
des.engraving({ coord = { 21,3 }, type = "engrave", text = "Avoid being burdened, it slows you down", degrade = false });
des.engraving({ coord = { 22,3 }, type = "engrave", text = "Drop items with '" .. nh.eckey("drop") .. "'", degrade = false });
des.engraving({ coord = { 22,3 }, type = "engrave", text = "Drop items with '" .. tut_key("drop") .. "'", degrade = false });
des.engraving({ coord = { 22,4 }, type = "engrave", text = "You can drop partial stacks by prefixing the item slot letter with a number", degrade = false });
--
des.monster({ id = "yellow mold", coord = { 26,2 }, waiting = true, countbirth = false });
des.engraving({ coord = { 25,5 }, type = "engrave", text = "Throw items with '" .. nh.eckey("throw") .. "'", degrade = false });
des.engraving({ coord = { 25,5 }, type = "engrave", text = "Throw items with '" .. tut_key("throw") .. "'", degrade = false });
des.trap({ type = "magic portal", coord = { 21,1 }, seen = true });
@@ -176,35 +216,36 @@ des.engraving({ coord = { 37,4 }, type = "engrave", text = "Missiles, such as ro
des.object({ coord = { 37,3 }, id = "sling", buc = "not-cursed", spe = 9 });
des.engraving({ coord = { 37,3 }, type = "engrave", text = "Wield the sling", degrade = false });
des.engraving({ coord = { 36,1 }, type = "engrave", text = "Use '" .. nh.eckey("fire") .. "' to fire missiles with the wielded launcher", degrade = false });
des.engraving({ coord = { 36,1 }, type = "engrave", text = "Use '" .. tut_key("fire") .. "' to fire missiles with the wielded launcher", degrade = false });
des.engraving({ coord = { 35,4 }, type = "engrave", text = "Firing launches items from your quiver; Use '" .. nh.eckey("quiver") .. "' to put items in it", degrade = false });
des.engraving({ coord = { 35,4 }, type = "engrave", text = "Firing launches items from your quiver; Use '" .. tut_key("quiver") .. "' to put items in it", degrade = false });
des.engraving({ coord = { 33,4 }, type = "engrave", text = "You can wait a turn with '" .. nh.eckey("wait") .. "'", degrade = false });
des.engraving({ coord = { 33,4 }, type = "engrave", text = "You can wait a turn with '" .. tut_key("wait") .. "'", degrade = false });
--
des.door({ coord = { 38,6 }, state = "closed" });
des.engraving({ coord = { 39,6 }, type = "engrave", text = "You loot containers with '" .. nh.eckey("loot") .. "'", degrade = false });
des.engraving({ coord = { 39,6 }, type = "engrave", text = "You loot containers with '" .. tut_key("loot") .. "'", degrade = false });
des.object({ coord = { 42,6 }, id = "large box", broken = true,
des.object({ coord = { 41,6 }, id = "large box", broken = true, trapped = false,
contents = function(obj)
des.object({ id = "secret door detection", class = "/", spe = 30 }); end
});
des.engraving({ coord = { 42,6 }, type = "engrave", text = "Containers can also be emptied with '" .. tut_key("tip") .. "'", degrade = false });
des.engraving({ coord = { 45,6 }, type = "engrave", text = "Magic wands are used with '" .. nh.eckey("zap") .. "'", degrade = false });
des.engraving({ coord = { 45,6 }, type = "engrave", text = "Magic wands are used with '" .. tut_key("zap") .. "'", degrade = false });
--
des.door({ coord = { 35,9 }, state = "nodoor" });
des.engraving({ coord = { 34,9 }, type = "engrave", text = "You can run by prefixing a movement key with '" .. nh.eckey("run") .. "'", degrade = false });
des.engraving({ coord = { 34,9 }, type = "engrave", text = "You can run by prefixing a movement key with '" .. tut_key("run") .. "'", degrade = false });
--
des.door({ coord = { 33,16 }, state = "nodoor" });
des.engraving({ coord = { 35,15 }, type = "engrave", text = "Travel across the level with '" .. nh.eckey("travel") .. "'", degrade = false });
des.engraving({ coord = { 35,15 }, type = "engrave", text = "Travel across the level with '" .. tut_key("travel") .. "'", degrade = false });
--
@@ -212,23 +253,22 @@ des.trap({ type = "magic portal", coord = { 27,14 }, seen = true });
--
des.engraving({ coord = { 48,1 }, type = "burn", text = "Use '" .. nh.eckey("eat") .. "' to eat edible things", degrade = false });
des.engraving({ coord = { 48,1 }, type = "burn", text = "Use '" .. tut_key("eat") .. "' to eat edible things", degrade = false });
des.object({ coord = { 50,3 }, id = "apple", buc = "not-cursed" });
des.object({ coord = { 50,3 }, id = "candy bar", buc = "not-cursed" });
local otmp = des.object({ coord = { 50,3 }, id = "corpse", montype = "newt", buc = "not-cursed" });
otmp:stop_timer("rot-corpse");
des.object({ coord = { 50,3 }, id = "corpse", montype = "lichen", buc = "not-cursed" });
--
des.door({ coord = { 46,11 }, state = "closed" });
des.engraving({ coord = { 43,11 }, type = "burn", text = "Use '" .. nh.eckey("twoweapon") .. "' to use two weapons at once", degrade = false });
des.engraving({ coord = { 43,11 }, type = "burn", text = "Use '" .. tut_key("twoweapon") .. "' to use two weapons at once", degrade = false });
des.object({ coord = { 43,13 }, id = "knife", buc = "uncursed" });
des.object({ coord = { 43,14 }, id = "dagger", buc = "blessed" });
des.engraving({ coord = { 43,16 }, type = "burn", text = "Swap weapons quickly with '" .. nh.eckey("swap") .. "'", degrade = false });
des.engraving({ coord = { 43,16 }, type = "burn", text = "Swap weapons quickly with '" .. tut_key("swap") .. "'", degrade = false });
des.door({ coord = { 40,15 }, state = "random" });
@@ -236,24 +276,60 @@ des.door({ coord = { 40,15 }, state = "random" });
des.object({ coord = { 48,7 }, id = "ring of levitation", buc = "not-cursed" });
des.engraving({ coord = { 48,10 }, type = "burn", text = "Put on accessories with '" .. nh.eckey("puton") .. "'", degrade = false });
des.engraving({ coord = { 48,10 }, type = "burn", text = "Put on accessories with '" .. tut_key("puton") .. "'", degrade = false });
des.engraving({ coord = { 48,16 }, type = "burn", text = "Remove accessories with '" .. nh.eckey("remove") .. "'", degrade = false });
des.engraving({ coord = { 48,16 }, type = "burn", text = "Remove accessories with '" .. tut_key("remove") .. "'", degrade = false });
des.door({ coord = { 50,16 }, state = "closed" });
--
des.engraving({ coord = { 58,9 }, type = "burn", text = "Use '" .. nh.eckey("down") .. "' to go down the stairs", degrade = false });
des.engraving({ coord = { 58,9 }, type = "burn", text = "Use '" .. tut_key("down") .. "' to go down the stairs", degrade = false });
des.stair({ dir = "down", coord = { 58,10 } });
--
-- one more ctrl-key help, if needed
tut_key_help(64, 4);
des.engraving({ coord = { 65,3 }, type = "burn", text = "UNDER CONSTRUCTION", degrade = false });
des.trap({ type = "magic portal", coord = { 66,2 }, seen = true });
--
-- squeezing through small gaps
des.engraving({ coord = { 69,12 }, type = "burn", text = "Can't get through? You're carrying too much.", degrade = false });
-- try to squeeze over boulders, find a trap door
des.object({ id = "boulder", coord = {71,16} });
des.object({ id = "boulder", coord = {72,16} });
des.object({ id = "boulder", coord = {73,16} });
des.trap({ type = "trap door", coord = { 73,15 } });
--
des.engraving({ coord = { 60,2 }, type = "engrave", text = "Spellcasting", degrade = false });
if (u.uenmax < 5) then
-- TODO: make sure hero has enough Pw to cast the spell (5 pw) instead?
-- TODO: ensure the first cast of this spell succeeds?
des.engraving({ coord = { 59,2 }, type = "engrave", text = "Unfortunately you don't have enough energy to cast spells.", degrade = false });
end
des.engraving({ coord = { 57,2 }, type = "engrave", text = "Pick up the spellbook with '" .. tut_key("pickup") .. "'", degrade = false });
des.object({ coord = { 57,2 }, id = "spellbook of light", buc = "blessed" });
des.engraving({ coord = { 55,2 }, type = "engrave", text = "Read the spellbook with '" .. tut_key("read") .. "'", degrade = false });
des.engraving({ coord = { 53,2 }, type = "engrave", text = "Use '" .. tut_key("cast") .. "' to cast a spell", degrade = false });
des.region(selection.area(53,01, 59, 3), "unlit");
--
des.engraving({ coord = { 72,2 }, type = "engrave", text = "You \"quaff\" potions with '" .. tut_key("quaff") .. "'", degrade = false });
des.object({ coord = { 72,2 }, id = "potion of object detection", buc = "blessed" });
----------------
-- entering and leaving tutorial _branch_ now handled by core
+1
View File
@@ -30,6 +30,7 @@ Debug-Mode Quick Reference:
#wizloadlua == load and execute a lua script
#wizmakemap == recreate the current dungeon level
#wizmondiff == [Opt] check for discrepancies in monster difficulty ratings
#wizobjprobs == [Opt] list actual probabilities of item generation
#wizrumorcheck == validate rumor indexing; also show first, second, and last
random engravings, epitaphs, and hallucinatory monsters
#wizseenv == show map locations' seen vectors
+4 -3
View File
@@ -3,7 +3,6 @@
*.6 NHSUBST
*.7 NHSUBST
fixes* NHSUBST
*.txt NHSUBST
config.nh NHSUBST
Guidebook.txt NH_header=no
tmac.n NH_header=no
@@ -12,5 +11,7 @@ fixes* NH_header=no
*.txt NH_header=no
* NH_filestag=(file%s_for_all_versions)
Guidebook.tex NH_DATESUB
Guidebook.mn NH_DATESUB
*.6 NH_DATESUB
Guidebook.mn NH_DATESUB NHAUTODOCS
*.6 NH_DATESUB NHAUTODOCS
*.7 NH_DATESUB NHAUTODOCS
fixes* -NHAUTODOCS
+7 -1
View File
@@ -14,4 +14,10 @@ Guidebook.pdf
Guidebook.ps
Guidebook.dated.*
*.synctex.*
# files that might appear from "make fetch-docs"
dlb.pdf
makedefs.pdf
mn.pdf
mnh.pdf
nethack.pdf
recover.pdf
+230 -37
View File
@@ -1,4 +1,4 @@
.\" $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.574 $ $NHDT-Date: 1711040379 2024/03/21 16:59:39 $
.\" $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.614 $ $NHDT-Date: 1770881338 2026/02/11 23:28:58 $
.\"
.\" This is an excerpt from the 'roff' man page from the 'groff' package.
.\"+--
@@ -31,8 +31,21 @@
.lt 70n
.\}
.
.so tmac.nh \" extra macros which aren't in tmac.n
.if !\n(nH .so doc/tmac.nh
.\" Load extra macros that "tmac.n" doesn't define.
.de So
.ie \n(.g&(\n(.x=1)&(\n(.y>22) .soquiet \\$1
.el .so \\$1
..
.
.So tmac.nh
.if !\n(nH So doc/tmac.nh
.
.if !\n(nH \{\
.tm fatal error: cannot locate "tmac.nh" macro package
.ab
.\}
.
.rm So
.
.\" building Guidebook.txt doesn't have CR font available; groff 1.23 issues
.\" a warning each time any font can't be loaded; earlier versions silently
@@ -46,8 +59,8 @@
.ds vr NetHack 3.7.0
.ds f0 \*(vr
.ds f1 \" empty
.\"DO NOT REMOVE NH_DATESUB .ds f2 DATE(%B %-d, %Y)
.ds f2 September 13, 2024
.\"DO NOT REMOVE NH_DATESUB .ds f2 Date(%B %-d, %Y)
.ds f2 April 16, 2026
.
.\" A note on some special characters:
.\" \(lq = left double quote
@@ -131,7 +144,8 @@ will vary with your background and training:
.pg
\fIArcheologists\fP understand dungeons pretty well; this enables them
to move quickly and sneak up on the local nasties. They start equipped
with the tools for a proper scientific expedition.
with the tools for a proper scientific expedition, and are able to read
ancient languages.
.pg
\fIBarbarians\fP are warriors out of the hinterland, hardened to battle.
They begin their quests with naught but uncommon strength, a trusty hauberk,
@@ -1233,6 +1247,9 @@ Autocompletes.
Default key is \(oqM-A\(cq, and also \(oq\(haN\(cq if
.op number_pad
is on.
.lp ""
Preceding #annotate with the \(oqm\(cq prefix is the same as
#overview with the prefix.
.lp "#apply "
Apply (use) a tool such as a pick-axe, a key, or a lamp.
Default key is \(oqa\(cq.
@@ -1268,6 +1285,7 @@ Talk to someone.
Default key is \(oqM-c\(cq.
.lp "#chronicle"
Show a list of important game events.
Default key is \(oqv\(cq.
.lp "#close "
Close a door.
Default key is \(oqc\(cq.
@@ -1368,7 +1386,6 @@ option is On, clicking on the hero (or steed when mounted) will
execute this command.
.lp "#history "
Show long version and game history.
Default key is \(oqV\(cq.
.lp #inventory
Show your inventory.
Default key is \(oqi\(cq.
@@ -1740,6 +1757,18 @@ floor container menu.
.lp ""
Autocompletes.
Default key is \(oqM-T\(cq.
.lp "#toggle "
Toggle a boolean option on or off.
Requires a parameter in parenthesis, the name of the option to toggle.
The option must be settable in-game.
.lp ""
For example:
.sd
.ft CR
BIND=':toggle(price_quotes)
BIND=@:toggle(autopickup)
.ft
.ed
.lp "#travel "
Travel to a specific location on the map.
Default key is \(oq_\(cq. \" underscore
@@ -1809,7 +1838,7 @@ Default key is \(oqM-v\(cq.
.lp #versionshort
Show the program's version number, plus the date and time that the
running copy was built from sources (not the version's release date).
Default key is \(oqv\(cq.
Default key is \(oqV\(cq.
.lp "#vision "
Show vision array.
Autocompletes.
@@ -1909,6 +1938,7 @@ Wish for something.
Autocompletes.
Debug mode only.
Default key is \(oq\(haW\(cq.
Precede this command with the \(oq\f(CRm\fP\(cq prefix to show a wish history menu.
.lp "#wmode "
Show wall modes.
Autocompletes.
@@ -2581,6 +2611,56 @@ Sometimes the bless or curse state of objects is referred to as their
or \(lq\f(CRBUCX\fP\(rq for Blessed, Uncursed, Cursed, or unknown.
(The term \fIbeatitude\fP is occasionally used as well.)
.hn 2
Artifacts
.pg
Some objects have been imbued with special powers and are known as
\fBArtifacts\fP.
They have specific types (such as long sword or orcish dagger) and distinct
names such as \fIGiantslayer\fP or \fIGrimtooth\fP.
Artifact weapons typically do more damage than their ordinary counterparts.
Some do extra damage against all monsters, others only against specific
types of monsters so aren't better than regular weapons against other types.
Some confer defensive capabilities when wielded or have other powers that
aren't listed here.
.pg
You might find them simply lying on the floor, including but not limited
to inside shops, or be granted as a reward for \(lq#offer\(rq on an
altar to your patron deity.
A few might be dropped by monsters, or might be converted from an ordinary
object of the same type via assigning the right name.
.\" should we mention dipping for Excalibur here?
Or you might wish for them, if you happen to be granted a wish, but such
wishes can fail.
.pg
Some artifacts have a specific alignment, others don't.
You won't obtain aligned ones that have a different alignment from yours
via offering and might get a shock if you attempt to wish for any of those
or find one and attempt to use it.
.pg
Each role has a distinct artifact that is contained in the \fIQuest\fP
dungeon branch.
These are commonly known as quest artifacts.
All are aligned and most are non-weapons.
They won't be found randomly.
.pg
The \(oq\f(CR\\\fP\(cq and \(oq\f(CR\`a\fP\(cq commands will
list artifacts that you have fully identified (knowing the name and item
type isn't sufficient).
.hn 2
Relics
.pg
There are three unique items that are named and have limited special
powers but aren't classified as artifacts.
Each is guarded by a particular monster and you'll need to collect all
three for use late in the game.
.\" The relics are listed in the same order as the Oracle's message about
.\" them rather than in the order they need to be used for the invocation.
They are \fIthe Bell of Opening\fP,
\fIthe Book of the Dead\fP, and
\fIthe Candelabrum of Invocation\fP.
Their corresponding descriptions when not yet identified are
silver bell, papyrus spellbook, and candelabrum.
.hn 2
Weapons (\(oq)\(cq)
.pg
Given a chance, most monsters in the Mazes of Menace will gratuitously try to
@@ -2644,6 +2724,12 @@ Some of the more obscure weapons (such as the \fIaklys\fP,
\fIlucern hammer\fP, and \fIbec-de-corbin\fP) are defined in an
appendix to \fIUnearthed Arcana\fP, an AD&D supplement.
.pg
Some interfaces support the
.op weaponstatus
option.
When it is enabled, an extra status condition is displayed, describing
the currently wielded weapon.
.pg
The commands to use weapons are \(oqw\(cq (wield), \(oqt\(cq (throw),
\(oqf\(cq (fire), \(oqQ\(cq (quiver),
\(oqx\(cq (exchange), \(oqX\(cq (twoweapon), and \(lq#enhance\(rq
@@ -2876,6 +2962,12 @@ option can be set (prior to game start) to attempt to play the entire
game without wearing any armor (a self-imposed challenge which is
extremely difficult to accomplish).
.pg
Some interfaces support the
.op armorstatus
option.
When it is enabled, an extra status condition is displayed, summarizing
currently worn armor.
.pg
The commands to use armor are \(oqW\(cq (wear) and \(oqT\(cq (take off).
The \(oqA\(cq command can be used to take off armor as well as other
worn items.
@@ -2920,8 +3012,16 @@ magic spells on them).
.pg
One of the most useful of these is the \fIscroll of identify\fP, which
can be used to determine what another object is, whether it is cursed or
blessed, and how many uses it has left. Some objects of subtle
enchantment are difficult to identify without these.
blessed, and how many uses it has left.
Some objects of subtle enchantment are difficult to identify without these.
.pg
A scroll whose label is known can be read even when the hero is blind.
If a scroll has been discovered, it will be listed in inventory by type
rather than by label, but the label is known in that situation even though
it isn't shown.
.pg
Many scrolls produce a different effect from usual if they are blessed or
cursed, or read while the hero is confused.
.pg
A mail daemon may run up and deliver mail to you as a
\fIscroll of mail\fP (on versions compiled with this feature).
@@ -3314,6 +3414,14 @@ not penalized for being spoken to by an angry god, priest(ess), or
other religious figure; a true atheist would hear the words but
attach no special meaning to them.
.pg
A pauper starts the game with no possessions, no spells, and no weapon or
spell skills (and if playing as a knight, your pony will not have a saddle).
Can only be initiated by starting a new game with \f(CROPTIONS=pauper\fP
set in your run-time configurtion file or \f(CRNETHACKOPTIONS\fP environment
variable.
Once the game is underway, you can acquire and use items, spells, and skills
in the usual way.
.pg
Most players fight with a wielded weapon (or tool intended to be
wielded as a weapon). Another challenge is to win the game without
using such a wielded weapon. You are still permitted to throw,
@@ -3470,7 +3578,8 @@ the Castle level's drawbridge or can be given to you via prayer boon.
and \fIPauper\fP are also conducts, and they can only be
enabled by setting the correspondingly named option in NETHACKOPTIONS
or run-time configuration file prior to game start.
In the case of \fIBlind\fP and \fIDeaf\fP, the option also enforces the conduct.
In the case of \fIBlind\fP and \fIDeaf\fP, the option also enforces the
conduct.
They aren't really significant accomplishments unless/until you make
substantial progress into the dungeon.
.
@@ -3528,7 +3637,7 @@ is a section marker (the closing \(oq\f(CR]\fP\(cq can be followed
by whitespace and then an arbitrary comment beginning with \(oq\f(CR#\fP\(cq).
The text between the square brackets is the section name.
Section markers are only valid after a CHOOSE directive and their names
are case insensitive.
are case-insensitive.
Lines after a section marker belong to that section up until another
section starts or a marker without a name is encountered or the file ends.
Lines within sections are ignored unless a CHOOSE directive has selected
@@ -3637,7 +3746,7 @@ Otherwise the last section extends to the end of the options file.
Highlight menu lines with different colors.
See the \(lqConfiguring Menu Colors\(rq section.
.lp MSGTYPE
Change the way messages are shown in the top status line.
Change the way messages are shown in the top line.
See the \(lqConfiguring Message Types\(rq section.
.lp ROGUESYMBOLS
Custom symbols for the rogue level's symbol set.
@@ -3656,13 +3765,14 @@ See the \(lqModifying NetHack Symbols\(rq section.
Example:
.sd
\f(CR# replace small punctuation (tick marks) with digits\fP
\f(CRSYMBOLS=S_boulder:0,S_golem:7\fP
\f(CRSYMBOLS=S_golem:7\fP
.ed
.lp WIZKIT
Debug mode only: extra items to add to initial inventory.
Value is the name of a text file containing a list of item names,
one per line, up to a maximum of 128 lines.
Each line is processed by the function that handles wishing.
Entries are added to the wish history; see the wizwish-command.
.lp ""
Example:
.sd
@@ -3691,7 +3801,8 @@ OPTIONS=color # Display things in color if possible
OPTIONS=lit_corridor # Show lit corridors differently
OPTIONS=hilite_pet,hilite_pile
# Replace small punctuation (tick marks) with digits
SYMBOLS=S_boulder:0,S_golem:7
OPTIONS=boulder:0
SYMBOLS=S_golem:7
#
# No startup splash screen. Windows GUI only.
OPTIONS=!splash_screen
@@ -3780,9 +3891,25 @@ See
.op role
for a description of how to use negation to exclude choices.
.lp ""
Default is random.
If \f(CRalign\fP is not specified, there is no default value;
player will be prompted unless role and/or race forces a choice for alignment.
Cannot be set with the \(oq\f(CRO\fP\(cq command.
Persistent.
.lp armorstatus
Display an extra status condition which summarizes currently worn armor
(default off, not supported by all interfaces).
.lp ""
For the usual case where more than one piece of armor is worn, a list of
letters is shown in the following order:
.sd
\f(CRG\fP - gloves;
\f(CRC\fP - cloak;
\f(CRA\fP - suit;
\f(CRU\fP - shirt;
\f(CRH\fP - helmet;
\f(CRB\fP - boots;
\f(CRS\fP - shield.
.ed
.lp autodescribe
Automatically describe the terrain under cursor when asked to get a location
on the map (default true).
@@ -4006,7 +4133,8 @@ See
.op role
for a description of how to use negation to exclude choices.
.lp ""
Default is random.
If \f(CRgender\fP is not specified, there is no default value;
player will be prompted unless role and/or race forces a choice for gender.
Cannot be set with the \(oq\f(CRO\fP\(cq command.
Persistent.
.lp "goldX "
@@ -4161,8 +4289,38 @@ Default \(oq|\(cq.
Key to go to the next menu page.
Default \(oq>\(cq.
.lp menu_objsyms
Show object symbols in menu headings in menus where
the object symbols act as menu accelerators (default off).
." [originally menu_objsyms was a boolean]
." Show object symbols in menu headings in menus where
." the object symbols act as menu accelerators (default off).
Inventory and other object menus are normally separated by object class
(weapons, armor, and so forth), with a menu header line at the beginning
of each group.
You can have menus add the display symbol for the class of objects for
each header line.
You can also add the display symbol for the individual item in each menu
entry.
For a tiles map, that would be a small rendition of an object's tile.
For a text map, it is the same character as is used for the object's
class, which would be most useful when there are no headers separating
objects among classes.
Possible values are
.PS "5\ -\ One-or-other"
.PL "0\ -\ None"
no symbols for either header lines or menu entries;
.PL "1\ -\ Headers"
show symbols on header lines but not entries;
.PL "2\ -\ Entries"
show symbols on menu entry lines but not headers;
.PL "3\ -\ Both"
show symbols on headers and entries;
.PL "4\ -\ Conditional"
only show symbols for entries if there are no headers;
.PL "5\ -\ One-or-other"
show symbols on headers, or on entries if no headers.
.PE
Supported by tty and curses.
When setting the value, it can be specified by digit or keyword.
The default value is \f(CRConditional\fP (4).
.lp menu_overlay
Do not clear the screen before drawing menus, and align
menus to the right edge of the screen. Only for the tty port.
@@ -4246,6 +4404,11 @@ the role (that is, by suffixing one of
If
.op "\-@"
is used for the role, then a random one will be automatically chosen.
.lp ""
On some systems, the default is the player's user name;
on others, there is no default and the player will be prompted.
The former can made to behave like the latter by specifying a generic name
such as ``player''.
Cannot be set with the \(oq\f(CRO\fP\(cq command.
.lp "news "
Read the NetHack news file, if present (default on).
@@ -4364,6 +4527,10 @@ The positive (no \(oq!\(cq) and negative (with \(oq!\(cq) entries
can be intermixed.
.lp pauper
Start the character with no possessions (default false). Persistent.
.lp ""
Also start with no spells or skills, which are tied to starting equipment.
Does not inhibit acquiring and using items, spells, and skills once play
has started.
.lp perm_invent
If true, always display your current inventory in a window (default false).
.lp ""
@@ -4482,6 +4649,15 @@ user name (on multi-user systems) or specifying a particular character
name (on single-user systems) or it might be disabled entirely. Requesting
it when not allowed or not possible results in explore mode instead.
Default is normal play.
.lp price_quotes
Whenever the game mentions the name of an object you haven't identified yet,
it also mentions the range of buy and sell prices you have seen for that
item (to help narrow down what it could be).
The price shown is the unit price for one item (even when you are looking at
a stack of multiple items).
Many players may want to turn this on while identifying objects, and then
turn it back off again for general play.
Default is off.
.lp pushweapon
Using the \(oqw\(cq (wield) command when already wielding
something pushes the old item into your alternate weapon slot (default off).
@@ -4506,9 +4682,20 @@ See
.op role
for a description of how to use negation to exclude choices.
.lp ""
Default is random.
If \f(CRrace\fP is not specified, there is no default value;
player will be prompted unless role forces a choice for race.
Cannot be set with the \(oq\f(CRO\fP\(cq command.
Persistent.
.lp reroll
Allows rerolling your character's starting inventory and attributes (default
false). Persistent.
.lp ""
Note that rerolling your character is not a recommended way to play if aiming
merely to win (a lucky start has a much smaller influence on whether or not
you win the game than your actions later in the game). This option exists
partly as an acknowledgement that some players will insist on doing so anyway,
and partly because rerolling may be necessary for certain types of challenge
games.
.lp rest_on_space
Make the space bar a synonym for the \(oq.\(cq (#wait) command (default off).
Persistent.
@@ -4542,7 +4729,8 @@ option if they're all negations.
.\" Only one positive value is allowed, and if present, it overrides any
.\" negations.
.lp ""
Default is \f(CRrandom\fP.
If \f(CRrole\fP is not specified, there is no default value;
player will be prompted.
Cannot be set with the \(oq\f(CRO\fP\(cq command.
Persistent.
.lp roguesymset
@@ -4612,7 +4800,7 @@ or you are making screenshots or streaming video.
Using the
.op statuslines:3
option is recommended so that there will be more room available for
status information, unless you're using nethack's \fIQt\fP interface
status information, unless you're using NetHack's \fIQt\fP interface
or your terminal emulator window displays fewer than 25 lines.
Persistent.
.lp "silent "
@@ -4716,6 +4904,9 @@ and prior versions (for example \(lqsuppress_alert:3.3.1\(rq).
This option may be used to select one of the named symbol sets found within
\(lqsymbols\(rq to alter the symbols displayed on the screen.
Use \(lqsymset:default\(rq to explicitly select the default symbols.
.lp terrainstatus
Display an extra status condition describing the spot beneath the hero's
feet (default off, not supported by all interfaces).
.lp "time "
Show the elapsed game time in turns on bottom line (default off).
Persistent.
@@ -4752,6 +4943,16 @@ Play a tutorial level at the start of the game.
Setting this option on or off in the config file will skip the query.
.lp "verbose "
Provide more commentary during the game (default on). Persistent.
.lp weaponstatus
Display an extra status condition which describes currently wielded weapon
(default off, not supported by all interfaces).
.lp ""
Some possible displayed values are:
.sd
\f(CRbare-hnds\fP - no weapon and no gloves;
\f(CRempty-hnd\fP - no weapon but gloves are worn;
\f(CRdual-weps\fP - wielding two weapons.
.ed
.lp whatis_coord
When using the \(oq/\(cq or \(oq;\(cq commands to look around on the map with
.op autodescribe
@@ -5505,7 +5706,9 @@ change the color or appearance of fields in the status display.
.pg
The format for defining status colors is:
.SD n
\f(CROPTION=hilite_status:\fIfield-name\fP/\fIbehavior\fP/\fIcolor\fP&\fIattributes\fP\fP
.\" was "\f(CR...\fI...\fP\fP" but font changes don't nest so final \fP didn't
.\" restore the pre-\f(CR font; assume that was Roman and explicitly use \fR
\f(CROPTION=hilite_status:\fIfield-name\fP/\fIbehavior\fP/\fIcolor\fP&\fIattributes\fP\fR
.ED
.pg
For example, the following line in your configuration file will cause
@@ -6064,23 +6267,13 @@ escape command (!). The syntax is the same as WIZARDS.
EXPLORERS\ =\ A list of users who are allowed to use the explore mode.
The syntax is the same as WIZARDS.
.lp
MSGHANDLER\ =\ A path and filename of executable. Whenever a message-window
message is shown, NetHack runs this program. The program will get
the message as the only parameter.
.lp
MAXPLAYERS\ =\ Limit the maximum number of games that can be running
at the same time.
.lp
SAVEFORMAT\ =\ A list of up to two save file formats separated by space.
The first format in the list will written as well as read. The second format
will be read only if no save file in the first format exists.
Valid choices are \(lqhistorical\(rq for binary writing of entire structs,
\(lqlendian\(rq for binary writing of each field in little-endian order,
\(lqascii\(rq for writing the save file content in ascii text.
.lp
BONESFORMAT\ =\ A list of up to two bones file formats separated by space.
The first format in the list will written as well as read. The second format
will be read only if no bones files in the first format exist.
Valid choices are \(lqhistorical\(rq for binary writing of entire structs,
\(lqlendian\(rq for binary writing of each field in little-endian order,
\(lqascii\(rq for writing the bones file content in ascii text.
.lp
SUPPORT\ =\ A string explaining how to get local support (no default value).
.lp
RECOVER\ =\ A string explaining how to recover a game on this system
+2448 -2297
View File
File diff suppressed because it is too large Load Diff
+1971 -1773
View File
File diff suppressed because it is too large Load Diff
+17 -6
View File
@@ -1,7 +1,10 @@
# NetHack 3.7 config.nh $NHDT-Date: 1596498144 2020/08/03 23:42:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
# NetHack 3.7 config.nh $NHDT-Date: 1745978702 2025/04/29 18:05:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $
# Copyright (c) 2016 by Pasi Kallinen
# NetHack may be freely redistributed. See license for details.
# Sample config file for NetHack 3.7.0
#
# Sample run-time configuration file for NetHack 3.7.0
# usually named ".nethackrc" (note leading dot; location
# depends upon the type of system nethack is running on).
#
# A '#' at the beginning of a line means the rest of the line is a comment.
#
@@ -177,9 +180,17 @@
# Default is 'inverse'
#OPTIONS=menu_headings:inverse
# Show object symbols in menus in the item class lines where that object symbol
# acts as an accelerator key to select items of that class.
#OPTIONS=menu_objsyms
# Control of displaying object symbols in menus for picking objects:
# show symbols in individual menu entries only if there are no class separators
#OPTIONS=menu_objsyms:4
# show symbols on object class separator lines and also in individual entries
#OPTIONS=menu_objsyms:3
# show symbols in individual entries but not on class separators
#OPTIONS=menu_objsyms:2
# show object symbols on class separators but not in individual entries
#OPTIONS=menu_objsyms:1
# don't show symbols on class separators or in individual menu entries
#OPTIONS=menu_objsyms:0
# Do not clear the screen before drawing menus, and align menus to right
#OPTIONS=menu_overlay
@@ -487,7 +498,7 @@
# Show all unholy water in red
#MENUCOLOR=" unholy " = red
# Show all cursed worn items in orange and underlined
#MENUCOLOR=" cursed .* (being worn)" = orange&underline
#MENUCOLOR=" cursed .* \(being worn\)" = orange&underline
# Use the IBM character set rather than just plain ascii characters
+114 -66
View File
@@ -1,40 +1,73 @@
.\" $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.12 $ $NHDT-Date: 1693253316 2023/08/28 20:08:36 $
.\"DO NOT REMOVE NH_DATESUB .TH DLB 6 "DATE(%-d %B %Y)" NETHACK
.TH DLB 6 "8 February 2022" NETHACK
.\"DO NOT REMOVE NH_DATESUB .ds Nd DATE(%Y)
.ds Nd 2022
.\" $NHDT-Branch: master $:$NHDT-Revision: 1.14 $ $NHDT-Date: 1735103831 2024/12/25 00:17:11 $
.\"DO NOT REMOVE NH_DATESUB .TH DLB 6 "Date(%-d %B %Y)" Project(uc)
.TH DLB 6 "25 December 2024" NETHACK
.\"DO NOT REMOVE NH_DATESUB .ds Nd Date(%Y)
.ds Nd 2024
.de NB
.ds Nb \\$2
..
.de NR
.ds Nr \\$2
..
.NB $NHDT-Branch: NetHack-3.7 $
.NR $NHDT-Revision: 1.12 $
.NB $NHDT-Branch: keni-gitset $
.NR $NHDT-Revision: 1.13 $
.\" groff and AT&T-descended troffs use different hyphenation patterns.
.\" Don't hyphenate the last word on a page or column, or
.\" before/after last/first 2 characters of a word.
.ie \n(.g .hy 12
.el .hy 14
.ds Na Kenneth Lorber
.SH NAME
dlb \- NetHack data librarian
.SH SYNOPSIS
.B dlb
{
.B xct
}
[
.B vfIC
]
arguments...
[
.B files...
]
.SH DESCRIPTION
.\" We'd use `RB` with 7 arguments, but Unix troff man(7) has a limit of
.\" 6 arguments to its macros.
{\c
.BR c | t | x\c
}\c
.RB [ v ]\c
.RB [ C
.IR directory ]
.RI [ file ]
\&.\|.\|.
.PP
.B dlb
{\c
.BR c | t | x\c
}\c
.RB [ v ]\c
.B I
.IR list-file
.PP
.B dlb
{\c
.BR c | t | x\c
}\c
.RB [ v ]\c
.RB [ f
.IR archive-file-name ]
.RI [ file ]
\&.\|.\|.
.SH DESCRIPTION
.I Dlb
is a file archiving tool in the spirit (and tradition) of tar for
NetHack version 3.1 and higher. It is used to maintain the
archive files from which NetHack reads special level files and other
read-only information. Note that like tar the command and option
specifiers are specified as a continuous string and are followed
by any arguments required in the same order as the option specifiers.
is a file archiving tool in the spirit (and tradition) of
.IR tar (1)
for
.IR nethack (6)
version 3.1 and higher.
It is used to maintain the
archive files from which the game reads special level files and other
read-only information.
Note that like
.IR tar ,
the letters specifying the operation and options
are expressed as a continuous string.
Unlike
.IR tar ,
.I dlb
is configured with a default set of file names to process.
.ig
.PP
^?ALLDOCS
This facility is optional and may be excluded during NetHack
@@ -48,61 +81,76 @@ This facility is optional and was excluded from this NetHack
configuration.
^.
^.
.SH COMMANDS
The
.B x
command causes
.I dlb
to extract the contents of the archive into the current directory.
.PP
The
..
.SS Operations
.B c
command causes
causes
.I dlb
to create a new archive from files in the current directory.
.PP
The
.B t
command lists the files in the archive.
.SH OPTIONS AND ARGUMENTS
.DT
.ta \w'f archive\ \ \ 'u
v verbose output
.br
.sp 1
f archive specify the archive. Default if f not specified is
LIBFILE (usually the nhdat file in the playground).
.br
.sp 1
I lfile specify the file containing the list of files to
put in to or extract from the archive if no files are listed
on the command line. Default for archive creation if no files
are listed is LIBLISTFILE.
.br
.sp 1
C dir change directory. Changes directory before trying to
read any files (including the archive and the lfile).
.br
lists the files in the archive.
.PP
.B x
causes
.I dlb
to extract the contents of the archive into the current directory.
.SH OPTIONS
.TP 13n \" "I list-file" + 2n
.BI "C " dir
Change directory to
.I dir
before trying to
read any files.
.TP
.BI "f " archive
Read from or write to
.I archive
instead of LIBFILE
(usually the
.I nhdat
file in the playground).
.TP
.BI "I " list-file
Read from
.I list-file
the names of files to emplace within or extract from the archive.
The default for archive creation is LIBLISTFILE.
.TP
.B v
Operate verbosely.
.SH EXAMPLES
Create the default archive from the default file list:
.br
dlb c
.sp 1
List the contents of the archive 'foo':
.br
dlb tf foo
.SH AUTHOR
.RS
.EX
dlb c
.EE
.RE
.PP
List the contents of the archive
.IR foo :
.RS
.EX
dlb tf foo
.EE
.RE
.SH AUTHOR
Kenneth Lorber
.SH "SEE ALSO"
.PP
nethack(6), tar(1)
.IR nethack (6),
.IR tar (1)
.SH BUGS
.PP
Not a good tar emulation; - does not mean stdin or stdout.
.IP \(bu 2n
Not a good
.I tar
emulation;
.B -
does not mean stdin or stdout.
.IP \(bu
Should include an optional compression facility.
.IP \(bu
Not all read-only files for NetHack can be read out of an archive;
examining the source is the only way to know which files can be.
examining the source is the only way to know which files can be.
.SH COPYRIGHT
This file is Copyright (C) \*(Na, \*(Nd for version \*(Nb:\*(Nr.
NetHack may be freely redistributed. See license for details.
+39 -37
View File
@@ -1,4 +1,4 @@
DLB(6) DLB(6)
DLB(6) Games Manual DLB(6)
@@ -6,47 +6,47 @@ NAME
dlb - NetHack data librarian
SYNOPSIS
dlb { xct } [ vfIC ] arguments... [ files... ]
dlb {c|t|x}[v][C directory] [file] ...
dlb {c|t|x}[v]I list-file
dlb {c|t|x}[v][f archive-file-name] [file] ...
DESCRIPTION
Dlb is a file archiving tool in the spirit (and tradition) of tar for
NetHack version 3.1 and higher. It is used to maintain the archive
files from which NetHack reads special level files and other read-only
information. Note that like tar the command and option specifiers are
specified as a continuous string and are followed by any arguments
required in the same order as the option specifiers.
Dlb is a file archiving tool in the spirit (and tradition) of tar(1)
for nethack(6) version 3.1 and higher. It is used to maintain the
archive files from which the game reads special level files and other
read-only information. Note that like tar, the letters specifying the
operation and options are expressed as a continuous string. Unlike
tar, dlb is configured with a default set of file names to process.
This facility is optional and may be excluded during NetHack configura-
tion.
Operations
c causes dlb to create a new archive from files in the current direc-
tory.
COMMANDS
The x command causes dlb to extract the contents of the archive into
the current directory.
t lists the files in the archive.
The c command causes dlb to create a new archive from files in the cur-
rent directory.
x causes dlb to extract the contents of the archive into the current
directory.
The t command lists the files in the archive.
OPTIONS
C dir Change directory to dir before trying to read any files.
OPTIONS AND ARGUMENTS
v verbose output
f archive Read from or write to archive instead of LIBFILE (usually
the nhdat file in the playground).
f archive specify the archive. Default if f not specified is LIBFILE
(usually the nhdat file in the playground).
I list-file Read from list-file the names of files to emplace within
or extract from the archive. The default for archive cre-
ation is LIBLISTFILE.
I lfile specify the file containing the list of files to put in to
or extract from the archive if no files are listed on the command line.
Default for archive creation if no files are listed is LIBLISTFILE.
C dir change directory. Changes directory before trying to read
any files (including the archive and the lfile).
v Operate verbosely.
EXAMPLES
Create the default archive from the default file list:
dlb c
dlb c
List the contents of the archive 'foo':
dlb tf foo
List the contents of the archive foo:
dlb tf foo
AUTHOR
Kenneth Lorber
@@ -55,16 +55,18 @@ SEE ALSO
nethack(6), tar(1)
BUGS
Not a good tar emulation; - does not mean stdin or stdout. Should
include an optional compression facility. Not all read-only files for
NetHack can be read out of an archive; examining the source is the only
way to know which files can be.
o Not a good tar emulation; - does not mean stdin or stdout.
o Should include an optional compression facility.
o Not all read-only files for NetHack can be read out of an archive;
examining the source is the only way to know which files can be.
COPYRIGHT
This file is Copyright (C) Kenneth Lorber, 2022 for version
NetHack-3.7:1.12. NetHack may be freely redistributed. See license
for details.
This file is Copyright (C) Kenneth Lorber, 2024 for version keni-git-
set:1.13. NetHack may be freely redistributed. See license for de-
tails.
NETHACK 8 February 2022 DLB(6)
NETHACK 25 December 2024 DLB(6)
+30 -4
View File
@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.0 $ $NHDT-Date: 1676619775 2023/02/17 07:42:55 $
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.21 $ $NHDT-Date: 1683746783 2023/05/10 19:26:23 $
fixes36.7 contains a summary of changes made to 3.6.6 in order to
produce 3.6.7 as well as any post-release fixes in binaries.
@@ -40,6 +40,32 @@ none
Fixes to 3.6.7 Post-release Problems and other Post-release changes
-------------------------------------------------------------------
none
extend the fix for build failure w/ newer C library headers to macOS (pr #988)
Windows: fix range error detected by address sanitizer in plselInitDialog()
Windows: nethackw.exe was vertically spacing out menu items based on
the height of the tileset in use, even though the tiles in the
menu were drawn at the default height of 16 anyway; get rid of
the extraneous vertical spacing between the menu rows
hilite_pile can remain on the map after eating food off the floor
vms: update winprocs.h to ensure that CLR_MAX is defined; necessary for
compiling vmsmail.c which uses winprocs.h but not hack.h
curses: when #quitting, just before the high scores are about to be shown
status_window was NULL and dereferenced, so add checks (issue #1090)
unix: update Makefile.dat so that if parallel make is used, it will build
the data files "engrave", "epitaph", and "bogusmon" sequentially;
'makedefs -s' builds all three at once and doing parallel instances
of that can produce seemingly mysterious problems by stomping on
each other's results
fix the mingw32 build of NetHack 3.6.7 by updating sys/winnt/Makefile.gcc,
sys/winnt/winnt.c and sys/winnt/stubs.c
correct the Ixoth tile
makedefs can produce individual bogusmon, engrave and epitaph files
drinkfountain() fate 24 to curse objects could end up cursing objects
on the floor chain instead of the intended inventory object chain
proceed with showpaths option even if the sysconf file is missing
avoid memory leak in mk_artifact(); cherry-pick of 3cca4f27 from 3.7 WIP
avoid using col in Guidebook build, since some distros no longer include
it, particularly some that use musl libc
back-port some nroff macro updates for Guidebook
prevent a crash when using 'O' to interactively set a text match highlight
for hunger
+256 -27
View File
@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1484 $ $NHDT-Date: 1726862062 2024/09/20 19:54:22 $
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1649 $ $NHDT-Date: 1777000050 2026/04/23 19:07:30 $
General Fixes and Modified Features
-----------------------------------
@@ -121,7 +121,8 @@ tribute (Discworld snippets) typos, in book order rather than fix order:
quote, passage #6 first footnote, insert omitted "be", passage #7
last paragraph, "to" -> "be"
Men at Arms passage #1, italicize /for/, passage #2, insert omitted
word "had": 'it was /fate/ that _had_ let Edward'
word "had": 'it was /fate/ that _had_ let Edward', #9, fix name typo
"Noddy" -> "Nobby"
Interesting Times passage #1, italicize several words
Feet of Clay passage #1, second "does not need" -> "doesn't even need"
Hogfather passage #7 missing initial double quote for "Oh, just ...",
@@ -131,7 +132,8 @@ tribute (Discworld snippets) typos, in book order rather than fix order:
missing opening single quote on second sentence of Lord Downey's
line, passage #11 both in footnote: "genious" -> "genius",
"was, oddly enough, was one [...]" -> "was, oddly enough, one [...]"
The Fifth Elephant #1, italicize /always/, #9, "dublet" -> "doublet"
The Fifth Elephant #1, italicize /always/, #9, "dublet" -> "doublet",
#12, fix name typo, "Vines" -> "Vimes"
The Truth #1, italicize several words
Thief of Time #2, "gold starts" -> "gold stars"
A Hat Full of Sky passage #9 "though" -> "thought"
@@ -213,7 +215,7 @@ if riding or levitating, hero could apply bullwhip downward to pull up things
some monster code was checking whether pets or engulfers were eating green
slime by checking for green slime corpse instead of glob
change light radius of stack of candles to square root
could get redundate "mon hits other-mon" messages when mon wields an artifact
could get redundant "mon hits other-mon" messages when mon wields an artifact
failed untrap while mounted that moved hero onto the trap would leave steed
with stale coordinates, triggering warnings if 'sanity_check' is On
when digging a pit results in it being filled by adjacent pool or lava, any
@@ -528,7 +530,7 @@ innocuous items like scrolls or eucalyptus leaves did harm when falling on
hero's head after being thrown upward
fighter types who start out knowing all non-magic armor should not know
cornuthaum and dunce cap
prediscovered weapons adjustmens: only knights and samurai know polearms;
prediscovered weapons adjustments: only knights and samurai know polearms;
rangers know launchers (bows), ammo (arrows), and spears regardless
of their race/species; likewise, rogues know all daggers
if the move counter ever reaches 1000000000, end the game
@@ -713,7 +715,7 @@ selection of random engravings, epitaphs, and hallucinatory monster names had
follow longer than average lines are most likely to be chosen and
ones which follow shorter than average lines are least likely; use
same workaround as for rumors: pad the shortest lines; result isn't
uniforn distribution but is better (tradeoff vs size; see makedefs)
uniform distribution but is better (tradeoff vs size; see makedefs)
make selection of random rumors, engravings, epitaphs, and hallucinatory monst
names have uniform distribution by handling long lines specially
when filling a special room with monsters, if one that can come in groups got
@@ -835,7 +837,8 @@ if a lit potion of oil on the floor was launched by an explosion and it hit
it could trigger an "obj_is_local" panic when end of game cleanup
tried to extinguish it as a light source
place_object() validated coordinates after using them to index level.objects
killed rope golem may drop leashes and bullwhips
killed rope golem may drop leashes, bullwhips, and grappling hooks
killed leather golem may drop leather cloaks, and saddles
using magic portals stuns hero for a few turns
using level teleporters confuses hero without teleport control for a few turns
clear obj->bypass for buried objects [a giant on ice triggers a fire trap,
@@ -959,9 +962,11 @@ a hero on the quest home level who runs or travels past the quest leader and
gets tossed out of the quest for some reason would keep running on the
far side of the quest portal
allow rush/run over water if wearing discovered water walking boots
putting on water walking boots while underwater (maybe via magical breathing)
and rising to surface wasn't causing the boots to become discovered
flying pets wouldn't target underwater food but if they happened to fly over
such food they could and would eat it
praying on an altar with pet corpse on it can revive the pet
praying on an altar with pet corpse or statue on it can revive the pet
applying a cursed oil lamp can make your hands slippery
valkyries start with a spear instead of a long sword
grid bugs don't have hands
@@ -987,7 +992,7 @@ bigroom variant 3 may have some walls replaced with other terrain
bigroom variant 4 may have two large squares of terrain in the middle
bigroom variant 5 may have patches of ice or clouds
some large monsters can knock back smaller monsters with a hit
change Demonbane to a mace, make it the first sac gift for priests,
change Demonbane to a silver mace, make it the first sac gift for priests,
and give it an invoke ability to banish demons
wielding Giantslayer prevents knockback from larger monsters; likewise for
carried loadstone(s)
@@ -1233,11 +1238,11 @@ restore the ability for trap creation via magic which creates pits to destroy
allow #sit while flying over a squeaky board trap to trigger it
weight of statues of wraiths and of monsters which never leave a corpse was 0
when a werecreature in human form attacked hero, it could transform to critter
despite hero having the Protection_from_shape_changers_attibute
despite hero having the Protection_from_shape_changers_attribute
status highlighting for hit points didn't work as intended for up or down HP
changes; 'up' rule was used for both, 'down' rule was ignored
unhide an unseen water monster using a polymorph trap on land
allow defining random-teleport exclusion zones in lua
allow defining random-teleport or monster-generation exclusion zones in lua
if Magicbane cancelled a shapeshifter, forcing it to 'unshift', subsequent
messages continued to refer to the shifted form
a pet that was poison resistant but not stoning resistant would eat Medusa's
@@ -1473,6 +1478,130 @@ interactively setting a status highlight for hunger with 'O' and choosing
use C++ regex processing but not for tty+posixregex
a pet with the hides-under attribute could "move reluctantly over" a cursed
object and then hide under it
prevent monster generation in the sokoban trap hallway
change MSGHANDLER from compile-time to sysconf option
allow changing extended command autocompletions via #optionsfull
if eating a tin's contents caused the hero to choke to death or turn to stone,
resulting bones would contain the tin still intact
when hero who is poly'd into metallivore form eats a tin, bypass "smells like
<monster>" feedback and the "Eat it?" prompt; just eat the contents
along with the tin without asking
digging in ice was handled inconsistently, particularly if done at the span
spot in front of closed drawbridge
angry god may remove an intrinsic
gelatinous cubes eat organic objects inside them
pets with reflection were unwilling to attack floating eyes
artifact gifts are rebalanced (easier to obtain; higher-value sacrifices are
needed for higher-value artifacts; lower-value artifacts are usually
gifted enchanted; unaligned artifacts are possible but rare even on
the first gift; artifacts you can't use well are less likely)
luck gains from sacrificing are limited by the value of the sacrifice
failed #untrap could move hero diagonally into or out of an open doorway
remember box is trapped after finding the trap
when you hear a monster incant a scroll, ensure that the 'I' invisible
monster indicator doesn't trump telepathy briefly
proceed with showpaths option even if the sysconf file is missing
angry shopkeeper was not charging for thrown items
avoid "You fall down a deep shaft!" if deliberately flying down
since introduction in 3.1.0, the definition for Mitre of Holiness has specified
that carrying it provides fire resistance, but that had never been
implemented; wearing it didn't confer fire resistance either--there is
no 'defends' capability for it since carrying should encompass that
if a tree and a boulder or statue were at the same location, applying an axe
would break the boulder or statue rather than chop the tree
avoid premapping outside Sokoban map to prevent showing stone glyphs
Grimtooth is permanently poisoned, protects from poison, and can fling poison
invoke cost for Grimtooth and Sunsword can be paid with magic power
cursed magic whistle can teleport you to your pet
Fire and Frost Brand can be invoked for expert level fireball or cone of cold
wielding Trollsbane grants hungerless regeneration
hitting with Ogresmasher gives a higher chance of knockback
Snickersnee can hit at a distance once per turn for free
the engraving pristine text field was not being appropriately populated during
level creation
worn alchemy smock reduces chances of dipped potions exploding
dwarves can sense buried items under their feet
monsters trapped in pits cannot kick
create familiar spell can create harder creatures
a vampire lord could choose to take on wolf form while flying over water or
lava, then revert to vampire lord form and teleport unnecessarily
a gas spore that was killed when an engulfer swallowed it produced an explosion
on the map rather than inside the engulfer
hallucination can display objects on the map that have a description (for
shuffling into play at game start) but no name; examining those might
trigger a crash
some food and paper items do no damage when bashing
improved messages for oilskin sacks protecting from water damage
some messages by amorous demons and mail daemon were delivered as verbal ones
even when the hero is deaf
travel couldn't find the vibrating square if it was covered by an object or
a monster; it isn't really a trap so treat it as special terrain
travel would stop one step in front of known vibrating square like other traps
fix bug which delayed burden changes due to monster actions (e.g. reverting to
natural form due to damage, changing carry capacity) for one turn
on arboreal levels (Ranger quest) where STONE terrain is treated as TREE, an
object at a tree location would be described as "embedded in stone"
an item at an ordinary tree location, whether the level is arboreal or not,
would be described as itself with no mention of the tree
some types of shopkeeper now start with a scroll of charging
objects are now accurately tracked as discovered even if not type-named nor
formally identified (fixing some bugs in scroll writing, and making
the discoveries list more accurate)
you cannot sacrifice objects/corpses while stunned or confused
'whatis' actions // and /? didn't work when the lootabc option was on, they
required /a and /c instead; add '/' and '?' as group accelerators so
that they work; /y and /n for them now only work when lootabc is off
writing on an unidentified scroll of blank paper identifies blank paper
dumplogs include spells and skills
praying will not restore monster-form HP while polymorphed, unless you
have unchanging
winter wolf cub was missing for monster to lycanthrope conversion
monster elves shooting arrows weren't getting intended small to-hit and damage
bonuses
luck has a reduced effect on to-hit chance
monsters use wand of teleportation to move hero away from item pile
lycanthrope instincts keep hero from changing shape while next to hostiles
scroll of enchant armor formula has changed (in particular, magical armor now
gains less enchantment when enchanted than nonmagical armor and
uncursed scrolls can sometimes enchant by more than one point)
dragonhide can rot
throwing ammo without a launcher produces a message
polymorphing into a large polyform unequips rather than destroying cloaks
clarify in the #quit message that it doesn't save the game
cursed potion of invisibility removes intrinsic invisibility
fix bug which caused engulf damage from air elementals and fog clouds to
ignore damage reduction from armor class
elementals do double damage on their home plane
water elementals move slightly more slowly
the "totally digested" instadeath timer is much faster
slow monster effects are more effective against faster enemies
light-spell is clerical, if playing a priest
boomerang can hit multiple monsters
the "bustling town" minetown has more peacefuls
healers may get tiny damage increase when attacking with knives
allow rogues to also backstab sleeping or paralyzed monsters
rogues cannot backstab monsters that have no backside
give experience if opening Schroedinger's Box causes death of the cat inside
priest donation amounts are explicitly stated, randomized slightly, based on
peak rather than current level, and allow for bulk donations (buying
larger amounts of clairvoyance/protection) if you have a lot of gold
amulet of magical breathing increases power regeneration
change some command keys, 'v' is now chronicle, 'V' is versionshort,
m-prefix 'V' is longer version, remove key binding of #history
one orc-town shaman has a higher level, affecting spellcasting
hero has a small chance of catching items thrown at them
wizard mode: history menu for #wizwish and WIZKIT
monster priests and wizards did not cast spells
prevent phaseable monsters hiding deep inside nondiggable walls
blessed potion of see invisible does not guarantee the intrinsic
prevent selecting all options in #optionsfull menu
shapeshifters change shape less
rolling boulder traps aren't removed when stepped on and move boulders
pushed onto them
when starting a new game as a monk, newsym(0,0) was being called (adjabil ->
postadjabil -> see_monsters when initializing See_invisible as hero
became level 1; seen 'monster' was the hero who hadn't been placed
on the map yet)
Fixes to 3.7.0-x General Problems Exposed Via git Repository
@@ -1800,7 +1929,7 @@ after the fix for zombie reviving near hero (which now interrupts hero's
occupation), could get "revive panic" when eating a troll corpse if
it revived on the same turn that eating the corpse would finish
a wizard's starting equipment was supposed to include a random spellbook of
spell level 1 through 3 but it was being foced to be level 1
spell level 1 through 3 but it was being forced to be level 1
earlier fix for prices of unpaid objects going away in persistent inventory
display when hero bought something during itemized billing didn't work
if paying for a used-up shop item--prices of any unpaid items vanished
@@ -1890,7 +2019,7 @@ don't blame/credit hero for stinking cloud if dying quest nemesis releases one
Lua selection operations 'subtract' and 'xor' didn't always work as intended
accept 'true' or 'false' as value for des.object field 'trapped'
special level loader didn't check for bad coordinates supplied by <level>.lua
file thorougnly enough
file thoroughly enough
hero might not be credited with "entered Mine Town" achievement for the town
variations which treat the whole level as the town if that level gets
entered via falling or level teleport
@@ -2014,7 +2143,7 @@ restoring a save file could trigger impossible "rnd(0) attempted" if it tried
a released version, it would crash due to divide by 0 error instead
fix regression of a post-3.6 fix: if 2 Wizards of Yendor were in play and 1
escaped the dungeon, bookkeeping for current number of Wizards stayed
at 2, interferring with future Wizard behavior
at 2, interfering with future Wizard behavior
sometimes a repeat count from the preceding command carried over to most
recent one when using do-again (^A); if the most recent one was an
extended command, the spurious repeat was for '#'
@@ -2051,6 +2180,59 @@ non-fireproof water walking boots wouldn't be burnt up if fire resistant hero
at wall locations
if a pile of objects had plain arrow(s) on top, map location classification
got confused and reported 'unexplored area'
when the 'fireassist' option was on, 'f' would choose uquiver over wielded
throw-and-return uwep
knockback could move hero diagonally into or out of an open doorway
farlook of /e or /E stopped reporting engraving and headstone text after a fix
for the situation where // or ; reported such text when there was an
object or monster in the way
message was garbled when lightning or acid breath hit iron bars
shop bug: buying a container with unpaid items in it could produce impossible
"unpaid_cost: object not on any bill" warnings
when walking into/against a locked closed door, 'autounlock'==kick didn't
execute kick when player answered yes to "Door is locked. Kick it?"
having a 1% chance of creating rideable monsters with worn saddle gave knights
a 1% chance of creating an extra saddle for starting pony; it wasn't
tracked with other objects so produced a trivial memory leak
when attacking a displacer beast, using the 'F' forcefight prefix prevented it
from swapping places with the hero
successfully disarming a chest trap was clearing the chest's 'tknown' bit
instead of setting it; likewise when failing to disarm triggered and
used up the trap
when game ended with 'force_invmenu' On, final disclosure of inventory would
contain spurious menu entry "? - (list likely candidates)"
avoid reporting "a gold pieces appears next to you" for mimic
don't try to split a pudding that got jousted into a hole and is off the map
mounted hero was able to deliver joust hits when trapped
timer sanity check for melting ice gave false complaint about non-ice for
frozen moat under open drawbridge
mhitm_ad_phys() was not applying Half_physical_damage when hero was target
callers of thitu() were not applying Half_physical_damage either
throwing crystal plate mail or helm of brilliance up against the ceiling could
result in the item being cracked and then vanishing
yn_function (used all over the place) sometimes triggered an impossible()
during do-again (^A) processing [ongoing revisions; more are probably
needed; listed here in case ^A behavior changes]
uncursed genocide while hallucinating deliberately mis-reports hero's role as
target but was also inappropriately showing it to livelog/#chronicle
livelog/#chronicle for bribing a demon lord reported random monster and
currency if hero was hallucinating
livelog/#chronicle for saving-grace: if saving-grace prevents hero's death,
report it [at present, it uses the livelog classification for breaking
a conduct]
naming a type of item, unnaming it (with name of <space>), naming it again
(new name or re-use of old one), then unnaming it again would issue
impossible: "named object not in disco"
throwing entire quiver and then picking the stack back up was not putting it
back into quiver
when reading a T-shirt or apron, add trailing period to the slogan unless
already present in the quoted text
when reading an engraving, suppress the addition of a trailing period if the
text already has one
cursed magic whistle could teleport hero on no-teleport levels
give a brief explanation when receiving a wish for acquiring the Amulet
teleportation traps no longer teleport you on levels made temporarily
no-teleport by the presence of a monster
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository
@@ -2108,6 +2290,7 @@ Qt: with a pick-one menu containing a pre-selected entry, clicking on that
instead of typing the selector letter toggled off preselected entry
but failed to toggle on the explicitly selected one; clicking again
after nothing was pre-selected anymore refused to toggle anything on
Qt: don't show main window and tombstone window maximized by default
tty: redraw unexplored locations as S_unexplored rather than <space> after
map has been partially overwritten by popup menu or text display
tty: previous change resulted in remnants of previous level being shown on
@@ -2161,6 +2344,9 @@ X11: when trying to lookup scrollbars in order to handle scrolling via keys,
X11: enable horizontal scrollbar for persistent inventory window
X11: if a group accelerator matched a menu command ('^' in menu for '/')
it wouldn't work to select, just to manipulate the menu
X11: ascii_map could try to use a color value, with some added flag bits set,
as an index into the color_gcs[] and inv_color_gcs[] arrays leading
to a segfault; clear the flag bits before using the color as an index
X11+macOS: after the "bad Atom" fix (below), the persistent inventory window
crept downward every time it got updated
@@ -2204,7 +2390,7 @@ curses: if user's terminal was set to 'application keypad mode' (DEC VTxxx
"ESC SPC G"), nethack wasn't recognizing number pad keys
curses: change petattr attributes, dropping support for curses-only ones
curses: swap the grey and no-color color initialization
curses: allow changing default colors with the 'palette' config option
curses+tty+Qt: allow changing default colors with the 'palette' config option
(only if compiled with CHANGE_COLOR)
curses: if messages have been issued during start-up (for instance, warnings
about issues in run-time config file), prompt user to press <return>
@@ -2375,7 +2561,12 @@ tty: add support for petattr
tty: if a ^C interrupt occurred while DECgraphics characters were being drawn
on the map, the "Really quit?" prompt would be illegible due to being
rendered with VT line drawing characters
tty: hide cursor unless waiting for user input
tty: hide cursor unless waiting for user input; now extended to include tty
platforms that define NO_TERMS, rather than just on those using
termcap/terminfo, namely Windows console and msdos (text-mode
implemented; vga and vesa just have stubs currently)
tty+curses: if terminal goes away while in the wishing prompt, return to the
wish prompt when game is restored
Unix: when user name is used as default character name, keep hyphenated value
intact instead stripping off dash and whatever follows as if that
specified role/race/&c (worked once upon a time; broken since 3.3.0)
@@ -2387,6 +2578,10 @@ Unix: re-do command line parsing
Unix: add ../include/nhlua.h to the alloc.o dependencies in Makefile.utl to
match Makefile.src
Unix: implement SELF_RECOVER compile-time option, on by default on linux
Unix: allow build to succeed with musl (instead of glibc), by specifying
musl=1 on the make command line
Unix: support tilde expansion for home directory path, "~/relative-path", in
command line --nethackrc=path and environment NETHACKOPTIONS=@path
user_sounds: move the message hook from inside individual window display ports
to the core where it allows MSGTYP_NOSHOW msgtyp's to still trigger
sounds to correct a reported github issue; also fixes a past reported
@@ -2490,6 +2685,8 @@ item-using monsters will zap wand of undead turning at corpse-wielding hero
when the corpse is harmful
boiling a pool or fountain now creates a temporary cloud of steam
random themed rooms in the dungeons of doom
environment variables THEMERM and THEMERMFILL can be used in wizard mode to
provide some control over theme room generation
extended achievement and conduct fields for xlogfile
record amount of gold in hero's possession in xlogfile
new objects: amulets of flying and guarding, helm of caution,
@@ -2566,7 +2763,7 @@ menu for what-is command supports /^ and /" to view a list of nearby or whole
level visible and remembered traps
spiders will occasionally spin webs when moving around
drinking a burning potion of oil will cure being turned into slime
new bigroom variant, a boulder maze
new bigroom variants, a boulder maze, hexagons, pillars
vomiting on an altar provokes the deities wrath
branch stairs have a different glyph, show up in yellow color in tty
duration of confusion when drinking booze depends upon hunger state
@@ -2704,12 +2901,36 @@ wand of secret door detection, spell of detect unseen, and wizard mode ^E now
flash the cursor at each location where detection finds something
saving-grace: once per game if receiving a killing blow from full or nearly
full HP, survive with 1 HP
livelog/#chronicle for saving-grace: if saving-grace prevents hero's death,
report it [at present, it uses the livelog classification for breaking
a conduct]
enlightenment/attribute disclosure for saving-grace: include a line for have
or haven't been saved (game in progress) or did or didn't get saved
(game over) via saving-grace
'selectsaved' lists "name-role-race-gend-algn" instead of just "name" in the
menu of save files available to be restored
'selectsaved' prefixes "name-role-race-gend-algn" with "- " for normal play,
"X " for explore mode, or "D " for debug mode if any of the games
shown in its menu weren't saved during normal play; if they're all
normal play, the prefix is suppressed
tourists gain experience by "taking photos" of new creatures, and
going to new dungeon levels
healers gain experience by healing pets
blessed scroll of destroy armor asks which armor to destroy if wearing more
than one armor; otherwise it'll destroy a cursed armor, or erodes
random armor
archeologists' fedora is lucky
telepathic hero can discern which particular monster just read a scroll
add "make fetch-docs" to download pre-formatted documentation
monsters will use throw-and-return weapons such as an aklys
archeologists can identify scrolls by deciphering their labels
monster destroy armor -spell first erodes armor
iron footwear protects the wearer against certain floor-based traps
ring of stealth prevents hero from leaving tracks
the game now automatically tracks which sell prices and buy prices you have
seen for each type of item; these are visible in the discoveries list,
and can also be shown elsewhere using the new 'price_quotes' option
new shields: shield of shock resistance, shield of drain resistance
new wand: wand of stasis
early-game monsters always miss with their first use of an attack wand
new command #toggle which can be used to toggle a boolean option
Platform- and/or Interface-Specific New Features
@@ -2768,7 +2989,7 @@ Unix: support --nethackrc=filename on the command line; same effect as
NETHACKOPTIONS='@filename' but leaves NETHACKOPTIONS available for
specifying options; --no-nethackrc is same as --nethackrc=/dev/null
Windows: implement MSGHANDLER (pr #749 by argrath)
Windows: Add configuration to support Curses on WinGUI (pr #1028 by chasonr)
Windows: Add configuration to support Curses on WinGUI (pr #1028 by chasonr)
X11: implement 'selectsaved', restore via menu of saved games
X11: echo getline prompt and response (wishes, applying names) to message
window and dumplog message history
@@ -2806,7 +3027,7 @@ always print a message when the hero teleports (pr #265 by copperwater)
always print a message when the hero level teleports (pr #265 by copperwater)
remove Sokoban luck penalties for actions you can't cheat with (pr #260 by
copperwater)
sounds for minotaurs (pr #298 by NullCGT)
sounds for minotaurs (pr #298 by Kestrel Gregorich-Trevor)
correct the Guidebook descriptions for msdos video_width and video_height to
state that they work with video:vesa; the video:vga setting that was
described there forces the 640x480x16 mode where video_width and
@@ -2820,7 +3041,7 @@ allow themed rooms constrained by level difficulty (pr #344 by copperwater)
add a varied form of LIBNH nethack library contribution (pr #385, #403
by apowers313)
add cross-compile to WASM (pr #385, #403, #412 by apowers313)
differentiating gendered monster tiles (pr #430 by NullCGT)
differentiating gendered monster tiles (pr #430 by Kestrel Gregorich-Trevor)
check bones data directly for deja vu messages (pr #374 by entrez)
unify code for extracting an object from a monster's inventory (pr #455 by
copperwater)
@@ -2847,9 +3068,8 @@ use %lu, not %d, in format string in timer_sanity_check() (pr #617 by argrath)
bad cast making sp_lev chameleon light source (pr #625 by entrez)
add Ray Chason's adaptation of nethack's Qt5 interface to work with Qt6 (issue
#525 followup comment by chasonr)
mingw32 build updates and replacement of sys/windows/Makefile.gcc with new
sys/windows/Makefile.mingw32 and sys/windows/Makefile.mingw32.depend
(pr #661 by feiyunw)
mingw32 build updates to replace contents of sys/windows/GNUmakefile and new
sys/windows/GNUmakefile.depend (pr #661 by feiyunw)
mark various pointers to const char as const pointers (pr #624 by argrath)
function fill_special_room() in sp_lev.c was dereferencing a pointer
argument prior to a subsequent check for a NULL pointer that
@@ -2906,6 +3126,16 @@ split "cannot_push" on moverock_done() into a separate function (pr #1282
by argrath)
split making pits on do_earthquake() into a separate function and
eliminate some gotos on do_earthquake() (pr #1287 by argrath)
update the WASM cross-compile to work with the current
code (pr #1331 by guillaumebrunerie)
add silver maces (pr #1405 by disperse)
applied several source comment spelling or grammar fixes that were linked
to an old rec.games.roguelike.nethack post from May 2006
by Arthur J. O'Dwyer
modernize code of LaTeX Guidebook (pr #1473 by Daniel Clow)
restore ability for a characteristic also resets exercise/abuse for that
characteristic (pr #1403 by greg-kennedy)
cross-compilation for the Amiga on Linux (pr #1494 by ingpaschke)
Code Cleanup and Reorganization
@@ -3039,4 +3269,3 @@ relocate general-purpose function choose_classes_menu(), from
options.c to windows.c
remove register from variable declarations
make glyph_to_cmap() a function instead of a macro
-1
View File
@@ -14,7 +14,6 @@ Platform- and/or Interface-Specific Fixes
General New Features
--------------------
Conway's Life bigroom variant
Platform- and/or Interface-Specific New Features
+71 -8
View File
@@ -61,6 +61,7 @@ Set debugging flags.
| mongen | boolean | Do monsters generate
| hunger | boolean | Does hero's hunger-state increase
| overwrite_stairs | boolean | Allow special-file commands overwrite the stairs
| prevent_pline | boolean | Prevent messages going out to the UI
|===
Example:
@@ -120,6 +121,15 @@ Example:
local k = nh.eckey("help");
=== flip_level
Flip the level horizontally or vertically.
Example:
nh.flip_level(1);
=== getlin
Asks the player for a text to enter, and returns the entered string.
@@ -201,6 +211,7 @@ Returns a table with the following elements:
| ttyp_name | text | name of trap type
| tseen | boolean | trap seen by you?
| madeby_u | boolean | trap made by you?
| once | boolean | trap is deleted once triggered
| tnote | integer | note of a squeaky board trap
| launchx, launchy, launch2x, launch2y | integer | coordinates of a boulder for a rolling boulder trap
| conjoined | integer | encoded directions for a [spiked] pit.
@@ -249,6 +260,35 @@ Example:
local str = nh.ing_suffix("foo");
=== int_to_objname
Convert integer value to object name and class.
Returns two strings, the object base name and the class character.
The returned strings may be empty if an error occurred.
Example:
local oname, oclass = nh.int_to_objname(45);
=== int_to_pmname
Convert integer value to monster type name.
Example:
local pmname = nh.int_to_pmname(12);
=== is_genocided
Is specific monster type genocided? Returns a boolean value.
Example:
local x = nh.is_genocided("vampire");
=== level_difficulty
Returns an integer value describing the level difficulty.
@@ -531,9 +571,10 @@ Example:
=== exclusion
Exclude an area of the map from being randomly chosen target when
falling or teleporting into the level. Multiple exclusions per level are allowed.
falling or teleporting into the level, or creating a monster.
Multiple exclusions per level are allowed.
* type is one of "teleport", "teleport-up", or "teleport-down".
* type is one of "teleport", "teleport-up", "teleport-down", or "monster-generation".
Example:
@@ -778,13 +819,15 @@ The hash parameter accepts the following keys:
| stunned | boolean |
| confused | boolean |
| waiting | boolean | monster will wait until hero gets next to it
| m_lev_adj | integer | monster's level adjustment
| tail | boolean | generate worm without a tail?
| group | boolean | generate a group of monsters?
| adjacentok | boolean | is adjacent location ok, if given one is not suitable?
| ignorewater | boolean | ignore water when choosing location for the monster
| countbirth | boolean | do we count this monster as generated
| appear_as | string | monster can appear as object, monster, or terrain. Add "obj:", "mon:", or "ter:" prefix to the value. |
| inventory | function | objects generated in the function are given to the monster
| appear_as | string | monster can appear as object, monster, or terrain. Add "obj:", "mon:", or "ter:" prefix to the value.
| inventory | function | objects generated in the function are given to the monster (any random inventory it gets is discarded unless keep_default_invent is true)
| keep_default_invent | boolean | if inventory is specified and this is true, those items are in addition to random inventory for this species; if inventory is not specified and this is false, monster gets no starting inventory
|===
Example:
@@ -820,7 +863,7 @@ Example:
=== object
Create an object. Returns the object as an <<Obj>> class.
Create an object and place it somewhere on the map. Returns the object as an <<Obj>> class.
The table parameter accepts the following:
[options="header"]
@@ -839,12 +882,13 @@ The table parameter accepts the following:
| eroded | int | Object erosion
| locked | boolean | Is the object locked?
| trapped | boolean | Is the object trapped?
| trap_known | boolean | If container is trapped, is it obvious?
| recharged | boolean | Is the object recharged?
| greased | boolean | Is the object greased?
| broken | boolean | Is the object broken?
| achievement | boolean | Is there an achievement attached to the object?
| x, y | int | Coordinates on the level
| coord | table | x,y coordinates in table format
| x, y | int | Coordinates on the level; defaults to a random location.
| coord | table | x,y coordinates in table format; defaults to a random location.
| montype | string | Monster id or class
| historic | boolean | Is statue historic?
| male | boolean | Is statue male?
@@ -1123,6 +1167,16 @@ Example:
local sel2 = selection.clone(sel);
=== describe_size
Return a text describing the size of the selection.
Example:
local sel = selection.fillrect(1,1, 3,3);
local txt = sel:describe_size();
=== ellipse
Example:
@@ -1307,6 +1361,8 @@ Example:
=== room
Create a selection of locations inside the (current) room.
Does not include the edges of the room, such as its walls.
Does not do any check on terrain type, so if there are non-ROOM locations inside the room, they remain part of the selection.
Example:
@@ -1337,11 +1393,13 @@ Handling objects via obj-class.
=== new
Create a new object via wishing routine.
Create a new object, either via wishing routine, or specifying object name and class.
Unlike des.object, does not place the object anywhere.
Example:
local o = obj.new("rock");
local o = obj.new({ id = "invisibility", class = "!" });
=== isnull
@@ -1530,6 +1588,11 @@ These constants are in the `nhc` table.
|===
| COLNO | Number of map columns
| ROWNO | Number of map rows
| NUMMONS | Number of different monster types
| LOW_PM | First monster type id. See <<_int_to_pmname>>.
| HIGH_PM | Last monster type id. See <<_int_to_pmname>>.
| FIRST_OBJECT | First object type id. See <<_int_to_objname>>.
| LAST_OBJECT | Number of object type ids. See <<_int_to_objname>>.
| DLB | 1 or 0, depending if NetHack is compiled with DLB
|===
+10 -5
View File
@@ -1,7 +1,7 @@
.\"DO NOT REMOVE NH_DATESUB .TH MAKEDEFS 6 "DATE(%-d %B %Y)" NETHACK
.TH MAKEDEFS 6 "8 February 2022" NETHACK
.\"DO NOT REMOVE NH_DATESUB .ds Nd DATE(%Y)
.ds Nd 2022
.\"DO NOT REMOVE NH_DATESUB .TH MAKEDEFS 6 "Date(%-d %B %Y)" Project(uc)
.TH MAKEDEFS 6 "25 December 2024" NETHACK
.\"DO NOT REMOVE NH_DATESUB .ds Nd Date(%Y)
.ds Nd 2024
.de NB
.ds Nb \\$2
..
@@ -10,6 +10,11 @@
..
.NB $NHDT-Branch: NetHack-3.7 $
.NR $NHDT-Revision: 1.22 $
.\" groff and AT&T-descended troffs use different hyphenation patterns.
.\" Don't hyphenate the last word on a page or column, or
.\" before/after last/first 2 characters of a word.
.ie \n(.g .hy 12
.el .hy 14
.ds Na Kenneth Lorber
.SH NAME
makedefs \- NetHack miscellaneous build-time functions
@@ -94,7 +99,7 @@ only if it is present, to obtain
.B githash=
and
.B gitbranch=
info and include related preprocessor #defines in
info and include related preprocessor #defines in
.I date.h
file.
.br
+8 -8
View File
@@ -1,4 +1,4 @@
MAKEDEFS(6) MAKEDEFS(6)
MAKEDEFS(6) Games Manual MAKEDEFS(6)
@@ -31,14 +31,14 @@ SHORT COMMANDS
the MDGREP FUNCTIONS section below for details.
-m Generate date.h and options file. It will read dat/gitinfo.txt,
only if it is present, to obtain githash= and gitbranch=
info and include related preprocessor #defines in date.h file.
only if it is present, to obtain githash= and gitbranch= info
and include related preprocessor #defines in date.h file.
-p Generate pm.h
-q Generate the rumors file.
-s Generate the bogusmon , engrave and epitaph files.
-s Generate the bogusmon, engrave, and epitaph files.
-1 Generate the epitaph file.
@@ -143,10 +143,10 @@ AUTHOR
The NetHack Development Team
COPYRIGHT
This file is Copyright (C) Kenneth Lorber, 2022 for version keni-crash-
web2:1.21. NetHack may be freely redistributed. See license for
details.
This file is Copyright (C) Kenneth Lorber, 2024 for version
NetHack-3.7:1.22. NetHack may be freely redistributed. See license
for details.
NETHACK 8 February 2022 MAKEDEFS(6)
NETHACK 25 December 2024 MAKEDEFS(6)
+1 -1
View File
@@ -136,7 +136,7 @@ b num \- i used to embolden italics
_bi \*Z mac \- \- print \*x in emboldened font 2, \*y after,
\*z before
bm num 1i,1i+1v \- height of bottom margin
_bt mac \- \- print pottom title
_bt mac \- \- print bottom title
bt num .5i+1v \- bottom of footer to bottom of page
_cf \*Z mac \- \- print contents of header line (double
quotes around \*x, \*y before, \*z after)
+10 -10
View File
@@ -17,8 +17,8 @@ DESCRIPTION
All -mn macros, diversions, string registers, and number registers are
defined below. Many nroff and troff requests are unsafe in conjunction
with this package. However, the requests below may be used with
impunity:
with this package. However, the requests below may be used with im-
punity:
.bp begin new page
.br break output line
@@ -29,8 +29,8 @@ DESCRIPTION
Font and point size changes with \f and \s are also allowed; for exam-
ple, ``\f2word\fR'' will italicize word. Output of the tbl(1), eqn(1),
and refer(1) preprocessors for equations, tables, and references is
acceptable as input.
and refer(1) preprocessors for equations, tables, and references is ac-
ceptable as input.
FILES
/usr/lib/tmac/tmac.n
@@ -47,12 +47,12 @@ WARNINGS
This package is not now intended for uses other than with the news doc-
umentation.
Bug reports are always welcome; please send them to the author.
(Include a sample of the input; this helps track down the bug.)
Bug reports are always welcome; please send them to the author. (In-
clude a sample of the input; this helps track down the bug.)
AUTHOR
Matt Bishop (mab@riacs.arpa, ihnp4!ames!riacs!mab, dec-
vax!decwrl!riacs!mab)
Matt Bishop (mab@riacs.arpa, ihnp4!ames!riacs!mab, decvax!decwrl!ri-
acs!mab)
Updated for versions 1.4-1.6 by The NetHack Development Team
REQUESTS
@@ -75,14 +75,14 @@ b num - i used to embolden italics
.bi x y z mac - - print x in emboldened font 2, y after,
z before
bm num 1i,1i+1v - height of bottom margin
.bt mac - - print pottom title
.bt mac - - print bottom title
bt num .5i+1v - bottom of footer to bottom of page
.cf x y z mac - - print contents of header line (double
quotes around x, y before, z after)
cm num 0 - 0 if no cut marks, nonzero if cut marks
.cn x y z mac - - print computer/site name; same as .i
.dd div - i text of display
dg str *,- - footnote mark
dg str *,<*> - footnote mark
dw str current - name of current day of week
dy str current - full date
.ed mac - b end display
+2
View File
@@ -76,6 +76,7 @@ and the second for
Macro What Initial Note \0 Explanation
Name It Is Value
.sp .3
nH num 0 \- avoid processing multiple times
_BR mac \- \- hard line break with vertical padding inserted
bR num \- i
_CC \*Y mac \- \- aligned one char key \*x with \fIshort\fP definition \*y
@@ -92,4 +93,5 @@ PX num \- i
PY num \- i
_SD \*X mac \- \- .sd with options c-center i-indent n-no indent
SF num \- i
UR mac \- \- URL passthrough for HTML generator
_UX mac \- \- .ux with updated trademark owner
+2
View File
@@ -36,6 +36,7 @@ REQUESTS
Macro What Initial Note Explanation
Name It Is Value
nH num 0 - avoid processing multiple times
.BR mac - - hard line break with vertical padding inserted
bR num - i
.CC x y mac - - aligned one char key x with short definition y
@@ -52,6 +53,7 @@ PX num - i
PY num - i
.SD x mac - - .sd with options c-center i-indent n-no indent
SF num - i
UR mac - - URL passthrough for HTML generator
.UX mac - - .ux with updated trademark owner
+9 -4
View File
@@ -1,7 +1,7 @@
.\"DO NOT REMOVE NH_DATESUB .TH NETHACK 6 "DATE(%-d %B %Y)" NETHACK
.TH NETHACK 6 "21 February 2022" NETHACK
.\"DO NOT REMOVE NH_DATESUB .ds Nd DATE(%Y)
.ds Nd 2022
.\"DO NOT REMOVE NH_DATESUB .TH NETHACK 6 "Date(%-d %B %Y)" Project(uc)
.TH NETHACK 6 "25 December 2024" NETHACK
.\"DO NOT REMOVE NH_DATESUB .ds Nd Date(%Y)
.ds Nd 2024
.de NB
.ds Nb \\$2
..
@@ -10,6 +10,11 @@
..
.NB $NHDT-Branch: NetHack-3.7 $
.NR $NHDT-Revision: 1.31 $
.\" groff and AT&T-descended troffs use different hyphenation patterns.
.\" Don't hyphenate the last word on a page or column, or
.\" before/after last/first 2 characters of a word.
.ie \n(.g .hy 12
.el .hy 14
.ds Na Robert Patrick Rankin
.SH NAME
nethack \- Exploring The Mazes of Menace
+1 -1
View File
@@ -286,4 +286,4 @@ COPYRIGHT
NETHACK 28 February 2024 NETHACK(6)
NETHACK 25 December 2024 NETHACK(6)
+10 -5
View File
@@ -1,4 +1,4 @@
The definitition for each OPTIONS= option resides in include/optlist.h as of
The definition for each OPTIONS= option resides in include/optlist.h as of
February 2020 in 3.7 WIP.
Boolean and compound options are combined into a single allopt[] array.
@@ -40,9 +40,14 @@ To add an entirely new option macro type:
iii) an initialization of an element in the allopt[] array, at
index opt_xxxx from step ii (xxxx is the option name).
2. Create the optfn_xxxx() function in options.c. Failure to do that will
result in a link error of "undefined function optfn_xxxx." The functions are
in options.c in alphabetical sequence by function name.
2. If you are adding a boolean option, link it to a global variable
(e.g. in flags or iflags) and update optfn_boolean in options.c if
necessary.
3. If you are not adding a boolean option, create the optfn_xxxx()
function in options.c. Failure to do that will result in a link error
of "undefined function optfn_xxxx." The functions are in options.c in
alphabetical sequence by function name.
The skeletal template for an optn_xxxx() function is:
@@ -83,7 +88,7 @@ To add an entirely new option macro type:
return optn_ok;
}
3. NOTE: If you add (or delete) an option, please update the short
4. NOTE: If you add (or delete) an option, please update the short
options help (option_help()), the long options help (dat/opthelp)
and also the Guidebooks.
+11 -4
View File
@@ -1,7 +1,7 @@
.\"DO NOT REMOVE NH_DATESUB .TH RECOVER 6 "DATE(%-d %B %Y)" NETHACK
.TH RECOVER 6 "8 February 2022" NETHACK
.\"DO NOT REMOVE NH_DATESUB .ds Nd DATE(%Y)
.ds Nd 2022
.\"DO NOT REMOVE NH_DATESUB .TH RECOVER 6 "Date(%-d %B %Y)" Project(uc)
.TH RECOVER 6 "25 December 2024" NETHACK
.\"DO NOT REMOVE NH_DATESUB .ds Nd Date(%Y)
.ds Nd 2024
.de NB
.ds Nb \\$2
..
@@ -10,6 +10,11 @@
..
.NB $NHDT-Branch: NetHack-3.7 $
.NR $NHDT-Revision: 1.12 $
.\" groff and AT&T-descended troffs use different hyphenation patterns.
.\" Don't hyphenate the last word on a page or column, or
.\" before/after last/first 2 characters of a word.
.ie \n(.g .hy 12
.el .hy 14
.ds Na Kenneth Lorber
.SH NAME
recover \- recover a NetHack game interrupted by disaster
@@ -43,6 +48,7 @@ supplies a directory which is the NetHack playground.
It overrides the value from NETHACKDIR, HACKDIR, or the directory
specified by the game administrator during compilation
(usually /usr/games/lib/nethackdir).
.ig
.PP
^?ALLDOCS
For recovery to be possible,
@@ -64,6 +70,7 @@ This configuration of
was created without support for recovery.
^.
^.
..
NetHack normally writes out files for levels as the player leaves them,
so they will be ready for return visits.
When checkpointing, NetHack also writes out the level entered and
+8 -12
View File
@@ -1,4 +1,4 @@
RECOVER(6) RECOVER(6)
RECOVER(6) Games Manual RECOVER(6)
@@ -22,15 +22,11 @@ DESCRIPTION
The -d option, which must be the first argument if it appears, supplies
a directory which is the NetHack playground. It overrides the value
from NETHACKDIR, HACKDIR, or the directory specified by the game admin-
istrator during compilation (usually /usr/games/lib/nethackdir).
For recovery to be possible, nethack must have been compiled with the
INSURANCE option, and the run-time option checkpoint must also have
been on. NetHack normally writes out files for levels as the player
leaves them, so they will be ready for return visits. When checkpoint-
ing, NetHack also writes out the level entered and the current game
state on every level change. This naturally slows level changes down
somewhat.
istrator during compilation (usually /usr/games/lib/nethackdir).
NetHack normally writes out files for levels as the player leaves them,
so they will be ready for return visits. When checkpointing, NetHack
also writes out the level entered and the current game state on every
level change. This naturally slows level changes down somewhat.
The level file names are of the form base.nn, where nn is an internal
bookkeeping number for the level. The file base.0 is used for game
@@ -77,10 +73,10 @@ BUGS
nism to avoid conflicts.
COPYRIGHT
This file is Copyright (C) Kenneth Lorber, 2022 for version
This file is Copyright (C) Kenneth Lorber, 2024 for version
NetHack-3.7:1.12. NetHack may be freely redistributed. See license
for details.
NETHACK 8 February 2022 RECOVER(6)
NETHACK 25 December 2024 RECOVER(6)
+4 -4
View File
@@ -87,7 +87,7 @@ There are 4 distinct types of sound sound_triggers used by NetHack.
at the outset (ambience_begin), at the
termination (ambience_end), and
periodically in-between as needed
(ambience_upate), likely with a different
(ambience_update), likely with a different
hero proximity value.
SOUND_TRIGGER_VERBAL Invoked by the core when someone (or something)
@@ -233,7 +233,7 @@ sound_play_usersound(char *filename, int32_t volume, int32_t usidx);
sound_ambience(int32_t ambienceid, int32_t ambience_action,
int32_t hero_proximity);
-- NetHack will call this function when it wants a particular
ambience related sound played in order to provide atomosphere
ambience related sound played in order to provide atmosphere
or flavor.
-- The ambienceid is used to identify the particular ambience sound
being sought. The abienceid identifiers are from the
@@ -508,8 +508,8 @@ use the following guidelines:
Windows with Visual studio nmake at the command
line.
sys/windows/Makefile.mingw32
sys/windows/Makefile.mingw32.depend
sys/windows/GNUmakefile
sys/windows/GNUmakefile.depend
Will require updates in order to build on
Windows with mingw32 or MSYS2 using GNU make at
+6 -5
View File
@@ -29,7 +29,7 @@
.\" labeled paragraph label (and first line)
.de PL
.br
\\h'|-\\n(PYu'\\$1\\h'|-\\n(PXu'\ -\ \\c \" back up, output the label, then
\\h'|-\\n(PYu'\\$1\\h'|-\\n(PXu'\ -\ \\c\" back up, output the label, then
. \" skip to width-of(" - ") before the
. \" normal indentation, output the " - "
. \" then attach the next line (the
@@ -134,8 +134,9 @@
\\$1\\$2
..
.
.\" Don't hyphenate the last word on a page or column. groff and AT&T-
.\" descended troffs use different hyphenation patterns.
.ie \n(.g .hy 6
.el .hy 2
.\" groff and AT&T-descended troffs use different hyphenation patterns.
.\" Don't hyphenate the last word on a page or column, or
.\" before/after last/first 2 characters of a word.
.ie \n(.g .hy 12
.el .hy 14
.\"tmac.nh/"
+5 -9
View File
@@ -284,7 +284,7 @@ update_inventory(arg)
-- For an argument of 0:
-- Indicate to the window port that the inventory has
been changed.
-- Merely calls display_inventory() for window-ports
-- Merely calls repopulate_perminvent() for window-ports
that leave the window up, otherwise empty.
-- or for a non-zero argument:
-- Prompts the user for a menu scrolling action and
@@ -649,14 +649,6 @@ can_suspend() -- Tell the core if the window system will allow the game
to be suspended now. If unconditionally yes or no, use
genl_can_suspend_yes() or genl_can_suspend_no().
start_screen() -- Only used on Unix tty ports, but must be declared for
completeness. Sets up the tty to work in full-screen
graphics mode. Look at win/tty/termcap.c for an
example. If your window-port does not need this function
just declare an empty function.
end_screen() -- Only used on Unix tty ports, but must be declared for
completeness. The complement of start_screen().
outrip(winid, int, time_t)
-- The tombstone code. If you want the traditional code use
genl_outrip for the value and check the #if in rip.c.
@@ -1009,6 +1001,10 @@ char display_inventory(lets, want_reply)
-- Calls a start_menu()/add_menu()/select_menu() sequence.
It returns the item selected, or '\0' if none is selected.
Returns '\033' if the menu was canceled.
void repopulate_perminvent(void)
-- a minimal alternative to display_inventory() that
focuses only on repopulating the permanent inventory
window.
raw_printf(str, ...)
-- Like raw_print(), but accepts arguments like printf(). This
routine processes the arguments and then calls raw_print().
+2
View File
@@ -15,3 +15,5 @@ tile.h
win32api.h
# really obsolete...
.cvsignore
sfproto.h
@@ -17,6 +17,10 @@
#ifdef CROSS_TO_AMIGA
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dos/dos.h>
#include <clib/dos_protos.h>
#include <proto/dos.h>
#endif
#ifdef __SASC_60 /* since SAS can prevent re-inclusion */
@@ -48,13 +52,9 @@ typedef long off_t;
#define PATHLEN 130
/* data librarian defs */
#ifndef NOCWD_ASSUMPTIONS
#define DLBFILE "NetHack:nhdat" /* main library */
#define DLBFILE2 "NetHack:nhsdat" /* sound library */
#else
#define DLBFILE "nhdat" /* main library */
#define DLBFILE2 "nhsdat" /* sound library */
#endif
/* nhsdat sound library not used in 3.7 */
#undef DLBFILE2
#ifndef CROSS_TO_AMIGA
#define FILENAME_CMP stricmp /* case insensitive */
@@ -193,21 +193,21 @@ void amii_setpens(int);
#define M(c) ((c) -128)
#endif
struct ami_sysflags {
char sysflagsid[10];
char sysflagsid[10];
#ifdef AMIFLUSH
boolean altmeta; /* use ALT keys as META */
boolean amiflush; /* kill typeahead */
boolean altmeta; /* use ALT keys as META */
boolean amiflush; /* kill typeahead */
#endif
#ifdef AMII_GRAPHICS
int numcols;
unsigned short amii_dripens[20]; /* DrawInfo Pens currently there are 13 in v39 */
AMII_COLOR_TYPE amii_curmap[AMII_MAXCOLORS]; /* colormap */
#ifdef AMII_GRAPHICS
int numcols;
unsigned short amii_dripens[20]; /* DrawInfo Pens currently there are 13 in v39 */
AMII_COLOR_TYPE amii_curmap[AMII_MAXCOLORS]; /* colormap */
#endif
#ifdef OPT_DISPMAP
boolean fast_map; /* use optimized, less flexible map display */
boolean fast_map; /* use optimized, less flexible map display */
#endif
#ifdef MFLOPPY
boolean asksavedisk;
boolean asksavedisk;
#endif
};
extern struct ami_sysflags sysflags;
+23
View File
@@ -5,6 +5,10 @@
#ifndef ARTIFACT_H
#define ARTIFACT_H
#include "permonst.h"
#include "prop.h"
/* clang-format off */
#define SPFX_NONE 0x00000000L /* no special effects, just a bonus */
@@ -49,6 +53,8 @@ struct artifact {
aligntyp alignment; /* alignment of bequeathing gods */
short role; /* character role associated with */
short race; /* character race associated with */
schar gen_spe; /* bias to spe when gifted or randomly generated */
uchar gift_value; /* minimum sacrifice value to be gifted this */
long cost; /* price when sold to hero (default 100 x base cost) */
char acolor; /* color to use if artifact 'glows' */
};
@@ -65,8 +71,25 @@ enum invoke_prop_types {
ENLIGHTENING,
CREATE_AMMO,
BANISH,
FLING_POISON,
FIRESTORM,
SNOWSTORM,
BLINDING_RAY
};
/* artifact tracking; gift and wish imply found; it also gets set for items
seen on the floor, in containers, and wielded or dropped by monsters */
struct arti_info {
Bitfield(exists, 1); /* 1 if corresponding artifact has been created */
Bitfield(found, 1); /* 1 if artifact is known by hero to exist */
Bitfield(gift, 1); /* 1 iff artifact was created as a prayer reward */
Bitfield(wish, 1); /* 1 iff artifact was created via wish */
Bitfield(named, 1); /* 1 iff artifact was made by naming an item */
Bitfield(viadip, 1); /* 1 iff dipped long sword became Excalibur */
Bitfield(lvldef, 1); /* 1 iff created by special level definition */
Bitfield(bones, 1); /* 1 iff came from bones file */
Bitfield(rndm, 1); /* 1 iff randomly generated */
};
/* clang-format on */
#endif /* ARTIFACT_H */
+98 -63
View File
@@ -7,28 +7,28 @@
/* in makedefs.c, all we care about is the list of names */
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr, bn) nam
gs, gv, cost, clr, bn) nam
static const char *const artifact_names[] = {
#elif defined(ARTI_ENUM)
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr, bn) \
gs, gv, cost, clr, bn) \
ART_##bn
#elif defined(DUMP_ARTI_ENUM)
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr, bn) \
gs, gv, cost, clr, bn) \
{ ART_##bn, "ART_" #bn }
#else
/* in artifact.c, set up the actual artifact list structure;
color field is for an artifact when it glows, not for the item itself */
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr, bn) \
gs, gv, cost, clr, bn) \
{ \
typ, nam, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr \
gs, gv, cost, clr \
}
/* clang-format off */
@@ -43,6 +43,7 @@ static const char *const artifact_names[] = {
#define FIRE(a,b) {0,AD_FIRE,a,b}
#define ELEC(a,b) {0,AD_ELEC,a,b} /* electrical shock */
#define STUN(a,b) {0,AD_STUN,a,b} /* magical attack */
#define POIS(a,b) {0,AD_DRST,a,b} /* poison */
/* clang-format on */
static NEARDATA struct artifact artilist[] = {
@@ -52,24 +53,47 @@ static NEARDATA struct artifact artilist[] = {
* 1. The more useful the artifact, the better its cost.
* 2. Quest artifacts are highly valued.
* 3. Chaotic artifacts are inflated due to scarcity (and balance).
*
* Artifact gen_spe rationale:
* 1. If the artifact is useful against most enemies, +0.
* 2. If the artifact is useful against only a few enemies, usually +2.
* This gives the artifact use to early-game characters who receive
* it as a gift or find it on the ground.
* 3. Role gift gen_spe is chosen to balance against the role's
* default starting weapon (it should be better, but need not be
* much better).
* 4. This can be modified as required for special cases.
* (In some cases, like Excalibur, the value is irrelevant.)
* 5. Nonweapon spe may have a special meaning, so gen_spe for
* nonweapons must always be 0.
*
* Artifact gift_value is chosen so that "endgame-quality" artifacts are
* not gifted in the early game (so that characters don't grind on an
* altar early-game until they have their endgame weapon, then use it to
* carry them through the game). Those artifacts have values ranging from
* around 8 to 10, based on how good the artifact is. Less powerful
* artifacts have values in the 1 to 5 range. Values in between are used
* for conditionally good artifacts. (Note that the value of a gift is
* normally 1 higher than the difficulty of the monster.)
*/
/* dummy element #0, so that all interesting indices are non-zero */
A("", STRANGE_OBJECT, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE,
NON_PM, NON_PM, 0L, NO_COLOR, NONARTIFACT),
NON_PM, NON_PM,
0, 0, 0L, NO_COLOR, NONARTIFACT),
A("Excalibur", LONG_SWORD, (SPFX_NOGEN | SPFX_RESTR | SPFX_SEEK
| SPFX_DEFN | SPFX_INTEL | SPFX_SEARCH),
0, 0, PHYS(5, 10), DRLI(0, 0), NO_CARY, 0, A_LAWFUL, PM_KNIGHT, NON_PM,
4000L, NO_COLOR, EXCALIBUR),
0, 10, 4000L, NO_COLOR, EXCALIBUR),
/*
* Stormbringer only has a 2 because it can drain a level,
* providing 8 more.
*/
A("Stormbringer", RUNESWORD,
(SPFX_RESTR | SPFX_ATTK | SPFX_DEFN | SPFX_INTEL | SPFX_DRLI), 0, 0,
DRLI(5, 2), DRLI(0, 0), NO_CARY, 0, A_CHAOTIC, NON_PM, NON_PM, 8000L,
NO_COLOR, STORMBRINGER),
DRLI(5, 2), DRLI(0, 0), NO_CARY, 0, A_CHAOTIC, NON_PM, NON_PM,
0, 9, 8000L, NO_COLOR, STORMBRINGER),
/*
* Mjollnir can be thrown when wielded if hero has 25 Strength
* (usually via gauntlets of power but possible with rings of
@@ -84,10 +108,12 @@ static NEARDATA struct artifact artilist[] = {
*/
A("Mjollnir", WAR_HAMMER, /* Mjo:llnir */
(SPFX_RESTR | SPFX_ATTK), 0, 0, ELEC(5, 24), NO_DFNS, NO_CARY, 0,
A_NEUTRAL, PM_VALKYRIE, NON_PM, 4000L, NO_COLOR, MJOLLNIR),
A_NEUTRAL, PM_VALKYRIE, NON_PM,
0, 8, 4000L, NO_COLOR, MJOLLNIR),
A("Cleaver", BATTLE_AXE, SPFX_RESTR, 0, 0, PHYS(3, 6), NO_DFNS, NO_CARY,
0, A_NEUTRAL, PM_BARBARIAN, NON_PM, 1500L, NO_COLOR, CLEAVER),
0, A_NEUTRAL, PM_BARBARIAN, NON_PM,
0, 8, 1500L, NO_COLOR, CLEAVER),
/*
* Grimtooth glows in warning when elves are present, but its
@@ -95,8 +121,9 @@ static NEARDATA struct artifact artilist[] = {
* (handled as special case in spec_dbon()).
*/
A("Grimtooth", ORCISH_DAGGER, (SPFX_RESTR | SPFX_WARN | SPFX_DFLAG2),
0, M2_ELF, PHYS(2, 6), NO_DFNS,
NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ORC, 300L, CLR_RED, GRIMTOOTH),
0, M2_ELF, PHYS(2, 6), POIS(0,0),
NO_CARY, FLING_POISON, A_CHAOTIC, NON_PM, PM_ORC,
0, 5, 1200L, CLR_RED, GRIMTOOTH),
/*
* Orcrist and Sting have same alignment as elves.
*
@@ -105,56 +132,56 @@ static NEARDATA struct artifact artilist[] = {
* Sting and Orcrist will warn of M2_ORC monsters.
*/
A("Orcrist", ELVEN_BROADSWORD, (SPFX_WARN | SPFX_DFLAG2), 0, M2_ORC,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 2000L,
CLR_BRIGHT_BLUE, ORCRIST), /* bright blue is actually light blue */
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF,
3, 4, 2000L, CLR_BRIGHT_BLUE, ORCRIST), /* actually light blue */
A("Sting", ELVEN_DAGGER, (SPFX_WARN | SPFX_DFLAG2), 0, M2_ORC,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 800L,
CLR_BRIGHT_BLUE, STING),
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF,
3, 1, 800L, CLR_BRIGHT_BLUE, STING),
/*
* Magicbane is a bit different! Its magic fanfare
* unbalances victims in addition to doing some damage.
*/
A("Magicbane", ATHAME, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0,
STUN(3, 4), DFNS(AD_MAGM), NO_CARY, 0, A_NEUTRAL, PM_WIZARD, NON_PM,
3500L, NO_COLOR, MAGICBANE),
0, 7, 3500L, NO_COLOR, MAGICBANE),
A("Frost Brand", LONG_SWORD, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0,
COLD(5, 0), COLD(0, 0), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 3000L,
NO_COLOR, FROST_BRAND),
COLD(5, 0), COLD(0, 0), NO_CARY, SNOWSTORM, A_NONE, NON_PM, NON_PM,
0, 9, 3000L, NO_COLOR, FROST_BRAND),
A("Fire Brand", LONG_SWORD, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0,
FIRE(5, 0), FIRE(0, 0), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 3000L,
NO_COLOR, FIRE_BRAND),
FIRE(5, 0), FIRE(0, 0), NO_CARY, FIRESTORM, A_NONE, NON_PM, NON_PM,
0, 5, 3000L, NO_COLOR, FIRE_BRAND),
A("Dragonbane", BROADSWORD,
(SPFX_RESTR | SPFX_DCLAS | SPFX_REFLECT), 0, S_DRAGON,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 500L,
NO_COLOR, DRAGONBANE),
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM,
2, 5, 500L, NO_COLOR, DRAGONBANE),
A("Demonbane", MACE, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_DEMON,
A("Demonbane", SILVER_MACE, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_DEMON,
PHYS(5, 0), NO_DFNS, NO_CARY, BANISH, A_LAWFUL, PM_CLERIC, NON_PM,
2500L, NO_COLOR, DEMONBANE),
1, 3, 2500L, NO_COLOR, DEMONBANE),
A("Werebane", SILVER_SABER, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_WERE,
PHYS(5, 0), DFNS(AD_WERE), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 1500L,
NO_COLOR, WEREBANE),
PHYS(5, 0), DFNS(AD_WERE), NO_CARY, 0, A_NONE, NON_PM, NON_PM,
1, 4, 1500L, NO_COLOR, WEREBANE),
A("Grayswandir", SILVER_SABER, (SPFX_RESTR | SPFX_HALRES), 0, 0,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 8000L,
NO_COLOR, GRAYSWANDIR),
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM,
0, 10, 8000L, NO_COLOR, GRAYSWANDIR),
A("Giantslayer", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_GIANT,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM, 200L,
NO_COLOR, GIANTSLAYER),
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM,
2, 4, 200L, NO_COLOR, GIANTSLAYER),
A("Ogresmasher", WAR_HAMMER, (SPFX_RESTR | SPFX_DCLAS), 0, S_OGRE,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 200L,
NO_COLOR, OGRESMASHER),
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM,
2, 1, 200L, NO_COLOR, OGRESMASHER),
A("Trollsbane", MORNING_STAR, (SPFX_RESTR | SPFX_DCLAS), 0, S_TROLL,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 200L,
NO_COLOR, TROLLSBANE),
A("Trollsbane", MORNING_STAR, (SPFX_RESTR | SPFX_DCLAS | SPFX_REGEN), 0,
S_TROLL, PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM,
2, 1, 200L, NO_COLOR, TROLLSBANE),
/*
* Two problems: 1) doesn't let trolls regenerate heads,
@@ -162,45 +189,50 @@ static NEARDATA struct artifact artilist[] = {
* allowing those at all causes more problems than worth the effort).
*/
A("Vorpal Blade", LONG_SWORD, (SPFX_RESTR | SPFX_BEHEAD), 0, 0,
PHYS(5, 1), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM, 4000L,
NO_COLOR, VORPAL_BLADE),
PHYS(5, 1), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM,
1, 5, 4000L, NO_COLOR, VORPAL_BLADE),
/*
* Ah, never shall I forget the cry,
* or the shriek that shrieked he,
* As I gnashed my teeth, and from my sheath
* I drew my Snickersnee!
* --Koko, Lord high executioner of Titipu
* --Ko-Ko, Lord high executioner of Titipu
* (From Sir W.S. Gilbert's "The Mikado")
*/
A("Snickersnee", KATANA, SPFX_RESTR, 0, 0, PHYS(0, 8), NO_DFNS, NO_CARY,
0, A_LAWFUL, PM_SAMURAI, NON_PM, 1200L, NO_COLOR, SNICKERSNEE),
0, A_LAWFUL, PM_SAMURAI, NON_PM,
0, 8, 1200L, NO_COLOR, SNICKERSNEE),
/* Sunsword emits light when wielded (handled in the core rather than
via artifact fields), but that light has no particular color */
A("Sunsword", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_UNDEAD,
PHYS(5, 0), DFNS(AD_BLND), NO_CARY, BLINDING_RAY, A_LAWFUL, NON_PM,
NON_PM, 1500L, NO_COLOR, SUNSWORD),
NON_PM,
0, 6, 1500L, NO_COLOR, SUNSWORD),
/*
* The artifacts for the quest dungeon, all self-willed.
* gen_spe should be 0; gift_value irrelevant and set to 12.
*/
A("The Orb of Detection", CRYSTAL_BALL,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), (SPFX_ESP | SPFX_HSPDAM), 0,
NO_ATTK, NO_DFNS, CARY(AD_MAGM), INVIS, A_LAWFUL, PM_ARCHEOLOGIST,
NON_PM, 2500L, NO_COLOR, ORB_OF_DETECTION),
NON_PM,
0, 12, 2500L, NO_COLOR, ORB_OF_DETECTION),
A("The Heart of Ahriman", LUCKSTONE,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), SPFX_STLTH, 0,
/* this stone does double damage if used as a projectile weapon */
PHYS(5, 0), NO_DFNS, NO_CARY, LEVITATION, A_NEUTRAL, PM_BARBARIAN,
NON_PM, 2500L, NO_COLOR, HEART_OF_AHRIMAN),
NON_PM,
0, 12, 2500L, NO_COLOR, HEART_OF_AHRIMAN),
A("The Sceptre of Might", MACE,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_DALIGN), 0, 0, PHYS(5, 0),
DFNS(AD_MAGM), NO_CARY, CONFLICT, A_LAWFUL, PM_CAVE_DWELLER, NON_PM,
2500L, NO_COLOR, SCEPTRE_OF_MIGHT),
0, 12, 2500L, NO_COLOR, SCEPTRE_OF_MIGHT),
#if 0 /* OBSOLETE -- from 3.1.0 to 3.2.x, this was quest artifact for the
* Elf role; in 3.3.0 elf became a race available to several roles
@@ -209,35 +241,37 @@ static NEARDATA struct artifact artilist[] = {
A("The Palantir of Westernesse", CRYSTAL_BALL,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL),
(SPFX_ESP | SPFX_REGEN | SPFX_HSPDAM), 0,
NO_ATTK, NO_DFNS, NO_CARY, TAMING, A_CHAOTIC, NON_PM, PM_ELF, 8000L,
NO_COLOR, PALANTIR_OF_WESTERNESSE),
NO_ATTK, NO_DFNS, NO_CARY, TAMING, A_CHAOTIC, NON_PM, PM_ELF,
0, 12, 8000L, NO_COLOR, PALANTIR_OF_WESTERNESSE),
#endif
A("The Staff of Aesculapius", QUARTERSTAFF,
(SPFX_NOGEN | SPFX_RESTR | SPFX_ATTK | SPFX_INTEL | SPFX_DRLI
| SPFX_REGEN),
0, 0, DRLI(0, 0), DRLI(0, 0), NO_CARY, HEALING, A_NEUTRAL, PM_HEALER,
NON_PM, 5000L, NO_COLOR, STAFF_OF_AESCULAPIUS),
NON_PM,
0, 12, 5000L, NO_COLOR, STAFF_OF_AESCULAPIUS),
A("The Magic Mirror of Merlin", MIRROR,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_SPEAK), SPFX_ESP, 0,
NO_ATTK, NO_DFNS, CARY(AD_MAGM), 0, A_LAWFUL, PM_KNIGHT, NON_PM, 1500L,
NO_COLOR, MAGIC_MIRROR_OF_MERLIN),
NO_ATTK, NO_DFNS, CARY(AD_MAGM), 0, A_LAWFUL, PM_KNIGHT, NON_PM,
0, 12, 1500L, NO_COLOR, MAGIC_MIRROR_OF_MERLIN),
A("The Eyes of the Overworld", LENSES,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_XRAY), 0, 0, NO_ATTK,
DFNS(AD_MAGM), NO_CARY, ENLIGHTENING, A_NEUTRAL, PM_MONK, NON_PM,
2500L, NO_COLOR, EYES_OF_THE_OVERWORLD),
0, 12, 2500L, NO_COLOR, EYES_OF_THE_OVERWORLD),
A("The Mitre of Holiness", HELM_OF_BRILLIANCE,
(SPFX_NOGEN | SPFX_RESTR | SPFX_DFLAG2 | SPFX_INTEL | SPFX_PROTECT), 0,
M2_UNDEAD, NO_ATTK, NO_DFNS, CARY(AD_FIRE), ENERGY_BOOST, A_LAWFUL,
PM_CLERIC, NON_PM, 2000L, NO_COLOR, MITRE_OF_HOLINESS),
PM_CLERIC, NON_PM,
0, 12, 2000L, NO_COLOR, MITRE_OF_HOLINESS),
A("The Longbow of Diana", BOW,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_REFLECT), SPFX_ESP, 0,
PHYS(5, 0), NO_DFNS, NO_CARY, CREATE_AMMO, A_CHAOTIC, PM_RANGER, NON_PM,
4000L, NO_COLOR, LONGBOW_OF_DIANA),
0, 12, 4000L, NO_COLOR, LONGBOW_OF_DIANA),
/* MKoT has an additional carry property if the Key is not cursed (for
rogues) or blessed (for non-rogues): #untrap of doors and chests
@@ -245,38 +279,39 @@ static NEARDATA struct artifact artilist[] = {
A("The Master Key of Thievery", SKELETON_KEY,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_SPEAK),
(SPFX_WARN | SPFX_TCTRL | SPFX_HPHDAM), 0, NO_ATTK, NO_DFNS, NO_CARY,
UNTRAP, A_CHAOTIC, PM_ROGUE, NON_PM, 3500L, NO_COLOR,
MASTER_KEY_OF_THIEVERY),
UNTRAP, A_CHAOTIC, PM_ROGUE, NON_PM,
0, 12, 3500L, NO_COLOR, MASTER_KEY_OF_THIEVERY),
A("The Tsurugi of Muramasa", TSURUGI,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_BEHEAD | SPFX_LUCK
| SPFX_PROTECT),
0, 0, PHYS(0, 8), NO_DFNS, NO_CARY, 0, A_LAWFUL, PM_SAMURAI, NON_PM,
4500L, NO_COLOR, TSURUGI_OF_MURAMASA),
0, 12, 4500L, NO_COLOR, TSURUGI_OF_MURAMASA),
A("The Platinum Yendorian Express Card", CREDIT_CARD,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_DEFN),
(SPFX_ESP | SPFX_HSPDAM), 0, NO_ATTK, NO_DFNS, CARY(AD_MAGM),
CHARGE_OBJ, A_NEUTRAL, PM_TOURIST, NON_PM, 7000L, NO_COLOR,
YENDORIAN_EXPRESS_CARD),
CHARGE_OBJ, A_NEUTRAL, PM_TOURIST, NON_PM,
0, 12, 7000L, NO_COLOR, YENDORIAN_EXPRESS_CARD),
A("The Orb of Fate", CRYSTAL_BALL,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_LUCK),
(SPFX_WARN | SPFX_HSPDAM | SPFX_HPHDAM), 0, NO_ATTK, NO_DFNS, NO_CARY,
LEV_TELE, A_NEUTRAL, PM_VALKYRIE, NON_PM, 3500L, NO_COLOR,
ORB_OF_FATE),
LEV_TELE, A_NEUTRAL, PM_VALKYRIE, NON_PM,
0, 12, 3500L, NO_COLOR, ORB_OF_FATE),
A("The Eye of the Aethiopica", AMULET_OF_ESP,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), (SPFX_EREGEN | SPFX_HSPDAM), 0,
NO_ATTK, DFNS(AD_MAGM), NO_CARY, CREATE_PORTAL, A_NEUTRAL, PM_WIZARD,
NON_PM, 4000L, NO_COLOR, EYE_OF_THE_AETHIOPICA),
NON_PM,
0, 12, 4000L, NO_COLOR, EYE_OF_THE_AETHIOPICA),
#if !defined(ARTI_ENUM) && !defined(DUMP_ARTI_ENUM)
/*
* terminator; otyp must be zero
*/
A(0, 0, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 0L,
NO_COLOR, TERMINATOR)
A(0, 0, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM,
0, 0, 0L, NO_COLOR, TERMINATOR)
}; /* artilist[] (or artifact_names[]) */
#endif
+27 -12
View File
@@ -5,7 +5,12 @@
#ifndef BOTL_H
#define BOTL_H
/* MAXCO must hold longest uncompressed status line, and must be larger
/* Note: this comment is about the pre-VIA_WINDOWPORT two line status
* which is still available but has not added a bunch of conditional
* extra status conditions (Grab, InLava, Held, Zzz and many others)
* or the new fields Weapon, Armor, and Terrain.
*
* MAXCO must hold longest uncompressed status line, and must be larger
* than COLNO
*
* longest practical second status line at the moment is
@@ -27,6 +32,9 @@ Astral Plane \GXXXXNNNN:123456 HP:1234(1234) Pw:1234(1234) AC:-127
#define MAXCO (COLNO + 40)
#endif
/* limit of the player's name in the status window */
#define BOTL_NSIZ 16
struct condmap {
const char *id;
unsigned long bitmask;
@@ -36,13 +44,20 @@ enum statusfields {
BL_CHARACTERISTICS = -3, /* alias for BL_STR..BL_CH */
BL_RESET = -2, /* Force everything to redisplay */
BL_FLUSH = -1, /* Finished cycling through bot fields */
/*
* Note: status_sanity_check() in wintty.c has strings for the rest
* of these, so if any get renumbered or more get added, be sure to
* keep those in sync.
*/
BL_TITLE = 0,
BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, /* 1..6 */
BL_ALIGN, BL_SCORE, BL_CAP, BL_GOLD, BL_ENE, BL_ENEMAX, /* 7..12 */
BL_XP, BL_AC, BL_HD, BL_TIME, BL_HUNGER, BL_HP, /* 13..18 */
BL_HPMAX, BL_LEVELDESC, BL_EXP, BL_CONDITION, /* 19..22 */
BL_VERS, /* 23 */
MAXBLSTATS, /* [24] */
BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, /* 1.. 6 */
BL_ALIGN, BL_SCORE, BL_CAP, BL_GOLD, /* 7..10 */
BL_ENE, BL_ENEMAX, BL_XP, BL_AC, BL_HD, /* 11..15 */
BL_TIME, BL_HUNGER, BL_HP, BL_HPMAX, /* 16..19 */
BL_LEVELDESC, BL_EXP, BL_CONDITION, /* 20..22 */
BL_WEAPON, BL_ARMOR, BL_TERRAIN, /* 23..25 */
BL_VERS, /* 26 */
MAXBLSTATS /* [27] */
};
enum relationships {
@@ -52,7 +67,7 @@ enum relationships {
};
enum blconditions {
bl_bareh,
bl_bareh, /* deprecated -- bl_weapon encompasses this */
bl_blind,
bl_busy,
bl_conf,
@@ -64,7 +79,7 @@ enum blconditions {
bl_grab,
bl_hallu,
bl_held,
bl_icy,
bl_icy, /* bl_terrain encompasses this */
bl_inlava,
bl_lev,
bl_parlyz,
@@ -75,7 +90,7 @@ enum blconditions {
bl_stone,
bl_strngl,
bl_stun,
bl_submerged,
bl_submerged, /* bl_terrain encompasses this */
bl_termill,
bl_tethered,
bl_trapped,
@@ -249,7 +264,7 @@ enum hlattribs {
struct hilite_s {
enum statusfields fld;
boolean set;
unsigned anytype;
enum any_types anytype;
anything value;
int behavior;
char textmatch[MAXVALWIDTH];
@@ -271,7 +286,7 @@ struct istat_s {
boolean chg; /* need to recalc time? */
boolean percent_matters;
short percent_value;
unsigned anytype;
enum any_types anytype;
anything a, rawval;
char *val;
int valwidth;
+15 -51
View File
@@ -149,10 +149,11 @@
#ifdef X11_GRAPHICS
/*
* There are two ways that X11 tiles may be defined. (1) using a custom
* format loaded by NetHack code, or (2) using the XPM format loaded by
* the free XPM library. The second option allows you to then use other
* programs to generate tiles files. For example, the PBMPlus tools
* There are two ways that X11 tiles may be defined:
* (1) using a custom format loaded by NetHack code.
* (2) using the XPM format loaded by the free XPM library.
* The second option allows you to then use other programs to
* generate tiles files. For example, the PBMPlus tools
* would allow:
* xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 | \
* ppmtoxpm >x11tiles_big.xpm
@@ -259,21 +260,23 @@
# ifdef CRASHREPORT
# undef CRASHREPORT
# endif
# ifdef MSDOS
# if defined(MSDOS) || defined(NOPANICTRACE)
# undef PANICTRACE
# endif
#endif
#ifdef CRASHREPORT
# ifndef DUMPLOG_CORE
# define DUMPLOG_CORE // required to get ^P info
# define DUMPLOG_CORE // required to get ^P info
# endif
# ifdef MACOS
# define PANICTRACE
# endif
# ifdef __linux__
# define PANICTRACE
# define NOSTATICFN
# ifndef NOSTATICFN // may be defined on command line
# define NOSTATICFN
# endif
# endif
// This test isn't quite right: CNG is only available from Windows 2000 on.
// But we'll check that at runtime.
@@ -395,38 +398,6 @@
/* # define ZLIB_COMP */ /* ZLIB for compression */
#endif
/*
* Internal Compression Options
*
* Internal compression options RLECOMP and ZEROCOMP alter the data
* that gets written to the save file by NetHack, in contrast
* to COMPRESS or ZLIB_COMP which compress the entire file after
* the NetHack data is written out.
*
* Defining RLECOMP builds in support for internal run-length
* compression of level structures. If RLECOMP support is included
* it can be toggled on/off at runtime via the config file option
* rlecomp.
*
* Defining ZEROCOMP builds in support for internal zero-comp
* compression of data. If ZEROCOMP support is included it can still
* be toggled on/off at runtime via the config file option zerocomp.
*
* RLECOMP and ZEROCOMP support can be included even if
* COMPRESS or ZLIB_COMP support is included. One reason for doing
* so would be to provide savefile read compatibility with a savefile
* where those options were in effect. With RLECOMP and/or ZEROCOMP
* defined, NetHack can read an rlecomp or zerocomp savefile in, yet
* re-save without them.
*
* Using any compression option will create smaller bones/level/save
* files at the cost of additional code and time.
*/
/* # define INTERNAL_COMP */ /* defines both ZEROCOMP and RLECOMP */
/* # define ZEROCOMP */ /* Support ZEROCOMP compression */
/* # define RLECOMP */ /* Support RLECOMP compression */
/*
* Data librarian. Defining DLB places most of the support files into
* a tar-like file, thus making a neater installation. See *conf.h
@@ -463,7 +434,7 @@
*/
#define INSURANCE /* allow crashed game recovery */
#ifndef MAC
#if !defined(MAC) && !defined(SHIM_GRAPHICS)
#define CHDIR /* delete if no chdir() available */
#endif
@@ -629,11 +600,10 @@ typedef unsigned char uchar;
* glyph" code, then the escape codes for color and the glyph character
* itself, and then the "end glyph" code.
*
* To compile NetHack with this, add tile.c to WINSRC and tile.o to WINOBJ
* in the hints file or Makefile.
* Set boolean option vt_tiledata and/or vt_sounddata in your config file
* to turn either of these on.
* Note that gnome-terminal at least doesn't work with this. */
* To compile NetHack with this, add tile.c to WINSRC and tile.o to WINOBJ in
* the hints file or Makefile. Set boolean option vt_tiledata and/or
* vt_sounddata in your config file to turn either of these on. Note that some
* terminals (e.g. old versions of gnome-terminal) don't work with this. */
/* #define TTY_TILES_ESCCODES */
/* #define TTY_SOUND_ESCCODES */
@@ -641,12 +611,6 @@ typedef unsigned char uchar;
* at least 28 additional rows beneath the status window on your terminal */
/* #define TTY_PERM_INVENT */
/* NetHack will execute an external program whenever a new message-window
* message is shown. The program to execute is given in environment variable
* NETHACK_MSGHANDLER. It will get the message as the only parameter.
* Only available with POSIX_TYPES, GNU C, or WIN32 */
/* #define MSGHANDLER */
/* enable status highlighting via STATUS_HILITE directives in run-time
config file and the 'statushilites' option */
#define STATUS_HILITES /* support hilites of status fields */
+5 -1
View File
@@ -31,6 +31,10 @@
#ifndef CROSSCOMPILE
#define SHORT_FILENAMES
#endif
/* this is not fully-implemented yet for msdos */
#ifdef ENHANCED_SYMBOLS
#undef ENHANCED_SYMBOLS
#endif
#endif
/*
@@ -91,7 +95,7 @@
#undef UNIX
#define DLB
#define HACKDIR "NetHack:"
#define NO_MACRO_CPATH
#endif
/*
+11 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 context.h $NHDT-Date: 1646428003 2022/03/04 21:06:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.45 $ */
/* NetHack 3.7 context.h $NHDT-Date: 1753856387 2025/07/29 22:19:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.58 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -135,6 +135,11 @@ struct achievement_tracking {
boolean minetn_reached; /* avoid redundant checking for town entry */
};
struct lifelists {
long total_seen_upclose; /* count of critters seen up close */
long total_photographed; /* count of critters photographed (tourists) */
};
struct context_info {
unsigned ident; /* social security number for each monster */
unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
@@ -145,9 +150,11 @@ struct context_info {
int current_fruit; /* fruit->fid corresponding to svp.pl_fruit[] */
int mysteryforce; /* adjusts how often "mysterious force" kicks in */
int rndencode; /* randomized escape sequence introducer */
int startingpet_typ; /* monster type for initial pet */
int warnlevel; /* threshold (digit) to warn about unseen mons */
long next_attrib_check; /* next attribute check */
long seer_turn; /* when random clairvoyance will next kick in */
long snickersnee_turn; /* Snickersnee last used to distance attack */
long stethoscope_seq; /* when a stethoscope was last used; first use
* during a move takes no time, second uses move */
boolean travel; /* find way automatically to u.tx,u.ty */
@@ -160,7 +167,8 @@ struct context_info {
boolean mv;
boolean bypasses; /* bypass flag is set on at least one fobj */
boolean door_opened; /* set to true if door was opened during test_move */
boolean tips[NUM_TIPS];
boolean resume_wish; /* game was exited while in wish prompt */
unsigned long tips;
struct dig_info digging;
struct victual_info victual;
struct engrave_info engraving;
@@ -173,6 +181,7 @@ struct context_info {
struct tribute_info tribute;
struct novel_tracking novel;
struct achievement_tracking achieveo;
struct lifelists lifelist;
char jingle[5 + 1];
};
+9 -4
View File
@@ -27,9 +27,9 @@
* <stddef.h> Common macro definitions
* <stdint.h> (C99) Fixed-width integer types
* <stdio.h> Input/output program utilities
*
* General utilities: memory management, program utilities, string
* conversions, random numbers, algorithms
* <stdlib.h> General utilities: memory management,
* program utilities, string conversions,
* random numbers, algorithms
* <string.h> String handling
* <tgmath.h> (C99) Type-generic math (macros wrapping math.h and
* complex.h)
@@ -51,13 +51,18 @@
*
*/
#if !defined(__cplusplus)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <assert.h>
#include <stdarg.h>
#include <ctype.h>
#include <time.h>
#include <limits.h>
#else /* !__cplusplus */
/* for FILE */
#include <stdio.h>
#endif /* !__cplusplus */
#endif /* CSTD_H */
+36 -36
View File
@@ -181,7 +181,6 @@ struct instance_globals_a {
struct h2o_ctx acid_ctx;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_b {
@@ -219,7 +218,6 @@ struct instance_globals_b {
boolean bot_disabled;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_c {
@@ -242,6 +240,7 @@ struct instance_globals_c {
/* decl.c */
char chosen_windowtype[WINTYPELEN];
int cmd_key; /* parse() / rhack() */
struct Cmd_bind *cmd_bind;
cmdcount_nht command_count;
/* some objects need special handling during destruction or placement */
struct obj *current_wand; /* wand currently zapped/applied */
@@ -260,7 +259,7 @@ struct instance_globals_c {
/* symbols.c */
int currentgraphics;
/* files.c */
/* files.c, cfgfiles.c */
char *cmdline_rcfile; /* set in unixmain.c, used in options.c */
char *config_section_chosen;
char *config_section_current;
@@ -298,8 +297,10 @@ struct instance_globals_c {
short corpsenm_digested; /* monster type being digested, set by gulpum */
/* zap.c */
/* new */
boolean converted_savefile_loaded;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_d {
@@ -340,8 +341,11 @@ struct instance_globals_d {
boolean decor_fumble_override;
boolean decor_levitate_override;
/* new */
boolean deferred_showpaths;
char *deferred_showpaths_dir;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_e {
@@ -362,7 +366,6 @@ struct instance_globals_e {
to gb.beyond_savefile_load */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_f {
@@ -387,7 +390,6 @@ struct instance_globals_f {
long int followmsg; /* last time of follow message */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_g {
@@ -422,6 +424,7 @@ struct instance_globals_g {
long gmst_moves;
struct obj *gmst_invent;
genericptr_t *gmst_ubak, *gmst_disco, *gmst_mvitals;
struct spell gmst_spl_book[MAXSPELL + 1];
/* pline.c */
struct gamelog_line *gamelog;
@@ -435,7 +438,6 @@ struct instance_globals_g {
long glyphmap_perlevel_flags;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_h {
@@ -456,7 +458,6 @@ struct instance_globals_h {
struct attack *hitmsg_prev;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_i {
@@ -475,6 +476,7 @@ struct instance_globals_i {
/* invent.c */
char *invbuf;
unsigned invbufsiz;
boolean item_action_in_progress;
int in_sync_perminvent;
/* mon.c */
@@ -490,7 +492,6 @@ struct instance_globals_i {
/* new */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_j {
@@ -499,7 +500,6 @@ struct instance_globals_j {
int jumping_is_magic; /* current jump result of magic */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_k {
@@ -513,7 +513,6 @@ struct instance_globals_k {
boolean known;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_l {
@@ -579,7 +578,6 @@ struct instance_globals_l {
char lua_copyright[LUA_COPYRIGHT_BUFSIZ];
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_m {
@@ -608,6 +606,9 @@ struct instance_globals_m {
/* dokick.c */
struct rm *maploc;
/* mhitm.c */
struct monst *mswallower; /* for gas spore explosion when it's swallowed*/
/* mhitu.c */
int mhitu_dieroll;
@@ -615,10 +616,10 @@ struct instance_globals_m {
boolean made_branch; /* used only during level creation */
/* mkmap.c */
int min_rx; /* rectangle bounds for regions */
int max_rx;
int min_ry;
int max_ry;
coordxy min_rx; /* rectangle bounds for regions */
coordxy max_rx;
coordxy min_ry;
coordxy max_ry;
/* mkobj.c */
boolean mkcorpstat_norevive; /* for trolls */
@@ -646,7 +647,6 @@ struct instance_globals_m {
* POT_WATER should become discovered */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_n {
@@ -696,7 +696,6 @@ struct instance_globals_n {
short nocreate4;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_o {
@@ -726,7 +725,8 @@ struct instance_globals_o {
/* options.c */
int opt_phase; /* builtin_opt, syscf_, rc_file_, environ_, play_opt */
/* builtin_opt, syscf_, rc_file_, environ_, play_opt */
enum option_phases opt_phase;
boolean opt_initial;
boolean opt_from_file;
boolean opt_need_redraw; /* for doset() */
@@ -742,11 +742,9 @@ struct instance_globals_o {
/* restore.c */
struct fruit *oldfruit;
long omoves;
/* rumors.c */
int oracle_flg; /* -1=>don't use, 0=>need init, 1=>init done */
unsigned long *oracle_loc;
/* uhitm.c */
boolean override_confirmation; /* Used to flag attacks caused by
@@ -755,7 +753,6 @@ struct instance_globals_o {
boolean obj_zapped;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_p {
@@ -806,13 +803,11 @@ struct instance_globals_p {
/* new stuff */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_q {
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_r {
@@ -841,11 +836,13 @@ struct instance_globals_r {
struct repo repo;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_s {
/* allmain.c */
boolean saving_grace_turn; /* saving grace was triggered this turn */
/* artifact.c */
int spec_dbon_applies; /* coordinate effects from spec_dbon() with
messages in artifact_hit() */
@@ -923,7 +920,6 @@ struct instance_globals_s {
int seethru; /* 'bubble' debugging: clouds and water don't block light */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_t {
@@ -949,8 +945,8 @@ struct instance_globals_t {
const char *this_title; /* title for inventory list of specific type */
/* muse.c */
int trapx;
int trapy;
coordxy trapx;
coordxy trapy;
/* rumors.c */
long true_rumor_size; /* rumor size variables are signed so that value -1
@@ -974,11 +970,13 @@ struct instance_globals_t {
int twohits; /* 0: single hit; 1: first of 2; 2: second of 2 */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_u {
/* allmain.c */
int uhp_at_start_of_monster_turn;
/* botl.c */
boolean update_all;
@@ -994,7 +992,6 @@ struct instance_globals_u {
/* new stuff */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_v {
@@ -1031,7 +1028,6 @@ struct instance_globals_v {
struct sound_voice voice;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_w {
@@ -1040,6 +1036,9 @@ struct instance_globals_w {
int warn_obj_cnt; /* count of monsters meeting criteria */
long wailmsg;
/* do_wear.c */
uint8 wasinwater;
/* symbols.c */
nhsym warnsyms[WARNCOUNT]; /* the current warning display symbols */
@@ -1054,9 +1053,9 @@ struct instance_globals_w {
/* new */
struct win_settings wsettings; /* wintype.h */
long were_changes; /* were.c, allmain.c */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_x {
@@ -1077,7 +1076,6 @@ struct instance_globals_x {
coordxy xstart, xsize;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_y {
@@ -1095,7 +1093,6 @@ struct instance_globals_y {
coordxy ystart, ysize;
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_z {
@@ -1112,7 +1109,6 @@ struct instance_globals_z {
* remember who zapped the wand. */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};
struct instance_globals_saved_b {
@@ -1188,6 +1184,10 @@ struct instance_globals_saved_n {
struct instance_globals_saved_o {
/* rumors.c */
unsigned oracle_cnt; /* oracles are handled differently from rumors... */
unsigned long *oracle_loc;
/* other */
long omoves; /* level timestamp */
};
struct instance_globals_saved_p {
+1 -1
View File
@@ -43,7 +43,7 @@ struct tmpbranch {
};
/*
* Values for type for tmpbranch structure.
* Values for type in tmpbranch structure.
*/
#define TBR_STAIR 0 /* connection with both ends having a staircase */
#define TBR_NO_UP 1 /* connection with no up staircase */

Some files were not shown because too many files have changed in this diff Show More