Compare commits

2069 Commits
Author SHA1 Message Date
karafruit f981f44949 Merge branch 'NetHack-5.0' into twitch-interact 2026-09-22 08:36:33 -07:00
Pasi Kallinen c94fd5225b Vault guard shouldn't be heard from too far away
When you were asked for a name and teleported out of the vault without
any gold on you, the vault guard says "Well, begone" - which could be
heard from anywhere on the level.

Limit that verbalization to 10 tiles away.
2026-09-20 17:30:07 +03:00
Pasi Kallinen f11a4b168b More strict checking of dishonourable attacks
Move the caitiff check into thitmonst, the code responsible
for object hitting a monster, intead of checking the caitiff
in multiple places before calling that.

Previously there were some cases where caitiff was not checked,
eg. samurai could fire arrows at a peaceful monster without
the dishonourable behaviour check.

Now you will get the check even if you miss with the projectile.

This may need to be adjusted for throwing beneficial potions
at monsters...
2026-09-19 15:07:43 +03:00
Crissman Loomis c63ee6ac7e Account for pet hunger while away from a level 2026-09-14 15:57:14 +09:00
Crissman Loomis aec687db2c Qt: use idClicked(); buttonClicked(int) is gone in Qt 6
Closes #1670
2026-09-11 10:06:18 -04:00
Crissman Loomis 55769ca9f0 fix Qt use-after-free reading the player name
Closes #1673
2026-09-11 10:02:18 -04:00
Crissman Loomis 1106456195 Preserve inactive level clocks on save pr #1677
Close #1677
2026-09-11 09:37:45 -04:00
nhmall 02dda03f56 update tested versions of Visual Studio 2026-09-10 2026-09-10 08:09:09 -04:00
nhmall fc75a55d86 fix "killed by a died"
This is a follow-up to commit 9114a33 that was intended to fix a "killed by a died" situation.
In that commit, the generic case could be encountered with variable str set to "explosion",
but that never got copied to svk.killer.name, and svk.killer.name remained set to "died"
during testing.

svk.killer.format = KILLED_BY_AN; is done whether the generic case, or not.

Close #1676
2026-09-09 21:15:43 -04:00
nhmall 017fbcf510 follow-up 2026-09-09 20:00:58 -04:00
nhmall 3a496219f3 macOS generated tile build fix 2026-09-09 19:55:33 -04:00
nhmall 2d3aa59065 X11: support BMP, GIF and PNG tiles pr #1666
"This plugs into the same code that provides support for BMP and GIF tiles for MS-DOS, and also populates the stub to read PNG tiles.
PNG is a compile-time option, and depends on libpng."

pull request #1666 by chasonr
2026-09-09 11:25:38 -04:00
nhmall 96c564f09d Merge branch 'x11-bmp-gif' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-09-09 11:23:34 -04:00
nhmall 05d2e88950 style uppercase tidbit 2026-09-09 11:21:30 -04:00
nhmall 2c9600713d X11: several bug fixes pr #1668 by chasonr 2026-09-09 11:17:42 -04:00
nhmall 4efcce2995 Merge branch 'X11-bug-fixes' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-09-09 11:12:38 -04:00
nhmall 0d64c3f1fd attempt to fix a reported regression in consoletty.c 2026-09-08 09:21:29 -04:00
nhmall 50b868f67a remove obsolete VISION_TABLES reference
VISION_TABLES removed as part of commit 3ffd330c31.
2026-09-06 13:52:20 -04:00
Pasi Kallinen 8695c4959c Add some wishing aliases
Things people playing on NAO have wished for which should
give a correct item
2026-09-05 15:10:05 +03:00
nhmall 04834a9316 follow-up: Makefile.top was left out of previous commit 2026-09-01 13:48:47 -04:00
nhmall cc4768f1c9 adjust some Makefile dependencies
Reported by @benknoble in https://github.com/NetHack/NetHack/issues/1669

Some undeclared dependencies could arise when building with make --shuffle

This attempts to resolve those.
2026-09-01 13:38:05 -04:00
Ray Chason 2f42bd7e27 Display tabs in the text window
Actually a menu, but menu windows convert to text if only displaying
text.
2026-08-30 19:03:45 -04:00
Ray Chason 393130a629 Handle tabs in the message window 2026-08-30 17:51:10 -04:00
Ray Chason 98815bc739 Tabify the #wizcustom menu 2026-08-30 16:44:44 -04:00
Ray Chason c88403f4ec Correct display of tabified PICK_NONE menu 2026-08-30 16:44:26 -04:00
Ray Chason 564affea88 Remove limit in size of widget_table
It is difficult, but possible, to exceed 1024 widgets. One way is to
set a very large Unicode symbol set, and then use #wizcustom. As there
is no limit to how many objects can occupy a square, this limit is a
possible hazard even to a normal game.
2026-08-30 15:52:15 -04:00
nhmall 1b752f0e11 follow-up 2026-08-30 10:29:53 -04:00
nhmall 9c8b8249eb Linux build doc and a comment update 2026-08-30 09:59:10 -04:00
nhmall 845be15439 follow-up: stale comment removed altogether
The external reference was moved out of files.c elsewhere,
so the comment was no longer accurate.
2026-08-28 11:19:00 -04:00
nhmall 988eaa44b4 relocate declaration of sounddir
It shouldn't have been located inside an #ifdef USER_SOUNDS block.
2026-08-28 10:46:50 -04:00
Ray Chason d9194cb4df Make hero visible at start
Scroll to make the hero visible when starting and when the main window
is resized.
2026-08-27 18:10:26 -04:00
nhmall ebe14f87d9 corpse age comment cleanup 2026-08-26 10:22:46 -04:00
nhmall 15a017c030 fix undead corpses being edible now
In 3.6.x, zombie corpses were always aged an extra 100:

NetHack/src/mon.c

Line 375 in 23d331a

 obj->age -= 100; /* this is an *OLD* corpse */
in 5.0.x, zombie corpses are always aged TAINT_AGE, which is only 50:

NetHack/src/mon.c

Line 648 in 97a6c13

 obj->age -= (TAINT_AGE + 1); /* this is an *OLD* corpse */

This is the result of commit 408321b.
The accompanying comment states that the purpose of that patch was meant to
just replace hard-coded numbers with symbolic values, but the commit set
two differing numeric values to the same symbol name, thus causing the
regression reported in:

https://github.com/NetHack/NetHack/issues/1664

Revert the values to match those of 3.6, and add the additional symbolic value.

Closes #1664
2026-08-24 21:56:18 -04:00
Ray Chason f3e0dc49b8 Adjust screen height to allow for a task bar 2026-08-24 12:02:35 -04:00
Ray Chason a575fccf08 Add PNG support 2026-08-24 12:02:35 -04:00
Ray Chason cc47605531 Add BMP and GIF support 2026-08-24 12:02:35 -04:00
nhmall 97a6c131a9 Merge branch 'menu-columns' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-08-24 07:28:33 -04:00
nhmall b67553ccc7 follow-up 2026-08-23 19:33:39 -04:00
nhmall 9b4a8dfb05 mon interaction with terrain was postponed
Fix #576

Reported initially by @copperwater for polymorphed monsters:
"observe how the [polymorphed-monster] hovers placidly above the water for
several turns like Wile E. Coyote before it gets a move, realizes it's
above water, and drowns. Ditto for lava."

A comment in the GitHub issue thread by @Tomsod pointed out that a
revived corpse could do the same.

This should set things up for other terrain fallout if discovered or
implemented in the future.
   - consume an additional bit in enum mon_terrain_effects (hack.h)
   - include the additional bit in TERRAIN_FALLOUT_MASK (monst.h)
   - add detection to maybe_set_terrain_effects (mon.c)
   - add action to terrain_effects (mon.c)

Implemented by stealing some upper unused mstate bits to avoid
invalidating existing save and bones.
2026-08-23 18:51:13 -04:00
Ray Chason b61aef834e Set menu font to proportional 2026-08-22 20:46:13 -04:00
Ray Chason 7840d75365 X11: set menu font to proportional
Menus that needed to be tabified now are.
2026-08-22 20:43:46 -04:00
Pasi Kallinen f913cb3704 X11: support tab-separated menu columns 2026-08-22 10:59:12 +03:00
Ray Chason db32a639a7 Extend last column to end of line
If a line in the menu has fewer columns than the others, the last one
is deemed to extend to the right margin, and does not count toward the
maximum width of that column.

Also, revert the change to NetHack.font_menu.
2026-08-22 10:57:25 +03:00
Ray Chason cadde6d317 Use text window for display_file
The text window is assumed to use a monospaced font.
2026-08-22 10:57:25 +03:00
Ray Chason 84bf23640c Line up selectable items 2026-08-22 10:57:24 +03:00
Ray Chason ffb08d3be6 Don't set columns for rows without tabs 2026-08-22 10:57:24 +03:00
Ray Chason bc14bd7f30 Adjust extra menu width 2026-08-22 10:57:24 +03:00
Ray Chason ae8b4bf12a Add support for tabbed menu columns 2026-08-22 10:57:24 +03:00
nhmall 44b04064be static analyzer: use of uninitialized value 'origarg'
../sys/unix/unixmain.c: In function ‘process_options’:
  ../sys/unix/unixmain.c:458:9: warning: use of uninitialized value ‘origarg’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
    458 |         config_error_add("Unknown option: %.60s", origarg);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2026-08-21 09:36:17 -04:00
Ray Chason 94834df5d1 Revise the column width calculation
The last column in a line continues to the end of the line, and may
overhang any subsequent columns in other lines.
2026-08-21 08:19:04 -04:00
0xb1aded c99b485c78 fix: init color256 value to prevent color flickering 2026-08-21 19:54:05 +08:00
Ray Chason b08c4f92b2 Tabify more menus
* Status hilites
* Disclose option
* Symbol set selection
2026-08-20 08:14:13 -04:00
Ray Chason b52ea09e25 Tabify the extended command list 2026-08-20 07:28:01 -04:00
Ray Chason c5181b9cb8 Improve support for tabbed columns
* Set the menu font to proportional
* Do not consider the last column of a line when calculating maximum
  column widths
* Use U+200A HAIR SPACE for finer column padding
* Track errors in column padding and adjust subsequent columns so that
  these errors do not accumulate across a row
2026-08-20 07:25:36 -04:00
nhmall 540c0549d8 follow-up: MSYS2 build fix 2026-08-19 08:00:15 -04:00
nhmall 6950543bb9 build fix under MSYS2
../src/pline.c: In function 'execplinehandler':
../src/pline.c:678:15: error: implicit declaration of function '_spawnv' [-Wimplicit-function-declaration]
  678 |         ret = _spawnv(_P_NOWAIT, sysopt.msghandler, args);
      |               ^~~~~~~
../src/pline.c:678:23: error: '_P_NOWAIT' undeclared (first use in this function); did you mean 'MM_NOWAIT'?
  678 |         ret = _spawnv(_P_NOWAIT, sysopt.msghandler, args);
      |                       ^~~~~~~~~
      |                       MM_NOWAIT
../src/pline.c:678:23: note: each undeclared identifier is reported only once for each function it appears in
make: *** [GNUmakefile:1376: o/nethack/pline.o] Error 1
2026-08-19 07:36:21 -04:00
nhmall 4c4867d586 map_mode may appear more than once without a gripe 2026-08-19 07:16:57 -04:00
nhmall a2e805aee2 CI: fontconfig 2026-08-19 06:43:27 -04:00
nhmall dd94830c10 CI: add libxft-dev 2026-08-19 06:39:36 -04:00
nhmall f61709ab36 update CI Linux versions 2026-08-19 06:07:11 -04:00
Pasi Kallinen 94336e6b63 fixes update 2026-08-19 09:47:11 +03:00
Ray Chason 6dc9ac1c31 Adjust font hights so underscores are not cut off 2026-08-19 09:37:41 +03:00
Ray Chason b8dc070d07 Fix right side of border rectangle 2026-08-19 09:37:41 +03:00
Ray Chason 392142d322 For menu items, set up pixmap and then manage
The widget is created with a label but not a pixmap, and then a pixmap
is set up for display. If the label is already realized and managed, it
will not resize when the pixmap is set up. This causes problems when
the inventory window is updated: unlike other menus, the parent Form
widget is already realized. The fix is to create the item widget in an
unmanaged state (XtCreateWidget), set up the pixmap (X11_wrap_widget
and X11_set_attrs), and then manage it (XtManageChild).
2026-08-19 09:37:41 +03:00
Ray Chason 9179d5d960 Adjustments for MacOS compile
per comments by Michael Allison
2026-08-19 09:37:41 +03:00
Ray Chason e3170cdedc Provide more space between TTY-style status fields 2026-08-19 09:37:41 +03:00
Ray Chason 3f8e704231 More ifdefs; use Xft font to split messages 2026-08-19 09:37:41 +03:00
Ray Chason cada45a786 Apply appropriate #ifdefs and static declarations 2026-08-19 09:37:41 +03:00
Ray Chason 5883fe4abb Declutter the rendering code a bit 2026-08-19 09:37:41 +03:00
Ray Chason 7e39b3faf1 Note Xft support in option window 2026-08-19 09:37:41 +03:00
Ray Chason faba01dd25 Dismiss the text window on key press 2026-08-19 09:37:41 +03:00
Ray Chason 6e80039c49 Convert the tombstone window to Xft 2026-08-19 09:37:41 +03:00
Ray Chason 31f5ca334d Convert the text window to Xft 2026-08-19 09:37:41 +03:00
Ray Chason cfe67ecc62 Convert dialogs to Xft 2026-08-19 09:37:41 +03:00
Ray Chason 8ae58f9347 Convert the one line message prompt to Xft 2026-08-19 09:37:41 +03:00
Ray Chason 7c9cf20d1d Convert fancy status and menus to Xft 2026-08-19 09:37:41 +03:00
Ray Chason 9e57c85b16 Condition should be USE_XFT, not USE_XPM 2026-08-19 09:37:40 +03:00
Ray Chason 737b3ac89a Implement italic fonts 2026-08-19 09:37:40 +03:00
Ray Chason 9d1aac189e Convert TTY status to Xft 2026-08-19 09:37:40 +03:00
Ray Chason e53b76b0e5 Convert message window to use Xft 2026-08-19 09:37:40 +03:00
Ray Chason fbc586bf44 Convert map to use Xft 2026-08-19 09:37:40 +03:00
Pasi Kallinen d44b6385d7 Don't complain about MAXPLAYERS with unknown command line param
Unix command line handling treated an unknown command line parameter
as a maximum number of allowed concurrent players.  This emitted
a complaint about expected MAXPLAYERS, and as it can be now set
in sysconf, remove this - most likely unused - functionality.
2026-08-18 19:44:48 +03:00
nhmall f6a592b7f9 glob nutrition should match owt reduction
reported directly to devteam as an impossible() call
within eaten_stat()

(internal tracking number 3216)
2026-08-18 10:24:35 -04:00
nhmall 4474d3cb2a pcmain.c: remove added second early_init() call
early_init() was already being called at pcmain.c line 70,
so the recently added call at line 132 was problematic
because it cleared program_state values that had been
intentionally set since the call at line 70.
2026-08-18 07:54:46 -04:00
Pasi Kallinen 9de03944e8 fixes update 2026-08-18 13:42:24 +03:00
Ray Chason 23315cf857 Combine XLoadFont and XQueryFont calls
The separate calls crash if the font does not exist; the combined call
returns NULL, as the caller expects.

Resolves #1508 and possibly #569.
2026-08-18 13:40:35 +03:00
nhmall ef5beb917a fixes5-0-1.txt catch-up 2026-08-17 21:25:34 -04:00
k21971 7c13477d33 Fix: don't leak in_checkpoint on a failed level write.
save_currentstate() increments program_state.in_checkpoint and then
returns early without decrementing it when currentlevel_rewrite()
fails (full disk, quota, unwritable directory). The guard at the top
of the function suppresses every later checkpoint for the rest of the
game, leaving recover with nothing newer than the last checkpoint that
did get written, and nothing says so.
2026-08-18 00:30:41 +00:00
k21971 370c282240 Fix: first INSURANCE checkpoint is never written.
savestateinlock() returns early unless
program_state.something_worth_saving is set, but both call sites that
are meant to lay down the initial checkpoint run before that flag is
set: newgame() calls save_currentstate() two lines early, and
dorecover() calls savestateinlock() 73 lines before it, ahead of the
pass that writes out the level files.

Both calls are therefore no-ops, and the <uid><plname>.0 lock file
holds nothing but the pid written by getlock() until the hero first
changes dungeon level. A game that dies without a chance to save
during that window (SIGKILL, OOM killer, watchdog, host reboot)
cannot be rebuilt: recover has no save file name, no current level
number and no game state, and reports "Checkpointing was not in
effect", which is true of the outcome but misleading about the cause.
The window covers the whole of a long stay on one level, and in
particular the entire period right after a restore.

Set the flag before the call in newgame(). In dorecover(), drop the
ineffective call and checkpoint once the restore is complete instead;
at the original spot no level file for this session has been written
yet, so a checkpoint there would name a current level and save file
that are not on disk. The new call goes after program_state.restoring
is cleared, so that stairs and traps are written with the same
relative dlevel encoding a normal save uses, and it is
save_currentstate() rather than savestateinlock() so that
in_checkpoint is set while savegamestate() writes u.ustuck_mid and
u.usteed_mid.

This arrived with the something_worth_saving guard; 3.4.3, which has
no guard, is unaffected. Looks like this issue has been around since
version 3.6.0.
2026-08-18 00:30:23 +00:00
nhmall d8ea2087bc fixes5-0-1.txt update for prior commit 2026-08-16 10:35:31 -04:00
nhmall f11b65c680 don't call it "your pet" until after it is tamed
Reported directly to devteam, the code was using "Your little dog
devours the tripe ration" during the taming process, prior to the
pet becoming yours.
2026-08-16 10:31:31 -04:00
nhw_cron 845603e2d8 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-08-16 07:47:27 -04:00
nhmall 9cf2b1bac9 early arg support for older platforms
The startup had fallen behind NetHack 5.0 startup for other platforms,
and lacked support for some of the early command line options.

Following this, if PC_EARLY_OPTIONS is defined in pcconf.h, the
port will support those options, such as --version, --showpaths,
--dumpenums, etc.)

Currently, MSDOS #defines's PC_EARLY_OPTIONS, but AMIGA, ATARI,
and MAC68K do not.
2026-08-16 07:09:22 -04:00
Pasi Kallinen 0a6c355678 fixes update 2026-08-14 11:08:26 +03:00
Pasi Kallinen 4652cd3ae7 Remove extra array indices 2026-08-14 11:08:26 +03:00
Ray Chason 0454838d13 Arrange labels more compactly 2026-08-14 11:08:26 +03:00
Ray Chason ddbea3b727 Implement remaining status labels 2026-08-14 11:08:26 +03:00
Ray Chason fbfac21aac Fix menu group accelerators
If there are, say, two or more potions in the menu, and multiple
selections are allowed, then '!' should select all potions. Such keys
were selecting only the first matching item.
2026-08-14 11:08:26 +03:00
Ray Chason 2d261f1398 Implement all text attributes for menus 2026-08-14 11:08:26 +03:00
Ray Chason 84ff4f8b7e Fix a null dereference when freeing fonts 2026-08-14 11:08:26 +03:00
Ray Chason 3398d250aa Implement blink on fancy status
and fix a bug with condition labels on the TTY status
2026-08-14 11:08:26 +03:00
Ray Chason 24d9c19378 Parenthesize the HL_ATTCLR_* symbols 2026-08-14 11:08:26 +03:00
Ray Chason 514669823b Implement bold, dim, italic, inverse, underline
Didn't get everything the last time.
2026-08-14 11:08:26 +03:00
Ray Chason 8d7d609a56 Implement attributes: bold, dim, italic, inverse
Track highlighting of recent changes separately from inverse, and
display highlight plus inverse as bordered text
2026-08-14 11:08:25 +03:00
Ray Chason 0ee7eef3ef Implement a hit point bar 2026-08-14 11:08:25 +03:00
Ray Chason 6043d189e1 Define wrapper for Label widgets
Renders to a Pixmap and then sets the Pixmap. This in itself does not
change the appearance, but provides a means to do percentage bars,
italics and more.
2026-08-14 11:08:25 +03:00
Ray Chason f7bb4eaae8 Fix timeout of fancy status colors
This was trying to retrieve the foreground color of the form created
in create_value(). Forms don't have colors, and so this was failing,
and update_color() didn't update the color.
2026-08-14 11:08:25 +03:00
Pasi Kallinen b56189cfcd X11: toggle off perm_invent if the window is closed manually 2026-08-13 11:16:45 +03:00
Pasi Kallinen a64c7c64e5 X11: Allow scrolling menus with PageUp/PageDown/Home/End
Change the menu_key() translation table command so it accepts
a parameter, and we can pass a (default) menu control key to it.
2026-08-12 12:37:37 +03:00
nhmall feaa9ed334 update tested versions of Visual Studio 2026-08-11 2026-08-11 14:15:24 -04:00
Pasi Kallinen f019d03a2f X11: fix menu windows being taller than the screen
Menu windows with lots of entries (such as #optionsfull) were taller
than the screen, making them awkward to use.

The widget needs to be realized before we can get the size.
Also, we need to set the size of the parent popup, not the
acting widget.
2026-08-11 11:46:24 +03:00
Pasi Kallinen e9a9f63b4f fixes-5-0-1.txt update 2026-08-10 09:36:40 +03:00
Ray Chason c50f9d8176 Draw the hitpoint bar in the hitpoint colors 2026-08-10 09:28:04 +03:00
Ray Chason b9bf823100 Implement a hit point bar 2026-08-10 09:28:04 +03:00
Ray Chason ac169e7100 Clean up, and block out with STATUS_HILITES 2026-08-10 09:28:04 +03:00
Ray Chason ba2c99f28c Remove old code 2026-08-10 09:28:04 +03:00
Ray Chason b763944fb4 Implement three line status 2026-08-10 09:28:04 +03:00
Ray Chason 7521e7120a Implement blink 2026-08-10 09:28:04 +03:00
Ray Chason 8137f6cf3d Remove some debug code 2026-08-10 09:28:03 +03:00
Ray Chason 0f39437315 Implement underline and italic 2026-08-10 09:28:03 +03:00
Ray Chason a7eb50fb36 Query font for status window height 2026-08-10 09:28:03 +03:00
Ray Chason 647fd71a2d Implement bold and dim attributes 2026-08-10 09:28:03 +03:00
Ray Chason 5dd1673678 Implement colors 2026-08-10 09:28:03 +03:00
Ray Chason 725bb3d05f Display gold symbol as Unicode if so configured
Some Unicode bits from winmap.c are moved to winX.c, so that winstat.c
can also use them.
2026-08-10 09:28:03 +03:00
Ray Chason c2b4ee53e5 Begin reimplemented TTY-style status 2026-08-10 09:28:03 +03:00
nhmall cd493962b1 don't catch thrown objects while asleep
Reported directly to devteam.
2026-08-07 08:46:53 -04:00
nhmall 411c8becb9 follow-up
scope of cmdstr
2026-08-06 10:35:46 -04:00
nhmall c3ce341434 Re: "Key binding failed?!--More--"; Strcat to an empty character buffer, causing garbage
This is intended to resolve GitHub Issue #1650, which I was unable to directly reproduce
on my test system.

This fix assumes that the reported issue was related to cmdstr[BUFSZ] buffer not
getting initialized, thus containing random memory values.
2026-08-06 10:22:24 -04:00
nhmall 15cfe90d62 follow-up: build with Qt6 support on Linux with Qt 6.1
1d3178a quieted the g++ build, but made the warnings even
worse with a clang build.

The addition of the -Wno-sfinae-incomplete caused an unrecognized
option warning using recent clang.

Recent clang build with Qt6.1 also caused several warnings
during the processing of the Qt6.1 header files related to
c++26-extensions.

This adds (under Linux) -Wnoc++-26-extensions to the clang++
command line to quiet those warnings and restricts the
-Wno-sfinae-incomplete command line option to the g++ build.
2026-08-06 10:05:27 -04:00
Ray Chason e0ecf0e5f2 Fix highlighting in 16 color text map
vga_redrawmap did not have the inverse flag available. Provide it.
2026-08-04 16:05:27 -04:00
Ray Chason 3e800b90d3 Support pet and tile decals in 16 color mode 2026-08-04 15:55:36 -04:00
Ray Chason 9d5184562e More decal support for VESA
* Support decals in overview mode
* Draw decals when redrawing the map
2026-08-04 09:38:38 -04:00
Ray Chason 85bb8c1fbc Simplify the 24-bit case 2026-08-03 22:20:18 -04:00
Ray Chason 0c044e9c90 Add hilite flags 2026-08-03 22:12:32 -04:00
Ray Chason bd68058327 Extend decal support to all VESA modes 2026-08-03 22:12:14 -04:00
nhmall a8a13bed81 fixes5-0-1.txt update for previous commit 2026-07-31 15:07:53 -04:00
nhmall 29cb8b7d9a Windows: group accelerator and menu item collision
In the event that there is a collision between a menu group accelerator
and an individual menu item's accelerator, disregard the group
accelerator.

'$' is the only known collision in NetHack 5.0 presently.

Close #805
2026-07-31 14:53:19 -04:00
nhmall 9447bba227 Windows: don't revert -D on command line
Reported by @youbo0 in GitHub issue #1616

This issue text stated:
"To enter wizard mode, I have a shortcut with -D -u wizard as suggested by
the wiki for Windows players. However, the name is now overridden by a name
in .nethackrc since 5.0, resulting in me not actually entering wizard mode
due to having the wrong name despite using -u wizard. In the previous
version, -u wizard was applying properly regardless."

Closes #1616
2026-07-31 08:59:20 -04:00
nhmall 193da97bac fixes5-0-1.txt catch-up 2026-07-31 06:49:39 -04:00
nhmall 05733d28f4 food_disappears is missing a tin check #1648
Reported in GitHub issue #1648 by @janne-hmp
2026-07-31 06:25:58 -04:00
nhmall 404e949e95 one more follow-up 2026-07-30 22:35:47 -04:00
nhmall 1e749c28ce follow-up
adjust the mon_offmap(mon) macro to test any of the bits that
constitute being off the map, while ignoring some of the other bits
that do not.
2026-07-30 22:30:34 -04:00
nhmall 59080106b9 include clearing of MON_ENDGAME_FREE, MON_ENDGAME_MIGR bits in place_monster
Issue reported by @ars3niy

Fix #1647
2026-07-30 21:58:42 -04:00
nhw_cron 5f1183d1ef This is cron-daily v1-May-7-2026. 000files updated: Files 2026-07-30 08:15:08 -04:00
nhmall ff87463e47 initial hilite_pet and hilite_pile msdos tiles
This is an initial attempt at adding support for hilite_pet and
hilite_pile to the msdos tile implementation, using the new
decal.txt tiles.

This initial attempt only supports a 16-bit vesa mode.

Other vesa modes and vga have not been done as of yet.
Hopefully, someone more familiar with vesa might contribute
improvements and support of the other modes at some point.
2026-07-29 20:48:44 -04:00
nhmall de842ec483 add a set of decals to stock tileset
win/share/decals.txt contains (initially) a decal_delimiter tile,
a decal_pet tile, and a decal_pile tile.
The latter two can be used for hilite_pet and hilite_pile implementations
that don't have something in place already. The implementation would
just need to apply (merge) the non-background decal pixels over a
regular tile.

The special decal_delimiter tile can be used to confirm the presence
of the delimiter tiles in the tileset and mark the end of the regular tiles,
and the start of the decal tiles.
   row 1 contains the background color whose pixels should be
   ignored when applying a decal to a tile.
   row 2 contains a row of pixels colored (0, 0, 0).
   row 3 contains a row of pixels colored pure green (0, 255, 0).
   row 3 contains a row of pixels colored pure blue  (0, 0, 255).
2026-07-29 20:47:50 -04:00
nhmall 1d3178a199 build with Qt6 support on Linux with Qt 6.1 2026-07-27 16:27:20 -04:00
PatR a3a587dcf3 fix #K4498 - stethoscope vs double trouble Wizard
When the Wizard is diguised as some other monster, applying a stethscope
described him as "that <foo> is really a <foo>".
2026-07-25 13:33:39 -07:00
nhmall 812a9f1435 Cross-compiling doc bit 2026-07-24 08:36:39 -04:00
nhmall 86cb47dd6b address a warning in cmd.c
cmd.c: In function ‘dokeylist’:
cmd.c:2961:23: warning: ‘]’ directive writing 1 byte into a region of size between 0 and 255 [-Wformat-overflow=]
 2961 |     Sprintf(buf2, "[%s]", key2txt(key, buf));
      |                       ^
2026-07-23 10:01:55 -04:00
nhmall d6da7e9819 fixes entry for pull request #1632 2026-07-23 09:46:03 -04:00
nhmall d428fb6708 Merge branch 'msdos-config' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-23 09:36:48 -04:00
nhmall 1a4cdff17f update tested versions of Visual Studio 2026-07-23 2026-07-23 09:34:33 -04:00
Ingo Paschke 3b05012624 sfstruct: buffered stdio writes on amiga and atari st
Enable USE_BUFFERING for the structlevel savefile write path on AMIGA
and TOS via a new SFSTRUCT_BUFFERING config define, with a 16 KB
setvbuf on the fdopen'd write stream so many small bwrite()s coalesce
into few dos.library Write() packets.  Leaves mread() unbuffered.

Mainline UNIX/WIN32 are unchanged (setvbuf is gated on the new define);
MAC68K is not enabled, avoiding fdopen()/fclose() on its remapped
non-libc file handles.
2026-07-23 09:01:57 -04:00
nhmall c2a3321684 follow-up bit 2026-07-21 12:13:17 -04:00
nhmall eb13f4de6d LUA version checking in nhl_init()
Use LUA_VERSION_NUM, not LUA_VERSION_RELEASE_NUM, for the check.

Move the definitions of the versions supported by this release of
NetHack to the top of nhlua.c, rather than 2300 lines into the file.

Close #1633
2026-07-21 12:07:45 -04:00
nhmall 85e080bb5d windows calls genl_prag() during startup
genl_prag() will process  the prag@ command line options, if present

Close #1634
2026-07-20 16:11:01 -04:00
Francium-223 1821a6b2e3 a typo fix in data.base
Close #1618
2026-07-11 15:40:30 -04:00
Ray Chason e00b32263e Support the Curses-only configuration 2026-07-10 09:08:55 -04:00
Ray Chason 7889eedfa5 MS-DOS: Support no-tiles and no-graphics builds
In previous versions of NetHack, setting -DUSE_TILES enabled the tile
support, while setting -DSUPPRESS_GRAPHICS produced a NetHack that
would write its TTY output to standard output, and rely on ANSI.SYS or
similar to do screen control. (USE_TILES is now TILES_IN_GLYPHMAP.)

This change ensures that the current NetHack can be built the same
ways.

One twist is that previous NetHacks would drop all support for graphical
modes when tiles were not supported. Thus sys/msdos/vid{vga,vesa}.c have
very disordered use of TILES_IN_GLYPHMAP. There was no need to check
this. But now, the graphical modes also support Unicode. A non-tiled
build should have the graphical modes, with only the text functions
present, provided that ENHANCED_SYMBOLS is defined.

Some unused and locally used symbols were cleaned up along the way.
2026-07-09 23:48:14 -04:00
nhmall f41f1aa09a resolve a cross-compile link error 2026-07-09 16:42:56 -04:00
nhmall 05d1ed365f follow-up fixes5-0-1.txt 2026-07-08 07:38:37 -04:00
nhmall 00ad0e6f76 fixes5-0-1.txt entry for pull request #1620 2026-07-08 07:24:16 -04:00
nhmall ec0f2f0f48 Merge branch 'msdos-vga-colors' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-08 07:22:52 -04:00
Ray Chason f3f39311e5 MS-DOS: Define a separate palette for VGA text
In 16 color mode, text colors are mapped onto the colors available in
the tileset. The mapping is a compromise, and is not one-to-one: cyan
and bright cyan are the same, and magenta and bright magenta are the
same.

This change defines a separate palette for use by the text map, and
switches palettes on any transition between text and tiled maps.
2026-07-07 16:24:35 -04:00
nhmall ac151181d2 more u.ustuck issues on save/restore
During a synchronous save operation initiated by the player (or
other trigger for dosave0()), the u.usteed_mid and u.ustuck_mid
values get set by savemonch(), and the monst pointers that
u.ustuck and u.usteed point to are no longer valid, but not
cleared.

The checkpoint operation, which also needs to ensure that
u.ustuck_mid and u.usteed_mid are set, must set them during
the checkpoint, which is okay because the u.usteed and
u.ustuck pointers _are_ valid during a checkpoint operation.

So, we need to distinguish between a save game sequence,
and a checkpoint sequence when writing out the u struct.
2026-07-06 14:16:15 -04:00
nhmall 81ac4deb1e follow-up: fixes5-0-1.txt update 2026-07-06 11:04:13 -04:00
nhmall 98bb86ab33 Windows: fix ascii map hilite_pet
hilite_pet was working with tiles, but not with ascii map.
2026-07-06 11:00:50 -04:00
nhmall bb0016db0a Windows:OPTIONS=windowtype:tty NetHackW.exe issue 2026-07-06 10:59:53 -04:00
nhmall 749646e8d3 follow-up: fix a paste error 2026-07-06 08:17:38 -04:00
nhmall a6308ad5db follow-up: eliminate a fall through warning 2026-07-06 08:03:58 -04:00
nhmall 2f76934ded Merge branch 'preserve-ghost-info' of https://github.com/copperwater/NetHack into NetHack-5.0 2026-07-06 08:01:56 -04:00
nhmall 3d0fe29ff7 Merge branch 'improve-herecmd' of https://github.com/JodiJodington/NetHack into NetHack-5.0 2026-07-06 07:59:37 -04:00
nhmall f5f498eb9e fixes5-0-1.txt entry for pull request #1617 2026-07-06 07:58:16 -04:00
nhmall a4dbd17d15 Merge branch 'msdos-tile-processing' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-06 07:53:06 -04:00
Ray Chason 12560f9b13 Add return value where needed. 2026-07-05 22:26:42 -04:00
nhmall 4761d45deb Guidebook.txt update - July 4, 2026 2026-07-04 23:43:41 -04:00
PatR 9004f49b01 GENERICUSERS in Guidebook 2026-07-04 19:12:00 -07:00
nhmall 25be684830 trailing spaces removed from generated nhlua.h 2026-07-04 14:29:54 -04:00
nhmall adbab7f767 periodic style check: whitespace cleanup
leading tabs and trailing blanks
2026-07-04 14:17:43 -04:00
Ray Chason af79ad629c MS-DOS: some optimizations for tile handling
* In both the 16 color and the VESA mode, the tileset image is loaded
      and split into individual tiles; the tiles are then processed into a
      form that is compatible with the video mode in use. For 16 color mode,
      a tile is processed each time it is displayed, leading to slow
      redrawing. For VESA mode, each tile is processed at startup, leading
      to long startup times. Both modes are changed so that the tile is
      processed once, when it is first displayed, and the result is cached.

    * Use memcpy when splitting the image into tiles.

    * Only load the tileset once. In 16 color mode, for reasons I do not
      understand, the gr_init function is called twice, leading to delay
      in startup. This does not happen in VESA mode.
2026-07-04 13:43:23 -04:00
nhmall 2afd03e015 Guidebook update - July 4, 2026 2026-07-04 13:16:31 -04:00
nhmall 228576628c fix spot_monsters give-away
Resolves #1603
2026-07-04 12:53:33 -04:00
nhmall 7c418cff6a follow-up: a compiler warning fix 2026-07-03 09:39:02 -04:00
nhmall ece0c3ce3c fixes5-0-1.txt entries for three pull requests 2026-07-03 08:45:04 -04:00
nhmall d912ab5e6a Merge branch 'start-time' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-03 08:36:12 -04:00
nhmall 454ab83a36 Merge branch 'msdos-font-null-ptr' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-03 08:35:32 -04:00
nhmall 9abb13dfcf Merge branch 'msdos-fonts' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-03 08:34:53 -04:00
nhmall edb99dcf8f fixes5-0-1.txt catch-up; also fix some whitespace 2026-07-03 08:30:40 -04:00
Ray Chason b3fd7330ef Fix operator precedence 2026-07-03 00:24:17 -04:00
Ray Chason 1de1b531b3 Some optimizations of the glyph lookup
* src/glyphs.c: Don't produce names for swallow glyphs that can never
  appear. This speeds up the building of the glyph index in
  populate_glyphname_hash_indices.

* src/symbols.c: Build a sorted index for loadsyms so that it can be
  searched with bsearch.

Benchmarking results, using the MS-DOS port on an emulated 386SX at
16 MHz; times are as measured with clock() from the entry to main()
to the appearance of the "Who are you?" prompt:

* Unmodified:  48.5 seconds
* With the loadsyms index: 40.4 seconds
* With impossible swallow glyphs left unnamed: 34.5 seconds

These changes should also be helpful for the Amiga and Atari ST ports.
2026-07-02 23:08:42 -04:00
Ray Chason ae8982fe3e MS-DOS: Check font pointer for null
The 16 color mode loads the font specified in font_map, and accepts it
only if its size is 8 by 16 pixels. This change avoids a null
dereference if the font is not found.
2026-07-02 21:34:35 -04:00
Ray Chason 3384619431 MS-DOS: Add Extended2 symbols to the bundled fonts
This change adds U+2299, U+2601 and U+2980 to the bundled fonts, so
that all symbols specified in the Extended2 symbol set are available.

Also, a few more directives are added to the files, so that FontForge
can load them and display their contents.
2026-07-02 21:22:30 -04:00
nhmall 5e80fd3b93 wand of stasis when off level
Account for the time spent on other levels for
wand of stasis

Resolves #1608
2026-07-02 17:48:29 -04:00
nhmall aaf601ffc8 follow-up bit 2026-06-28 17:49:00 -04:00
nhmall bfa924bb0e replace hardcoded number with correct enum value 2026-06-28 17:46:17 -04:00
nhmall c918878299 follow-up: field name typo 2026-06-27 11:45:36 -04:00
nhmall 90aaeb53cd follow-up: zero out puzzling_criteria 2026-06-27 11:41:54 -04:00
nhmall ac3d71a82a give player an inkling of why corpses didn't stack
When corpses haven't stacked, and there is no player-discernable
reason why, provide some additional information in some cases,
but only when it is required.

Gender variance is the supported case in this commit.

Related to GitHub issue #1607.

This commit doesn't change the underlying mechanics to allow
the corpses to stack, but it does help the player understand
why that's the case in this instance.
2026-06-27 11:18:44 -04:00
nhmall 6fee8a4e78 yet another warning bit
In file included from ../include/hack.h:34,
                 from sp_lev.c:14:
In function ‘create_monster’,
    inlined from ‘lspo_monster’ at sp_lev.c:3386:5:
../include/rm.h:528:32: warning: array subscript -1 is below array bounds of ‘struct monst *[80][21]’ [-Warray-bounds=]
  528 |         if (!svl.level.monsters[x][y])                     \
      |              ~~~~~~~~~~~~~~~~~~^~~
sp_lev.c:2045:25: note: in expansion of macro ‘remove_monster’
 2045 |                         remove_monster(x, y);
      |                         ^~~~~~~~~~~~~~
../include/rm.h: In function ‘lspo_monster’:
../include/rm.h:476:19: note: while referencing ‘monsters’
  476 |     struct monst *monsters[COLNO][ROWNO];
      |                   ^~~~~~~~
In function ‘create_monster’,
    inlined from ‘lspo_monster’ at sp_lev.c:3386:5:
../include/rm.h:530:27: warning: array subscript -1 is below array bounds of ‘struct monst *[80][21]’ [-Warray-bounds=]
  530 |         svl.level.monsters[x][y] = (struct monst *) 0;     \
      |         ~~~~~~~~~~~~~~~~~~^~~
sp_lev.c:2045:25: note: in expansion of macro ‘remove_monster’
 2045 |                         remove_monster(x, y);
      |                         ^~~~~~~~~~~~~~
../include/rm.h: In function ‘lspo_monster’:
../include/rm.h:476:19: note: while referencing ‘monsters’
  476 |     struct monst *monsters[COLNO][ROWNO];
      |                   ^~~~~~~~
2026-06-26 15:21:19 -04:00
nhmall 2b2f949484 address another warning
sounds.c: In function ‘domonnoise’:
sounds.c:818:40: warning: array subscript [0, 1] is outside array bounds of ‘const char * const[2]’ [-Warray-bounds=]
  818 |                     verbl_msg = vampmsg[vampindex];
      |                                 ~~~~~~~^~~~~~~~~~~
sounds.c:786:38: note: while referencing ‘vampmsg’
  786 |             static const char *const vampmsg[] = {
      |                                      ^~~~~~~
2026-06-26 15:11:42 -04:00
nhmall c40bf4658d more warning cleanup
The use of strncat and eos(buf) together was odd anyway.
2026-06-26 14:56:26 -04:00
nhmall e3407a923f address some compiler complaints 2026-06-26 12:30:36 -04:00
JodiJodington ae011af026 added a button that shows previous messages to herecmdmenu 2026-06-24 13:11:20 -05:00
JodiJodington 8c3a553f4b added an attributes button to herecmdmenu 2026-06-24 12:17:12 -05:00
JodiJodington 3574a99d35 added a jump button to herecmdmenu 2026-06-24 12:17:12 -05:00
JodiJodington 06436b69d3 added an engrave button to herecmdmenu 2026-06-24 12:17:00 -05:00
JodiJodington 164c057d5f added a pray button to herecmdmenu 2026-06-24 12:16:37 -05:00
nhw_cron 5911ee19d0 This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-06-23 21:36:13 -04:00
Kevin Nowaczyk e381605bba Remove wintype.h include from hack.h
Removed unnecessary second include for wintype.h
2026-06-23 18:18:59 -07:00
nhkeni 2c58864b1c CRASHREPORTURL should have been updated at 5.0.0 release 2026-06-23 19:14:54 -04:00
JodiJodington f119ab3dcf made it so the drop button in herecmdmenu does a multi-drop 2026-06-23 15:22:10 -05:00
nhmall e6b5338441 some windows build updates 2026-06-21 14:18:00 -04:00
nhkeni 1fa60f7536 Add a new T-shift slogan. 2026-06-21 14:10:51 -04:00
copperwater 43c302d927 Copy bones monster info to recorporealized ghost
This is a reimplementation of commit ec32748 in TNNT by entrez:

    If you use undead turning on a dead hero's corpse from a bones file,
    its ghost will get sucked back into its body when it comes back to
    life.  In such cases, treat the newly revived corpse/recorporealized
    ghost as a "former hero" for the purposes of livelogging bones
    monster kills.

Part of this change was to remove a bit of weirdness in the game - the
odd situation where you revive a corpse-ghost combo on a bones pile, and
get the messages:

    The human corpse glows iridescently.
    Foo's ghost is suddenly drawn into its former body!
    The human is resurrected!

and subsequently the monster is just a generic human (or elf, etc)
without anything indicating it used to be a player. With this change,
the monster will retain the name that the ghost had, and its struct
ebones prevents the player from renaming it.

This commit also adjusts the "resurrected" message to explicitly use the
monster's name if it has one, and to use YMonnam in the unrelated case
where the monster was a pet (so reviving an unnamed tame kitten will
print as "Your kitten is resurrected!")
2026-06-21 06:42:10 -04:00
nhmall 186d9524de missed a line in this file 2026-06-20 20:02:31 -04:00
nhkeni 7c694ad785 Remove deprecated option --version:paste
This should have been deleted before the 5.0.0 release.
2026-06-20 19:43:26 -04:00
nhmall 6808e87869 yet more 3.7 cleanup 2026-06-20 18:55:28 -04:00
nhmall 6399e0070b dat/*.lua 3.7 vestiges 2026-06-20 18:35:38 -04:00
nhmall 198ac655e5 more 3.7 vestiges
A little later than this probably should have been committed.
2026-06-20 18:26:43 -04:00
nhkeni f5724ff9e6 fixes entry for my previous commit 2026-06-20 17:57:48 -04:00
nhkeni 39434c9a2c Merge branch 'NetHack-5.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-5.0 2026-06-20 17:50:30 -04:00
G. Branden Robinson d7ce2410b0 fixes5-0-1.txt update 2026-06-20 15:31:53 -04:00
nhmall f5f87c7ee9 missed version bit 2026-06-20 11:18:14 -04:00
nhkeni 11dc617483 Merge branch 'NetHack-5.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-5.0 2026-06-19 20:59:55 -04:00
nhkeni 10d87c4b9d nhgitset: Deprecate PRE and POST hooks.
nhgitset version 6
prepare for future phases to get rid of those hooks
fix some minor bugs
2026-06-19 20:44:46 -04:00
Patric Mueller bb040cc2e1 Merge branch 'ars3niy-curses256' into NetHack-5.0
Closes #1561
2026-06-19 16:36:53 +02:00
Doktor L 08ac68b754 Use 256 colours in curses window port
Only glyphs that are customised via config can have colours different
from the basic 16. For such glyphs, when curses supports 256 colours,
use them.
2026-06-19 16:36:27 +02:00
Doktor L 19c87585fa Create curses colour pairs for 256 colours
Keep only 8 background colours but if curses supports 256 colours and
256*8 colours pairs, create colours pairs for 256 foregrounds rather
than just 16.
2026-06-19 16:36:27 +02:00
Doktor L 7036f902d2 Pass base-256 colour index to curses_putch
And to its inner function write_char
2026-06-19 16:36:27 +02:00
Doktor L f3d292e111 Combine three arguments of curses_putch into one
It will need another parameter for 256-colour support. To avoid having
too many arguments, put glyph colour, background colour and attributes
into a struct and, since to curses library all of that is attributes
that are handled by same function, call the struct "gryph attributes".

curses_putch was also declared in two different headers, remove one of
those declarations.
2026-06-19 16:36:27 +02:00
Doktor L 24adb1c592 curses: use existing background parameter for pile
The blue background colour for piles was implemented by changing glyph
colour to curses colour pair with the desired background, and then
passed to curses_putch which takes character and background colour and
makes curses colour pair out of them once again.

Pass blue background to curses_putch instead and let it create curses
colour pair just once.
2026-06-19 16:36:27 +02:00
nhmall 43ae611d64 fixes5-0-1.txt entries following pull request 2026-06-19 10:20:50 -04:00
nhmall 33e2f54e7c Merge branch 'correct-regions-with-ball-travel' of https://github.com/copperwater/NetHack into NetHack-5.0 2026-06-19 10:17:40 -04:00
nhmall 04963ecf81 follow-up: add a general catch for "says" 2026-06-19 10:08:42 -04:00
nhmall 8705d12046 Merge branch 'shopkeeper-voice-respects-deaf' of https://github.com/copperwater/NetHack into NetHack-5.0 2026-06-19 10:07:11 -04:00
copperwater 7a23470c33 Fix: thrown ball travel did not check for regions
This is an issue that we discovered in TNNT last year when we added a
custom region with effects that trigger upon entry: it was possible to
bypass those effects by entering the region via a thrown iron ball.

This can be demonstrated by creating a poison gas cloud and then
dragging oneself inside the cloud behind a thrown ball: you land in the
cloud and are surrounded by poisonous gas, but are unharmed by it.

This commit fixes the iron ball code to call in_out_region when
appropriate, which handles the side effects of entering and exiting
regions in addition to preventing travel into or out of a hypothetical
region that blocks entry or exit.
2026-06-19 09:35:23 -04:00
copperwater b54c38c65b Fix: a shopkeeper msg was printed even when deaf
The message in question is '[shopkeeper] says "You be careful with my
[item]!"' when you wield a shop-owned item, but it was being printed
even when the hero is deaf.

Following other examples of shopkeeper dialogue, the correct thing to do
here is not to suppress the message if deaf but instead provide some
nonverbal feedback, so that is what I did.
2026-06-19 09:12:57 -04:00
nhmall 118899a5f0 update tested versions of Visual Studio 2026-06-18 2026-06-18 09:48:34 -04:00
nhmall 6d0757fc86 Fix MS-DOS crosscompile on macOS host 2026-06-16 19:56:30 -04:00
nhmall d13eceb28b eliminate one more source of vault guard newsym msgs
see_monsters() was producing spurious vault guard at 0,0
messages

Reproduce issue by:
    1. Entering vault via teleport.
    2. Wait for guard to enter.
    3. Drop gold (if necessary) and follow guard.
    4. Right after the guard disappears, but before
       the corridor does, the following can lead to
       the messages:
       a) control-R to refresh the display.
          or
       b) save the game and restore.

       In both cases, see_monsters() will get called and lead
       to the spurious messages for the vault guard that is
       parked.

Also, add a macro PARKEDMONSTER(mon) instead of checking the
the isgd bit and the value of mon->mx being zero in multiple
places

Also, adds MON_PARKED bit to mstate.
Currently the PARKEDMONSTER(mon) macro mentioned above,
does not use the new bit.
2026-06-14 14:31:18 -04:00
nhmall 8e9d23b578 msdos warning bit
../sys/msdos/font.c: In function 'load_font':
../sys/msdos/font.c:89:22: warning: unused variable 'j' [-Wunused-variable]
   89 |             unsigned j;
      |                      ^
2026-06-12 11:00:28 -04:00
nhmall b0e24236e3 update tested versions of Visual Studio 2026-06-12 2026-06-12 06:07:27 -04:00
PatR dfd6e0739f fix issue #1580 - item action for leash in use
Issue reported by JodiJodington:  the item action for a leash didn't
distringuish a leash that is already in use from one that isn't.

Fixes 1580
2026-06-12 01:11:43 -07:00
nhmall 6c11cac0f7 fixes5-0-1.txt entry for pull request #1581 2026-06-11 14:09:25 -04:00
Ray Chason 0248dbf550 MSDOS: Accept only single character font mappings
* makefont.lua generates incorrect PSF fonts. There can be multiple
  characters mapped to a single glyph, but the mappings should be
  separated by FE bytes.

* font.c should accept only single character mappings -- not combining
  sequences. The bundled fonts have no combining sequences, but I am
  exploring other options that provide more Unicode coverate.
2026-06-10 23:14:09 -04:00
nhmall 958415607b periodic style check: whitespace cleanup
leading tabs and trailing blanks
2026-06-10 15:52:13 -04:00
Patric Mueller 49ac961884 replace NOTPARMDECL with TPARM_WORKAROUND
The old logic used a negative check to emit an extern declaration for
tparm(). This guarded against old platforms whose curses implementations
did not declare their own functions.

If there are still any platforms left that need this declaration, they
can set TPARM_WORKAROUND to get the old behavior back.
2026-06-10 10:16:44 +02:00
nhmall 178b295701 Merge branch 'fix/overflow-checks' of https://github.com/0x0b1ade/NetHack into NetHack-5.0 2026-06-09 22:54:20 -04:00
nhmall e5a3ec9219 follow-up: whitespace bit 2026-06-09 22:50:33 -04:00
nhmall 9d44b1dbce follow-up: fixes5-0-1.txt 2026-06-09 22:49:36 -04:00
nhkeni 383d810357 re-write fetch-Lua target
cleaner output
better structure
better error checking and recovery
2026-06-09 17:22:12 -04:00
nhmall e34238d2bc MS-DOS: several fixes for the tiled map 2026-06-09 16:48:02 -04:00
nhmall 1faa85010d Merge branch 'msdos-map-fixes' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-06-09 16:36:21 -04:00
Ray Chason 1ac6ec5d1e MS-DOS: several fixes for the tiled map
VESA mode: Set the viewport size correctly so the position bar does
not overlay the map.

VESA mode: Correctly set the size to which tiles are stretched when
overview mode (F4) is selected.

Both VESA and 16 color modes: Pass correct parameters to vga_userpan
and vesa_userpan, so the pan keys (CTRL+arrow) work correctly.
Some emulations don't report CTRL with up or down arrows, so accept
CTRL-home, CTRL-page up, CTRL page down and CTRL-end.

16 color mode: Set the panning direction so CTRL-left and CTRL-right
pan in the same direction as 3.4.3.
2026-06-09 16:25:46 -04:00
PatR c8b15fe854 pull request #1557 - erinyes level adjustments
Pull request from youbo0: when hero's alignment gets low enough, the
adjusted experience level for erinyes effetively dropped instead of
increased.  It was being capped at 50 which has a special meaning for
monsters.

Change the level limit to 49 which is as high as ordinary monsters go.

Does not affect saved data.

Fixes #1557
2026-06-09 13:00:22 -07:00
nhmall 57111e3c1f update pdcursesmod submodule 2026-06-09 09:40:15 -04:00
nhmall 917cc1a596 add pair of generated files to .gitignore 2026-06-08 13:47:55 -04:00
nhmall 7e18df3c5f ensure sane values for monst fields from bones 2026-06-08 00:06:59 -04:00
nhmall c0f06ac4fd follow-up to 84a6eb5e
Ensure MON_STILL_ARRIVING bit is cleared before an early return.
2026-06-07 23:54:43 -04:00
Alex Smith b309392b5a Fixes entry for the recent bugfix 2026-06-08 04:42:44 +01:00
Alex Smith 738aa5c076 Make monsters not scared of the Sokoban rolling boulder traps
They aren't initially loaded with boulders, thus aren't dangerous.

This is particularly relevant for pets, who would otherwise be very
reluctant to follow their owners up to the level above.
2026-06-08 04:41:31 +01:00
Alex Smith 9f7a9d2c88 Prevent off-map monsters banking turns
If a monster is marked as off the map, then it is included in
iterations over the monster list, but not allowed to move. This
meant that such monsters would gain movement points on every turn
but not spend them, which could lead to the monster taking a lot of
turns in a row when placed back onto the map.

This commit removes the movement allocation from monsters that are
flagged as dead or removed from the map, meaning that they neve
get more than one turn's worth of movement allocation.
2026-06-08 04:04:12 +01:00
nhmall 28cc7cb6bf Merge branch 'msdos-colors' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-06-07 17:29:42 -04:00
Ray Chason a160322aef MS-DOS: Fix custom colors in VESA BIOS mode
The basic colors are being displayed as black. Colors specified as RGB
are not being converted to the pixel format for the current mode.  This
manifests as walls in dungeon branches being drawn in black when the
symbol set is IBMgraphics, and in the wrong color when Enhanced1 is in
use and the display mode uses 15 or 16 bits per pixel. A particular
mode that shows this bug is 1024 by 768 under DOSBox.
2026-06-07 17:09:27 -04:00
0x0b1ade 4d590abac1 Add length checks in init_dungeon_dungeons 2026-06-07 22:02:20 +08:00
nhmall cbfd3aa944 placement for the added save_currentstate() call wasn't right
in gulpmu() that particular placement would result in u.uswallow = 0,
and u.ustuck set.

A better optimal location needs to be sought.
2026-06-07 01:52:54 -04:00
nhmall 51486d0c02 fix recover failure after unexpected exit
u.ustuck and u.usteed are handled differently in 5.0.0 than
in previous releases, and an unexpected halt to NetHack could
result in an inability to use recover to get the game back.

If the hero was engulfed, u.uswallow, could get saved to the
checkpoint file with a value of 1 without a corresponding
u.ustuck_mid value representing the m_id of the engulfing monster.

Recover had no information to use to restore the u.ustuck pointer
when loading the monsters on the level.

With u.uswallow set to 1, the game would proceed to enter if-blocks
based on that, and then crash/fault when it attempted to dereference
u.ustuck, during the recover attempt.

This updates the values of u.ustuck_mid immediately before saving
struct you during a checkpoint, so that the resulting file had
u.uswallow and u.ustuck_mid values that were in concert.

It does the same for u.usteed and u.usteed_mid.

This also now adds a save_currentstate() checkpoint call when
the swallowed/unswallowed status changes, that is whenever set_ustuck()
is called.
2026-06-07 01:31:19 -04:00
nhmall 1f4198c705 aklys message improvements 2026-06-06 15:01:54 -04:00
nhmall 498db90437 follow-up: fixes5-0-1.txt entry 2026-06-06 12:29:39 -04:00
nhmall 7f787a372a Merge branch 'pl_character-overflow' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-06-06 12:27:03 -04:00
Ray Chason 19c85c1987 Don't overflow svp.plname on restore 2026-06-06 12:10:15 -04:00
nhmall ed1b4af5cd fix build on Windows arm64 2026-06-06 10:36:47 -04:00
nhmall 393f42cd6f follow-up: grammar and format string 2026-06-05 20:17:48 -04:00
Ingo Paschke 78f59660d0 mac: drop the obsolete exit getreturn
The revived mac68k port (on the m68k-wip branch) removed it: it runs
an event loop after exit_nhwindows() has torn the windowing system
down and crashes; the tombstone already pauses.  Removing it here too
keeps the block from resurfacing in NetHack-5.0 <-> m68k-wip merges.
2026-06-05 19:46:05 +02:00
Ingo Paschke 28ca8b26c3 rename MACOS9 to MAC68K to avoid confusion with modern macOS 2026-06-05 16:30:09 +02:00
nhmall 2950bd85cb Revert "don't attempt with a blank host name in fetch-lua"
This reverts commit 9566605ba2.
2026-06-04 21:17:41 -04:00
nhmall f2fc324bef Revert "follow-up"
This reverts commit 0ea0de5301.
2026-06-04 21:17:15 -04:00
nhmall d1f9c17418 Revert "yet another follow-up for Makefile.top fetch-Lua"
This reverts commit 784692fd40.
2026-06-04 21:16:44 -04:00
nhmall c20f5acbb5 Revert "one more follow-up"
This reverts commit 1c649facea.
2026-06-04 21:16:17 -04:00
nhmall 1c649facea one more follow-up 2026-06-04 20:32:50 -04:00
nhmall 784692fd40 yet another follow-up for Makefile.top fetch-Lua 2026-06-04 20:22:50 -04:00
nhmall 0ea0de5301 follow-up 2026-06-04 20:14:29 -04:00
nhmall 9566605ba2 don't attempt with a blank host name in fetch-lua
After exhausting the three URL's for fetch-lua, exit with error,
don't try to connect to a URL with a blank host name.
2026-06-04 20:01:46 -04:00
nhmall cdd42b88a2 curl was not returning an error to shell on 404 error
Add the --fail option to curl to make it do so.
2026-06-04 19:21:26 -04:00
nhmall 19f0ae07cc follow-up: regression reported, so comment out until researched 2026-06-04 16:55:33 -04:00
nhmall 3d46ee9523 follow-up from yesterday: ascii_map done uniquely 2026-06-04 15:57:53 -04:00
nhmall 6c1d7c074d follow-up: do the flush_screen(0) at end always 2026-06-04 15:54:11 -04:00
nhmall 93e7928a6f follow-up: fixes5-0-1.txt update 2026-06-04 15:44:41 -04:00
nhmall 2edf27f0f0 aklys fixes
track which locations had updates that could be seen in tmp_at()
to aid in cleanup.

ensure that nothing is shown for places that the hero can't see
(internal buglist entry 3161).

adjust several aklys messages to better reflect the tethering
aspect.
2026-06-04 15:36:12 -04:00
nhmall ecfa78f974 cherry-pick for CROSS; use "?=" for MAKELUAFLAGS
Using "?=" allows a hints file to set that ahead of Makefile
2026-06-04 07:21:22 -04:00
Ingo Paschke 63cb04f410 hints: keep host CC for top-level lua in cross builds
LUAMAKEFLAGS uses TARGET_CC, which the cross hints override to the
target compiler.  The top-level liblua.a is a host-side prerequisite
of the generated include/nhlua.h; the target lua is built separately
under BUILD_TARGET_LUA.
2026-06-04 07:17:35 -04:00
nhmall 006867cf0d catch-up entry for fixes5-0-1.txt 2026-06-03 19:48:46 -04:00
nhmall fd0a4ec878 optlist.h maintenance
A very small number of boolean options had drifted, such that
their initval setting did not match its opt_in or opt_out value.

Correct that, by ensuring opt_in or opt_out reflects what was
actually happening.

The only option whose initial value is changing as a result
of this is timed_delay. It was listed as an opt_out option, but
was not being initialized as such. Now it is. This makes the
Mac X11 throwing animations work correctly with the earlier
timed_delay option adjustments for X11. There was nothing
displaying on Mac X11 after those earlier changes, unless
the timed_delay option was turned on.

Going forward, for boolean options, setting opt_in or opt_out
is all that is required, as that was the original intention
of those fields. It will take precedence if they fall out of
sync again.
2026-06-03 17:44:49 -04:00
nhmall cd047cc6b8 thinko in comment 2026-06-03 16:38:53 -04:00
nhmall 8182cf3982 required after TIMED_DELAY fix previously committed 2026-06-03 16:29:51 -04:00
Pasi Kallinen eb4d098717 X11: Obey timed_delay
I noticed a strange thing where the X11 windowport didn't show the tethered
thrown aklys animation correctly.  Interestingly, other stuff, such as zapped
wands did show the path.  I didn't bother trying to figure out what the core
was doing differently, as the animation worked in all the other windowports,
so instead fix the issue in X11, so it behaves the same as all the others.

The issue seems to be that the event loop exited on any(?) event, instead
of our specific timed event.  So, create our event with a magic id number,
and exit only when we encounter that.

Also: Obey the timed_delay option, and change the delay from 30ms to 50ms,
like in other windowports.
2026-06-03 23:06:30 +03:00
nhmall d4e2c577ba follow-up: CC override was in MAKELUAFLAGS
Just make sure it is uing the correct one
remove the addition in the previous commit
2026-06-03 13:49:43 -04:00
nhmall 4b65360d3c allow hints file to specify compiler for Lua 2026-06-03 13:45:49 -04:00
nhmall 49d3d5ecd8 Makefile.utl would allow hints file to specify TARGET_CC 2026-06-03 13:27:19 -04:00
Pasi Kallinen 4fadc7c96f Fix qt compile
Some recent Makefile hints reorg messed with the Qt compile,
it needs to be linked tiles
2026-06-03 10:54:16 +03:00
nhmall 0aba284106 better placement for ensuring graving vanishes
This is better placement for making the original
engraving vanish when told that it vanishes;
helps to ensure that it isn't showing for any
next steps.

also, a warning bit
2026-06-02 09:34:52 -04:00
nhmall 29c300b4e0 stale engraving marker still showing at prompt 2026-06-01 20:44:17 -04:00
nhmall a31a9cb152 Makefile.nmake updates for git_sha 2026-05-31 18:28:06 -04:00
nhmall c112e50afe follow-up: indentation bit 2026-05-31 13:57:56 -04:00
nhmall ef48aa3c18 Merge branch 'fix-libnh-glyphpiletop-constant' of https://github.com/avgas3/NetHack into NetHack-5.0 2026-05-31 13:46:23 -04:00
nhmall 055caaffbf revisit shop_keeper() readiness
During a restore from a savefiles is not the only
time that levels are processed by getlev() in NetHack.
They are read back in as the hero moves up and down
between levels and dungeons.

The previous fix checked for program_state.beyond_savefile_load,
but once set, that remains static through level changes.

It would be better to check the status of the level
being read, because those operations do placements as well.

Add the following:
    struct levelstatus level_status;
    level_status.making   - in the midst of makelevel processing
    level_status.loading  - in the midst of loading a level via getlev()
    level_status.ready    - the level is fully ready

    (all 3 of the above status settings are mutually exclusive)

    level_status.shkready - the level processing is far enough
                            along to allow shop keeper tests and actions

This also relocates the find_lev_obj() call in getlev() down several
lines, so that it falls after any set_residency() calls, so that it
has a better chance of carrying out what it was intending to do with
the shop_keeper() checks made by its subfunctions.
2026-05-31 13:26:34 -04:00
Housebot 3096da48fe libnh: export GLYPH_PILETOP_OFF constant
Expose GLYPH_PILETOP_OFF in libnh JS constants so embedding apps
can distinguish statue glyphs from piletop glyphs.
2026-05-31 11:21:25 -06:00
nhmall f72554a238 avoid shk interaction too early 2026-05-30 15:54:18 -04:00
nhmall b6b35a8d0f yet-another fixes5-0-1.txt update 2026-05-30 11:48:31 -04:00
nhmall 13ff430b14 Alter the fixes5-0-1.txt entry to match code 2026-05-30 11:45:20 -04:00
nhmall 78e7b23b1e follow-up: Unix uses different code; build fix 2026-05-30 11:40:54 -04:00
nhmall bb407a84da follow-up: fixes5-0-1.txt entry re:previous commit 2026-05-30 11:38:38 -04:00
nhmall 2a912fe001 SELECTSAVE update
In SELECTSAVE implementations, out of date savefiles in the
tree were triggering error messages to the user during the
building of the pick list. The file with the error never
ended up on the pick list, or got removed, so the error was
perpetual on every SELECTSAVE startup.

This passes the UTD_QUIETLY flag down the the small set of
callers involved, so that when it was received by uptodate(),
it went about its verification work quietly.
2026-05-30 11:32:37 -04:00
nhmall e82a1f3276 Merge branch 'glyphs-fixes-take2' of https://github.com/ingpaschke/NetHack into pr1559 2026-05-30 08:12:32 -04:00
Patric Mueller 207db14301 tty: handle indexed colors separately from RGB color space
The terminfo entries from the standard ncurses distribution have
peculiar settings for entries supporting 24 bit colors. The direct
entries mix indexed and RGB values into an incompatible mess.

This commit adds a simple workaround for the tty port.  Colors are
initialised as if only 8 ANSI colors are available.  This does not
affect color customisation from the symsets.

The curses port is affected as well. But I am not yet comfortable to
refactor a large part of the code for an absolute edge case.
2026-05-30 13:53:13 +02:00
nhw_cron a24a0240ce This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-29 15:40:37 -04:00
nhw_cron 526ffaa582 This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-29 15:40:22 -04:00
nhmall 0c7070037d yet another Guidebook follow-up 2026-05-29 06:42:39 -04:00
nhmall d676206200 follow-up bit Contributing.md 2026-05-29 06:31:01 -04:00
nhmall 898a430617 follow-up bits for Guidebook.mn processing 2026-05-29 06:27:02 -04:00
nhmall 942f34c883 fix file name in header line 2026-05-28 21:11:38 -04:00
nhmall 287d3f60b5 tone down header lines on GitHub Contributing pg 2026-05-28 21:06:39 -04:00
nhmall 883620699f Guidebook.txt update
Created from make. The cron repo did not have today's updates.
2026-05-28 17:43:02 -04:00
Ingo Paschke 5f817fe9ad glyphs: code-review fixes and parse_id off-by-one
- cmap_offset was calculated on every compose_glyph_name() call;
    calculate it once with a static function.
  - Drop parse_id's G_ auto-populate: an unbracketed lookup allocated
    the index with no matching free.  Linear-scan instead when absent.
  - compose_glyph_name: require bufsz >= BUFSZ, build names with
    bounded Snprintf instead of Strcpy/Strcat, drop the dead memchr.
  - parse_id's permonst scan used i <= pm_count, reading one past the
    SYM_MON block (S_nothing) and matching it as a monster; use <.
  - Drop a stale NO_GLYPH empty-bucket comment from the open-addressed
    table.
2026-05-28 21:08:54 +02:00
nhmall 29380dfdb9 follow-up: TeX doesn't require special handling for ']' 2026-05-28 11:32:06 -04:00
nhmall f47edf59c3 Guidebook update
Make it clear that the *DIR options are not available on Unix.

Related to discussion on GitHub Issue #1552
2026-05-28 11:17:46 -04:00
nhmall a9401fd78a Guidebook bits for Jon Wätte (Jon W{tte)
There is no unintentional spelling mistake.
Close #1523
2026-05-27 23:02:19 -04:00
nhmall 6c950d958f util project needed strutil.c and alloc.c
It was using dupstr(), so strutil had to be added to the project.
2026-05-27 20:58:29 -04:00
nhmall 4e80fda312 build fix for util 2026-05-27 20:51:51 -04:00
nhmall f88d410ba2 typos 2026-05-27 20:14:50 -04:00
nhmall 38d8d2972d README 3.6 vestige 2026-05-27 20:05:59 -04:00
nhmall 0bf0498155 add dirs-perms.500 and a default build change
The directories and permissions portion of the linux.500 and macOS.500
hints files and their included files has been consolidated to
dirs-perms.500.

The builder can edit that one file now, to identify
the folders that will be utilised as part of the build.

Alternatively, you can set those folders and permissions in a
make.perms file in the top of the NetHack folder tree and
they should take precedence over the ones in dirs-perms.500
because dirs-perms.500 uses '?=' variable assignment, which
means "set the value of the variable if no value has been set."

* NOTE: BUILD CHANGE *

This also makes WANT_SOURCE_INSTALL=1 the default over
WANT_SHARED_INSTALL=1, if neither is explicitly set.
The new default is the safer and less-impacting default,
but it will change where things get installed over earlier
Makefile builds. You can be explicit with WANT_SHARED_INSTALL=1
in your make command to get that..

These are the differences between the two:

make WANT_SHARED_INSTALL=1    Place the results of the install/update portion
                              of the build into a shared area on a multiuser
                              system.

make WANT_SOURCE_INSTALL=1    Place the results of the install/update portion
                              of the build into a subfolder of the source
                              tree, rather than in a system-wide shared area.

Also note that the macOS hints file behaves slightly differntly depending
on whether WANT_SOURCE_INSTALL=1 was set versus letting it be the default.
That's not new, it behaved that way before.
2026-05-27 19:32:40 -04:00
nhmall 5d2dc1c85e update tested versions of Visual Studio 2026-05-27 2026-05-27 19:25:11 -04:00
nhw_cron e31a104542 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-27 17:49:25 -04:00
nhmall 94d3946ef1 follow-up: fix a couple of paste errors 2026-05-27 17:09:43 -04:00
nhmall d7d0e9061a follow-up: trailing whitespace 2026-05-27 16:44:51 -04:00
nhmall ce31feb231 add some foundational work for uplifts
Be able to carry out uplifts during minor release
lifetimes.

Document a way to be able to uplift struct content
without incrementing EDITLEVEL and breaking existing savefiles.
Use the mechanics outlined to uplift the contents instead, where
it is feasible to do so. The uplift is currently one-way only. An
uplifted savefile cannot be used with an earlier build of NetHack
, one built with a lower SAVEFILE_REVISION_LEVEL, than the one which
wrote the savefile.

The final byte (byte 79) of the 80 critical bytes in the savefile,
of which 10 are reserved for future expansion and not currently
used, will now be used for holding the savefile revision level
(SAVEFILE_REVISION_LEVEL in include/patchlevel.h) at the time
the savefile was written.

That leaves 9 of the bytes available for future use.
2026-05-27 16:14:20 -04:00
nhmall e352048612 include MAXTCHARS in --dumpenums 2026-05-26 22:00:12 -04:00
Ingo Paschke 598253eac8 glyphs: rotate-5 in glyph_hash eliminates true collisions
The previous rotate-1-xor put consecutive characters' bits in
adjacent positions, so short similar names like fox/bat or
jaguar/lichen collided -- 164 colliding buckets across the 9577
named glyphs.  Rotate-5 spreads each character across a 5-bit
window: zero true collisions, one m68k ROL.L, no multiplication.

The 16 remaining same-hash buckets are name duplicates from a
separate compose_glyph_name bug, addressed by its own fix.
2026-05-25 15:45:25 -04:00
nhw_cron b4f417f2ca This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-25 15:41:24 -04:00
nhmall bd67f3d0d6 merge bit 2026-05-25 15:33:54 -04:00
nhmall fee9516d9b Merge branch 'fix-piletop-generic-obj-prefix' of https://github.com/ingpaschke/NetHack into pr1549 2026-05-25 15:30:40 -04:00
Ingo Paschke 95d70ef5d8 glyphs: add piletop_ prefix to piletop-generic-obj canonical names
parse_id's glyph_is_object branch only emitted the "piletop_" prefix
when glyph_is_normal_piletop_obj(glyph) was true.  Piletop-generic
objects (the GLYPH_OBJ_PILETOP_OFF + 1 .. + LAST_GENERIC range) hit
glyph_is_piletop_generic_obj() instead and got no prefix, so they
produced the same canonical name as their non-piletop generic
counterparts.

For example glyph 3449 (GLYPH_OBJ_OFF + GENERIC_STRANGE) and glyph
7993 (GLYPH_OBJ_PILETOP_OFF + GENERIC_STRANGE) both yielded
"G_generic_strange".  14 such pairs exist; the piletop variant is
unreachable by name from nethackrc, and the runtime hashtable's
"assume no id occurs twice" populate loop silently dropped them.

Emit "piletop_" for both piletop predicates so each glyph gets a
distinct canonical name.  --dumpglyphnames now shows the 14
"G_piletop_generic_*" entries (and the count goes from 9577 to 9591;
the existing off-by-one in glyph_is_normal_piletop_obj still hides
slot GLYPH_OBJ_PILETOP_OFF + FIRST_OBJECT - 1, which is addressed by
its own fix).
2026-05-25 21:19:51 +02:00
nhmall 503355bb11 yet another function and date name update
Related to the overhaul of glyphname hash indices
2026-05-25 14:44:32 -04:00
nhmall 8b3eb77305 cherry-pick pr #1548 52e0404 glyphname indexes 2026-05-25 14:30:02 -04:00
Ingo Paschke be9e430ebb glyphs: replace open-addressed glyphname hashtable with sorted index
The open-addressed glyphname_hashtable stored each canonical
"G_xxx" name as a dupstr'd string in its bucket: ~9577 small heap
allocations and ~290 KB of resident name strings, on top of ~256 KB
of 32768-bucket scaffolding kept at <50% load for probe performance.
On classic Mac OS the populate cost (quadratic small-allocation in a
fragmented Memory Manager heap) dominated startup time -- many
seconds on an SE/30 -- and ~800 KB resident is meaningful on the
small machines the port targets.

Switch to a sorted (hash, glyph) index sized exactly to the number
of named glyphs:

  struct glyphname_hashtable_entry_t {
      uint32 hash;
      int glyphnum;
  };

populate_glyphname_hashtable() allocates one block of MAX_GLYPH
entries (no per-name strings), fills it via compose_glyph_name() +
glyph_hash(), and qsort()s ascending by hash.  Lookup binary-searches
the hash column, then walks any equal-hash neighbours verifying each
candidate by reconstructing its canonical name and strcmpi'ing it
back -- collisions are rare with 9577 uniformly-distributed 32-bit
hashes.

Other changes that fall out:

 * Extract compose_glyph_name() from parse_id's bulk-iteration switch
   so it is the single source of truth for "glyph number -> canonical
   name".  Called by find_glyph_in_hashtable for collision
   verification, by populate_glyphname_hashtable, by the
   --dumpglyphnames path, and by wizcustom_glyphnames.
 * empty_glyphname_hashtable() reduces to free(ptr); no per-entry
   strings to release.
 * Drop find_glyphname_in_hashtable_by_glyphnum (no longer used --
   wizcustom_glyphnames iterates compose_glyph_name directly).
 * Drop the res_fill_hashtable parse_id mode; populate iterates
   directly.

Memory drops from ~800 KB to ~75 KB.  One allocation instead of
~9578.  Lookup goes from O(1) to O(log N) but N ~ 9577 means ~14
comparisons per probe -- well under what the upstream cache ever
cost in practice.

Function names (populate_glyphname_hashtable, etc.) are kept for
extern.h compatibility; the data structure is now a sorted index,
"hashtable" in the names is historical.

--dumpglyphnames output is byte-identical.
2026-05-25 14:22:19 -04:00
nhmall b7c7f051b4 update Guidebook to refer to glyphname 2026-05-25 13:49:44 -04:00
nhmall 752af5b435 add fixes5-0-1.txt entry for pr #1547
fix off-by-one in glyph_is_normal_piletop_obj
2026-05-25 12:19:47 -04:00
Ingo Paschke 87a0bdf26c display: fix off-by-one in glyph_is_normal_piletop_obj
glyph_is_normal_object includes its boundary slot
GLYPH_OBJ_OFF + FIRST_OBJECT - 1 via >=, but its piletop sibling
glyph_is_normal_piletop_obj used > and excluded the matching
GLYPH_OBJ_PILETOP_OFF + FIRST_OBJECT - 1 slot.  That leaves
exactly one glyph (the would-be G_piletop_generic_venom) matching
neither the piletop-generic nor the piletop-normal predicate, so
parse_id never builds a name for it and --dumpglyphnames emits a
blank line for the slot.

Change > to >= so the two ranges are inclusive on the same side.
--dumpglyphnames now produces (8009) G_piletop_generic_venom.
2026-05-25 17:06:24 +02:00
nhmall 0e39c11be9 update --dumpenums
Include the glyph_offsets from display.h
2026-05-24 22:24:50 -04:00
nhmall 7a38d29363 nomenclature: glyphids
glyphids shall be known as glyphnames henceforth
glyphid_cache shall be known as glyphname_hashtable
2026-05-24 18:30:46 -04:00
nhmall 7996090a19 Merge branch 'no-bees-in-these-trees' of https://github.com/copperwater/NetHack into NetHack-5.0 2026-05-24 15:57:03 -04:00
copperwater c1697c0042 Don't print "low buzzing" for bee-less trees when kicked
Noticed this when testing a level with some barren trees which were set
in the special level to not contain bees; the barren trees are still
able to produce a low buzzing. This may convince players that they can
get bees from the tree if only they kick it enough times, which will not
happen.

To avoid that, only print this message when the tree can release bees,
augmenting the existing check for killer bees being non-extinct.
2026-05-24 15:37:35 -04:00
nhmall 0a332657f1 methods of disabling glyphid cache prefill
Two methods are now provided for slow ports/platforms that
need to do this for performance reasons.

Hopefully, this will avoid proliferation of more platform-specific
conditional code within initoptions_init().

Method (1): #define DISABLE_GLYPHID_CACHE_PREFILL in platform/OS's
            include/*conf.h.

or

Method (2): set gd.disable_glyphid_cache_prefill = TRUE in startup code
            after decl_global_init(), and prior to initoptions_init().
	    It has to be done after decl_global_init() because
	    decl_global_init() sets the value to its initialization
	    default.
2026-05-24 12:40:24 -04:00
nhmall c22b21e3bd follow-up: spelling fix in comment 2026-05-24 11:49:12 -04:00
nhmall c506c73fbe X11 bit 2026-05-24 00:21:40 -04:00
nhmall 05371dd481 some tipping fixes
- adjust the surface name in prompts (resolves a TODO in the code).
- be more player-friendly with the prompting, and don't prompt a
second time if the floor/surface is the only tip-destination, as
that can be annoyng and viewed as unnecessary. Instead, include
that information in the first decision prompt.

Resolves #1537
2026-05-24 00:01:50 -04:00
nhmall 7025945d2a Get CROSSCOMPILE defined earlier in the Makefiles 2026-05-23 22:50:12 -04:00
nhmall 2680476825 fixes entry for the big-endian fix 2026-05-23 21:37:56 -04:00
nhmall 58f2ef3a9e Merge branch 'lua-coordxy-bigendian' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-23 21:31:44 -04:00
Ingo Paschke 4470ce348e lua: read coordxy fields with the right width (big-endian fix)
Add ANY_INT16 to any_types and use it for u.ux/uy/tx/ty and uz
dlevel/dnum.  These are coordxy (int16_t) but the Lua bindings were
treating them as 1-byte fields, so on big-endian m68k Lua read the
high byte (0) instead of the actual value.  Symptom: place_object
off map <0,0> in the tutorial.
2026-05-24 02:55:57 +02:00
nhmall ff4abc9b8c 3rd time is the charm3rd time is the charm3rd time is the charm 2026-05-23 20:05:54 -04:00
nhmall d7726e6069 follow-up grammar bit 2026-05-23 20:03:30 -04:00
nhmall 94e7d0bcf3 fixes5-0-1.txt catch-up 2026-05-23 20:01:06 -04:00
nhw_cron 0536318099 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-23 19:16:10 -04:00
nhmall fd4fd6ef86 README-hints -> README.hints 2026-05-23 13:43:06 -04:00
nhmall 6aed21933d add paragraph about README.hints to NewInstall.unx 2026-05-23 13:33:35 -04:00
nhw_cron 2808f45c70 This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-22 16:37:10 -04:00
nhmall 3ea7fd3d67 stamp Guidebook with date of most recent commit to it 2026-05-22 15:41:18 -04:00
Ingo Paschke 1e34b52648 share: extend pcmain.c nhuuid to CROSS_TO_MSDOS, drop stub
The MSDOS branch carried a zero-filled placeholder with a FIXME; it
can use the same RFC 4122 v4 path as Atari and Amiga.
2026-05-22 15:21:00 -04:00
Ingo Paschke ced5744fe6 share+amiga: gate pcmain.c nhuuid for CROSS_TO_AMIGA, drop amidos.c copy
amidos.c had a byte-identical copy of the RFC 4122 v4 generator
already living under CROSS_TO_ATARI in sys/share/pcmain.c.
2026-05-22 15:20:50 -04:00
nhmall 189a0b8c3f update tested versions of Visual Studio 2026-05-22 2026-05-22 14:46:17 -04:00
nhmall be4d613bff follow-up curses idlecheckpoint 2026-05-22 14:20:13 -04:00
nhmall e394dc341b prevent a checkpoint from executing too early 2026-05-22 12:25:13 -04:00
nhmall a1fad59f2d idlecheckpoint support in curses 2026-05-22 12:24:32 -04:00
nhmall 4c7f2dfaac some Windows curses adjustments dialog on startup 2026-05-22 12:21:42 -04:00
Alex Smith 3f837939ba Change the MAX_REROLLS option to be MAX_REROLL_RATE
Having a hard cap on the number of rerolls doesn't help save CPU
usage from excessive rerolling, because if the cap is set low
enough to keep the CPU usage reasonable it isn't high enough for
players to actually use the feature.

Instead, allow capping the number of rerolls per second. (Sensible
values seem to be in the 5-10 range.) If the player attempts more
rerolls than this, show a paranoid confirmation prompt: the need to
type the answer to the prompt will slow a human user down (and if
the prompt is filled in too quickly, it will simply just be shown
again, preventing attempts to use automation to skip the prompt).
2026-05-22 06:02:00 +01:00
Ingo Paschke 7d512fd8ce shk: show item glyphs in the pay-bill menu
menu_pick_pay_items() passed &nul_glyphinfo to add_menu so
port windowports never had a tile/glyph to render alongside
each entry on the bill.  Compute the proper glyph_info from
the bill's obj, matching the pattern src/invent.c already
uses for inventory menus.
2026-05-21 16:05:47 -04:00
nhmall 3beaf04c45 fixes update for menu glyphs: shop bills, tip/loot 2026-05-21 15:54:27 -04:00
Ingo Paschke e14cb40a6e pickup: show container glyphs in tip/loot menus
doloot_core(), choose_tip_container_menu(), and
tipcontainer_gettarget() each iterate carried or floor containers
and offer them as menu rows, but passed &nul_glyphinfo so port
windowports had nothing to render alongside.  Compute proper
glyph_info from each container the same way src/invent.c
already does for inventory menus.
2026-05-21 15:47:55 -04:00
nhmall b9d87fea6d fix a buffer overlow introduced in recent commit 2026-05-21 12:04:01 -04:00
nhmall 18845b6f67 match magic object tiles with mundane counterparts
Fixes #1533
2026-05-21 10:44:29 -04:00
nhmall 65646e2a8c fix recently appearing warnings in clang-22 and visual studio
clang-22:

invent.c:2621:16: warning: variable 'option' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
 2621 |     } else if (!hit_reroll_limit(u.uroleplay.numrerolls)) {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
invent.c:2629:9: note: uninitialized use occurs here
 2629 |     if (option == 'y') {
      |         ^~~~~~
invent.c:2621:12: note: remove the 'if' if its condition is always true
 2621 |     } else if (!hit_reroll_limit(u.uroleplay.numrerolls)) {
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
invent.c:2570:16: note: initialize the variable 'option' to silence this warning
 2570 |     char option;
      |                ^
      |                 = '\0'
1 warning generated.

visual studio:

src/invent.c(2629,1): warning C4701: potentially uninitialized local variable 'option' used
2026-05-21 10:36:22 -04:00
Pasi Kallinen 51f486589c Add sysconf MAX_REROLLS option
Public servers probably want to set this.
2026-05-21 09:11:24 +03:00
nhmall 0f8f8f4892 Windows console dev debug line 2026-05-21 01:26:29 -04:00
nhmall f9165e66fc curses display sizes on Windows console, GUI 2026-05-20 08:55:28 -04:00
nhmall 93786ddfd9 add a fixes5-0-1.txt entry for WANT_SYSTEM_LUA=1 2026-05-20 08:00:02 -04:00
nhw_cron 1eb91a61af This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-20 07:41:49 -04:00
nhmall 1b7e529732 cross-compile and build adjustments
Tested:
    Ubuntu: make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 resp=1 update
    Ubuntu: make WANT_SYSTEM_LUA=1 WANT_WIN_TTY=1 WANT_WIN_CURSES=1 resp=1 update
    make CROSS_TO_MSDOS=1 package
    make CROSS_TO_AMIGA=1 all
    make CROSS_TO_AMIGA=1 package
2026-05-20 00:37:02 -04:00
nhmall 4c825ed9a9 typo CROSS_TO_MSDOS=1 2026-05-19 15:38:37 -04:00
nhmall b17eafa0ab CROSS_TO_AMIGA=1 build fix
Fallout from other work this past weekend.
2026-05-19 12:18:23 -04:00
nhmall 182dd93a38 remove a debug line 2026-05-19 11:53:54 -04:00
nhmall 46735de8a6 extend WANT_SYSTEM_LUA=1 to other distros
Only tested on Ubuntu at this point.

feedback on other distros is welcome
2026-05-19 11:38:05 -04:00
nhmall 5333747f02 Add some support for Alpine Linux system Lua package
Requires apk add lua5.4-dev (for the C Lua headers)
2026-05-19 00:49:30 -04:00
nhmall 721dc27f26 remove an unneeded change from earlier CROSS_TO_MSDOS 2026-05-18 16:09:36 -04:00
nhmall 68e36aff74 CROSS_TO_AMIGA fix 2026-05-18 16:06:15 -04:00
nhmall 9841830460 some more follow-up
CROSS_TO_MSDOS build
2026-05-18 15:46:54 -04:00
nhmall 95151d99fc more follow-up
CI still had a duplicate tile.o
2026-05-18 14:18:24 -04:00
nhmall 0607d6426c follow-up 2026-05-18 13:53:02 -04:00
nhmall 3a892160df macOS follow-up 2026-05-18 13:07:13 -04:00
nhmall 29951cccd1 add support for optional builder-created make.prefs
Set things up so that the Makefile build will look for 'make.prefs'
at the top of the NetHack source tree.

If 'make.prefs' is present, the Makefile build will include it
just ahead of the PRE section of a hints file specified to
sys/unix/setup.sh, or practically the first thing during a
Makefile build if no hints file was specified.

The advantage of using a 'make.prefs' is that instead of putting a
series of Makefile variable value assignments on the command line
each time, like this:
    make WANT_WIN_X11=1 WANT_WIN_TTY=1 WANT_WIN_CURSES=1 c2x=1 resp=1 update
you can, instead, put those preferences into make.prefs, like this:

# start of make.prefs
WANT_WIN_X11=1
WANT_WIN_TTY=1
WANT_WIN_CURSES=1
c2x=1
resp=1
# end of make.prefs

Now, my make command just needs to specify a target:
    make update

The syntax for checking whether make.prefs exists, and for including
it, is GNU make, or bsd make, specific, so sys/unix/mkmkfile.sh will
insert the correct syntax for the make that is in-use when
sys/unix/setup.sh is executed.

The 'make.prefs' file isn't limited to Makefile variable assignments, and
can contain any valid make syntax for the version of make on your system,
but adding make syntax beyond Makefile variable assignment will cause
your make.prefs file to become specific to that version of make. There
are syntactical differences between GNU make and bsd make, particularly
for directives and conditional tests.

The 'make.prefs' file can potentially eliminate much/all of the manual
editing of distributed repository Makefiles or hints files that you, as
a NetHack developer or builder, might routinely carry out.
You have the option of placing your preference changes in 'make.prefs'
instead.

Related reference for .500 hints file variables:

In the NetHack source tree:
sys/unix/README.hints

On GitHub:
https://github.com/NetHack/NetHack/blob/NetHack-5.0/sys/unix/README-hints

For example, on macOS, where GNU make is being used, and I typically
set things up using the macOS.500 hints file:
    sys/unix/setup.sh sys/unix/hints/macOS.500
I might have the following make.prefs in the root of my NetHack source tree:
#---- snip -------
$(info Attention - Using make.prefs)
WANT_MACSOUND=1
resp=1
#---- end-snip ---

For another example, on Linux, where GNU make is being used, and I
typically set things up using the linux.500 hints file:
    sys/unix/setup.sh sys/unix/hints/linux.500
I might have the following make.prefs file in the root of my NetHack
source tree:
#---- snip -------
$(info Using make.prefs)
WANT_WIN_X11=1
WANT_WIN_TTY=1
WANT_WIN_CURSES=1
c2x=1
resp=1
#---- end-snip ---
2026-05-18 13:03:31 -04:00
nhmall d9bc6d7b8a Revert "add #-EARLY section"
This reverts commit 85ca1cce74.
2026-05-17 20:54:08 -04:00
nhmall 85ca1cce74 add #-EARLY section 2026-05-17 20:38:10 -04:00
nhmall 8ce430bd89 put the values on other pdcurses platforms back
They were set this way on other pdcurses platforms prior
to this recent change, so leave them at those values.
2026-05-16 22:13:40 -04:00
nhmall 125800404b fixes5-0-1.txt catch-up 2026-05-16 21:45:30 -04:00
nhmall 51011e234d build fix attempt for msdos cross-compile
Recent change was #ifdef PDCURSES, but that is
also used on msdos and other platforms
2026-05-16 21:41:05 -04:00
nhmall 476d0717a7 CI NetHack version 2026-05-16 21:02:38 -04:00
nhmall 083e55e905 Windows curses-related follow-up 2026-05-16 12:22:03 -04:00
nhmall d78a875110 more Windows curses size tinkering 2026-05-16 12:15:20 -04:00
nhmall b2458e679a recently-appeared warning bit
mkroom.c(598): warning C4389: '!=': signed/unsigned mismatch
2026-05-16 11:37:51 -04:00
nhmall 4434b14884 more hints file readiness in Makefiles 2026-05-16 10:59:48 -04:00
Pasi Kallinen 5199921c05 Fix experience-level up/down hilighting
The highlighting worked correctly for #levelchange in wizard mode,
but not for gaining experience levels by killing monsters.
2026-05-16 16:51:34 +03:00
nhmall e1ee404ecc warning workaround led to a build error on some platforms & compilers
Use another method for the warning workaround.

allmain.c:33:56: error: 'maybe_unused' attribute cannot be applied to types
   33 | early_init(int argc USED_FOR_CRASHREPORT, char *argv[] USED_FOR_CRASHREPORT)
      |                                                        ^
allmain.c:28:30: note: expanded from macro 'USED_FOR_CRASHREPORT'
   28 | #define USED_FOR_CRASHREPORT UNUSED
      |                              ^
../include/tradstdc.h:510:16: note: expanded from macro 'UNUSED'
  510 | #define UNUSED ATTRUNUSED
      |                ^
../include/tradstdc.h:397:22: note: expanded from macro 'ATTRUNUSED'
  397 | #define ATTRUNUSED [[maybe_unused]]
      |                      ^
allmain.c:33:49: warning: unused parameter 'argv' [-Wunused-parameter]
   33 | early_init(int argc USED_FOR_CRASHREPORT, char *argv[] USED_FOR_CRASHREPORT)
      |                                                 ^
1 warning and 1 error generated.
2026-05-16 09:05:29 -04:00
nhmall 2445b97a10 build fix with hints file linux.500 and musl=1
This fix was suggested by @PPN-SD in the comments on
GitHub issue https://github.com/NetHack/NetHack/issues/1530#issuecomment-4466027729

Resolves #1530
2026-05-16 08:57:54 -04:00
Pasi Kallinen 0f0e7c99bf Fix random attended shrines in irregular rooms 2026-05-16 14:57:12 +03:00
nhmall a8f97a3926 OpenBSD build bits
An issue still remains with fetch-Lua in the top Makefile.
2026-05-15 21:58:51 -04:00
Patric Mueller 3a0c6f17c7 fix buffer overflow in update_topl
Buffer overflows could occur when interacting with containers while
inputting or outputting many items.

This commit ensures topline updates do not exceed buffer limits by
checking against TBUFSZ.

Issue reported by k21971 on IRC.
2026-05-15 23:32:14 +02:00
PatR e11ff5f703 another try at removing static analyzer complaints
The one in options hasn't been addressed this time.
2026-05-15 13:40:34 -07:00
nhmall c558ef0b33 Makefile syntax did not work on OpenBSD
Trying another approach for whichbsd.500
2026-05-15 15:29:25 -04:00
Pasi Kallinen a533350537 TTY: allow custom glyph colors on more limited terminals
Previously changing glyph colors required a terminal with more
than 256 colors, even if the color was one of the basic 16 colors
used by NetHack.
2026-05-15 20:21:52 +03:00
nhw_cron e05864544c This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-15 12:25:20 -04:00
nhmall d81d47b81e new file header info 2026-05-15 12:18:29 -04:00
nhmall 8d0cfb05fa rename netbsd.500 to bsd.500
In past releases of NetHack, there was a myriad of different hints
files for different operating systems, and even different versions
of operating systems.

It made maintenance a chore, because all the variable hints files
had to be updated for a wanted change, or (as typically was the
case), some lesser-used hints files were left behind and became
outdated.

Instead of going down that road again, this renames
    sys/unix/hints/netbsd.500
to
    sys/unix/hints/bsd.500

Where things need to differ for a different bsd flavour,
the differences can be shrouded in things like

    .if ${WHICHBSD} == "NETBSD"
    .else
    .endif

This change is being done to make maintenance easier, at the
cost of making the resulting Makefiles a little more complex,
but there won't be as many separate Makefile hints to maintain.

This commit is being done instead of merging pull request #1531
which would add a new sys/unix/hints/openbsd.500 file.

Only tested on NetBSD so far. Please let us know if there's
an issue on other bsd's, and we will attempt to fix thos issues.

Closes #1531

Close
2026-05-15 12:11:34 -04:00
PatR 9ec26da4ff static analysis fix attempt
These three changes compile but I don't know whether thay succeed in
suppressing the new static analyzer complaints.
2026-05-15 08:11:56 -07:00
nhmall 99f559fe18 utilize more real estate on Windows GUI curses
Some inventory items were being hidden in a lengthy list.
2026-05-15 01:21:45 -04:00
nhmall accb14b797 free up some console alloc()'d memory under curses
tty takes care of this, but it wasn't being done under curses
2026-05-14 23:57:25 -04:00
nhmall 5edb093e14 pdcurses: don't truncate curses window width
The curses windows were being capped at 110 columns
inappropriately.

Use the full width of the console.
2026-05-14 22:40:48 -04:00
nhmall 2eb817af07 OS bit in sp_lev.c 2026-05-14 13:03:48 -04:00
PatR c6a58c5c5a warning fix 2026-05-14 08:48:19 -07:00
Pasi Kallinen f000fed16d Fix statue and figurine genders in special levels
When a random statue or a figurine was generated in special levels,
the gender was not initialized correctly, so you ended up getting
eg. "dwarf ruler"

It now works correctly, and you can still specifically request
a non-gendered version with the montype-parameter.

For example

des.object({ id = "statue" });
des.object({ id = "statue", montype = "dwarf ruler" });
2026-05-14 17:38:29 +03:00
nhmall 342bbc85c4 warning bit for clang-22 and tiletext.c 2026-05-14 08:31:33 -04:00
nhmall 7e50882ffb Files updated from cron daily 2026-05-14 07:29:02 -04:00
nhmall bc20ccd659 README wording bit 2026-05-13 20:38:52 -04:00
nhmall 11cd021063 update header info on netbsd.500 2026-05-13 17:34:46 -04:00
Pasi Kallinen 17f5642faf Obey statue type gender
The gnome king statue in minetn-5 was generated as a gnome leader,
obey the gender of the statue name, so generating a statue of
for example "gnome king" and "gnome queen" works correctly.
2026-05-13 23:08:27 +03:00
Anthony C Howe afeb2f55c9 bsd build support
Originating from https://github.com/NetHack/NetHack/pull/1519,
there was an issue with the pull request's back-end fork or with
the pull request itself.

The code changes were applied manually instead, with credit to the
pull request's author, instead of being directly merged in via the
pull request.

Contributed by @SirWumpus on GitHub.

Also,
- fixed a bit of conditional code in include/unixconf.h, where the
  #else clause remained out of reach for non-bsd systems, but was
  needed..
- added a disclaimer to the contributed sys/unix/hints/netbsd.500.
2026-05-13 12:49:45 -04:00
nhmall 46ab1ae213 follow-up: remove previous line 2026-05-13 12:43:15 -04:00
nhmall b9da5b7ced update tested versions of Visual Studio 2026-05-13 2026-05-13 12:40:12 -04:00
nhmall b17392a985 innocuous commit 2026-05-13 11:39:40 -04:00
nhmall 17ae931003 fixes5-0-1.txt catch-up 2026-05-12 19:08:44 -04:00
nhmall 1b1beaa5bb spelling correction 2026-05-12 18:00:39 -04:00
nhmall 82d7b2b249 Merge branch 'cleanup-followup' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-12 12:46:25 -04:00
nhmall e0ccf22d84 One of our TeX tools leaves .out files behind 2026-05-12 12:44:26 -04:00
Ingo Paschke 6736f878aa Amiga: graphical tombstone RTG-screen fallback
amii_outrip relies on LoadRGB4/transpalette fade and raw BltBitMap
to a SMART_REFRESH window -- chipset-era idioms that do not reach
the visible display on Picasso96 or CyberGraphX screens.  On RTG
the screen stayed black and the user saw nothing between the
death messages and the high-score list.  Detect RTG by screen
size > 800x600 and fall through to genl_outrip so RTG users get
the ASCII tombstone instead.

Switch the still-graphical path to BltBitMapRastPort so the blit
goes through the layer system, and move CloseWindow(ripwin)
outside the Forbid()/Permit() pair (same fix as amii_cleanup).

Rename cmap_white/cmap_black to cmap_outline/cmap_fill -- those
variables actually hold the indices of the darkest and lightest
palette entries, used for the four offset outline strokes and
the centered fill stroke respectively; the old names were
backwards.
2026-05-12 15:33:29 +02:00
Ingo Paschke 89971a5fc9 Amiga: fix extended-command menu mouse-pick
The amii_get_ext_cmd menu used the first character of each command
as the item identity (id.a_char) and then linearly searched
extcmdlist for the first command starting with that character.
Many commands share a first letter, so picking #airlevel returned
#adjust, #wipe returned #wear, etc.  Store the actual index in
id.a_int and read it back directly.

While in that function, size obufp at BUFSZ (was 100) and replace
the unbounded strcpy from extcmdlist[i].ef_txt with strncpy +
explicit NUL.
2026-05-12 15:31:44 +02:00
Ingo Paschke 146fbf20d8 Amiga: clamp amii_numcolors and guard tile CMAP loop
Reject tile/tomb IFF files whose nPlanes field exceeds DEPTH:
the CMAP loop writes 1<<np entries into amii_initmap[] /
amiv_init_map[], both sized AMII_MAXCOLORS = 1<<DEPTH = 64, so
a malformed file with nPlanes >= 7 would corrupt adjacent BSS.

After OpenScreen succeeds, clamp amii_numcolors to the actually
populated portion of the init-map arrays (AMII_PALETTE_SIZE for
text mode, AMIV_PALETTE_SIZE for tile mode).  On a 64-color
screen this stops LoadRGB4 from loading the zero-initialized
tail entries as black.  Replace the matching magic 32 in the
tilefile selection with AMIV_PALETTE_SIZE.

While there, add the (char) cast on amii_glyph_buffer's
truncating assignment to make the contract explicit.
2026-05-12 15:30:48 +02:00
Ingo Paschke 459113a48e Amiga: fix --more-- infinite loop on overlong words
When a single word exceeds the visible message-window width the
wrap loop found no whitespace, called outmore(cw), and continued
without advancing str -- and on the next iteration curx==0 took
it straight back to the same spot.  Force-break the word at the
column boundary when we are already at the start of a line.

Also reset the wrapping static flag to 0 after the NHW_BASE wrap
cleanup runs, so the cleanup fires once after a wrap instead of
on every subsequent putstr.
2026-05-12 15:29:37 +02:00
Ingo Paschke 4e63ba90ca Amiga: bound BufferQueueChar; move CloseWindow out of Forbid()
Make the BufferQueueChar macro bounds-check KbdBuffered against
KBDBUFFER internally so the RAWKEY and NEWSIZE 'R'-64 paths can
no longer push past the 10-byte queue; widen KbdBuffered to int
so the counter cannot wrap silently in the queue-scan loops.

In amii_cleanup move kill_nhwindows()/DeleteMsgPort() outside
the Forbid()/Permit() pair: CloseWindow can wait on layers.library
semaphores on OS 3.x and that is unsafe under Forbid.  Keep only
the IDCMP-flush loop inside.
2026-05-12 15:28:43 +02:00
Ingo Paschke 252ca5bef7 Amiga: defensive NULL/bounds guards in menus and window creation
Guard the gd lookup in DoMenuScroll's GADGETUP/MOUSEMOVE branches
so a window with no GadgetID==1 does not deref NULL; match the
existing guards in the keyboard-scroll branches.  In the keyboard
selector and MENU_UNSELECT_ALL paths, only mutate items with
canselect set so a non-selectable header cannot have its str
stomped.  Clamp MENU_LAST_PAGE topidx to >= 0.  Make find_menu_item
return NULL on negative idx instead of the head item.  Guard the
PROMPTFIRST data[] shuffle behind cury > 0.

In amii_destroy_nhwindow's NHW_OVER branch use cw->win with a NULL
guard instead of dereferencing amii_wins[WIN_OVER]->win blindly.
Range-check the type argument to amii_create_nhwindow.  Fix the
*argv_in[1] precedence bug so the -L/-l flag does not deref NULL
when it is the last argument.  Wrap AllocAslRequest result in a
NULL check before AslRequestTags/FreeAslRequest.

Defensively bounds-check the idx argument to DispCol.  Replace
the -25937 signed-int literal in clipwin's PropInfo with the
equivalent UWORD value 39599.  Simplify amii_start_menu's free
loop; switch DoMenuScroll's inventory title and Count display to
Snprintf, and stop passing countString to pline as a format.
2026-05-12 15:27:13 +02:00
Ingo Paschke 15e3973ac2 Amiga: tighten input/dialog buffer bounds
Right-size the Intuition string-gadget buffer to BUFSZ so a caller
with a BUFSZ-sized buffer cannot be overflowed.  Enlarge the
amii_yn_function prompt buffer to fit the worst-case query + resp
+ def + trailing space and switch the appends to Snprintf with
remaining-space tracking.  Replace sprintf in amii_display_file's
"Can't display X: Y" path with Snprintf.  In EditColor's Save path
drop the strcpy/strcat chain that could trail off the end of
oname/nname when dirname returned a near-full path; use Snprintf
instead.  Rewrite dirname() to copy first and truncate the copy,
so it no longer briefly NULs the caller's string.
2026-05-12 15:24:15 +02:00
Ingo Paschke d99eeb17c2 Amiga: header hygiene and palette-size constants
Add AMII_PALETTE_SIZE / AMIV_PALETTE_SIZE in amiconf.h to make the
actual populated portion of the init-map arrays explicit.  Drop the
redundant extern void exit() declaration.  Annotate Abort with
NORETURN in both amiconf.h and winproto.h; drop the duplicate Abort
declaration further down winproto.h.

Convert the bare-token "CLIPPING must be defined" assertion in
windefs.h into a real #error directive.

Comment in winext.h to disambiguate the three similarly named
amii*_init*map palette arrays.
2026-05-12 15:21:23 +02:00
Ingo Paschke ebcf31a4da Amiga: drop UNTESTED AROS path; tighten fopenp separator write
The UNTESTED #ifdef in freediskspace was never gated by any hints
file, so the unsigned-long-long path could only be enabled by a
stray manual #define -- in which case the return type is still
long and silently truncates.  Remove the branches.

In fopenp the separator '/' write was unchecked: when the path
segment exactly filled the buffer to BUFSIZ-2 it would land at
buf[BUFSIZ-1] and the follow-on NUL would write past the end.
Guard the write.
2026-05-12 15:19:28 +02:00
Ingo Paschke 157c005f02 Amiga: harden host-side bmp/xpm to iff converters
Replace #pragma-pack BMP header reads with little-endian byte
readers so the tool works on any host endianness.  Add dimension
and color-count range checks, zero-init pixel remap table, check
calloc, free bmpdata on early returns, send malloc errors to
stderr.  Add bp>xbuf guards to xpmgetline's strip loop.
2026-05-12 15:18:44 +02:00
Ingo Paschke cb46d9effd Amiga: tighten two minor issues from review
- amii_set_text_font called CloseLibrary(DiskfontBase) outside the
  OpenLibrary guard; on Kickstart V36+ that is a no-op for a NULL
  handle, but on V33/V34 it is undefined.  Move the close inside
  the if-block where DiskfontBase is known non-NULL.
- amii_get_ext_cmd's bounds check used BUFSZ for an obufp[100]
  buffer; the tighter COLNO check actually bounded it but the
  expression was misleading.  Use sizeof obufp.
2026-05-12 15:12:07 +02:00
Ingo Paschke 74c87caac3 Amiga: fix bitmap/IFF resource handling in winchar.c
- MyAllocBitMap left bm->bm.Planes[] uninitialized; InitBitMap only
  fills BytesPerRow/Rows/Flags/Depth, not Planes[].  If AllocRaster
  fails mid-loop, MyFreeBitMap was iterating up to Depth and would
  pass uninitialized stack-garbage pointers to FreeRaster.  Zero
  Planes[] before the alloc loop.
- ReadImageFile leaked iffparse.library, the IFFHandle, the DOS file
  handle, and any open-IFF state on every panic path.  On AmigaOS
  those handles are not auto-reclaimed when the process dies, so
  each failure stranded resources until reboot.  Restructure to a
  single cleanup label and free in reverse-acquisition order before
  panicking.
- OpenIFF returns an error code that was being thrown away, so a
  failed open would feed corrupt state to ParseIFF.  Check and
  bail.
2026-05-12 15:12:07 +02:00
Ingo Paschke f583787825 Amiga: fix overview-window crashes
- MyAllocBitMap left bm->mflags uninitialized, so MyFreeBitMap took the
  wrong path between FreeRaster and FreeMem and intermittently corrupted
  exec's free list (Software Failure 0x81000005, DEADEND in FreeMem).
- The NHW_OVER window is BORDERLESS, so attaching WINDOWSIZING |
  WINDOWDRAG | WINDOWCLOSE created phantom gadgets that hit-test against
  unrelated input.  Pressing ESC while the overview was selected fired
  CLOSEWINDOW and destroyed the window underneath the running code,
  leading to wild-PC crashes.  Drop the gadget flags; SHIFT-HELP already
  toggles the overview cleanly via delayed_key_action.
- amii_destroy_nhwindow only reset WIN_MAP / WIN_STATUS / WIN_MESSAGE /
  WIN_INVEN; WIN_OVER and WIN_BASE kept pointing at freed slots, so any
  later 'WIN_X != WIN_ERR && amii_wins[WIN_X]->win' check dereferenced
  NULL.  Reset them too.
2026-05-12 15:12:07 +02:00
Ingo Paschke 7c8524ae37 Amiga: make amigapkg depend on $(GAMEBIN)
Without the dependency, 'make amigapkg' would copy whatever was
already in targets/amiga/ without ever rebuilding when sources
changed -- silently shipping a stale binary.
2026-05-12 15:12:07 +02:00
Ingo Paschke 657f6eaad9 Amiga: fix latent issues found in code review
- fname[18]/sprintf risks overflow for >=10 in any version field;
  switch to snprintf into a wider static buffer.
- (1L << i) for i==31 (or shifting into the depth-loop terminator)
  is undefined for signed long; use 1UL.
- Drop unused cnt= from amii_display_nhwindow's DoMenuScroll call;
  the menu return value is consumed elsewhere, not here.
2026-05-12 15:12:07 +02:00
nhmall 7d802883bc replace hard-coded nroff with $(NROFF) 2026-05-12 09:07:06 -04:00
nhmall 80a99d1ed1 stop init of allopt[] from wiping out disregards 2026-05-12 00:10:38 -04:00
nhmall f5456fa92c another Windows issue causing startup grief 2026-05-11 22:59:42 -04:00
nhmall d62b56e0f2 yet more hints file prep 2026-05-11 20:45:49 -04:00
nhmall ccb3db39d7 more hints file prep 2026-05-11 19:59:53 -04:00
nhmall ef600a41f6 allow a hints file to be able to specify GUIDECMD
define GUIDECMD in sys/unix/Makefile.doc using '?=' notation
2026-05-11 19:16:03 -04:00
PatR c42d35eac0 avoid newsym(0,0) for vault guard
When a vault guard is being moving off the map to <0,0> to wait until
his temporary corridor gets removed, don't try to update the map for
that off-the-screen location in order to avoid triggering impossible()
from newsym().

Plus a trivial tweak to NH_abort().  Its argument is never modified so
declare it as such.
2026-05-11 15:06:13 -07:00
nhmall 45ab4eb1aa follow-up: paste error snuck in 2026-05-11 17:40:50 -04:00
nhmall f06e2389b6 more fixes5-0-1.txt updates 2026-05-11 17:36:21 -04:00
nhmall 3b5e784c69 fixes5-0-1.txt catch-up 2026-05-11 17:07:17 -04:00
nhw_cron 34204d0874 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-11 16:27:48 -04:00
nhmall 48fa545cf5 update Contributing.md 2026-05-11 16:25:14 -04:00
nhmall 9bfaa066e2 Merge branch 'cleanup' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-11 15:43:56 -04:00
nhmall 3ca18c8e44 be more cautious on gcc version for warning 2026-05-11 15:40:29 -04:00
nhmall 0991b0e770 tiletext.c warning suppression 2026-05-11 15:30:53 -04:00
nhkeni 3973944a93 Fix subst for luahelper. 2026-05-11 15:22:06 -04:00
Ingo Paschke 1cfff0f002 Amiga: correct command-line flag doc in amii.hlp
Wizard mode is gated on player name == WIZARD_NAME, not on -D or
-debug.  Document -uwizard as the working entry point.
2026-05-11 20:51:06 +02:00
Ingo Paschke d1a84de8fc Amiga: delete outdated/sys/amiga/
These 3.4.1-era files are superseded: Build/Install.ami -> README.amiga;
Makefile.ami/.agc -> sys/unix/hints/include/cross-*.500;
NetHack.cnf -> sys/amiga/nethack.cnf;
txt2iff/xpm2iff.c -> sys/amiga/*_host.c.
2026-05-11 20:51:06 +02:00
Ingo Paschke 2e61bf768f Amiga: fix port_help double-prefix path
display_file -> dlb_fopen -> fopen_datafile already prepends DATAPREFIX;
wrapping PORT_HELP in fqname() too produced "NetHack:NetHack:amii.hlp".
2026-05-11 20:51:06 +02:00
Ingo Paschke 344063afb6 Amiga: route non-menu messages from DoMenuScroll to ProcessMessage
DoMenuScroll dropped IDCMP messages for non-owner windows -- so a
resize of WIN_INVEN or close-gadget on WIN_OVER during a menu never
reached the game state.  Forward those to ProcessMessage;
VANILLAKEY/RAWKEY stay with the menu.
2026-05-11 20:51:06 +02:00
Ingo Paschke 8dbbbc2fef Amiga: deduplicate amii_procs and amiv_procs
Factor common body into AMI_WIN_PROCS_BODY.  The POSITIONBAR / CLIPPING /
CHANGE_COLOR guards in the original were dead.
2026-05-11 20:51:06 +02:00
Ingo Paschke c85a8cf607 Amiga: drop redundant 'either windowtype' guards
Six if(WINVERS_AMIV || WINVERS_AMII) sites are always true with
amitty.c gone.
2026-05-11 20:51:06 +02:00
Ingo Paschke 5d86dfccb5 Amiga: replace WINVERS_AMI* strcmp with WINDOWPORT() id compare
The macros were strcmp("amiv", windowprocs.name)==0 at every reference
-- 72 sites including inner loops.  Use the 5.0 core's WINDOWPORT(wn)
which compares wp_id.
2026-05-11 20:51:06 +02:00
Ingo Paschke 688f9344cd Amiga: route port paths through fqname()
Tile loading hard-coded "NetHack:tiles/tiles{16,32}.iff" and PORT_HELP
hard-coded "nethack:amii.hlp".  Route through fqname(DATAPREFIX) so
DATADIR= overrides apply.  Refresh amii.hlp to 5.0 content, ship it via
amigapkg, and document HACKDIR / SAVEDIR / BONESDIR examples in
nethack.cnf.
2026-05-11 20:51:06 +02:00
nhkeni df9673c96e Make all top-level .md files subject to nhsub substitutions. 2026-05-11 14:46:06 -04:00
Ingo Paschke c5d8ab1985 Amiga: collapse #ifndef CROSS_TO_AMIGA include forks
Every #include block had a paired NH: assign path for native builds.
Only the cross-compile path is built now.
2026-05-11 20:43:08 +02:00
Ingo Paschke 010c068861 Amiga: clean up amiconf.h
Remove legacy compiler guards and stale extern declarations (the
ami_wbench_* family, CopyFile, ami_argset, ami_mkargline, FromWBench).
Drop unused AMII_*_VOLUME / DEFAULT_ICON macros and the
IDCMP_CLOSEWINDOW auto-define.
2026-05-11 20:43:08 +02:00
Ingo Paschke 94a74b84d8 Amiga: drop OPT_DISPMAP / display_map / fast_map machinery
display_map() was never integrated; no .c defines it.  All OPT_DISPMAP /
DISPMAP / sysflags.fast_map conditionals were unreachable.
2026-05-11 20:43:08 +02:00
Ingo Paschke 7b559f4d02 Amiga: delete dead files and dead-macro code
Delete amigst.c (empty) and amitty.c (TTY/BBS stub).  Drop WINVERS_AMIT,
SUPERBITMAP_MAP, EXTMENU, SHELL/dosh(), and the bbs_id reference in
src/files.c.
2026-05-11 20:30:45 +02:00
Ingo Paschke beaed3aa08 Amiga: delete the .p prototype headers
amidos.p, amiwind.p, winami.p duplicated and partly contradicted
winproto.h.  Switch amidos.c and amigst.c to winproto.h.
2026-05-11 20:30:45 +02:00
Ingo Paschke e90a297021 Amiga: drop #if 0 dead-code blocks
Includes a dead amii_player_selection / RandomWindow pair (~280 lines),
eraseall / CopyFile in amidos.c, and smaller fragments.
2026-05-11 20:30:45 +02:00
Ingo Paschke 00433c7998 Amiga: drop TESTING dev toggle in winchar.c 2026-05-11 20:30:45 +02:00
Ingo Paschke a8e54185eb Amiga: drop SHAREDLIB dead build flavor 2026-05-11 20:29:47 +02:00
Ingo Paschke 7b67da20b7 Amiga: make INTUI_NEW_LOOK unconditional
OS 2.0+ Intuition is required; the pre-2.0 fallback paths are unreachable.
2026-05-11 20:29:47 +02:00
Ingo Paschke f0b6ddc6f8 Amiga: drop legacy non-gcc compiler guards
Remove AZTEC_C, _DCC, SASC, LATTICE, MANX arms. The port targets bebbo gcc.
2026-05-11 20:29:47 +02:00
Ingo Paschke 22ddba7c1e Amiga: more review fixes
- NHW_BASE / NHW_OVER collided with NHW_PERMINVENT=6; renumber off NHW_LAST_TYPE.
- GlyphToIcon used > 10000 instead of >=.
- make_menu_items sized array by sizeof(amii_menu_item) instead of menu_item.
- DoMenuScroll could deref NULL amip on SELECTUP.
- get_nhuuid uses ISAAC64 rn2() instead of hand-rolled LCG.
- fopenp's bound check fired one byte too late.
- winami.p had stale signatures for amii_end_menu, amii_select_menu, amii_suspend_nhwindows.
2026-05-11 20:29:47 +02:00
Ingo Paschke f8ea34489f Amiga: fix three latent bugs found in code review
amiv_lprint_glyph used uninitialized 'base'; amii_clear_nhwindow
compared cw->type to a winid; amii_sethipens fell through.
2026-05-11 20:29:47 +02:00
nhw_cron 66c97eaab3 This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-11 13:44:16 -04:00
nhmall b2cf7d5a84 Guidebook datestamp to most recent commit 2026-05-11 12:33:35 -04:00
nhmall e8e8749c25 move header to bottom of the Contributing.md file 2026-05-11 12:18:17 -04:00
nhw_cron 7c14ed2723 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-11 11:55:40 -04:00
nhmall b4f28edfe4 some malloc() 2026-05-11 11:33:15 -04:00
nhmall a5a4bc6b4a remove an outdated file that brought a complaint
All the files in outdated are mostly source as they were prior to
the move to the outdated part of the NetHack tree. They are left
there in case somone wants to try to resurrect a port.

They are not meant to be compiled, or used as-is.
2026-05-11 06:38:11 -04:00
nhmall a583201f15 check malloc() return in bmp2iff_host.c 2026-05-11 06:34:20 -04:00
nhmall 16986710d5 follow-up grammar 2026-05-10 23:23:17 -04:00
nhmall 430c84aef7 catch up fixes5-0-1.txt 2026-05-10 23:21:34 -04:00
nhmall f10fe47505 dat/history sync with Guidebook 2026-05-10 22:58:47 -04:00
nhmall 610bd839ee update the code for portable Windows configuration
Restrict which options in sysconf will be processed
when seeking PORTABLE_DEVICE_PATHS.
2026-05-10 21:11:17 -04:00
nhmall 2337a2bae5 Windows follow-up
Remove some unused temporary code
2026-05-10 16:04:09 -04:00
nhmall 745c7fb8d8 some windows fixes
Resolves #1526
2026-05-10 16:00:33 -04:00
nhmall 9d5b02d912 NetHack 5.0.0 packaging error from visual studio
A remnant hard-coded 370 was in package.nmake.

Note: The errant file was not used to construct the official
binaries. Those were done using sys/windows/Makefile.nmake.

Closes #1525
2026-05-10 14:43:26 -04:00
nhmall 5cf9086c84 Windows: don't demand keypress on intentional exit 2026-05-10 12:10:26 -04:00
nhmall aa63616118 spelling correction 2026-05-10 11:36:43 -04:00
nhmall f64b996899 optional package sequencer for building binary
Add Makefile support for an optional AMIGPKGSEQ to
append a suffix to the Amiga binary, without having to
rename the zip file manually after the
    make CROSS_TO_AMIGA=1 package
step.
2026-05-10 10:33:20 -04:00
nhmall edafe39f5d add awareness of possible updated binary with numeric suffix
Close #1514
2026-05-10 09:07:10 -04:00
nhmall 029ed6eabd Merge branch 'amiga-menu-glyphs' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-10 08:50:38 -04:00
nhmall ce92a979dd Merge branch 'linux-tty-cflags' of https://github.com/torakoya/NetHack into NetHack-5.0 2026-05-10 08:48:30 -04:00
Ingo Paschke c1ae9d5d8c Amiga: restore glyph icons in menus
Core changes routed transient inventory away from WIN_INVEN, so the
port's win == WIN_INVEN gate stopped matching and glyphs vanished.
Track has_glyphs on the menu and key rendering and sizing off that.
2026-05-09 17:11:33 +02:00
nhw_cron 13bbbf6a13 This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-07 23:25:42 -04:00
nhw_cron b02f28fec2 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-07 23:25:25 -04:00
nhw_cron 669e44c670 This is cron-daily v1-May-7-2026. 005manpages updated: makedefs.txt 2026-05-07 23:25:06 -04:00
nhw_cron fed12887ca This is cron-daily v1-May-7-2026. 005manpages updated: mnh.txt 2026-05-07 23:24:48 -04:00
nhw_cron 3f02b77f2e This is cron-daily v1-May-7-2026. 005manpages updated: nethack.txt 2026-05-07 23:24:35 -04:00
nhw_cron 92734c3283 This is cron-daily v1-May-7-2026. 005manpages updated: recover.txt 2026-05-07 23:24:22 -04:00
nhmall 4938a85068 relocate Contributing.md to the root 2026-05-07 11:40:14 -04:00
nhmall 39f31a8f06 fix a CROSS_TO_WASM=1 build issue 2026-05-07 10:43:24 -04:00
Yoichiro Takahashi 4a4b4498a8 Respect ncurses cflags on Linux tty 2026-05-07 21:22:15 +09:00
nhmall 88bacb00c2 fixes update 2026-05-07 07:14:56 -04:00
nhmall 22009c300a update to DEVEL/Contributing.md 2026-05-07 07:11:55 -04:00
nhmall 1c1f64dc19 Issue #1521 asks for Contributing.md file
This is expected to improve and fill out over time, with more
guidelines for contributing.
2026-05-07 07:02:26 -04:00
nhmall d52b1daf50 bring fixes5-0-1.txt up to date 2026-05-07 00:23:16 -04:00
nhmall 89c6b49b0c spelling correction in nethack.6 2026-05-06 23:19:13 -04:00
nhmall 6204679bfd Guidebook type fix 2026-05-06 23:02:29 -04:00
nhmall 6ed95bebba paste error in Guidebook.tex 2026-05-06 22:58:34 -04:00
nhmall d5673a948e Merge branch 'gbr-NetHack-5.0-man-page-fixes' of https://github.com/g-branden-robinson/NetHack into g-branden-robinson-gbr-NetHack-5.0-man-page-fixes 2026-05-06 21:25:06 -04:00
nhmall dcf8752e92 Merge branch 'fix/libnh-native-build' of https://github.com/YttriumOx/NetHack into YttriumOx-fix/libnh-native-build 2026-05-06 21:07:23 -04:00
nhkeni cc4c5227af use full URL for nethack.org in Guidebook.mn 2026-05-06 16:19:02 -04:00
G. Branden Robinson 48ae0eb46e doc/nethack.6: Rewrite initial description
I noticed that the "Dungeons & Dragons" trademark acknowledgement should
be using the _registered_ trade mark sign instead of the more general
one, as the mark's enjoyed registered status (in the U.S.) since 1978.

https://tmsearch.uspto.gov/search/search-results/73123558

It occurred to me that updating the game description for a 2026 audience
might be an improvement on one that assumes the reader is familiar with
D&D, with Teletype machines ("TTYs"), and with the Rogue game, which
NetHack arguably eclipsed in notoriety decades ago.

So I rewrote it, and dropped the references to D&D.  Besides, as of
commit c99da87c70, NetHack is incompatible with "Strength Table I." in
the AD&D Player's Handbook (TSR 2010, p. 9), so any grognard who lifts
would snatch NetHack's D&D membership card away anyway.  ;-)
2026-05-06 04:53:12 -05:00
G. Branden Robinson 76303faeab doc/*.6: Use typographer's double quotes
...where available.

groff_man_style(7):

Notes
...
     • When and how should I use quotation marks?

       ... groff, Heirloom Doctools troff, neatroff, and mandoc support
       all of the special characters \[oq], \[cq], \[lq], \[rq], \[aq],
       and \[dq] described in subsection “Portability” above.  DWB, Plan
       9, and Solaris troffs do not.  Interpolating the strings \*(lq
       and \*(rq portably yields directional double quotation marks, if
       available, in all these formatters (though neatroff does not
       supply a man macro package), but they cannot reliably be used in
       macro arguments.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 1d13d2ce62 doc/nethack.6: Fix markup nits
Drop unnecessary quotation marks from macro call arguments.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 74a3dc9d71 doc/makedefs.6: Fix style and markup nits
* Set cross reference to "nethack" man page in lowercase, because that's
  the name under which it's installed, and POSIX systems are
  case-sensitive.
* Refer to the "nethack" command using a man page cross reference only
  on its first occurrence.
* Favor bullets over hyphens for itemized list.
* Drop explicit indentation amounts from lists.  The man(7) package's
  default suffices on all of Solaris 10, DWB 3.3, Plan 9, Heirloom
  Doctools, and GNU *roffs, and on mandoc(1).
* Use tagged paragraphs to set synopses of syntax productions used in
  the documented file format.
* Drop inset (indentation) of itemized and tagged lists; the bullets
  make the structure clear, and (with the foregoing change) this way the
  paragraphs align.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 61a16e6983 doc/recover.6: Fix style and markup nits
* Identify NETHACKDIR and HACKDIR as environment variables.
* ...and set them italics, not roman.
* Set default playground directory name in italics, not roman.
* Set command names in italics.
* Refer to command operands as such, not as "options".
* Use man page cross reference on first occurrence of "nethack" when
  referring to the command executable as opposed to the overall game.
  Because some text is commented out (`ig`nored), meaning the "first"
  occurrence appears twice (what's lexically present vs. what's
  formatted) do this twice as future-proofing.
* Set file names in italics, not roman.  Set variable parts of file
  names in roman.
* Refer to "single-user systems" instead of "microcomputers"; the latter
  is becoming antiquated terminology.
* Favor present tense over future.
* Tighten wording.
* Spell "save files" consistently as two words.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 2d3f9b8c21 doc/recover.6: Revise synopsis
Tighten formatting: set synopsis syntax characters adjacently to
operands.  Rename `-d` option argument from "directory" to
"playground-directory" for clarity.

Set operands more idiomatically.  They are not given in pairs; instead
"base" can be repeated arbitrarily.  See, for example, the POSIX
reference page for ls(1).
  https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ls.html

Format ellipsis idiomatically.

groff_man_style(7):

Notes
       ... The idiomatic roff ellipsis is three dots (periods) with thin
       space escape sequences \| internally separating them.  Since dots
       both begin control lines and are candidate end‐of‐sentence
       characters, however, it is sometimes necessary to prefix and/or
       suffix an ellipsis with the dummy character escape sequence \&.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 561d08e53b doc/*.6: Improve formatting of carets
...on typesetters and UTF-8 terminals.

groff_man_style(7):
   Portability
...
     Several special characters are also widely portable.  Except for
     \-, \[em], and \[ga], AT&T troff did not consistently define the
     characters listed below, but its descendants, like DWB, Plan 9, or
     Solaris troff, can be made to support them by defining them in font
     description files, making them aliases of existing glyphs if
     necessary; see groff_font(5).  groff’s extended notation for
     special characters, \[xx], is also supported by mandoc(1), Heirloom
     Doctools troff, and neatroff, but not DWB, Plan 9, or Solaris
     troffs.
...
     \[ha]  Basic Latin circumflex accent (“hat”).  Some output devices
            format “^” as U+02C6 (modifier letter circumflex accent).
Notes
     Some tips on composing and troubleshooting your man pages follow.
...
     • Escape sequences of the form \[xx] don’t format correctly.

       The \[xx] special character escape sequence is a GNU troff
       extension also supported by mandoc, Heirloom Doctools troff, and
       neatroff.  DWB, Plan 9, and Solaris troffs don’t implement it.
       If your man page requires portability to these formatters, spell
       such escape sequences as “\(xx”; no closing parenthesis is used.
       xx must be exactly two characters; groff_char(7) lists portable
       special character identifiers.
2026-05-06 04:53:12 -05:00
G. Branden Robinson b602b495bb doc/makedefs.6: Clarify - as option argument
Quote it, use fuller C standard I/O terminology, and use active voice.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 4ab9ec36de doc/makedefs.6: Tigthen formatting
Set synopsis syntax characters adjacently to operands.
2026-05-06 04:53:12 -05:00
G. Branden Robinson bdae11c61d doc/nethack.6: Revise role info in synopsis
Revise presentation of backward-compatible role options.

- Give them a metasyntactic variable name and present them in the main
  command synopsis.

- Present the possible values in a typographical display, indented with
  filling disabled.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 44c8405000 doc/nethack.6: Revise primary synopsis
Set it as a hanging paragraph, as is idiomatic for Unix command
synopses.  Tighten formatting: set synopsis syntax characters adjacently
to operands.  Also drop explicit line breaks, permitting synopsis to
exercise the configured line length of the selected output device.

Temporarily disable adjustment in a manner more friendly to the system's
(or user's) configuration.[1]  Stop attempting to manipulate
hyphenation; there's no portable way to do that.[2]

Before and after, as rendered with Solaris 10, DWB 3.3, and Plan 9
troffs:

-     nethack [ -d|--directory directory ] [ -w|--windowtype
-     interface ]
-     [ --nethackrc:rc-file | --no-nethackrc ] [ -n ] [ -dec |
-     -ibm ]
-     [ -u player-name ] [ -X | -D ] [ -p profession ] [ -r race ]
-     [ -@ ]
+     nethack [-d|--directory directory]
+          [-w|--windowtype interface]
+          [--nethackrc:rc-file|--no-nethackrc] [-n] [-dec|-ibm]
+          [-u player-name] [-X|-D] [-p profession] [-r race] [-@]

Not shown: Literal text is in bold, and option arguments in italics.

(Full disclosure: The aforementioned formatters use different page
offsets [left margin sizes], and Plan 9 nroff doesn't render _any_
typeface changes, ever, for any document using any macro package.)

Before and after, as rendered with groff, mandoc, and Heirloom Doctools
troff:

-       [ --nethackrc:rc-file | --no-nethackrc ] [ -n ] [ -dec | -ibm ]
-       [ -u player-name ] [ -X | -D ] [ -p profession ] [ -r race ] [ -@ ]
+       nethack [-d|--directory directory] [-w|--windowtype interface]
+              [--nethackrc:rc-file|--no-nethackrc] [-n] [-dec|-ibm]
+              [-u player-name] [-X|-D] [-p profession] [-r race] [-@]

(Full disclosure: groff 1.24.x man(7) uses a default line length of
80n,[3] up from the 78n of its previous releases going back to 2002, and
used by Heirloom Doctools and mandoc.)

[1] https://cgit.git.savannah.gnu.org/cgit/groff.git/tree/tmac/an.tmac?h=1.24.1#n159
[2] https://cgit.git.savannah.gnu.org/cgit/groff.git/tree/tmac/an.tmac?h=1.24.1#n202
[3] https://cgit.git.savannah.gnu.org/cgit/groff.git/tree/NEWS?h=1.24.1#n509
2026-05-06 04:53:12 -05:00
G. Branden Robinson e4476516cd doc/nethack.6: Revise scoreboard mode synopsis
Set it as a hanging paragraph, as is idiomatic for Unix command
synopses.  Tighten formatting: set synopsis syntax characters adjacently
to operands.  Since viewing the scoreboard is a separate mode of
operation, arrange first the options that select this mode.[1]  Also
drop explicit line breaks, permitting synopsis to exercise the
configured line length of the selected output device.

Before and after, as rendered with Solaris 10 troff:

-     nethack [ -d|--directory directory ] -s|--scores [ -v ]
-     [ -p profession ] [ -r race ] [ player-name ...]
+     nethack {-s|--scores} [-d|--directory directory] [-v]
+          [-p profession] [-r race] [player-name ...]

Before and after, as rendered with groff, mandoc, and Heirloom Doctools
troff:

-     nethack [ -d|--directory directory ] -s|--scores [ -v ]
-     [ -p profession ] [ -r race ] [ player‐name ...]
+     nethack {-s|--scores} [-d|--directory directory] [-v] [-p profession]
+            [-r race] [player‐name ...]

Not shown: Literal text is in bold, and option arguments in italics.

[1] See, for example,
<https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/utilities/compress.html>.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 2011f8b4c1 doc/nethack.6: Split non-playing synopses
The `--showpaths` and `--version` options can't be (usefully) combined
with `--usage` or `--help`, nor with each other.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 2b4b589a63 doc/nethack.6: Spell option argument as "rc-file"
...that is, not in capitals.  Lowercase seems more consistent with Unix
practice.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 2c9bda8660 doc/nethack.6: Respell playername option argument
Spell it as a hyphenated noun phrase.  Use an ellipsis instead of
pluralization to mark its repeatability.  Slightly recast its
description.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 4a76d66ad9 doc/nethack.6: Be more portable to old roffs (4/4)
Define strings for directional single quotation marks.

groff_man_style(7):

Notes
     Some tips on composing and troubleshooting your man pages follow.
...
     • When and how should I use quotation marks?
...
       Obtaining directional single quotation marks is more of a
       challenge.  Historically, man pages used ` and ', which troff
       rendered on typesetters as ‘ and ’, exclusively for them.
       However, in recent years, some distributors of groff have chosen
       to override the meanings of these characters in man pages,
       remapping them to their Unicode Basic Latin code points.
       Unfortunately, ` and ' are the only reliable means of obtaining
       directional single quotation marks in AT&T troff; in that
       implementation, often no special character escape sequences exist
       to obtain them.  Further, AT&T troff’s special character
       identifiers, like its font names, were device‐specific.  To
       achieve quotation portably in man pages rendered both by AT&T and
       more modern troffs, consider adding a preamble to your page after
       the TH call as follows.

              .ie \n(.g \{\
              .  ds oq \[oq]\"
              .  ds cq \[cq]\"
              .\}
              .el \{\
              .  ds oq `\"
              .  ds cq '\"
              .\}

       You must then use the \* escape sequence to interpolate the
       quotation mark strings.

              The command
              .RB \*(oq "while !\& git pull; do sleep 10; done" \*(cq
              retries an update from the repository until it succeeds.

       If this procedure seems complex, petition your distributor to
       revert their remapping of the ` and ' characters.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 1922fb687d doc/nethack.6: Be more portable to old roffs (3/4)
Unbreakable spaces in AT&T troff were always non-adjustable.

Define a string to use groff's `\~` extension if possible.

groff_man_style(7):
   Portability
...
     \~        Adjustable non‐breaking space.  Use this escape sequence
               to prevent a break inside a short phrase or between a
               numerical quantity and its corresponding unit(s).

                      Before starting the motor,
                      set the output speed to\~1.
                      There are 1,024\~bytes in 1\~KiB.
                      CSTR\~#8 documents the B\~language.

               \~ is a GNU extension also supported by Heirloom Doctools
               troff 050915 (September 2005), mandoc 1.9.14
               (2009‐11‐16), neatroff (commit 1c6ab0f6e, 2016‐09‐13),
               and Plan 9 from User Space troff (commit 93f8143600,
               2022‐08‐12), but not by DWB or Solaris troffs.

Fixes bad rendering in DWB 3.3 troff:

@@ -999 +999 @@
-            file.   -s|-s~-v  may  also  be  followed  by  arguments  -p
+            file.   -s|-s -v  may  also  be  followed  by  arguments  -p
@@ -1005 +1005 @@
-            entries  which  match both.  -s|-s~-v may be followed by one
+            entries  which  match both.  -s|-s -v may be followed by one

Solaris 10 troff _would_ misrender as well, but a different portability
problem keeps some of the foregoing text from rendering at all.
2026-05-06 04:53:12 -05:00
G. Branden Robinson afeec3dd65 doc/nethack.6: Be more portable to old roffs (2/4)
Old *roffs don't support the `ti` special character.  Compensate.

Before (DWB, Solaris 10):
            The --nethackrc:RC-file option will use RC-file  instead  of
            the   default   run-time   configuration   file   (typically
            /.nethackrc) and the --no-nethackrc option can  be  used  to
            skip any run-time configuration file.

Before (Plan 9):
          The --nethackrc:RC-file option will use RC-file  instead  of
          the   default   run-time   configuration   file   (typically
          ti/.nethackrc) and the --no-nethackrc option can be  used  to
          skip any run-time configuration file.

After (all):
            The --nethackrc:RC-file option will use RC-file  instead  of
            the   default   run-time   configuration   file   (typically
            ~/.nethackrc) and the --no-nethackrc option can be  used  to
            skip any run-time configuration file.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 14430511bd doc/nethack.6: Be more portable to old roffs (1/4)
Favor the very old `lq` and `rq` extension _strings_ over special
characters of the same name.  This fixes missing punctuation and text
when rendering this document with DWB and Solaris 10 nroffs, and
misrendered text with Plan 9 nroff.

Before (DWB, Solaris 10):
            discovery  mode (also known as explore mode).  -D will start
            the game in debug mode (also known  as  wizard  mode)  after
            changing  the  character  name  to  wizard, if the player is
            allowed.  Otherwise it will switch to -X.  Control of who is
            allowed to use debug mode is done via the

Before (Plan 9):
          discovery  mode (also known as explore mode).  -D will start
          the game in debug mode (also known  as  wizard  mode)  after
          changing  the  character  name to lqwizardrq, if the player is
          allowed.  Otherwise it will switch to -X.  Control of who is
          allowed to use debug mode is done via the lqWIZARDS=rq line in
          NetHack's sysconf file.

After (all):
            The -X option will start the game in a  special  non-scoring
            discovery  mode (also known as explore mode).  -D will start
            the game in debug mode (also known  as  wizard  mode)  after
            changing  the  character  name to "wizard", if the player is
            allowed.  Otherwise it will switch to -X.  Control of who is
            allowed to use debug mode is done via the "WIZARDS=" line in
            NetHack's sysconf file.

(There are minor differences in the page offset amount, and Plan 9 uses
UTF-8 double quotation marks, U+201C and U+201D.)

groff_man(7):
   Strings
     The following strings are defined for use in man pages.  None of
     these is necessary in a contemporary man page; see
     groff_man_style(7). ...
...
     \*(lq
     \*(rq   interpolate special character escape sequences for left and
             right double‐quotation marks, \(lq and \(rq, respectively.

(I see that I should reword the foregoing to something like "None is
necessary in man pages targeting only contemporary *roff formatters".)

   History

     ... 4BSD (1980) added lq and rq strings.  ... Unix System V (1988)
     incorporated the lq and rq strings.

     Except for EX/EE, James Clark implemented the foregoing features in
     early versions of groff.  ... Plan 9 from User Space’s troff ...
     incorporated the lq and rq strings in 2025.

groff_man_style(7):

Notes
     Some tips on composing and troubleshooting your man pages follow.
...
     • When and how should I use quotation marks?

       As noted above in subsection “Font style macros”, apply quotation
       marks to “brief specimens of literal text, such as article
       titles, inline examples, mentions of individual characters or
       short strings, and (sub)section headings in man pages”.  Multi‐
       word literals, such as Unix commands with arguments, when set
       inline (as opposed to displayed between EX and EE), should be
       quoted to ensure that the boundaries of the literal are clear
       even when the material is stripped of font styling by, for
       example, copy‐and‐paste operations.  groff, Heirloom Doctools
       troff, neatroff, and mandoc support all of the special characters
       \[oq], \[cq], \[lq], \[rq], \[aq], and \[dq] described in
       subsection “Portability” above.  DWB, Plan 9, and Solaris troffs
       do not.  Interpolating the strings \*(lq and \*(rq portably
       yields directional double quotation marks, if available, in all
       these formatters (though neatroff does not supply a man macro
       package), but they cannot reliably be used in macro arguments.

Per the final sentence above, do a little dance to avoid using these
strings in macro arguments.
2026-05-06 04:53:12 -05:00
G. Branden Robinson fb611b60bc doc/nethack.6: Spell "NetHack" thus
...when not referring specifically to the command's file name.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 103d5f27e7 doc/makedefs.6: Drop redundant br requests
Paragraphing macros in *roff systems generally break the output line,
and the same is true of all of man(7)'s paragraphing macros.

groff_man(7):
   Paragraphing macros
     These macros break the output line.  An ordinary paragraph (P)
     indents all output lines by the same amount.  A hanging paragraph
     (HP) is a cosmetic variant of P with a hanging indent.  Definition
     lists frequently occur in man pages; these can be set as tagged
     paragraphs, which have one (TP) or more (TQ) leading tags followed
     by a paragraph that has an additional indentation.
2026-05-06 04:53:08 -05:00
G. Branden Robinson 67e724cd75 doc/*.[67]: Set man page xrefs consistently
NetHack's man pages already preponderantly use man(7) `IR` macro for
this purpose.  Align outliers.

The "SEE ALSO" section of doc/mn.7 is a partial exception.  While the
rest of the document sets cross-referenced man page topics in italics,
this section of the page does not.  It seems likely that this decision
was made in deliberate imitation of Seventh Edition Unix manuals (1979)
or their descendants in USG/USL and BSD Unices.  That feature of the
Unix man pages, however, was not deliberate per Doug McIlroy, the author
of the man(7) macros and editor of Volume 1 of the Seventh Edition Unix
Programmer's Manual, per his communication on the groff mailing list.

But NetHack has a policy of not modifying Matt Bishop's "mn" macro
file or its man page, so I leave that exception in place.

References:

https://lists.gnu.org/archive/html/groff/2021-08/msg00023.html
https://lists.gnu.org/archive/html/groff/2021-08/msg00040.html
https://github.com/NetHack/NetHack/pull/977#issuecomment-1424996578
2026-05-06 04:39:57 -05:00
G. Branden Robinson bbcfc474d0 doc/*.[67]: Drop redundant calls and requests
Sectioning and paragraphing macros always break the output line.

(Sub)sectioning macros always set text after the heading as a paragraph.

Fixes:

$ mandoc -T lint doc/*.[67] # output edited
doc/makedefs.6:49:2: WARNING: skipping paragraph macro: PP after SH
doc/nethack.6:367:2: WARNING: skipping paragraph macro: br after PP
doc/nethack.6:365:2: WARNING: skipping paragraph macro: PP empty
doc/nethack.6:157:2: WARNING: skipping paragraph macro: PP after SH
doc/nethack.6:431:2: WARNING: skipping paragraph macro: PP after SH
doc/nethack.6:673:2: WARNING: skipping paragraph macro: PP after SH
doc/nethack.6:676:2: WARNING: skipping paragraph macro: PP after SH
doc/recover.6:29:2: WARNING: skipping paragraph macro: PP after SH
doc/recover.6:125:2: WARNING: skipping paragraph macro: PP after SH
doc/recover.6:141:2: WARNING: skipping paragraph macro: PP after SH
doc/mnh.7:23:2: WARNING: skipping paragraph macro: PP after SH
doc/mnh.7:46:2: WARNING: skipping paragraph macro: PP after SH
2026-05-06 04:39:57 -05:00
G. Branden Robinson d2a49d4f8a doc/nethack.6: Revise "ENVIRONMENT" section
Explain meaning of stacked paragraph tags naming environment variables.

Drop call of deprecated man(7) `DT` macro and invocation of `ta` request
to set tab stops to attempt table-like layout.  (The latter made the
former nilpotent anyway.)  Replace this material with calls of tagged
paragraphing macro `TP` and groff man(7)'s `TQ` extension for setting
multiple tags with a paragraph.  The result takes up more screen lines,
but renders well with more formatters.

Set indentation of tagged paragraph using a constant numeric expression
to accommodate pseudo-roff formatters that don't implement arithmetic
evaluation.  (Some of these ignore _any_ indentation, regardless.)

Slightly recast descriptions of environment variables.

Set file name literals in italics.

Protect file and environment variable names from hyphenation.

Fixes:

an.tmac:doc/nethack.6:608: style: use of deprecated macro: .DT
2026-05-06 04:39:57 -05:00
G. Branden Robinson 6c9e8cb1c9 doc/nethack.6: Revise "FILES" section
* Define string to exercise groff's hyphenless break point feature.
  This helps with file names and URLs.  On formatters that don't claim
  compatibility with groff, define the string as nothing, getting the
  same result as before (a _highly_ ragged right margin, jarring
  adjustment, or overset lines).

* If the formatter does not claim compatibility with groff, define a
  copy of groff man(7)'s `TQ` macro to ease stacking of paragraph tags.

* Set file name literals in italics.  Stop quoting them (which was
  inconsistently done anyway).

* Revise "FILES" section.
  - Drop redundant `PP` paragraphing call.

    $ mandoc -T lint doc/nethack.6
    ...
    mandoc: doc/nethack.6:432:2: WARNING: skipping paragraph macro: PP after SH
    ...

    groff_man(7):

     .SH [heading‐text]
            Set heading‐text as a section heading. ...  Text lines after
            the call are set as an ordinary paragraph (P).

  - Drop call of deprecated man(7) `DT` macro and invocation of `ta`
    request to set tab stops to attempt table-like layout.  (The latter
    made the former nilpotent anyway.)  Replace this material with calls
    of tagged paragraphing macro `TP` and groff man(7)'s `TQ` extension
    for setting multiple tags with a paragraph.  The result takes up
    more screen lines, but renders well with more formatters.

  - Fine-tune styling of file names.

    groff_man_style(7):
            Use italics for file and path names, ... for variant
            (user‐replaceable) portions of syntax synopses, ... and
            anywhere a parameter requiring replacement by the user is
            encountered.  An exception involves variant text in a
            context already typeset in italics, such as file or path
            names with replaceable components; in such cases, follow the
            convention of mathematical typography: set the file or path
            name in italics as usual but use roman for the variant part
            (see IR and RI below), and italics again in running roman
            text when referring to the variant material.

Solaris 10, DWB 3.3, and Plan 9 from User Space nroffs formatted the
table of file names and descriptions quite badly.

Before:
            nethack                     The program itself.
            Guidebook | Guidebook.txt   NetHack's user manual.
            data, oracles, rumors       Data files used by NetHack.
            bogusmon                    Another data file.
            engrave, epitaph, tribute   Still more data files.
            symbols                     Data file holding sets of speci-
            fications
                                        for  how  to  display  monsters,
            objects, and
                                        map features.
            options                     Data file containing a  descrip-
            tion of the
                                        build-time option settings.
            help, hh, cmdhelp           Help data files.  ('cmdhelp'  is
            obsolete.)
...

Now (pagination on AT&T nroffs is omitted):
            nethack
                 The program itself.

            Guidebook
            Guidebook.txt
                 NetHack's user manual.

            data
            oracles
            rumors
                 Data files used by NetHack.

            bogusmon
                 Another data file.

            engrave
            epitaph
            tribute
                 Still more data files.

            symbols
                 Data file holding sets of  specifications  for  how  to
                 display monsters, objects, and map features.

            options
                 Data file containing a description  of  the  build-time
                 option settings.

            help
            hh
            cmdhelp
                 Help data files.  (cmdhelp is obsolete.)

Fixes:

an.tmac:doc/nethack.6:444: style: use of deprecated macro: .DT
2026-05-06 04:39:57 -05:00
G. Branden Robinson a562b80019 doc/makedefs.6: Fix style nits
* End sentence with period, like others in this document.
* Set literal file name in italics like all others in this document, not
  bold.
2026-05-06 04:39:57 -05:00
G. Branden Robinson 0c915adea1 doc/makedefs.6: Break text line at end of sentence
Ensure that *roff programs detect the sentence ending here.

https://www.gnu.org/software/groff/manual/groff.html.node/Sentences.html
2026-05-06 04:39:57 -05:00
G. Branden Robinson 32c1b24f32 doc/makedefs.6: Make punct styling consistent
Elsewhere in this document, punctuation after italicized words is set in
roman, not italics.
2026-05-06 04:39:57 -05:00
G. Branden Robinson 82c174a847 doc/makedefs.6: Fix warning from DWB 3.3 nroff
Not a serious issue in my opinion, but worth fixing.  DWB does not
misrender the document, and the "stack" referred to is not the runtime
stack employed by the operating system, but one in the *roff language
runtime.

The diagnostic appears to be spurious in this case, but it isn't always.

https://github.com/n-t-roff/DWB3.3/issues/10
2026-05-06 04:39:57 -05:00
G. Branden Robinson fc0fd459b1 doc/nethack.6: Drop spurious request arguments
No *roff known to me interprets arguments to the `br` request.  They
don't complain, either, but some day that may change.

https://savannah.gnu.org/bugs/?61450
2026-05-06 04:39:57 -05:00
G. Branden Robinson 9508a133d0 doc/*.6: Fix unescaped hyphens
groff_man_style(7):
     •  Option dashes are specified with the \- escape sequence; this is
        an important practice to make them clearly visible and to
        facilitate copy‐and‐paste from the rendered man page to a shell
        prompt or text file.
...
     \-     Minus sign.  \- produces the basic Latin hyphen‐minus
            (U+002D) specifying Unix command‐line options and frequently
            used in file names.  “-” is a hyphen in roff; some output
            devices format it as U+2010 (hyphen).
2026-05-06 04:39:57 -05:00
G. Branden Robinson 2566ddefdf doc/*.6: Break input lines at sentence endings
...pacifying a warning from the forthcoming groff 1.25.

Fixes:

troff:doc/dlb.6:159: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:53: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:55: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:58: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:153: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:159: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:166: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:222: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:245: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:279: warning: end of sentence detected before end of text line [-w style]
troff:doc/mnh.7:30: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:225: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:226: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:230: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:234: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:236: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:524: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:577: warning: end of sentence detected before end of text line [-w style]
troff:doc/recover.6:155: warning: end of sentence detected before end of text line [-w style]
2026-05-06 04:39:57 -05:00
G. Branden Robinson a33da92029 doc/*.6: Tweak copyright notices in man pages
Use *roff special character `\(co` for copyright sign.  This special
character identifier is _almost_ universally portable, dating back to
Ossanna troff in 1976.[1]  The exception is Plan 9 nroff, which claims
to be thoroughly UTF-8 oriented and should be able to render a copyright
sign.[2]  If no glyph for the character is available, the output device
driver degrades it to "c" (which is technically correct[3]), except for
groff, which falls back to "(C)"[4] only on its "ascii" output device.
All of groff's other devices have a a proper copyright sign.[5]

References:
[1] https://archive.org/details/unix-programmers-manual-seventh-edition-vol-2-1983/
    (pp. 196ff., see esp. "Table II", p. 227)
[2] https://github.com/9fans/plan9port/pull/735#issuecomment-3391733330
[3] https://www.copyright.gov/circs/circ03.pdf
[4] https://github.com/GitMirroring/groff/blob/a4d6e619afc8042b12084527c3c11eae919533e2/tmac/tty.tmac#L123
[5] https://paste.c-net.org/ComradesCourage
2026-05-06 04:39:57 -05:00
G. Branden Robinson 56d0708ac7 doc/mnh.7: Migrate to use "NH_DATESUB"
Aligns with other NetHack man pages and fixes:
$ nroff -ww -z -rCHECKSTYLE=4 -man doc/*.[67]
an.tmac:doc/mnh.7:2: style: .TH missing fourth argument; suggest package/project name and version (e.g., "groff 1.23.0")
2026-05-06 04:39:57 -05:00
G. Branden Robinson c91ee79dcb doc/nethack.6: Fix inelegant formatting
Replace instances of blank line paragraphing with `PP` macro calls.

There are three problems with the style of paragraphing that this commit
fixes.

1.  A `br` break request is redundant with an adjacent blank text line.
2.  A `br` request is also redundant with a paragraphing macro call.
3.  When you use a paragraphing macro call instead of a blank text line,
    you get the configured amount inter-paragraph space.  When
    typesetting with the man(7) package, the default inter-paragraph
    space amount is 0.4v.  A blank text line usually puts 1v of empty
    space into the document.

See groff_man_style(7).

Fixes:
$ nroff -ww -z -rCHECKSTYLE=4 -man doc/*.[67]
an.tmac:doc/nethack.6:435: style: blank line in input
an.tmac:doc/nethack.6:442: style: blank line in input
an.tmac:doc/nethack.6:535: style: blank line in input
an.tmac:doc/nethack.6:539: style: blank line in input
an.tmac:doc/nethack.6:543: style: blank line in input
an.tmac:doc/nethack.6:568: style: blank line in input
an.tmac:doc/nethack.6:572: style: blank line in input
2026-05-06 04:39:57 -05:00
G. Branden Robinson 723afcd51f doc/*.6: Fix macro usage style errors
Fixes:
$ nroff -ww -z -rCHECKSTYLE=4 -man doc/*.[67]
an.tmac:doc/dlb.6:41: style: .IR expects at least 2 arguments, got 1
an.tmac:doc/makedefs.6:125: style: .IR expects at least 2 arguments, got 1
an.tmac:doc/makedefs.6:131: style: .IR expects at least 2 arguments, got 1
an.tmac:doc/makedefs.6:137: style: .IR expects at least 2 arguments, got 1
an.tmac:doc/nethack.6:89: style: .BR expects at least 2 arguments, got 1
an.tmac:doc/nethack.6:129: style: .BR expects at least 2 arguments, got 1
an.tmac:doc/nethack.6:273: style: .BR expects at least 2 arguments, got 1
2026-05-06 04:39:57 -05:00
G. Branden Robinson d90422f0ce doc/nethack.6: Drop commented-out legacy remark
Unix terminal drivers started transitioning away from paper terminals
and toward video terminals, and therefore away from '#' and '@' as the
"erase" and "kill" characters, respectively, before NetHack was born.
2026-05-06 04:39:57 -05:00
G. Branden Robinson 3871409560 doc/nethack.6: Fix poor commented-out *roff syntax
groff_man_style(7):
   Portability
...
     \e        Format the roff escape character on the output; widely
               used in man pages to render a backslash glyph.  It works
               reliably as long as the “ec” request is not used, which
               should never happen in man pages, and it is slightly more
               portable than the more explicit \[rs] (“reverse solidus”)
               special character escape sequence.

This change's purpose is to put things right in case the change I'm
proposing next to delete this language entirely gets reverted.
2026-05-06 04:39:57 -05:00
G. Branden Robinson 75e2a6a669 doc/nethack.6: Fix invalid *roff syntax
Also fix a case hidden by a comment.

Fixes:
$ nroff -ww -z -man doc/*.[67]
troff:doc/nethack.6:68: warning: escape character ignored before '@'
troff:doc/nethack.6:292: warning: escape character ignored before '@'
2026-05-06 04:39:57 -05:00
Patric Mueller 60de227615 fix ncurses build on macOS with Homebrew 2026-05-06 09:58:00 +02:00
Benjamin de WaalandClaude Opus 4.7 f6afa23e28 libnh: fix native build of libnh.a on macOS
Fixes four issues that prevented `make WANT_LIBNH=1 all` from producing
a libnh.a that could be linked into a host program on macOS.  Before
these patches, it built but the resulting archive was unusable: macOS
ld errored on a nested liblua archive member, was missing date.o and
hacklib symbols (`populate_nomakedefs`, `eos`, `lcase`, `mungspaces`,
...), and had duplicate definitions of `main`, `whoami`, etc.

Specific changes:

1. sys/libnh/libnhmain.c: drop `static` on `whoami()`.  src/earlyarg.c
   declares it `extern` and calls it from `scores_only()`; the static
   makes it file-local and that reference goes unresolved.

2. sys/libnh/libnhmain.c: gate the emscripten-only code in get_nhuuid
   with `#ifdef __EMSCRIPTEN__` instead of `#ifdef NHUUID`.  The macOS
   hints define NHUUID for the libnh build (they did so unconditionally
   before NO_NHUUID even existed), so on native builds the compiler
   tried to call `emscripten_run_script_int` / `_string` and failed
   with implicit-function-declaration errors.  __EMSCRIPTEN__ is the
   real signal for "this is being cross-compiled to WASM."

3. sys/unix/hints/macOS.500: in the WANT_LIBNH block, add an explicit
   `recover: lua_support` dependency (gated by MAKEFILE_TOP).  When
   $(GAME) is overridden to empty, the regular `recover: $(GAME)` chain
   no longer triggers `lua_support`, so include/nhlua.h never gets
   generated and recover.c's transitive #include of hack.h fails.

4. sys/unix/hints/macOS.500: rewrite the libnh.a rule.  The previous
   `ar rcs libnh.a $(HOBJ) $(LIBNHSYSOBJ) liblua-$(LUA_VERSION).a` had
   four problems: (a) ar archives liblua.a as a single opaque member
   that macOS ld can't dereference, (b) date.o (DATE_O, kept separate
   from HOBJ) was never archived, so `populate_nomakedefs` and
   `nomakedefs` were missing, (c) hacklib.a was likewise omitted, and
   (d) HOBJ already contains $(SYSOBJ) (with unixmain.o) and $(WINOBJ)
   (the tty windowport), which duplicated symbols from libnhmain.o /
   winshim.o.

   The fix uses `libtool -static` so hacklib.a and liblua's archive
   have their members merged rather than nested, depends on $(LUALIB)
   so lua_support runs first, includes $(DATE_O) and $(TARGET_HACKLIB),
   and uses $(filter-out $(SYSOBJ) $(WINOBJ),$(HOBJ)) to drop the
   duplicates.

Verified by clean rebuild on macOS 26 (arm64, Apple clang 17):
  make spotless
  make fetch-Lua
  make WANT_LIBNH=1 all
and link-tested with a tiny harness that calls
shim_graphics_set_callback() against the resulting libnh.a.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 07:06:41 +01:00
nhmall 8fcc15a860 mention_decor and tutorial K4372
Bug report stated:
"If 'mention_decor' is set in config file or NETHACKOPTIONS,
starting the game tells you that you are standing on stairs
which lead out of the dungeon.  But if you also start the
tutorial, you won't be on those stairs--they won't even exist
until the tutorial is exited.

The stairs message can't be suppressed until the program
knows whether the tutorial will be entered, and since
prompting is one of the ways to decide that."

What this does:

Don't heed mention_decor option during the primary rcfile()
processing.

Do heed it after the tutorial.

Note:
If mention_decor is expected to actually be active during the
tutorial, then the rcfile_only_this_option(opt_mention_decor)
likely has to be moved to a different line, which should be
easy enough.
2026-05-05 11:03:44 -04:00
nhmall b7735632bf follow-up for issue #1512
The previous fix, while valid, still prompts for input during early
options processing if stdin is a tty. It really shouldn't be doing
that during early options such as --showpaths, so alter the placement
of the program_state.earlyoptions flag within *main().
2026-05-05 06:57:32 -04:00
nhmall d259245a47 Merge branch 'amiga-followups' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-04 22:58:59 -04:00
Ingo Paschke ed4d100459 Amiga: provide a real v4 UUID via get_nhuuid 2026-05-04 19:13:48 +02:00
Ingo Paschke 5852e8c2a0 Amiga: ship as a NetHack drawer with drawer icon and README 2026-05-04 15:43:12 +02:00
Ingo Paschke d94fb08f8b Amiga: ship Workbench icons for the binary and text files 2026-05-04 15:33:20 +02:00
Ingo Paschke 9a909be7c5 Amiga: auto-assign NetHack: to the program directory 2026-05-04 15:33:14 +02:00
nhmall 400c458fee fix copyright release details
GitHub issue https://github.com/NetHack/NetHack/issues/1513

Starting a new game, at the
'Shall I pick character's race, role, gender and alignment for you? [ynaq]'
prompt, the game shows as 'Version 5.0.0-0 Unix Work-in-progress'
but then once the game has started and you check #version you see
the correct 'Unix NetHack Version 5.0.0-0 post-release' feedback.

Closes #1513
2026-05-04 09:06:52 -04:00
nhmall 60d59f4d55 early startup options could be run non-interactively
https://github.com/NetHack/NetHack/issues/1512

Closes #1512
2026-05-04 08:23:56 -04:00
Ingo Paschke 82efba55f2 Amiga: fix misleading fallback warning and stale comment 2026-05-04 12:42:36 +02:00
Ingo Paschke b72f5cb9a2 Amiga: stop rendering CLR_BLACK and CLR_WHITE as inverse video 2026-05-04 12:42:10 +02:00
Ingo Paschke 548f356cbd Amiga: default number_pad:1 in shipped nethack.cnf 2026-05-04 12:38:21 +02:00
Ingo Paschke 691a8dd7d2 Amiga: promote AMIGA_INTUITION to supported so it shows up in version info 2026-05-04 12:37:34 +02:00
Ingo Paschke f1393bdf6c Amiga: wire altmeta option to sysflags.altmeta 2026-05-04 12:35:33 +02:00
nhmall 3a753dc98e yet another follow-up 2026-05-03 14:13:28 -04:00
nhmall b92c1483bb another libnhmain.c follow-up
Check if it's available before calling.
2026-05-03 14:11:47 -04:00
nhmall b6482d09f4 libnhmain follow-up 2026-05-03 13:26:36 -04:00
nhmall a55ca016eb hints file update for wasm CFLAGS to include -DNHUUID 2026-05-03 13:18:37 -04:00
nhmall ced26a2cea update get_nhuuid() for libnhmain
Try using emscripten_run_script_string("crypto.randomUUID()");
I need to commit this to the repository to test it elsewhere.

If there isn't a revert shortly after this, it must have at least
built without issue.
2026-05-03 13:06:54 -04:00
nhmall 4eefeb30dd Merge branch 'amiga-5.0.0-fixes' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-03 12:27:14 -04:00
Ingo Paschke b6747f89ca Amiga: fall back to text mode when tile mode is not viable
Detect Workbench depth, display-database MaxDepth, and free chip RAM;
if any signals AMIV can't run (e.g. A1000 with 4-colour WB), swap
windowprocs to amii_procs before opening any screens.
2026-05-03 18:01:07 +02:00
Ingo Paschke 2a59726f18 Amiga: disable SYSCF, drop sysconf from package
SYSCF is for multi-user system-admin lockdown; single-user Amigas
don't need it, and assure_syscf_file() killing the binary when run
outside NetHack: was breaking normal launches.
2026-05-03 17:48:22 +02:00
Ingo Paschke d9da319622 Amiga: honor __stack under libnix
Reference __stkinit so the linker pulls swapstack.o from libnix.a;
without it the program runs on the inherited shell stack and crashes
inside Lua / level-gen.
2026-05-03 17:48:15 +02:00
nhmall 1947eb98a4 CROSS_TO_WASM build fixes 2026-05-03 07:37:13 -04:00
nhmall c2a7bdb369 less prone to overlooking target names next time 2026-05-02 22:05:31 -04:00
nhmall a417ca49a2 tag as post-release 2026-05-02 19:26:05 -04:00
nhmall 6b92be3656 Windows nmake build fix for 5.0.0 2026-05-02 14:12:40 -04:00
nhmall 77040f70c7 cross-compiler build fixes 2026-05-02 14:10:04 -04:00
Alex Smith 16ff591153 check_mongen_order shouldn't be compiled into release builds
This function is only used during development, so if it's included
in a release build, the compiler will warn that it's never used.
2026-05-02 17:47:25 +01:00
nhmall 82bb085616 Merge branch 'to500' into NetHack-next 2026-05-02 11:24:50 -04:00
nhw_cron 681bac6aa1 This is cron-daily v1-Apr-26-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-02 11:23:37 -04:00
nhmall e90bc62d7d Merge branch 'to500' into NetHack-next 2026-05-02 10:54:33 -04:00
nhmall 1db2ee5104 dat/history sync 2026-05-02 10:49:43 -04:00
nhmall 41ba62618a placeholder in you 2026-05-02 10:45:29 -04:00
nhmall f63164efc6 version in NetHackProperties.props 2026-05-02 10:37:47 -04:00
nhmall 3fd34d902c Merge branch 'to500' into NetHack-next 2026-05-02 10:27:50 -04:00
nhmall 5c57ac49bf Guidebook wording update 2026-05-02 10:27:15 -04:00
nhmall c4af3448cf patchlevel.h wording bit 2026-05-02 10:25:34 -04:00
nhmall 1f7b2c0ef4 another README update 2026-05-02 10:19:24 -04:00
nhmall 5228a01cde Guidebook.txt update 2026-05-02 10:15:44 -04:00
nhmall f6e2690a7a Guidebook.txt update 2026-05-02 10:14:56 -04:00
nhmall ed997de587 Merge branch 'to500' into NetHack-next 2026-05-02 10:05:32 -04:00
nhmall ce15b9644e README update 2026-05-02 10:05:02 -04:00
nhmall 2b634b1672 Merge branch 'to500' into NetHack-next 2026-05-02 09:56:30 -04:00
nhmall 596ca7756c Merge branch 'NetHack-3.7' into to500 2026-05-02 09:55:08 -04:00
nhmall a127ec7dca Windows MSGSTOP bit
This is a stop gap fix.
2026-05-02 09:54:12 -04:00
nhmall 0c9382e704 placeholders 2026-05-02 08:25:58 -04:00
nhmall 3db7baf4d3 Merge branch 'to500' into NetHack-next 2026-05-02 07:58:58 -04:00
nhmall ec7ffc6360 Merge branch 'NetHack-3.7' into to500 2026-05-02 07:49:47 -04:00
Alex Smith ec7781b996 Remove saving grace
This feature was no longer fulfilling its intended purpose: the
issue is that when players are aware of it, instead of creating
interesting stories, it becomes a resource the player can rely on.

Alternative mitigation for some "unfair" early-game deaths has been
added (such as the warning shot for early-game attack wands and the
ability of iron shoes to protect against certain early traps), and
the warning shot in particular can create interesting gameplay
moments and stories of its own, especially when saving grace is
*not* present (discovering that a monster has a wand of fire and
can oneshot you is an interesting emergency situation, but less
scary if you know that its first attempt to oneshot you will fail).

The feature was also proving quite hard to code correctly, because
there are numerous cases that it "obviously" shouldn't affect
(most notably beheading due to Vorpal Blade, but also things like
purple worm digestion) which would need to be special-cased, and
because there are grey areas like wand zap bounces (which might or
might not be an intentional attempt by the player to hit themself
with the bounce) and damage from traps. Removing it saves the need
to work out, for every new damage source, whether and when saving
grace should interact with it.

Breaks save compatibility.
2026-05-02 10:25:39 +01:00
nhmall 3b3cfb75b4 Merge branch 'to500' into NetHack-next 2026-05-02 00:22:14 -04:00
nhmall a56cc97d74 Merge branch 'NetHack-3.7' into to500 2026-05-02 00:19:08 -04:00
nhmall b8c1a5dae9 Revert "change gy.youmonst"
This reverts commit 5b66ba4c99.
2026-05-02 00:11:06 -04:00
nhmall fd2e44e24f Revert "mhm initialization"
This reverts commit fcc8d4d3c3.
2026-05-01 23:27:24 -04:00
nhmall fcc8d4d3c3 mhm initialization 2026-05-01 22:36:37 -04:00
nhmall bd74660e06 some documentation updates including date stamp 2026-05-01 21:50:38 -04:00
Alex Smith 4e20ebc7aa Reserve save file space for new conducts and options
This will make it possible to change conducts and options in the
future without breaking the save format.
2026-05-02 01:14:25 +01:00
nhmall 0eda8f288c Merge branch 'NetHack-3.7' into to500 2026-05-01 17:17:17 -04:00
Alex Smith e35af92d13 Fix the fix to the pricequotes option
It was displaying price quotes even with the option off, when
removing items from a container.
2026-05-01 21:41:40 +01:00
nhmall d3f2ed4e47 Guidebook.tex fix 2026-05-01 13:16:33 -04:00
nhmall 7739b382ac Guidebook.tex fix 2026-05-01 13:09:49 -04:00
nhmall 84e2822106 Merge branch 'NetHack-3.7' into to500 2026-05-01 13:03:43 -04:00
PatR 218bb7bffe documentation update: v vs V
Version and history commands.  Plus a quarter-assed description of the
versinfo option.  ('mO' can update and possibly provide enough into to
make sense of it.)

\#history was already revised but the new description was inaccurate.

Guidebook.tex is untested.
2026-05-01 09:56:08 -07:00
nhmall bce8624a07 verb tense bit 2026-05-01 12:41:31 -04:00
nhmall 6c9e7b60e2 Guidebook update 2026-05-01 12:38:03 -04:00
Pasi Kallinen 540e2a999e Couple language nits 2026-05-01 18:31:57 +03:00
nhmall 31d3867ccc Merge branch 'NetHack-3.7' into to500 2026-05-01 09:12:37 -04:00
nhmall a165d9ee42 preprocessor macro: MAC -> MACOS9 2026-05-01 09:11:29 -04:00
nhmall cfcc3bad85 wording/grammar bit in Cross-compiling 2026-05-01 08:37:33 -04:00
nhmall 7937140ec7 Merge branch 'NetHack-3.7' into to500 2026-05-01 08:11:42 -04:00
nhmall 7f824c8d5c Guidebook type 2026-05-01 07:58:02 -04:00
nhmall 88309ebfd1 wording bit 2026-05-01 07:46:38 -04:00
PatR 82dc90c713 newsym() impossible() band-aid
Prevent the main vision_recalc loop from triggering an impossible for
bad coordinates from newsym().  This hack may mean that the underlying
problem will remain unsolved but at least newsym won't cause the fuzzer
to panic or frighten players with impossible warnings.
2026-04-30 22:59:07 -07:00
nhmall e607982c6a whitespace 2026-04-30 20:38:14 -04:00
nhmall 49fac6b422 a couple of typos 2026-04-30 20:12:08 -04:00
nhmall 7d4885e2fd updated Guidebook.mn
history text
2026-04-30 20:06:20 -04:00
nhmall 5167796d13 Merge branch 'NetHack-3.7' into to500 2026-04-30 17:09:02 -04:00
nhmall c5e48213d2 Qt and c++ use a different set of CFLAGS 2026-04-30 09:37:40 -04:00
nhmall 319dd38873 simplify get_macos_uuid()
also remove a magic number 37 by replacing it with NHUUIDSZ
2026-04-30 09:27:50 -04:00
nhmall c5b258c2cf more empty bonesfile 2026-04-30 09:08:29 -04:00
Alex Smith 7fdaf92367 Reduce generation probabilities of the wand of digging
In earlier versions of NetHack, wands of digging generated fairly
often, allowing players to do a large amount of digging through the
maze walls in Gehennom and giving them a chance of an early escape
item.

In the current version, the need for both of these things has been
reduced: supply chests give a supply of early escape items
(including wands of digging), and Gehennom is no longer mostly made
of mazes with diggable walls. As such, there is no longer a reason
to generate wands of digging in such large numbers, even though it
was correct in the past.

This commit modifies some of the generation probabilities for wands
of digging in order to make them less abundant, in order to work
better with the code changes since the previous version.
2026-04-30 09:20:08 +01:00
nhmall 82854b7936 documentation updates
more Dungeoneers list updates for valued contributors
2026-04-30 01:39:18 -04:00
nhmall 22ab0456d0 follow-up: don't clear the bit until end of function 2026-04-30 01:28:07 -04:00
nhmall 2b985be3b9 macOS fixes 2026-04-30 01:13:40 -04:00
PatR c99da87c70 issue #1506 - Str 18/50
Requested by Tomsod:  change the break point for +2 damage bonus from
strength to be 18/50 instead of 18/51 so that gnome and orc heros can
achieve that 'naturally' by maxxing out Str.

Closes #1506
2026-04-29 21:17:31 -07:00
Pasi Kallinen 52c74222c2 Update perm_inventory when returning to human form
Embedded dragon scales weren't updated to worn
2026-04-30 07:07:48 +03:00
nhmall 6c36009ce4 case bit 2026-04-29 23:55:48 -04:00
nhmall 5035b36956 possible macOS build fix
I need someone with arm64 Mac to confirm.
2026-04-29 23:48:19 -04:00
nhmall 84a6eb5e22 avoid impossible() with inbound migrating mon 2026-04-29 23:43:01 -04:00
nhmall 702fbfa06e make the inclusion of NHUUID support the default in hints files
On macOS, the required underlying pieces are in there.

On Linux, we try to test for the presence of libuuid and
the uuid.h header files. If the tests are both successful,
we proceed to include NHUUID support.

On either macOS or Linux, NO_NHUUID=1 on the Make command
line will forcibly prevent the inclusion of the support for NHUUID.
2026-04-29 21:48:52 -04:00
Alex Smith f98428001c Fix a bug in price quote display
They weren't displaying in, e.g., the menu to pick up multiple
objects at once, which is a particularly important place to
display them.
2026-04-30 01:17:01 +01:00
nhmall 1ad11d985e Merge branch 'NetHack-3.7' into to500 2026-04-29 16:54:31 -04:00
nhw_cron a646c3d55e This is cron-daily v1-Apr-26-2026. 005guidebook updated: doc/Guidebook.txt 2026-04-29 16:52:05 -04:00
nhmall 30787e468f Merge branch 'NetHack-3.7' into to500 2026-04-29 15:12:08 -04:00
nhmall cc00eca915 documentation updates
Dungeoneers list updates

Michael Meyer (aka entrez on GitHub) provided a large number
of fixes, updates and suggestions for the next upcoming release.
2026-04-29 14:58:03 -04:00
nhmall 6d8d1b2044 documentation updates
Dungeoneers list updates

Ingo Paschke provided Amiga updates to get the port working
for the release to follow 3.6.7. He used the gcc-15.2 branch
of bebbo's Amiga toolchain on Linux.

G. Branden Robinson contributed several updates and suggestions to
help ensure that the *roff documentation production remains viable.
2026-04-29 14:40:33 -04:00
Pasi Kallinen 2dfc2e7e87 Remove double hallu trap 2026-04-29 21:03:15 +03:00
nhmall 1b28d5e261 update tested versions of Visual Studio 2026-04-29 2026-04-29 12:35:33 -04:00
Pasi Kallinen 8a41076657 Some hallu monster, liquid, trap changes 2026-04-29 19:14:47 +03:00
nhmall ce5459884a Merge branch 'NetHack-3.7' into to500 2026-04-29 09:21:48 -04:00
Pasi Kallinen 0be07d2816 Fix migrating object trying to newsym invalid location 2026-04-29 15:45:12 +03:00
Pasi Kallinen a3fdf22153 Fix monster postmove moving off-map monster 2026-04-29 15:43:55 +03:00
Alex Smith 62cfbdc4a0 Fix the new rolling boulder traps for when monsters step on them
The traps don't disappear when stepped on any more; that should be
true even when monsters step on them.

(This bug was reported privately to me via IRC, rather than via the
devteam's email address, so there isn't a ticket number to close.)
2026-04-29 04:16:56 +01:00
nhmall 662bd9828d Merge branch 'NetHack-3.7' into to500 2026-04-28 17:34:03 -04:00
nhmall dafa24b742 stray tabs 2026-04-28 17:31:21 -04:00
nhmall 4b85aff707 updated doc/fixes3-6-7.txt 2026-04-28 16:59:54 -04:00
nhmall 25c8528a79 3.7 -> 5.0 in DEVEL Porting 2026-04-28 16:46:01 -04:00
nhmall bcdebdb903 Merge branch 'NetHack-3.7' into to500 2026-04-28 16:05:26 -04:00
nhmall ee55f125a0 follow-up bit for consoletty.c
Limit the #ifdef INSURANCE range to only the function call
that requires it.
2026-04-28 16:03:04 -04:00
PatR bb53b29481 simplify picking item up while swallowed 2026-04-28 12:35:39 -07:00
nhmall dfb3331320 Merge branch 'NetHack-3.7' into to500 2026-04-28 12:59:24 -04:00
Pasi Kallinen ed885d3ff6 Guidebook.tex: reroll
Add missing reroll-option
Remove one mangled line.
2026-04-28 19:38:03 +03:00
Pasi Kallinen 75b3c83a1d Guidebook.tex: Archeologists and scrolls 2026-04-28 19:34:17 +03:00
Pasi Kallinen a340d43d3a Guidebook.tex: Add missing price_quotes option 2026-04-28 19:29:44 +03:00
nhmall 00053eaa3e Merge branch 'NetHack-3.7' into to500 2026-04-28 12:23:21 -04:00
nhmall 26e6775591 more 3.7 to 5.0 in win files 2026-04-28 12:22:51 -04:00
nhmall b2c52b6de2 follow-up bit for Qt idlecheckpoint 2026-04-28 12:14:01 -04:00
nhmall 845a9a7b9c a first try at a Qt idlecheckpoint implementation 2026-04-28 12:09:55 -04:00
nhmall 3cc2d072b6 Merge branch 'NetHack-3.7' into to500 2026-04-28 09:04:38 -04:00
nhmall f6761c7d22 fix an impossible() on pick-up from stomach 2026-04-28 01:54:33 -04:00
nhmall a090ba90a1 add option idlecheckpoint
New experimental option

This requires platform support to be useful. Currently an
implementation for Windows TTY console is included.

A Unix TTY implementation should be achievable I would think,
but I haven't pursued that, at least not yet (contributions welcome).
I'm not sure whether Qt or X11 interfaces offer a similar
timeout capability..

How it works:

When idlecheckpoint in on, if the wait for a new input is idle for
10 seconds (length of time to waite is controlled by
IDLECHECKPOINT_WAIT_TIME #define in hack.h), save_currentstate() is
called to bring everything up-to-date should a hangup or crash occur.
The input wait then continues/resumes.

The save_currentstate() call is only executed once per input request.
2026-04-27 19:22:04 -04:00
nhmall 3dbdeb7596 Merge branch 'NetHack-3.7' into to500 2026-04-27 15:03:53 -04:00
nhmall b7f66f9723 fix an issue with internal recover (Windows) 2026-04-27 14:50:01 -04:00
Pasi Kallinen 9098c21421 wizshowuuid return value 2026-04-27 10:22:07 +03:00
PatR e0e87b0aa4 update X11/nh32icon and nh56icon
Updated and previewed with the X11 bitmap program but not with nethack
itself.
2026-04-26 20:47:22 -07:00
nhmall 291972d038 wizmode wizshowuuid to view the game's NHUUID 2026-04-26 22:58:26 -04:00
nhmall 118c317f63 Merge branch 'NetHack-3.7' into to500 2026-04-26 22:33:23 -04:00
nhmall 05b02c7b9b use newer Windows file routines on bones
Also correct a double-open bug that resulted from
earlier code removal.
2026-04-26 22:31:52 -04:00
nhw_cron bfc3eca4f4 This is cron-daily v1-Apr-26-2026. 000files updated: Files 2026-04-26 21:01:20 -04:00
nhw_cron fae32c29d1 This is cron-daily v1-Apr-26-2026. 005manpages updated: makedefs.txt 2026-04-26 21:01:18 -04:00
nhw_cron 226c773ca7 This is cron-daily v1-Apr-26-2026. 005manpages updated: nethack.txt 2026-04-26 21:01:17 -04:00
nhw_cron 8f7f9a8c46 This is cron-daily v1-Apr-26-2026. 005manpages updated: recover.txt 2026-04-26 21:01:15 -04:00
nhkeni 27fa906ebf update CRASHREPORTURL examples 2026-04-26 18:01:10 -04:00
nhmall a396ad1033 force new txt files in doc 2026-04-26 13:29:30 -04:00
nhw_cron 0bacd6fedf This is cron-daily v1-Apr-26-2026. 000files updated: Files 2026-04-26 13:24:23 -04:00
nhmall 97f8ad10b4 more updates 2026-04-26 13:21:18 -04:00
nhw_cron e39a7c31ad This is cron-daily v1-Apr-26-2026. 000files updated: Files 2026-04-26 13:02:30 -04:00
nhmall 45f4c697a7 miscellaneous 2026-04-26 12:54:44 -04:00
nhmall 0e10f82856 update sys win 2026-04-26 12:42:38 -04:00
nhmall d6f8241ac1 update dat src include... 2026-04-26 12:34:02 -04:00
nhmall 11ae226eeb some dat updates 2026-04-26 12:13:14 -04:00
nhmall 89a54b8370 update .gitattributes 2026-04-26 11:58:47 -04:00
nhw_cron 9e248ef8a2 This is cron-daily v1-Apr-26-2026. 000files updated: Files 2026-04-26 11:53:45 -04:00
nhw_cron 5b9df0041c This is cron-daily v1-Apr-26-2026. 005guidebook updated: doc/Guidebook.txt 2026-04-26 11:53:32 -04:00
nhw_cron 3fb81a48a1 This is cron-daily v1-Apr-26-2026. 005manpages updated: nethack.txt 2026-04-26 11:53:20 -04:00
nhw_cron ae1eb87b9d This is cron-daily v1-Apr-26-2026. 005manpages updated: recover.txt 2026-04-26 11:53:08 -04:00
nhmall 74e2062063 README 1st cut 2026-04-26 11:51:02 -04:00
nhmall 84e76bbbcb README-hints bit 2026-04-26 11:13:03 -04:00
nhmall 3cb7bfc0b3 more sys 2026-04-26 11:08:10 -04:00
nhmall ab730b70da revert an external URL change 2026-04-26 11:04:33 -04:00
nhmall 8d1e6b054c Install.dos bit 2026-04-26 10:57:31 -04:00
nhmall d7a6b3085e sys files 2026-04-26 10:47:48 -04:00
nhmall a6cdb6aefd change sys/unix bits and doc 2026-04-26 10:41:11 -04:00
nhmall d5d76f0f14 doc util 2026-04-26 10:10:05 -04:00
nhmall 2a6e7c47ec leave outdated files as 3.6; more to 5.0 2026-04-26 09:29:50 -04:00
nhmall 97b6fad509 "NetHack 3.7" to "NetHack 5.0" in doc include src sys win 2026-04-26 09:25:42 -04:00
nhmall 8ddfa958b1 HINTSVERSION 2026-04-26 09:09:14 -04:00
nhmall ae146b2c7c Merge branch 'NetHack-3.7' into to500 2026-04-26 08:57:38 -04:00
nhmall afefa38dda update a couple of documentation files 2026-04-26 08:56:11 -04:00
nhmall c25528dafe try to prevent panic encountering empty bones file 2026-04-26 08:51:33 -04:00
Patric Mueller 7fc9baa851 Update wall colors for Enhanced symsets
Making the walls in the mines brown and the walls in Fort Ludios
light blue.
2026-04-26 14:47:38 +02:00
nhmall 99525ea7b7 hints files from .370 to .500 2026-04-26 08:15:08 -04:00
nhmall f9ccf24b0b date update 2026-04-26 07:28:04 -04:00
PatR 831251016d vision fix
I have no idea whether this prevents the newly discovered impossible().
However, it does fix an obvious typo--in hindsight--that I made 6 years
ago (dealing with temporary lighting for camera flashes).
2026-04-25 21:17:05 -07:00
nhmall a3fa63f444 typo fix 2026-04-25 20:34:24 -04:00
nhmall 1d5397d35b follow-up with how-to for two Linux distros 2026-04-25 20:28:07 -04:00
nhmall b6503fa52e update README-hints 2026-04-25 20:22:12 -04:00
nhmall 5354943300 pcmain() follow-up 2026-04-25 20:15:48 -04:00
nhmall e08fdc2d1f move the stub routines from pcsys.c to pcmain.c
Fixes broken Amiga build
2026-04-25 20:08:43 -04:00
nhw_cron f4f085891d This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-04-25 17:00:59 -04:00
nhmall a906ed8236 another follow-up 2026-04-25 16:47:12 -04:00
nhmall 532152ffc0 macOS follow-up 2026-04-25 16:41:16 -04:00
nhmall 98308a8a7d thinko while looking into macOS 2026-04-25 16:19:24 -04:00
PatR 27f6ae340b address issue #1490 - rolling boulder segfault
Issue reported by BartekCupial:  segfault occurred and was tracked to
behavior of a rolling boulder trap.  Suggested fix was included, but it
assumes that the destination spot is valid so is suspect.

A comment pointed out that the path is validated when a rolling boulder
trap is created so the segfault should be impossible.  I didn't find an
explanation but am adding a fix based on the one in the issue report.

Closes #1490
2026-04-25 13:14:33 -07:00
nhmall 89c7435b7a attempt macOS fix 2026-04-25 15:57:36 -04:00
nhmall 4cf78d8f31 add macuuid.m 2026-04-25 15:44:53 -04:00
nhmall b9a46107ef fix up some odd indentation in mcastu.c 2026-04-25 15:05:08 -04:00
nhmall 309afb2eb2 add support for a unique game identifier
A 37 character field for holding a unique identifier is added
to the save file, as well as to an ancestor field in bones files.

Since it requires installation of libuuid package on Linux,
it requires an exlicit WANT_NHUUID=1 on the Make command line there.
Without the libuuid support, the saved nhuuid is empty, which should
be harmless.

This also moves the save and restore of gm.moves higher up so that it
already has a value the first time it is used against a relative saved
timestamp.

Invalidates savefiles and bones files due to new fields.

I need to get this committed before I can test out the macOS portion,
so there may be some build issues there briefly (hopefully), and
follow-up commits to resolve them.

Increments EDITLEVEL.
2026-04-25 14:48:49 -04:00
nhmall 5b66ba4c99 change gy.youmonst
Add a pointer to struct you, and put umonst there. Eliminate
the youmonst struct in gy.

The naming convention better matches the other u related fields,
and u.umonst has the same level of indirection as other monst pointers.

The u.umonst pointer is cleared prior to saving the parent u (struct you),
and u.umonst is reestablished upon restore.

Invalidates existing saves and bones due to the presence of the added
pointer field in struct you.
2026-04-25 14:41:39 -04:00
nhmall 80c08334ab yet another Windows follow-up 2026-04-24 22:02:15 -04:00
nhmall 36df2315c9 another Windows console follow-up 2026-04-24 21:58:33 -04:00
nhmall 8982addb9d revert one Windows change
Windows stores things a bit differently.
Use a static function in consoletty.c to preserve that behavior,
but still utilize the core colortable[] array.
2026-04-24 21:44:48 -04:00
nhmall 15a9acbefb more colortable[] updates
declare colortable[] const and no longer static so it can be shared
by code in window ports..

get rid of the Windows console port rgbtable and use the
core colortable[] instead.

utilize function colortable_to_int32() in Windows console instead
of the rgbtable_to_long() in the Windows port.

delete the Windows rgbtable_to_long() function.
2026-04-24 21:15:48 -04:00
nhmall 88a47cc7b6 colortable[] formatting
remove unused hexval field (show it in a comment)

The rgb values should be the same as they were
previously, just expressed with hex values on the
table initialization.
2026-04-24 20:13:01 -04:00
nhmall b3d9ab5183 revisit the "Welcome back" message
Also takes helm into consideration now

Closes #537
2026-04-24 11:14:53 -04:00
karafruit dc920f6af4 Merge branch 'NetHack-3.7' into twitch-interact 2026-04-23 20:37:34 -07:00
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
karafruit eee77d0f1b Prevent teleport control from working on twitch redeems to teleport the player 2026-04-22 20:37:00 -07: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
karafruit 6642a731c7 Update submodules 2026-04-19 08:38:22 -07:00
karafruit 85cc045400 Merge branch 'NetHack-3.7' into twitch-interact 2026-04-19 08:36:20 -07:00
karafruit ebed555f0a streamhack hints file 2026-04-19 08:33:57 -07: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
karafruit b7281f0b28 Merge branch 'NetHack-3.7' into twitch-interact 2026-04-15 18:02:20 -07:00
karafruit 71deeb0416 Rate limit checking twitch in fifo 2026-04-14 18:01:29 -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
karafruit a34a07bb75 Merge branch 'NetHack-3.7' into twitch-interact 2026-04-13 15:05:44 -07: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
karafruit d03582f685 Merge branch 'NetHack-3.7' into twitch-interact 2025-08-30 11:09:34 -07: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
karafruit ab0dd2de6e Preliminary implementation of twitch integration 2024-10-08 09:03:58 -07: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
825 changed files with 60560 additions and 35001 deletions
+1
View File
@@ -2,6 +2,7 @@
*.cpp NHSUBST
*.sh NHSUBST
*.pl NHSUBST
*.md NHSUBST
Porting NHSUBST
README NHSUBST
* text=auto
+3
View File
@@ -49,6 +49,7 @@ Makefile.gcc
Makefile-orig
Makefile.bcc-orig
Makefile.gcc-orig
make.prefs
*.suo
*.pdb
*.ilk
@@ -56,6 +57,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 +97,4 @@ bundle/*
util/*.lib
util/*.exp
submodules/CHKSUMS.tmp
sys/amiga/regex/
+15
View File
@@ -0,0 +1,15 @@
If you are making a GitHub pull request for NetHack, please follow these guidelines:
1. The 50/72 Rule: Keep the subject line (the first line) under 50 characters
for readability in git log --oneline. If you need a more detailed description
(the body), wrap it at 72 characters.
2. Separate Subject from Body: Always include a blank line between the subject
and the body. This helps Git tools correctly parse the message.
<!-- NetHack 5.0 Contributing.md $NHDT-Date: 1780016788 2026/05/29 01:06:28 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $-->
<!-- NetHack may be freely redistributed. See license for details.-->
+102 -100
View File
@@ -1,6 +1,6 @@
Cross-compiling NetHack 3.7 Last edit: February 18, 2023
Cross-compiling NetHack 5.0 Last edit: April 26, 2026
The NetHack 3.7 build process differs from the build process of previous
The NetHack 5.0 build process differs from the build process of previous
versions in some important ways. Those differences make it possible to use
a cross-compiler running on one platform (the "host" platform of the build)
to produce a binary NetHack package that can execute on an entirely different
@@ -9,7 +9,7 @@ platform.
Part A Contents:
A1. Why cross-compile?
A2. Building NetHack 3.6 (before)
A3. Building NetHack 3.7 (going forward)
A3. Building NetHack 5.0 (going forward)
A4. How was the build procedure reduced to 5 steps?
A5. How can I help with the cross-compiling initiative?
@@ -18,7 +18,7 @@ Part B Contents:
B2. What needs to be built and executed on the HOST?
B3. What needs to be built for the TARGET?
B4. Case sample: msdos
B5. Case sample: amiga (started but incomplete)
B5. Case sample: amiga
B6. Case sample: Web Assembly, libnh
B7. Case sample: mips
@@ -118,10 +118,10 @@ might, just might, be usable across platforms, but the chances are against it,
and that certainly cannot be counted on.
+------------------------------------------+
| A3. Building NetHack 3.7 (going forward) |
| A3. Building NetHack 5.0 (going forward) |
+------------------------------------------+
Again, very generally, the build of NetHack in 3.7 requires the following
Again, very generally, the build of NetHack in 5.0 requires the following
steps to be carried out:
1. Compile and link util/makedefs.
@@ -152,7 +152,7 @@ executing the native compiler.
| A4. How was the build procedure reduced to 5 steps? |
+-----------------------------------------------------+
The following are among several design changes planned in NetHack 3.7,
The following are among several design changes planned in NetHack 5.0,
and these specific changes are what altered the build process to make
cross-compiling possible:
@@ -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
@@ -408,9 +412,9 @@ Using the cross-compiler, build the following targets:
system support in *sys.c as well as others sources pertaining to your
specific target platform(s).
b) Lua (mandatory in 3.7)
b) Lua (mandatory in 5.0)
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,29 +473,29 @@ 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
them in subfolders of lib. The linux.500 and macOS.500 hints files are
configured to find the cross-compiler there if you add
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.
On your linux host:
cd sys/unix ; sh setup.sh hints/linux.370 ; cd ../..
cd sys/unix ; sh setup.sh hints/linux.500 ; cd ../..
make fetch-lua
On your macOS host:
cd sys/unix ; sh setup.sh hints/macOS.370 ; cd ../..
cd sys/unix ; sh setup.sh hints/macOS.500 ; cd ../..
make fetch-lua
The MSDOS cross-compile can then be carried out by specifying
@@ -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 5.0 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 5.0 source
cd NetHack
sys/unix/setup.sh sys/unix/hints/linux.500
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/NH500AMI.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 5.0 source
cd NetHack
sys/unix/setup.sh sys/unix/hints/macOS.500
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 |
@@ -640,10 +642,10 @@ Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html
sudo apt-get install python3 cmake default-jre
For macOS, you will need to install Xcode, git, cmake, Python 3.5 or new
For macOS, you will need to install Xcode, git, cmake, Python 3.5 or newer
(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:
@@ -663,12 +665,12 @@ Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html
On your linux host, prepare to cross-compile NetHack as follows:
cd sys/unix ; sh setup.sh hints/linux.370 ; cd ../..
cd sys/unix ; sh setup.sh hints/linux.500 ; cd ../..
make fetch-lua
On your macOS host, prepare to cross-compile NetHack as follows:
cd sys/unix ; sh setup.sh hints/macOS.370 ; cd ../..
cd sys/unix ; sh setup.sh hints/macOS.500 ; cd ../..
make fetch-lua
Then, cross-compile to targets/wasm as follows:
@@ -691,11 +693,11 @@ Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html
The cross-compiler hints additions are enclosed inside ifdef sections
and shouldn't interfere with the non-cross-compile builds using
hints/linux.370 or hints/macOS.370.
hints/linux.500 or hints/macOS.500.
+--------------------------------+
| B7. Case sample: mips |
| B7. Case sample: mips |
+--------------------------------+
Cross-compiler used: gcc-mipsel-linux-gnu, g++-mipsel-linux-gnu
@@ -710,7 +712,7 @@ Cross-compiler url:
sudo apt install g++-mipsel-linux-gnu
On your linux host, prepare to cross-compile NetHack as follows:
cd sys/unix ; sh setup.sh hints/linux.370 ; cd ../..
cd sys/unix ; sh setup.sh hints/linux.500 ; cd ../..
make fetch-lua
Then, cross-compile to targets/mips as follows:
@@ -723,7 +725,7 @@ Cross-compiler url:
The cross-compiler hints additions are enclosed inside ifdef sections
and shouldn't interfere with the non-cross-compile builds using
hints/linux.370 or hints/macOS.370.
hints/linux.500 or hints/macOS.500.
---
+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
+5
View File
@@ -0,0 +1,5 @@
6
PRE and POST hooks will be dropped at some future date -
see https://www.nethack.org/devel/deprecation.html for details.
See "git log DEVEL" for previous changes.
+2 -2
View File
@@ -1,4 +1,4 @@
# NetHack 3.7 code_features.txt $NHDT-Date: 1596498264 2020/08/03 23:44:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.6 $
# NetHack 5.0 code_features.txt $NHDT-Date: 1596498264 2020/08/03 23:44:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.6 $
# Copyright (c) 2015 by Michael Allison
# NetHack may be freely redistributed. See license for details.
@@ -115,7 +115,7 @@ and available to all NetHack source files.
decl.c variable definitions are generally laid out in much the same
order as their corresponding declarations in decl.h.
A new header file cstd.h was added to coincide with 3.7's switch to
A new header file cstd.h was added to coincide with 5.0's switch to
C99. It contains calls to some C99 standard header files.
=================== NEXT FEATURE ==========================
+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>.
+252 -82
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 "Can'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,81 @@ 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);
open TOHOOK, "|-", $hname or die "open $hname: $!";
print TOHOOK <STDIN>;
close TOHOOK or die "close $hname: $! $?";
print TRACE "END $p\n" if($trace);
my($p) = @_;
my $hname = $0;
$hname =~ s!^((.*$DS)|())(.*)!$1$p-$4!;
my $vig = version_in_git;
if(-x $hname){
if(`git config --bool nethack.NoDepWarn` ne "true\n"){
print STDERR <<~E_O_M;
WARNING: $p hooks will be going away. See
https://www.nethack.org/devel/deprecation.html
To stop seeing this message, run
git config --bool nethack.NoDepWarn true
E_O_M
}
print TRACE "START $p: $hname\n" if($trace);
open TOHOOK, "|-", $hname or die "open $hname: $!";
print TOHOOK <STDIN>;
close TOHOOK or die "close $hname: $! $?";
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 +301,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 +370,31 @@ 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.
=over 4
=item ==>
As of Git 2.54, multiple actions may be specified for each hook
event - that makes this redundant for hooks and will be removed at
some future time when Git 2.54 (or later) is better distributed.
This should speed up hook processing.
=back 4
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 +414,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)
+100 -86
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__
@@ -392,7 +392,21 @@ $TEST-Branch: theirs $
TEST 8:
<<< d1
/* NetHack 3.7 objnam.c $TEST-Date$ $TEST-Branch$:$TEST-Revision$ */
/* NetHack 5.0 objnam.c $TEST-Date$ $TEST-Branch$:$TEST-Revision$ */
===
/* NetHack 3.7 objnam.c $TEST-Date: 1426977394 2015/03/21 22:36:34 $ $TEST-Branch: master $:$TEST-Revision: 1.108 $ */
/* NetHack 5.0 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;
+318 -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,140 @@ 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";
}
# This list and the code below will need to be updated if other changes occur
# before this progression is finished.
# 6 announce eventual deprecation of PRE and POST hooks
# 6->7 unset nethack.NoDepWarn, change message, docs in NHgithook.pm
# 7 deprecation of PRE and POST hooks
# 7->8 unset nethack.NoDepWarn, change message, docs in NHgithook.pm and make fail
# 8 PRE and POST throw errors
# 8->9 unset nethack.NoDepWarn, remove code, docs
# 9 removal of PRE and POST code
system('git','config','--unset','nethack.NoDepWarn') unless($opt_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 +176,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 OUT "=pod\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 +393,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 +439,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 +476,5 @@ nethack.substprefix
1 Fail.
2 Intervention required.
=for nhgitset nhgitset NetHack git helper installer
+161 -143
View File
@@ -1,4 +1,4 @@
This is a listing of all files in a full NetHack 3.7 distribution, organized
This is a listing of all files in a full NetHack 5.0 distribution, organized
in their standard manner on a UNIX system. It indicates which files are
necessary for which versions, so that you can tell which files may be deleted
from or not transferred to your system if you wish.
@@ -7,13 +7,14 @@ from or not transferred to your system if you wish.
.:
(files in top directory)
.clang-format Cross-compiling Files
Porting README azure-pipelines.yml
.clang-format Contributing.md Cross-compiling
Files 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 +24,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 +48,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)
@@ -75,33 +77,34 @@ fixes3-2-2.txt fixes3-2-3.txt fixes3-3-0.txt fixes3-3-1.txt
fixes3-4-0.txt fixes3-4-1.txt fixes3-4-2.txt fixes3-4-3.txt
fixes3-5-0.txt fixes3-6-0.txt fixes3-6-1.txt fixes3-6-2.txt
fixes3-6-3.txt fixes3-6-4.txt fixes3-6-5.txt fixes3-6-6.txt
fixes3-6-7.txt fixes3-7-0.txt fixesX-X-X.txt lua.adoc
makedefs.6 makedefs.txt mn.7 mn.txt
mnh.7 mnh.txt nethack.6 nethack.txt
options.txt recover.6 recover.txt sound.txt
tmac.n tmac.nh window.txt
fixes3-6-7.txt fixes5-0-0.txt fixes5-0-1.txt fixesX-X-X.txt
lua.adoc makedefs.6 makedefs.txt mn.7
mn.txt mnh.7 mnh.txt nethack.6
nethack.txt options.txt recover.6 recover.txt
sound.txt tmac.n tmac.nh window.txt
include:
(files for X versions)
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 revision.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,30 +125,20 @@ 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
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
outdated/sys/atari:
(files for Atari version - untested for 3.7)
(files for Atari version - untested for 5.0)
Install.tos atarifnt.uue nethack.mnu setup.g tos.c
unx2atar.sed
outdated/sys/be:
(files for BeOS version - untested for 3.7)
(files for BeOS version - untested for 5.0)
README bemain.c
outdated/sys/mac:
@@ -162,7 +155,7 @@ Makefile.BC Makefile.MSC SCHEMA35.MSC moveinit.pat ovlinit.c
schema1.BC schema2.BC schema3.MSC
outdated/sys/os2:
(files for OS/2 version - untested for 3.7)
(files for OS/2 version - untested for 5.0)
Install.os2 Makefile.os2 nhpmico.uu os2.c
outdated/sys/unix:
@@ -185,7 +178,7 @@ outdated/sys/vms:
lev_lex.h
outdated/sys/wince:
(files for Windows CE and PocketPC - untested for 3.7)
(files for Windows CE and PocketPC - untested for 5.0)
Install.ce bootstrp.mak celib.c cesetup.bat cesound.c
defaults.nh keypad.uu menubar.uu mhaskyn.c mhaskyn.h
mhcmd.c mhcmd.h mhcolor.c mhcolor.h mhdlg.c
@@ -198,21 +191,13 @@ resource.h winMS.h winhack.c winhack.rc winhcksp.rc
winmain.c
outdated/sys/wince/ceinc:
(header files for Windows CE and PocketPC - untested for 3.7)
(header files for Windows CE and PocketPC - untested for 5.0)
assert.h errno.h fcntl.h
outdated/sys/wince/ceinc/sys:
(sys/stat.h for Windows CE and PocketPC - untested for 3.6.2)
stat.h
outdated/sys/windows:
(files that are no longer maintained for current game code)
travis-gcc.sh
outdated/sys/windows/vs:
(files that are no longer maintained for current game code)
travisci.sh
outdated/win/Qt3:
(files for the Qt 3 widget library - X11, Windows, Mac OS X, or Qtopia)
Info.plist Install.Qt knethack.lnk
@@ -223,12 +208,12 @@ qt3tableview.cpp qt3tableview.h tileedit.cpp
tileedit.h
outdated/win/gem:
(files for GEM versions - untested for 3.7)
(files for GEM versions - untested for 5.0)
Install.gem bitmfile.c gem_rsc.uu gem_rso.uu gr_rect.c gr_rect.h
load_img.c tile2img.c title.uu wingem.c wingem1.c xpm2img.c
outdated/win/gnome:
(files for GNOME versions - untested for 3.7)
(files for GNOME versions - untested for 5.0)
README gn_xpms.h gnaskstr.c gnaskstr.h gnbind.c gnbind.h
gnglyph.c gnglyph.h gnmain.c gnmain.h gnmap.c gnmap.h
gnmenu.c gnmenu.h gnmesg.c gnmesg.h gnomeprv.h gnopts.c
@@ -291,31 +276,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 revision.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)
NHinfo.uu README.amiga amidos.c amifont.uu
amifont8.uu amii.hlp amimenu.c amirip.c
amistack.c amiwind.c bmp2iff_host.c clipwin.c
cnf-info.uu colorwin.c drawer-info.uu grave16.xpm
license-info.uu nethack.cnf readme-info.uu txt-info.uu
winamenu.c winami.c 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
@@ -350,11 +347,8 @@ random.c
(Berkeley uudecode file, which may be used in build process of any version)
uudecode.c
(file for MSDOS, OS/2, Amiga, and Atari versions - only MSDOS tested for 3.7)
pcmain.c
(file for MSDOS, OS/2, and Atari versions - only MSDOS tested for 3.7)
NetHack.cnf pctty.c
(file for MSDOS, Amiga versions)
NetHack.cnf pcmain.c pctty.c
(file for MSDOS, OS/2, and VMS versions)
termcap
@@ -362,10 +356,10 @@ termcap
(file for VMS version)
tclib.c
(files for MSDOS, OS/2 and Atari versions - only MSDOS tested for 3.7)
(files for MSDOS, Amiga versions)
pcsys.c pcunix.c
(files for OS/2 version - untested for 3.7)
(files for OS/2 version - untested for 5.0)
Makefile.lib termcap.uu
(files for UNIX and Be versions)
@@ -384,9 +378,10 @@ sys/unix:
(files for UNIX versions)
Install.unx Makefile.check Makefile.dat Makefile.doc
Makefile.src Makefile.top Makefile.utl NewInstall.unx
README-hints README.xcode XCode.xcconfig depend.awk
gitinfo.sh mkmkfile.sh nethack.sh setup.sh
sysconf unixmain.c unixres.c unixunix.c
README.hints README.xcode XCode.xcconfig depend.awk
gitinfo.sh macuuid.m mkmkfile.sh nethack.sh
setup.sh sysconf unixmain.c unixres.c
unixunix.c
sys/unix/NetHack.xcodeproj:
(file for macOS Xcode)
@@ -406,15 +401,16 @@ NetHack.xcscheme makedefs.xcscheme recover.xcscheme
sys/unix/hints:
(files for configuring UNIX NetHack versions)
linux-minimal linux.370 macOS.370
macosx.sh solaris solaris-playground
unix
bsd.500 linux-minimal linux.500
macOS.500 macosx.sh solaris
solaris-playground unix
sys/unix/hints/include:
(files for configuring UNIX NetHack versions)
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
compiler.500 cross-post.500 cross-pre1.500 cross-pre2.500
dirs-perms.500 gbdates-post.500 gbdates-pre.500 linuxdistro.500
misc.500 multisnd-post.500 multisnd1-pre.500 multisnd2-pre.500
multiw-1.500 multiw-2.500 response.500 whichbsd.500
sys/vms:
(files for VMS version)
@@ -427,18 +423,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 +443,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 +505,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)
@@ -589,8 +606,9 @@ Install.X11 NetHack.ad Window.c X11-issues.txt
dialogs.c ibm.bdf nethack.rc nh10.bdf
nh32icon nh56icon nh72icon nh_icon.xpm
pet_mark.xbm pilemark.xbm rip.xpm tile2x11.c
winX.c winmap.c winmenu.c winmesg.c
winmisc.c winstat.c wintext.c winval.c
winX.c winlabel.c winmap.c winmenu.c
winmesg.c winmisc.c winstat.c wintext.c
winval.c
win/chain:
(files for stacking window systems)
@@ -609,9 +627,9 @@ NetHackTerm.applescript recover.pl
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
bmptiles.c decals.txt gifread.c giftiles.c monsters.txt
nhicns.uu nhsplash.xpm objects.txt other.txt ppmwrite.c
renumtiles.pl thintile.c tile.doc tile.h tile2bmp.c
tilemap.c tileset.c tiletext.c tiletxt.c
win/shim:
@@ -664,13 +682,13 @@ 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
qt_plsel.moc qt_set.moc qt_stat.moc qt_xcmd.moc qt_yndlg.moc
(file generated by makedefs -m but unused in 3.7)
(file generated by makedefs -m but unused in 5.0)
monstr.c
(file optionally generated by tilemap at compile time)
+3 -3
View File
@@ -1,4 +1,4 @@
NetHack Porting Guidelines v 3.7 2023-04-23
NetHack Porting Guidelines v 5.0 2023-04-23
1.0 Introduction
@@ -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.
@@ -229,7 +229,7 @@ libraries.
5.0 Design Updates
The following design updates were introduced in NetHack 3.7.
The following design updates were introduced in NetHack 5.0.
5.1 Quest text files
+46 -109
View File
@@ -1,66 +1,42 @@
NetHack 3.7.0 work-in-progress -- General information
NetHack 5.0.0 -- General information
NetHack 3.7 is an enhancement to the dungeon exploration game NetHack,
which is a distant descendent of Rogue and Hack, and a direct descendent of
NetHack 3.6.
NetHack 5.0 is an enhancement to the dungeon exploration game NetHack,
which is a distant descendent of Rogue and Hack, and a direct descendent
of NetHack 3.6.
NetHack 3.7.0 work-in-progress is not a release of NetHack. As a .0 version,
and still very early in its development cycle, there has already been changes
made, and there will continue to be many more prior to an eventual release.
The file doc/fixes3-7-0.txt in the source distribution will be updated with
a list of fixes as they are committed.
NetHack 5.0.0 is a release of NetHack. As a .0 version, there may be some
bugs encountered. Constructive suggestions, GitHub pull requests, and bug
reports are all welcome and encouraged.
In short -- there are likely to be bugs. Don't treat NetHack-3.7 branch as
released code, and if stability is paramount, then the most recent
NetHack 3.6.7 release is safest for you.
The file doc/fixes5-0-0.txt in the source distribution contains a full list
of fixes and changes as they were committed. The text in there was written
for the development team's own use and is provided "as is", so please do
not ask us to further explain the entries in that file. Some entries might
be considered "spoilers", particularly in the "new features" section.
We're making the .0 work-in-progress available so that you can observe, test
out, and contribute to its development. Constructive suggestions, GitHub pull
requests, and bug reports are all welcome and encouraged.
The file doc/fixes3-7-0.txt in the source distribution has a full list of
bug-fixes included so far, as well as brief mentions of some of the other code
changes. The text in there was written for the development team's own use and is
provided "as is", so please do not ask us to further explain the entries in
that file. Some entries might be considered "spoilers", particularly in the
"new features" section.
Along with the game improvements and bug fixes, NetHack 3.7 strives to make
Along with the game improvements and bug fixes, NetHack 5.0 strives to make
some general architectural improvements to the game or to its building
process. Among them:
process. Among them, 5.0 has:
* Remove barriers to building NetHack on one platform and operating system,
* The source code is compliant with the C99 standard.
* removes barriers to building NetHack on one platform and operating system,
for later execution on another (possibly quite different) platform and/or
operating system. That capability is generally known as "cross-compiling."
See the file "Cross-compiling" in the top-level folder for more information
on that.
* Replace the build-time "yacc and lex"-based level compiler, the "yacc and
lex"-based dungeon compiler, and the quest text file processing done
by NetHack's "makedefs" utility, with Lua text alternatives that are
loaded and processed by the game during play.
* The build-time "yacc and lex"-based level compiler, the
"yacc and lex"-based dungeon compiler, and the quest text file processing
previously done by NetHack's "makedefs" utility, have been replaced with
Lua text alternatives that are loaded and processed by the game during play.
* Write game savefiles and bonesfiles in a more portable and consistent way
to open up the possibility of utilizing them between different platforms,
such as between your desktop computer and your hand-held device.
* Add support to make the game restartable without exit (a.k.a. "play again"
support). Toward that end, many previously scattered and separate variables
have been gathered into central 'ga' through 'gz' structures in
decl.h/decl.c. That central ability to reinitialize the variables will
benefit the porting effort to some platforms that are under consideration
where "play again" is typical.
Here are some other general notes on the changes in NetHack 3.7 that were not
Here are some other general notes on the changes in NetHack 5.0 that were not
considered spoilers:
- automatic annotation "gateway to Moloch's Sanctum" for vibrating square
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
- - - - - - - - - - -
@@ -97,75 +73,36 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code.
that the default configuration is SysV/Sun/Solaris2.x (simply because
the code was housed on such a system).
The files sys/*/Install.* were written to guide you in configuring the
program for your operating system. The files win/*/Install.* are
available, where necessary, to help you in configuring the program
for particular windowing environments. Reading them, and the man pages,
should answer most of your questions.
The files sys/*/Install.*, or sys/*/NewInstall.* were written to guide
you in configuring the program for your operating system. The files
win/*/Install.* are available, where necessary, to help you in
configuring the program for particular windowing environments.
Reading them, and the man pages, should answer most of your questions.
At the time of the most recent official release, NetHack 3.6, it had
been tested to run/compile on:
At the time of the most recent official release, NetHack 5.0, it had
been tested to run and/or compile on:
Intel Pentium or better running Linux, BSDI
[compiles, runs]
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)
[compiles, runs]
Intel-based, or Apple M1, M2, M3, M4, M5 Macs running
macOS 10.11 (El Capitan) to macOS 26 (Tahoe)
[compiles, runs]
(follow the instructions in sys/unix/NewInstall.unx)
Intel 80386 or greater running MS-DOS with DPMI
[cross-compiles on Linux, runs on MS-DOS, emulator/dosbox]
built via djgpp compiler (native or Linux-hosted cross-compiler)
AmigaOS 3.0 or later
[cross-compiles on Linux or macOS, runs on Amiga or emulator]
Running requires Kickstart 39+
6 MB free RAM minimum (8 MB recommended)
Hard drive with ~5 MB free space
There has also been some success runing/comiling on:
OpenVMS (aka VMS) V8.4 on Alpha and on Integrity/Itanium/IA64
Previous versions of NetHack were tested and known to run on the
following systems, but it is unknown if they can still build and
execute NetHack 3.6 or NetHack 3.7:
Apple Macintosh running MacOS 7.5 or higher, LinuxPPC, BeOS 4.0
Atari ST/TT/Falcon running TOS (or MultiTOS) with GCC
AT&T 3B1 running System V (3.51)
AT&T 3B2/600 & 3B2/622 running System V R3.2.1
AT&T 3B2/1000 Model 80 running System V R3.2.2
AT&T 3B4000 running System V
AT&T 6386 running System V R3.2
Commodore Amiga running AmigaDOS 3.0 or higher with SAS/C 6.x
(but see Makefile.ami about DICE and Manx)
Data General AViiON systems running DG/UX
DEC Alpha/VMS (aka OpenVMS AXP), running V1.x through V7.1
DEC VAX/VMS, running V4.6 through V7.1
DEC vaxen running BSD, Ultrix
Decstations running Ultrix 3.1, 4.x
Encore Multimax running UMAX 4.2
Gould NP1 running UTX 3/2
HP 9000s300 running HP-UX
HP 9000s700 running HP-UX 9.x, 10.x, 11.x
H/PC Pro devices running Windows CE 2.11 and higher.
IBM PC/RT and RS/6000 running AIX 3.x
IBM PS/2 and AT compatibles running OS/2 - 2.0 and up with GCC emx
IBM PS/2 and AT compatibles running OS/2 1.1 - 2.0 (and probably
Warp) with Microsoft 6.0, and OS/2 2.0 and up with IBM CSet++ 2.0.
Intel 80386 or greater (or clone) running 386BSD
Intel x86 running a version of Windows 7 or 8 or prior to XP.
Mips M2000 running RiscOS 4.1
NeXT running Mach (using BSD configuration)
Palm Size PC 1.1 devices running Windows CE 2.11
Pocket PC devices running Windows CE 3.0 and higher
Pyramid 9820x running OSx 4.4c
SGI Iris running IRIX
Stardent Vistra 800 running SysV R4.0
Stride 460 running UniStride 2.1
Sun-3s, -4s, and -386is running SunOS 3.x
Sun-3s and -386is running SunOS 4.x
"Sun SPARC"-based machine running SunOS 4.x, Solaris 2.x, or Solaris 7
Valid Logic Systems SCALD-System
Previous versions, using a cross-compiler hosted on another platform,
such as win32, could also build the following from source:
Pocket PC devices running Windows CE 3.0 and higher
H/PC Pro devices running Windows CE 2.11 and higher
Palm Size PC 1.1 devices running Windows CE 2.11
Unless otherwise mentioned, the compiler used was the OS-vendor's
C compiler.
OpenVMS (ask VMS) V9.2-3 on x86-64
- - - - - - - - - - -
@@ -205,13 +142,13 @@ If a feature is not accepted you are free, of course, to post the patches
to the net yourself and let the marketplace decide their worth.
All of this amounts to the following: If you decide to apply a free-lanced
patch to your 3.6 code, you are welcome to do so, of course, but we won't
be able to provide support or receive bug reports for it.
patch to your NetHack 5.0 code, you are welcome to do so, of course, but we
won't be able to provide support or receive bug reports for it.
In our own patches, we will assume that your code is synchronized with ours.
-- Good luck, and happy Hacking --
# $NHDT-Date: 1652133501 2022/05/09 21:58:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.97 $
# $NHDT-Date: 1779926755 2026/05/28 00:05:55 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.113 $
# Copyright (c) 2012 by Michael Allison
# NetHack may be freely redistributed. See license for details.
+47 -61
View File
@@ -1,43 +1,44 @@
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_latest_gcc14:
imageName: 'ubuntu-latest'
toolchainName: gcc14
buildTargetName: all
linux_latest_clang_all:
imageName: 'ubuntu-latest'
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
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_latest_docs:
imageName: 'ubuntu-latest'
toolchainName: docs
buildTargetName: all
continueOnError: true
@@ -60,30 +61,10 @@ variables:
steps:
- bash: |
if [ "$(toolchain)" == "gcc7" ]
if [ "$(toolchain)" == "gcc14" ]
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" ]
then
echo "##vso[task.setvariable variable=CC]gcc-10"
echo "##vso[task.setvariable variable=CXX]g++-10"
fi
if [ "$(toolchain)" == "gcc11" ]
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 +73,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'
@@ -105,7 +86,7 @@ steps:
echo "CXX: $CXX"
displayName: 'Echoing variables'
- checkout: git://NetHack/NetHack@NetHack-3.7
- checkout: git://NetHack/NetHack@NetHack-5.0
submodules: true
path: $(netHackPath) # $(Agent.BuildDirectory)/$(netHackPath)
@@ -124,7 +105,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 +120,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 +147,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'
@@ -175,14 +158,14 @@ steps:
- bash: |
sudo apt-get -qq -y update
sudo apt-get -qq -y install libncurses-dev
sudo apt-get -qq -y install libx11-dev libxaw7-dev xfonts-utils qtbase5-dev qtmultimedia5-dev qtbase5-dev-tools
sudo apt-get -qq -y install libx11-dev libxaw7-dev libxft-dev fontconfig xfonts-utils qtbase5-dev qtmultimedia5-dev qtbase5-dev-tools
condition: and(eq( variables['Agent.OS'], 'Linux' ), eq( variables.buildTarget, 'all'))
workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
displayName: 'Getting linux build dependencies'
- bash: |
cd sys/unix
sh setup.sh hints/linux.370
sh setup.sh hints/linux.500
cd ../..
make fetch-lua
make WANT_WIN_ALL=1 QT_SELECT=5 MOC=moc all
@@ -222,8 +205,9 @@ steps:
workingDirectory: $(Agent.BuildDirectory)/$(netHackPath)
- bash: |
brew install groff
cd sys/unix
sh setup.sh hints/macos.370
sh setup.sh hints/macos.500
cd ../..
make fetch-lua
make WANT_MACSOUND=1 all
@@ -232,21 +216,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
sh setup.sh hints/linux.500
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
+1
View File
@@ -2,6 +2,7 @@
*.des NHSUBST
*.txt NHSUBST
*.lua NHSUBST
luahelper NHSUBST
data.base NHSUBST
symbols NHSUBST
tribute NHSUBST
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Archeologist Arc-fila.lua $NHDT-Date: 1652195998 2022/05/10 15:19:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Archeologist Arc-fila.lua $NHDT-Date: 1781994863 2026/06/20 22:34:23 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Archeologist Arc-filb.lua $NHDT-Date: 1652195998 2022/05/10 15:19:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Archeologist Arc-filb.lua $NHDT-Date: 1781994863 2026/06/20 22:34:23 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Archeologist Arc-goal.lua $NHDT-Date: 1652195998 2022/05/10 15:19:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Archeologist Arc-goal.lua $NHDT-Date: 1781994864 2026/06/20 22:34:24 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Archeologist Arc-loca.lua $NHDT-Date: 1652195999 2022/05/10 15:19:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Archeologist Arc-loca.lua $NHDT-Date: 1781994864 2026/06/20 22:34:24 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Archeologist Arc-strt.lua $NHDT-Date: 1652195999 2022/05/10 15:19:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Archeologist Arc-strt.lua $NHDT-Date: 1781994864 2026/06/20 22:34:24 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Barbarian Bar-fila.lua $NHDT-Date: 1652195999 2022/05/10 15:19:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Barbarian Bar-fila.lua $NHDT-Date: 1781994864 2026/06/20 22:34:24 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Barbarian Bar-filb.lua $NHDT-Date: 1652196000 2022/05/10 15:20:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Barbarian Bar-filb.lua $NHDT-Date: 1781994864 2026/06/20 22:34:24 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Barbarian Bar-goal.lua $NHDT-Date: 1652196000 2022/05/10 15:20:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Barbarian Bar-goal.lua $NHDT-Date: 1781994865 2026/06/20 22:34:25 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Barbarian Bar-loca.lua $NHDT-Date: 1652196000 2022/05/10 15:20:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Barbarian Bar-loca.lua $NHDT-Date: 1781994865 2026/06/20 22:34:25 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Barbarian Bar-strt.lua $NHDT-Date: 1652196001 2022/05/10 15:20:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
-- NetHack Barbarian Bar-strt.lua $NHDT-Date: 1781994865 2026/06/20 22:34:25 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.5 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Caveman Cav-fila.lua $NHDT-Date: 1652196001 2022/05/10 15:20:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Caveman Cav-fila.lua $NHDT-Date: 1781994865 2026/06/20 22:34:25 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Caveman Cav-filb.lua $NHDT-Date: 1652196001 2022/05/10 15:20:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Caveman Cav-filb.lua $NHDT-Date: 1781994866 2026/06/20 22:34:26 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Caveman Cav-goal.lua $NHDT-Date: 1652196002 2022/05/10 15:20:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Caveman Cav-goal.lua $NHDT-Date: 1781994866 2026/06/20 22:34:26 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Caveman Cav-loca.lua $NHDT-Date: 1652196002 2022/05/10 15:20:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Caveman Cav-loca.lua $NHDT-Date: 1781994866 2026/06/20 22:34:26 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Caveman Cav-strt.lua $NHDT-Date: 1652196002 2022/05/10 15:20:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $
-- NetHack Caveman Cav-strt.lua $NHDT-Date: 1781994866 2026/06/20 22:34:26 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/perl
# NetHack 3.7 GENFILES $NHDT-Date: 1596498242 2020/08/03 23:44:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
# NetHack 5.0 GENFILES $NHDT-Date: 1596498242 2020/08/03 23:44:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
# Copyright (c) 2018 by Kenneth Lorber
# NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Healer Hea-fila.lua $NHDT-Date: 1652196003 2022/05/10 15:20:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Healer Hea-fila.lua $NHDT-Date: 1781994866 2026/06/20 22:34:26 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Healer Hea-filb.lua $NHDT-Date: 1652196003 2022/05/10 15:20:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Healer Hea-filb.lua $NHDT-Date: 1781994867 2026/06/20 22:34:27 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Healer Hea-goal.lua $NHDT-Date: 1652196003 2022/05/10 15:20:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Healer Hea-goal.lua $NHDT-Date: 1781994867 2026/06/20 22:34:27 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Healer Hea-loca.lua $NHDT-Date: 1652196004 2022/05/10 15:20:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Healer Hea-loca.lua $NHDT-Date: 1781994867 2026/06/20 22:34:27 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Healer Hea-strt.lua $NHDT-Date: 1652196004 2022/05/10 15:20:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Healer Hea-strt.lua $NHDT-Date: 1781994867 2026/06/20 22:34:27 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991, 1993 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Knight Kni-fila.lua $NHDT-Date: 1652196004 2022/05/10 15:20:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Knight Kni-fila.lua $NHDT-Date: 1781994867 2026/06/20 22:34:27 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Knight Kni-filb.lua $NHDT-Date: 1652196005 2022/05/10 15:20:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Knight Kni-filb.lua $NHDT-Date: 1781994868 2026/06/20 22:34:28 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Knight Kni-goal.lua $NHDT-Date: 1652196005 2022/05/10 15:20:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Knight Kni-goal.lua $NHDT-Date: 1781994868 2026/06/20 22:34:28 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Knight Kni-loca.lua $NHDT-Date: 1652196005 2022/05/10 15:20:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Knight Kni-loca.lua $NHDT-Date: 1781994868 2026/06/20 22:34:28 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Knight Kni-strt.lua $NHDT-Date: 1652196006 2022/05/10 15:20:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
-- NetHack Knight Kni-strt.lua $NHDT-Date: 1781994868 2026/06/20 22:34:28 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.5 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Monk Mon-fila.lua $NHDT-Date: 1652196006 2022/05/10 15:20:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Monk Mon-fila.lua $NHDT-Date: 1781994868 2026/06/20 22:34:28 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Monk Mon-filb.lua $NHDT-Date: 1652196006 2022/05/10 15:20:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Monk Mon-filb.lua $NHDT-Date: 1781994869 2026/06/20 22:34:29 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Monk Mon-goal.lua $NHDT-Date: 1652196007 2022/05/10 15:20:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Monk Mon-goal.lua $NHDT-Date: 1781994869 2026/06/20 22:34:29 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Monk Mon-loca.lua $NHDT-Date: 1652196007 2022/05/10 15:20:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Monk Mon-loca.lua $NHDT-Date: 1781994869 2026/06/20 22:34:29 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Monk Mon-strt.lua $NHDT-Date: 1652196007 2022/05/10 15:20:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
-- NetHack Monk Mon-strt.lua $NHDT-Date: 1781994869 2026/06/20 22:34:29 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.9 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Priest Pri-fila.lua $NHDT-Date: 1652196008 2022/05/10 15:20:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Priest Pri-fila.lua $NHDT-Date: 1781994870 2026/06/20 22:34:30 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Priest Pri-filb.lua $NHDT-Date: 1652196008 2022/05/10 15:20:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Priest Pri-filb.lua $NHDT-Date: 1781994870 2026/06/20 22:34:30 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Priest Pri-goal.lua $NHDT-Date: 1687033651 2023/06/17 20:27:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Priest Pri-goal.lua $NHDT-Date: 1781994870 2026/06/20 22:34:30 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Priest Pri-loca.lua $NHDT-Date: 1652196009 2022/05/10 15:20:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
-- NetHack Priest Pri-loca.lua $NHDT-Date: 1781994870 2026/06/20 22:34:30 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.5 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Priest Pri-strt.lua $NHDT-Date: 1652196009 2022/05/10 15:20:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.5 $
-- NetHack Priest Pri-strt.lua $NHDT-Date: 1781994870 2026/06/20 22:34:30 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.6 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Ranger Ran-fila.lua $NHDT-Date: 1652196009 2022/05/10 15:20:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Ranger Ran-fila.lua $NHDT-Date: 1781994871 2026/06/20 22:34:31 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Ranger Ran-filb.lua $NHDT-Date: 1652196010 2022/05/10 15:20:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Ranger Ran-filb.lua $NHDT-Date: 1781994871 2026/06/20 22:34:31 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Ranger Ran-goal.lua $NHDT-Date: 1652196010 2022/05/10 15:20:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Ranger Ran-goal.lua $NHDT-Date: 1781994871 2026/06/20 22:34:31 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Ranger Ran-loca.lua $NHDT-Date: 1652196010 2022/05/10 15:20:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Ranger Ran-loca.lua $NHDT-Date: 1781994871 2026/06/20 22:34:31 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Ranger Ran-strt.lua $NHDT-Date: 1652196011 2022/05/10 15:20:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Ranger Ran-strt.lua $NHDT-Date: 1781994871 2026/06/20 22:34:31 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Rogue Rog-fila.lua $NHDT-Date: 1652196011 2022/05/10 15:20:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Rogue Rog-fila.lua $NHDT-Date: 1781994872 2026/06/20 22:34:32 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1992 by Dean Luick
-- NetHack may be freely redistributed. See license for details.
--
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Rogue Rog-filb.lua $NHDT-Date: 1652196011 2022/05/10 15:20:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Rogue Rog-filb.lua $NHDT-Date: 1781994872 2026/06/20 22:34:32 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1992 by Dean Luick
-- NetHack may be freely redistributed. See license for details.
--
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Rogue Rog-goal.lua $NHDT-Date: 1652196012 2022/05/10 15:20:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Rogue Rog-goal.lua $NHDT-Date: 1781994872 2026/06/20 22:34:32 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1992 by Dean Luick
-- NetHack may be freely redistributed. See license for details.
--
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Rogue Rog-loca.lua $NHDT-Date: 1652196012 2022/05/10 15:20:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Rogue Rog-loca.lua $NHDT-Date: 1781994872 2026/06/20 22:34:32 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1992 by Dean Luick
-- NetHack may be freely redistributed. See license for details.
--
+3 -3
View File
@@ -1,4 +1,4 @@
-- NetHack Rogue Rog-strt.lua $NHDT-Date: 1652196012 2022/05/10 15:20:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
-- NetHack Rogue Rog-strt.lua $NHDT-Date: 1781994872 2026/06/20 22:34:32 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.7 $
-- Copyright (c) 1992 by Dean Luick
-- NetHack may be freely redistributed. See license for details.
--
@@ -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
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Samurai Sam-fila.lua $NHDT-Date: 1652196013 2022/05/10 15:20:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Samurai Sam-fila.lua $NHDT-Date: 1781994873 2026/06/20 22:34:33 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Samurai Sam-filb.lua $NHDT-Date: 1652196013 2022/05/10 15:20:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Samurai Sam-filb.lua $NHDT-Date: 1781994873 2026/06/20 22:34:33 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Samurai Sam-goal.lua $NHDT-Date: 1652196013 2022/05/10 15:20:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Samurai Sam-goal.lua $NHDT-Date: 1781994873 2026/06/20 22:34:33 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Samurai Sam-loca.lua $NHDT-Date: 1652196014 2022/05/10 15:20:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Samurai Sam-loca.lua $NHDT-Date: 1781994873 2026/06/20 22:34:33 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Samurai Sam-strt.lua $NHDT-Date: 1695932714 2023/09/28 20:25:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
-- NetHack Samurai Sam-strt.lua $NHDT-Date: 1781994874 2026/06/20 22:34:34 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.5 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Tourist Tou-fila.lua $NHDT-Date: 1652196014 2022/05/10 15:20:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Tourist Tou-fila.lua $NHDT-Date: 1781994874 2026/06/20 22:34:34 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Tourist Tou-filb.lua $NHDT-Date: 1652196015 2022/05/10 15:20:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Tourist Tou-filb.lua $NHDT-Date: 1781994874 2026/06/20 22:34:34 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Tourist Tou-goal.lua $NHDT-Date: 1652196015 2022/05/10 15:20:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
-- NetHack Tourist Tou-goal.lua $NHDT-Date: 1781994874 2026/06/20 22:34:34 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.6 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Tourist Tou-loca.lua $NHDT-Date: 1652196015 2022/05/10 15:20:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Tourist Tou-loca.lua $NHDT-Date: 1781994874 2026/06/20 22:34:34 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Tourist Tou-strt.lua $NHDT-Date: 1652196016 2022/05/10 15:20:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $
-- NetHack Tourist Tou-strt.lua $NHDT-Date: 1781994875 2026/06/20 22:34:35 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991,92 by M. Stephenson, P. Winner
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Valkyrie Val-fila.lua $NHDT-Date: 1652196016 2022/05/10 15:20:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Valkyrie Val-fila.lua $NHDT-Date: 1781994875 2026/06/20 22:34:35 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Valkyrie Val-filb.lua $NHDT-Date: 1652196016 2022/05/10 15:20:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Valkyrie Val-filb.lua $NHDT-Date: 1781994875 2026/06/20 22:34:35 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Valkyrie Val-goal.lua $NHDT-Date: 1652196017 2022/05/10 15:20:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.5 $
-- NetHack Valkyrie Val-goal.lua $NHDT-Date: 1781994875 2026/06/20 22:34:35 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.6 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Valkyrie Val-loca.lua $NHDT-Date: 1652196017 2022/05/10 15:20:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Valkyrie Val-loca.lua $NHDT-Date: 1781994875 2026/06/20 22:34:35 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Valkyrie Val-strt.lua $NHDT-Date: 1652196017 2022/05/10 15:20:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Valkyrie Val-strt.lua $NHDT-Date: 1781994876 2026/06/20 22:34:36 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1991-2 by M. Stephenson
-- NetHack may be freely redistributed. See license for details.
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Wizard Wiz-fila.lua $NHDT-Date: 1652196018 2022/05/10 15:20:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Wizard Wiz-fila.lua $NHDT-Date: 1781994876 2026/06/20 22:34:36 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1992 by David Cohrs
-- NetHack may be freely redistributed. See license for details.
--
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Wizard Wiz-filb.lua $NHDT-Date: 1652196018 2022/05/10 15:20:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack Wizard Wiz-filb.lua $NHDT-Date: 1781994876 2026/06/20 22:34:36 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.2 $
-- Copyright (c) 1992 by David Cohrs
-- NetHack may be freely redistributed. See license for details.
--
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Wizard Wiz-goal.lua $NHDT-Date: 1652196018 2022/05/10 15:20:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Wizard Wiz-goal.lua $NHDT-Date: 1781994876 2026/06/20 22:34:36 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1992 by David Cohrs
-- NetHack may be freely redistributed. See license for details.
--
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Wizard Wiz-loca.lua $NHDT-Date: 1652196019 2022/05/10 15:20:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack Wizard Wiz-loca.lua $NHDT-Date: 1781994876 2026/06/20 22:34:36 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1992 by David Cohrs
-- NetHack may be freely redistributed. See license for details.
--
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack Wizard Wiz-strt.lua $NHDT-Date: 1652196019 2022/05/10 15:20:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $
-- NetHack Wizard Wiz-strt.lua $NHDT-Date: 1781994877 2026/06/20 22:34:37 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
-- Copyright (c) 1992 by David Cohrs
-- NetHack may be freely redistributed. See license for details.
--
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack endgame air.lua $NHDT-Date: 1652196019 2022/05/10 15:20:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $
-- NetHack endgame air.lua $NHDT-Date: 1781994877 2026/06/20 22:34:37 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.3 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1992,1993 by Izchak Miller, David Cohrs,
-- and Timo Hakulinen
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack gehennom asmodeus.lua $NHDT-Date: 1652196020 2022/05/10 15:20:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
-- NetHack gehennom asmodeus.lua $NHDT-Date: 1781994877 2026/06/20 22:34:37 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1992 by M. Stephenson and Izchak Miller
-- NetHack may be freely redistributed. See license for details.
+3 -3
View File
@@ -1,4 +1,4 @@
-- NetHack endgame astral.lua $NHDT-Date: 1652196020 2022/05/10 15:20:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.7 $
-- NetHack endgame astral.lua $NHDT-Date: 1781994877 2026/06/20 22:34:37 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.9 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1992,1993 by Izchak Miller, David Cohrs,
-- and Timo Hakulinen
@@ -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 })
+1 -1
View File
@@ -1,4 +1,4 @@
-- NetHack gehennom baalz.lua $NHDT-Date: 1652196020 2022/05/10 15:20:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
-- NetHack gehennom baalz.lua $NHDT-Date: 1781994878 2026/06/20 22:34:38 $ $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.6 $
-- Copyright (c) 1989 by Jean-Christophe Collet
-- Copyright (c) 1992 by M. Stephenson and Izchak Miller
-- NetHack may be freely redistributed. See license for details.

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