Commit Graph

5578 Commits

Author SHA1 Message Date
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
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
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
Pasi Kallinen
f73d9ee704 Expose selection size description to lua 2026-01-25 15:18:51 +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
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
e9f57281f8 Expose flip_level to lua 2026-01-20 17:50:27 +02: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
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
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
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
nhmall
6459d44461 some spelling and inconsistency corrections; comments and elsewhere 2026-01-11 11:31:34 -05: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
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
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
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
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
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
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
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
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
621d21ebb9 Archeologists can decipher scroll labels
Prior to this commit, Archeologists had an incredibly difficult
start, worse than was intended. This is intended to make it a bit
easier (whilst making the role more different from other roles) via
allowing them to identify scroll types earlier in the game than the
other roles are able to (they do it using a knowledge of ancient
languages that lets them read scroll labels that other roles
couldn't).
2025-12-03 21:35:17 +00:00
Alex Smith
a0ccb4b0cb Show spells and skills in the dumplog
These are often an important part of a character's build. There's
no purpose in listing them in disclose because the player generally
already knows what spells and skills they had and doesn't need them
identified, but they're useful when looking at someone else's game
or reminiscing over a past game.
2025-12-02 19:19:18 +00:00