Commit Graph

10713 Commits

Author SHA1 Message Date
85cc045400 Merge branch 'NetHack-3.7' into twitch-interact 2026-04-19 08:36:20 -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
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
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
b7281f0b28 Merge branch 'NetHack-3.7' into twitch-interact 2026-04-15 18:02:20 -07:00
71deeb0416 Rate limit checking twitch in fifo 2026-04-14 18:01:29 -07: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
a34a07bb75 Merge branch 'NetHack-3.7' into twitch-interact 2026-04-13 15:05:44 -07: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
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
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
nhmall
fffbf4c2e5 Windows option update for map_mode
Ensure preference_update() is called
2026-04-10 10:36:36 -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
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
fdbf84b9b7 remove some dead code 2026-04-06 13:17:32 -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
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
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
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