Commit Graph

17856 Commits

Author SHA1 Message Date
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