Commit Graph

15521 Commits

Author SHA1 Message Date
PatR
67513c96bb options help
Update the 'optmenu' data file to describe the simple options menu
(new paragraph containing just a one sentence) as well as the full
options menu (still several paragraphs).  Visible by choosing '?' in
the full options menu or the 'how to set options' choice in the main
help menu.

Add a line to the simple options menu about how to get the full
options menu.  Only shown if you type '?' to toggle on "show help";
taken away again if you use '?' to toggle back to "hide help".
2023-08-31 14:58:51 -07:00
PatR
bc93ee5d04 pet petrified by eating Medusa's corpse
From a reddit thread:  a tame mind flayer ate Medusa's corpse and was
turned to stone.  Pets won't eat cockatrice corpses unless stoning
resistant but would eat Medusa's corpse if merely poison resistant.
Mind flayers aren't normally poison resistant but could be if wearing
green dragon scales/mail.

Augment the touch_petrifies() test when classifying food for pets.
2023-08-30 13:38:08 -07:00
nhkeni
9136c75425 nhgitset.pl tid
Older versions of git, when cloning a repo and
the expected source templates directory does not
exist, does not create .git/hooks, which causes
nhgitset.pl to fail.  So do it here.
2023-08-29 21:04:32 -04:00
PatR
6bb9b8a955 missing dependency in sys/unix/Makefile.utl
The dependencies in util/Makefile duplicate those in src/Makefile for
objects.o and monst.o but the latter got changed last year and the
change wasn't replicated.
2023-08-29 11:38:06 -07:00
Michael Meyer
8fa53d6ac5 Adjust seenres when observed attack succeeds
If a monster sees an elemental attack succeed from some other creature
or environmental danger, it will be willing to try those attacks again.
2023-08-29 12:05:48 +03:00
PatR
82d83dc83d \#wizkill vs dmonsfree
When testing the high priest livelog/#chronicle feedback I used #wizkill
on the Sanctum level to kill Moloch's high priestess and immediately
level teleported to the Astral level to target the other high priests.
I got impossible "dmonsfree: 0 removed doesn't match 1 pending" there.
2023-08-29 00:45:11 -07:00
PatR
05a99064b6 fix #K3997 - livelog feedback for high priests
If you killed a second high priest (either two on Astral or first in
the Sanctum and another on Astral) the livelog/#chronicle message
would report "killed high priest of Foo (2nd time)" even though the
first was the high priest of Bar, or even just "killed high priest
(2nd time)" if second kill happened when not adjacent.

High priests pass the 'unique monster' test (even though they aren't
actually unique--there will be four of them) so get logged for killing
such.  Always report "killed high priest of Foo" and only do so if the
specific high priest[ess] monster hasn't been revived and re-killed.

Logging deaths of unique monsters normally reports the 1st, 2nd, 3rd,
5th, 10th, and various later instances.  If you were to kill Moloch's
high priest and all three on Astral, the last one wouldn't be logged
because 4th instance gets skipped.  This forces each one to be treated
as the 1st (provided that the mrevived flag is clear), so for logging
purposes it will now behave as if there are 4 distinct high priests.
2023-08-29 00:02:19 -07:00
nhkeni
06a3bd0424 mac: don't fail "make install" if SHELLDIR already exists 2023-08-28 19:18:36 -04:00
nhkeni
068a460d05 fix various typos in NHDT lines 2023-08-28 16:17:41 -04:00
Michael Meyer
38cda5ad52 Adjust seenres on visible gear removal
If a monster sees you remove some piece of gear that grants a
resistance, it will remove that resistance from its list of remembered
resistances and be willing to try attacking you with that adtyp again.
This avoids the situation where you put on a ring of cold, get hit with
one cold attack, and then can remove it because all the monsters nearby
will permanently remember you as being cold resistant (but even after
this change a wily hero could still step into a niche and do it without
any monsters seeing, so trick them into thinking she's still cold
resistant...).  The hero could still be resistant if there were multiple
sources to begin with, of course, but the monsters will test it and
learn that again if necessary.

It's a little weird that the monsters can recognize the intrinsic
granted by the item being removed, but they display knowledge of
unidentified (by the hero) objects in many other circumstances too, so I
hope it's forgivable in the pursuit of having them act more cleverly
about resuming previously-resisted attacks like this.  Another approach
that avoids the gear recognition, blanking seenres on any gear change,
can result in odd situations like orcs treating their own cloaks as
potential sources of many different resistances, which also seems silly.
2023-08-26 14:13:03 +03:00
PatR
99683d94b4 fixes entry for PR #1087 - Magicbane cancellation
Pull request from entrez:  if Magicbane's cancellation effect hit a
shapeshifter and caused it to revert to base form, further messages
for the rest of that attack referred to it by the cached name of its
shifted shape.

Fixes #1087
2023-08-25 12:14:02 -07:00
Michael Meyer
9a5b6e8e77 Fix: name confusion after MB cancels shapeshifter
The cancellation effect of Magicbane can cause shapeshifters to change
to their base forms.  Since the name of the monster being attacked is
cached earlier, the name used for subsequent messages from Mb_hit would
be outdated after this happened.  For example, as encountered in a
recent game: "The magic-absorbing blade cancels the vampire bat! The
vampire bat turns into a vampire lord! The vampire bat is confused."
Insert the new name into hittee[] if cancellation caused the targeted
monster to change form.
2023-08-25 12:03:32 -07:00
PatR
6ad9eef25d update a couple of comments
Fix a couple of typos and rephrase 'livelog_mon_nam()' description.
2023-08-25 11:43:00 -07:00
nhmall
a627e83a81 nested comment warning 2023-08-25 14:02:57 -04:00
Pasi Kallinen
b5a43a60f2 Asmodeus' cold magic attack when hero is resistant
Asmodeus kept using the cold magic attack when hero was cold resistant.
The distance magic attack already considered hero resistances, so
use the same logic for the close-up magic attack.
2023-08-25 10:58:11 +03:00
Pasi Kallinen
e407af4477 Allow defining random-teleport exclusion zones in lua
Adds a new lua command

  des.exclusion({ type = "teleport", region = { x1,y1, x2,y2 } });

which allows defining "exclusion zones" in the level, areas where
random teleports (or falling into the level) will never place the hero.
Does not prevent targeted teleportation into the area.

Breaks saves and bones.
2023-08-24 18:38:39 +03:00
Pasi Kallinen
0794a64b9d Fix lua object added to container error
The reference count of the deleted object was changed,
instead of the object that it was merged into.
2023-08-24 09:22:57 +03:00
PatR
9ee6f29c06 vt_tiledata/vt_sounddata comment bit 2023-08-18 12:09:27 -07:00
PatR
78607a37a5 more obufs - two-handed weapon in "hands"
Pointed out by entrez:  prevent doname() from consuming two obuf[]
buffers when it constructs the plural of "hand" while formatting a
wielded two-handed weapon.

Since only one such item should be able to occur in any list of
objects, it is not likely to be the cause of any message oddities
that might happen when a cached value is in a formatting buffer gets
re-used too soon.  However, not releasing a second buffer right away
prevents an attempt to release the first one from succeeding because
it won't be the last one allocated anymore, so some buffer churn was
happening.
2023-08-16 18:16:11 -07:00
nhmall
f625d2efcf more tabs to spaces 2023-08-16 10:22:10 -04:00
nhmall
d421e2512e tab to spaces 2023-08-16 10:07:01 -04:00
PatR
341b1ad289 sortloot details
The sortloot classification routine had some inappropriate casts to
'coordxy' for things had nothing to do with map coordinates.  I was
going to change the relevant fields to 'short' but that seems iffy
for 'indx' so I changed them all to 'int'.
2023-08-15 15:48:41 -07:00
PatR
f64e779e7d github pull request #1086 - obufs in sortloot()
Pull request by entrez:  sortloot could churn through every obuf[].
Change it to release them as soon as they're used, like the fix for
inventory display in commit e43ec0cef1
two years ago.

I don't have a test case.

Closes #1086
2023-08-15 14:34:25 -07:00
Michael Meyer
3ce3128e09 Release obufs used by sortloot
Some further application of e43ec0c logic, which was intended to fix odd
messages produced by obufs clobbered by inventory updates (like "the
ogre lord yanks Cleaver from your corpses!").  That issue was still
lurking around because sortloot(), via sortloot_cmp(), was continuing to
call for obufs via loot_xname() without releasing them immediately.  It
was going through the entire inventory doing that, much like
display_pickinv() was prior to Pat's fix in e43ec0ce, so could cause
the contents of obufs to still be clobbered by perm_invent updates.
This changes sortloot_cmp() to releases the obufs it calls for as soon
as possible so that won't happen any more.
2023-08-15 14:33:17 -07:00
nhmall
b5dcb58d52 two minor comment typos 2023-08-15 14:12:52 -04:00
nhkeni
9ba47555c9 Merge remote-tracking branch 'origin/keni-versioncopy' into NetHack-3.7 2023-08-15 09:33:59 -04:00
PatR
853613cb68 curses numpad handling comments
Update a couple of comments for yesterday's 8-bit escapes M-O to M-^O
fix.
2023-08-14 13:08:11 -07:00
PatR
8b57393027 curses number pad revisited
The previous curses escape sequence conversion for 8-bit sequences was
looking for those to start with M-O when the correct value for that is
actually M-^O.

Add support for the number pad's non-digit keys.  Most useful for real
VTxxx keyboard since emulators are usually stuck mapping '+' and '.'
to ',', '.', and '-'.  There's no universal solution for that.
2023-08-13 13:07:54 -07:00
nhmall
1a99c9382e Qt6 on Linux Makefile tweak 2023-08-13 12:06:19 -04:00
PatR
1e47b4e824 third typo on same line as previous two... 2023-08-12 16:11:50 -07:00
PatR
fe919f91b3 couple of comment typos
The second one has two on the same line.
2023-08-12 15:04:10 -07:00
PatR
7ea091048c count_level_features() bit
The relatively recent code to recalculate the number of fountains and
sinks on a level was including column 0.  levl[*][0] is not used for
the map.
2023-08-12 15:01:02 -07:00
PatR
c155d23823 data.base entry for stethoscope
I was going to add a joke entry for "microscope" to data.base and
disocovered that stethoscope was missing.  (There is a rumor about
cursed ones.)  Add a lame entry for it so that the joke has something
to relate to.

Searching for "stethoscope" led to the "cope" comment, which is near
the "cornuthaum" entry.  Add a comment giving Janet credit for coining
the term.
2023-08-11 15:57:27 -07:00
PatR
70834c12df curses number pad handling
This attempts to address the issue on hardfought (as described by K2
on reddit two weeks ago) which happened after updating their terminfo
database.  It's based on the reported workaround of having users force
their terminals to avoid "application keypad mode".  The fixes entry is
my guess at what is happening so could be wrong....

I don't have a numeric keypad so this is untested; it /ought to work/.
NetHack's curses interface is doing it's own keypad recognition when
the curses library returns a multi-char sequence rather than converting
that into corresponding KEY_xxx token.  Numpad keys that the interface
recognizes begin with 2 char 'ESC O' when transmitted as 7-bit sequences.
This adds support for SS3 (as sent by DEC Vtxxx terminals and emulators;
value is single char 'M-O') for 8-bit sequences.

It shouldn't break typing Alt+O but that's something else that I can't
test properly.  Setting nethack's 'altmeta' option and manually typing
2 char 'ESC O' still works as intended.

This is curses-specific; the tty interface is completely unaffected.
[However, the vms port has supported SS3 with tty for decades. :-]
2023-08-11 13:14:01 -07:00
nhmall
7b2a72d083 update tested versions of Visual Studio 2023-08-10 2023-08-10 09:49:54 -04:00
nhmall
036ad82074 doc follow-up 2023-08-08 12:49:29 -04:00
nhmall
b7c92b498d support Linux build with qt6-base-dev & qt6-multimedia-dev
There was an error:
    ../win/Qt/qt_main.cpp:767:37: error: attempt to use a deleted function
                        action->setData(actchar);
                                        ^
    /usr/include/x86_64-linux-gnu/qt6/QtCore/qvariant.h:199:5: note: 'QVariant<char *, false>' has been explicitly marked deleted here
        QVariant(T) = delete;
        ^
    1 error generated.

I'm hoping the fix applied is the correct one for the error.
2023-08-08 12:41:44 -04:00
Pasi Kallinen
491cc9933f Unhide a water monster using a polymorph trap 2023-08-08 16:49:03 +03:00
nhmall
c4e7c96c5f window port interface clarification 2023-08-07 15:00:56 -04:00
PatR
9f16eaa0a5 fix 'up' and 'down' status highlighting for HP
If there was a status_hilite rule for hitpoints:up, it got used for
both up and down changes.  If there was one for hitpoints:down, it got
ignored even if there was no 'up' rule.  The flag for which direction
the value changed was always positive even when the value went down.

I'm reasonably sure that at some point HP up/down worked correctly.
This problem was present in 3.6.4; I didn't go back any farther.
2023-08-05 12:50:47 -07:00
nhmall
9907d4c59e Guidebook.txt update 2023-08-05 15:38:47 -04:00
PatR
c7865f7588 PR #1071 again - highlighting critical HP
Update the documentation for
OPTIONS=status_hilite:hitpoints/criticalhp/<color&attributes>
A criticalhp rule now overrides up/down/changed rules as well as
absolute/percentage/always rules.
2023-08-05 11:05:07 -07:00
PatR
70791271dd update PR #1071 - highlighting critical HP
If status field 'hitpoints' has rules for both 'criticalhp' and 'up'
or 'down' or 'changed', make critical-hp take precedence.  Otherwise
critical-hp might never be seen because of the value changing every
move (if hero has regeneration attribute).  Normally up/down/changed
take precedence over other types of highlighting.

Something is messed up with up/down/changed HP though.  I'm seeing
the 'up' highlight when it goes either up or down and not seeing the
'down' highlight at all.  'up' and 'down' for gold work as expected.
2023-08-04 22:33:29 -07:00
PatR
651a5b210f fix github issue #1085 - strength of orc captain
Issue reported by Umbire:  Uruk-Hai have strength 18/100 and can grow
into orc captains, but orc captains' strength was limited to 18/50.

Cap strength at 18/100 for hero poly'd into an orc captain, same as
when poly'd into an Uruk-hai.  Since poly'd heroes don't grow into
larger forms, the only way to notice is to polymorph into an Uruk-Hai
at some point and into an orc captain at some other point.

Fixes #1085
2023-08-04 15:12:33 -07:00
nhkeni
1663ecf85d Add --version:copy, deprecate --version:paste. 2023-08-03 21:51:25 -04:00
PatR
9d9042e94b fix #K3968 - objfree: obj not worn
New feature to sometimes hit twice for skilled martial-arts/bare-handed
was unconditionally using uswapwep for the second hit.  If it was a
breakable object, hitting could break it and produce impossible "objfree:
obj not free".

Only use uswapwep for u.twoweap; use Null for second bare-handed hit.
2023-08-01 10:28:21 -07:00
nhmall
025edeb443 CROSS_TO_MIPS=1 build fix 2023-08-01 10:42:20 -04:00
PatR
cb03790759 fix #K3966 - Guidebook error for encumbrance
The 'status' section early in the Guidebook says that encumbrance is
one of "Unencumbered, Encumbered, Stressed" and so on.  The second in
the list should say "Burdened" rather than "Encumbered".
2023-07-31 23:13:14 -07:00
PatR
af387db16d bare-handed combat warning fix 2023-07-31 10:26:37 -07:00
nhmall
7cec01748e Revert "warning after commit 60c19568"
This reverts commit d32208562e.
2023-07-31 10:16:35 -04:00