Commit Graph

15747 Commits

Author SHA1 Message Date
PatR
a40dbe791e pull request #1119 - refine impact vs zombies
Pull request by entrez:  refine the recent change to have buried
zombies be affected (emerge from ground sooner) by objects that
impact the ground on or near their burial spot.

Closes #1119
2023-11-05 21:56:31 -08:00
Michael Meyer
98d2b0ecb3 Follow up on disturbing buried zombies
Change 852f8e4 by requiring a minimum impact before a buried zombie
nearby will be disturbed: light, but still excluding things like
scrolls, if it's a violent impact (dropped while levitating, thrown, or
kicked), and fairly heavy if the hero is just placing the item on the
ground normally.

Moving the call out of flooreffects meant it no longer applied to
pushing boulders around, so have moverock disturb nearby zombies.  I
additionally had wake_nearby do the same thing.

Finally, I renamed check_buried_zombies (which doesn't really reflect
what it does) to disturb_buried_zombies.
2023-11-05 21:51:45 -08:00
PatR
e384e3a5a1 suppress 'variable not used' warning
My compiler didn't warn about this.  The value conditionally gets set
but then isn't used anywhere besides that.  For the time being, give
'skipped_noninuse' a fake use rather than eliminate it altogether.
2023-11-05 17:23:46 -08:00
PatR
1b04533b35 fix #4027 - unix command line parsing bug
'nethack --show' is rejected, which is ok, but the feedback is
'prscore: bad arguments (2)' which is pretty confusing.

Reject any --s unless it's the start of --scores or --showpath[s].
'nethack --show' will be rejected as "Unknown option: --show."
'nethack -show' is still accepted and will report that it can't find
any scores for how as it always has (assuming that there aren't any
score entries for "how" :-).
2023-11-05 17:16:02 -08:00
nhw_cron
9d83152ced This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-05 19:16:23 -05:00
PatR
54a64c35ae pull request #1120 - split same-race-sacrifice from
dosacrifice() into a separate routine.

Pull request from argrath:  move the code that handles same-race
sacrifice into a separate routine.

Log message for commit d5fa2f8ba0.

Closes #1120
2023-11-05 15:20:22 -08:00
PatR
e7b685abe5 pull request #1115 - streamline level_tele()
Pull request from entrez:  clean up the if/else-if/else logic in
level_tele().

Trying things a little differently this time.  This is an extra log
message for commit 4876b70b9b.

Closes #1115
2023-11-05 15:15:27 -08:00
PatR
e1b47e74e3 remainder of PR #1109 - named fruit lookup
Remainder of 'database-suggestions' pull request by entrez:  named
fruit lookup when checking for data.base entries.

I'll admit that not sure what this actually accomplishes and am not
interested enough to figure it out myself.

This is the first time I've ever managed to do something useful with
'git cherry-pick', although I haven't tried much after early failures.

The other part of the pull request was dealt with manually earlier,
commit bc9518ca16.

Closes #1109
2023-11-05 15:08:02 -08:00
Michael Meyer
6cfd3367bc Encyclopedia lookup: check all existing fruitnames
Use fruit_from_name instead of checking gp.pl_fruit directly so that
changing the fruitname won't cause fruits already in the player's
inventory to stop working with lookup.
2023-11-05 14:55:27 -08:00
nhkeni
6c8035d1e7 allow --showpath for --showpaths 2023-11-05 10:26:13 -05:00
Pasi Kallinen
8dc7a4882a Make spell menu work with repeat command 2023-11-05 13:49:04 +02:00
Pasi Kallinen
f720e1e548 Themeroom: Cloud room 2023-11-05 13:08:43 +02:00
PatR
2ee7509945 replace getenv("TTYINV") with perminv_mode option
Add a new option 'perminv_mode' to augment perm_invent.  It handles
the same choices as the temporary TTYINV method:  show all items other
than gold, show full inventory including gold, or only show in-use
items (similar to the '*' command).

For tty, both the all-except-gold and full-inventory modes can add
the poorly named 'sparse' variation which populates unused slots in
its fixed grid with the inventory letter that would go in each.

For others, the default has been changed from full-inventory to
all-except-gold.  Note that gold is treated as part of 'all' or of
'in-use' if it is quivered because having the amount be shown on the
status line doesn't make that redundant.

Changing the default may mess up WinGUI if it assumes that perm_invent
is full inventory with gold.

Initially I was going to change perm_invent into a compound but this
leaves it as an on/off toggle and adds perminv_mode as a separate
option for how to show the inventory when the toggle is on.  It may
make sense to combine them since dual controls is a little confusing,
but right now setting perm_invent On when perminv_mode is 'none'
changes that to 'all' and changing perminv_mode away from 'none' when
perm_invent is Off toggles it to On.

Guidebook.mn has been updated but as usual Guidebook.tex is lagging.
2023-11-05 02:31:26 -08:00
PatR
e16f80395b curses perm_invent tweak
If there's room, avoid writing the column indicator (when one or more
entries have been truncated due to insufficient window width) on an
entry.  Only applies to first page so only matters if sortpack is off.

Also, for windowborders=3 or 4, where the map, message, and status
windows have borders but the perm_invent one doesn't, insert a blank
line at the top when there is only one line of output (such as "not
carrying anything") so that it lines up with the top line inside the
adjacent window rather than with that window's top border.  No effect
when perm_invent itself has a border or when none of the others do.
2023-11-05 02:12:14 -08:00
Pasi Kallinen
2bb7239867 Fix iron bars dissolving turning floor into doorway 2023-11-04 13:41:12 +02:00
Pasi Kallinen
738c2239c9 Lightning has a small chance of melting iron bars 2023-11-04 13:04:27 +02:00
SHIRAKATA Kentaro
d5fa2f8ba0 Split sacrificing same race into separete function 2023-11-04 13:52:31 +09:00
Pasi Kallinen
56f4657041 Simplify add_menu, part 10 2023-11-03 22:37:50 +02:00
Pasi Kallinen
4dd9602f4b Simplify add_menu, part 9 2023-11-03 22:32:36 +02:00
PatR
bc9518ca16 part of PR #1109 - data.base entries
Part of the pull request by entrez, changing a few data.base entries
recently introduced by PR #1108.

Changes ice box to a different quote, but I've re-applied the prior
quote to ice terrain rather than delete it.  Also replace a UTF
apropostophe in the ice quote which escaped the previous purge of
such things.

Replaces the C.S.Lewis quote for Demonbane with a one-liner from the
Bible.  I realized a bit late that Demonbane is no longer a sword and
never given to lawful Angels as starting gear anymore, consequently
the new quote doesn't fit very well.

The PR changed the helm of brilliance entry to be for all helms and
this rejects that.  Instead, it adds a few generic helmet descriptions
and changes the helm of brilliance quote--now misquote--to be useful
to players, describing it as crystal rather than steel.

Pull request 1109 is still open--there's a second commit in it dealing
with fruit name handling that this commit doesn't touch.
2023-11-03 13:26:53 -07:00
Pasi Kallinen
ee27757b60 Simplify add_menu, part 8 2023-11-03 22:23:46 +02:00
Pasi Kallinen
06235b7841 Simplify add_menu, part 7 2023-11-03 22:04:55 +02:00
Pasi Kallinen
70c47c4054 Simplify add_menu, part 6 2023-11-03 21:48:46 +02:00
Pasi Kallinen
93fd946ff6 Simplify add_menu, part 5 2023-11-03 21:41:26 +02:00
Pasi Kallinen
175d167896 Simplify add_menu, part 4 2023-11-03 21:27:22 +02:00
Pasi Kallinen
7592ce81f4 Simplify add_menu, part 3 2023-11-03 21:09:34 +02:00
Pasi Kallinen
2fd177ddb5 Simplify add_menu, part 2 2023-11-03 21:01:17 +02:00
PatR
957b8ac601 fixes entry for PR #1103 - potion of sickness
Pull request from vultur-cadens:  make thrown potion of sickness more
consistently effective but less powerful.  It is no longer blocked
by a target monster's innate magic resistance but it now only halves
current HP without also halving maximum HP, and the message about the
target "looking rather ill" is skipped if it only has 1HP so doesn't
take any damage.

Closes #1103
2023-11-03 11:20:57 -07:00
vultur-cadens
43f42b35e6 potion of sickness hit effect
The potion of sickness would previously always print the message
"<mon> looks rather ill." when hitting a non-poison-resistant monster,
even if all effects were resisted due to monster magic resistance.

To make the potion more useful against high-MR monsters, this change
removes the dependence on monster MR, but also removes the halving of
maximum HP to prevent it from being overpowered.  Hitting with a
potion of sickness now reliably halves only the current HP of
non-poison-resistant targets.

The effect of poisoned projectiles, which can be created from a potion
of sickness, is not resisted by monster MR, so it does not make much
sense for the potion effect to be subject to monster MR.  There is
also code to make Pestilence suffer the sickness effect when hit by a
potion of healing, but due to monster MR, it had no practical effect
other than printing a misleading message.
2023-11-03 11:18:29 -07:00
PatR
8f1b1288cb pull request #1114 - NetHack.ad remarks about XPM
Pull request from bernhardreiter:  NetHack.ad has a comment about
needing to use an external tool such as XV or PBMplus rather than
the NetHack.double_tile_size resource if nethack is built with the
USE_XPM configuration.  Add some more detail since using 'hints' when
setting up the Makefiles can define that behind the builder's back.

The extra detail won't be useful to players who obtain prebuilt
binaries that incorporate the X11 interface.  The comment in config.h
(see preceding pull request) won't be either, and maybe should be
moved to NetHack.ad where such users will be able to see it.

Fixes #1114.
2023-11-03 11:04:35 -07:00
Michael Meyer
ccf997b28b Cache and restore gb.bhitpos in water_damage_chain
If throwing an item while levitating sent the hero hurtling into a wall
of water, the item would land in the water due to water_damage_chain's
use of bhitpos.  Restore the previous value when it is finished to avoid
interfering with the use of bhitpos further up the call stack.
2023-11-03 11:04:35 -07:00
Michael Meyer
5ba7939110 Fix: hurtling into wall of water
A hero hurtled into a wall of water while levitating, flying, or wearing
water-walking boots wouldn't be stopped by it unless it was on the Plane
of Water.  Make it stop hurtling heroes immediately no matter the
location.

I also noticed that once I was hurtled safely into the wall of water, it
was described as a "pool" when I examined it with ':'.  Fix that, too,
even though I think it shouldn't really be encountered in-game.
2023-11-03 11:04:34 -07:00
Pasi Kallinen
a6051dae81 Simplify adding menu headings 2023-11-03 19:07:15 +02:00
PatR
8dfcdfe753 pull request #1114 - NetHack.ad remarks about XPM
Pull request from bernhardreiter:  NetHack.ad has a comment about
needing to use an external tool such as XV or PBMplus rather than
the NetHack.double_tile_size resource if nethack is built with the
USE_XPM configuration.  Add some more detail since using 'hints' when
setting up the Makefiles can define that behind the builder's back.

The extra detail won't be useful to players who obtain prebuilt
binaries that incorporate the X11 interface.  The comment in config.h
(see preceding pull request) won't be either, and maybe should be
moved to NetHack.ad where such users will be able to see it.

Fixes #1114.
2023-11-03 02:54:57 -07:00
Bernhard E. Reiter
3a14239be1 doc: add note that USE_XPM can be defined otherwise
* Add an additional hint to win/X11/NetHack.ad that `USE_XPM` can be defined outsite of `config.h` as it is the case with `hints/linux-x11`-
2023-11-03 02:49:01 -07:00
PatR
a521c7a116 pull request #1113 - fix xpm example in config.h
Pull request from bernhardreiter:  config.h shows an example of how
to manipulate the tiles file with PBMplus (to enlarge them for X11
under the USE_XPM configuration) but that example is missing the
final step of capturing the modified data in a file.

Fixes #1113
2023-11-03 02:44:37 -07:00
Bernhard E. Reiter
733b41347a Doc: fix xpm scaling example in config.h
* Add conversion back to xpm in the example command, otherwise the error message is `Failed to load x11tiles: XpmFileInvalid`
2023-11-03 02:44:08 -07:00
nhmall
75384b95d4 Merge branch 'NetHack-3.7' of https://github.com/g-branden-robinson/NetHack into NetHack-3.7 2023-11-02 16:42:38 -04:00
Pasi Kallinen
852f8e4996 Dropping items disturbs buried zombies 2023-11-02 20:31:51 +02:00
Pasi Kallinen
e6993f2ef1 Digging down on a magical trap causes it to explode 2023-11-02 19:18:18 +02:00
G. Branden Robinson
467a0180a6 doc/Guidebook.mn: Use idiomatic *roff features
Stop trying to deduce whether the document is being formatted for a
typesetter (a device that can use proportional fonts) or a terminal (a
device that generally can't) by asking the formatter to measure
formatted texts.  Instead, use the built-in `n` and `t` conditions that
nroff and troff have supported for this purpose since 1976 at the
latest.  All known troff implementations support these.

https://www.gnu.org/software/groff/manual/groff.html.node/Operators-in-Conditionals.html
2023-11-02 11:55:35 -05:00
G. Branden Robinson
462973ab53 doc/Guidebook.mn: Drop junk syntax
These *roff control lines were ill-formed.  `.fi` is a request to turn
on filling, not a closing bracket for an `if` request (*roff is not a
Bourne shell).

https://www.gnu.org/software/groff/manual/groff.html.node/Conditional-Blocks.html

Further, *roff generally does not accept more than one request per
input line.  Exceptions to this rule are the control structuring
requests (`if`, `ie`, `el`, and in GNU troff, `while`, `do` and `nop`).
But here, only one (`do`-nested) request is governed by the `if` anyway.
2023-11-02 11:55:22 -05:00
PatR
c1045cc18a sanity check: avoid "you over monster" impossible
I did this several months ago to avoid a sanity check warning (and
consequent fuzzer panic) when an engulfer expels the hero on a full
level.  I was hoping to refine it but never went back; install it
now before forgetting about it entirely.

If a chameleon changes from wall-phazer to engulfer while in a spot
the hero can't move onto and engulfs him/her, expelling the hero
after the engulfer has taken the hero's spot might be forced to put
the hero on top of the engulfer or another monster when unable to
use the engulfer's former spot.  Rather than try to figure out all
the possible ways this might happen and attempt to deal with each
of them, just prevent an engulf attack from succeeding if the hero
wouldn't be able to move to the engulfer's spot.  (Does not prevent
an air elemental over water from engulfing the hero.)
2023-11-02 09:12:37 -07:00
nhmall
196fd41817 comment out font warning argument to groff 1.23
The font warnings are no longer being generated as of b73e4815,
so there is no need for the '-W font' argument to groff at this time.
2023-11-02 10:31:50 -04:00
PatR
8cd032a6aa thawing ice fix
Ice in front of a raised drawbridge was desccribed as "[ice:19?]"
and didn't present any thaw status when hero was close.
2023-11-02 01:13:18 -07:00
PatR
a985fa1167 comment fixup for saving cond_xyz
This started as a typo/thinko fix but ended up rewording the comment.
2023-11-01 22:07:43 -07:00
PatR
b73e4815fa Guidebook.txt: silence groff complaints about CR
Don't attempt to switch to CR font (used to get fixed-width characters
when generating output that uses proportional width ones) when output
is already fixed-width (plain text).

The most recent release of groff (version 1.23) complains when a font
can't be found, then keeps going.  Earlier versions just silently kept
going.  Failing to load the CR font when already producing fixed-width
chars makes 'keep going' acceptable but the font-load-failure warnings
are a nuisance.
2023-11-01 21:35:56 -07:00
PatR
986596b26d tweak to #K4026 fix 2023-11-01 02:08:39 -07:00
PatR
fa0f3751a3 fix #K4026 - "object lost" panic during theft
"object lost" panic occurred when hero's worn amulet of magical
breathing was stolen.  This prevents drown() -> emergency_disrobe()
from dropping an item while in the midst of it being stolen, avoiding
the possibility of it no longer being in inventory when the theft
completes.  There may be variations other than drowning that lead to
unwear -> drop-or-destroy that are still vulnerable, and this fix can
potentially cause items to vanish from hangup save files.

It also has a side-effect of not being able to drop levitation boots
to lighten encumbrance enough to crawl out of water if the drowning
occurs while they are being taken off, not just when being stolen,
even though they should be easily droppable in such circumstance.  The
hero will just need to drop other things instead.
2023-11-01 01:54:32 -07:00
PatR
c8a84acfa5 handle C++ vs enum arithmatic differently
The cast to (int) was much simpler but this seems better overall.
2023-10-31 15:04:14 -07:00