Commit Graph

5459 Commits

Author SHA1 Message Date
PatR
1d22a396d4 fixes3-7-0 typo 2025-03-10 21:54:22 -07: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
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
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
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
nhkeni
e358f37863 Merge remote-tracking branch 'origin/keni-fetchdocs' into NetHack-3.7 2025-02-07 15:36:19 -05: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
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
c9abc92dd7 Fix lua.adoc 2025-01-24 19:04:17 +02: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
nhmall
8ee014f5d1 update credits 2025-01-12 23:57:56 -05: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
PatR
a118869262 rephrase a recent fixes entry 2025-01-06 11:01:18 -08: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
428665c613 fixes entry update for another part of commit 37758c7e 2025-01-04 19:16:02 -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
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
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
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
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
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
nhkeni
bb57c38e24 Option formatting cleanup. 2024-12-27 18:17:49 -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
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
Pasi Kallinen
0079bf87bb fixes update 2024-12-21 18:19:42 +02: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
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
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
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
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
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
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