Commit Graph

17070 Commits

Author SHA1 Message Date
SHIRAKATA Kentaro
94eef3c3db split "poof" in potion_dip() into a separate function 2024-08-17 18:02:03 -07:00
PatR
23532b012b farlook of "`"
Allow farlook/quicklook to step through all engravings--corridor
ones as well as room ones--with repeated '`' when picking location
with getpos(), similar to how repeated '^' goes through all traps
no matter what display character they use.

It isn't possible to look at corridor engravings by using their
default symbol '#'.  It is possible by using 'a' for "anything of
interest" but that matches lots of other stuff.

This tries to add an NHDT tags line to sym.h.  That was followed by
'git nhadd' which did stage it for commit, but date/branch/revision
tag expansion isn't working.  I did something similar to defsym.h
about 5 weeks ago; that one worked and I don't recall having needed
to do anything special.
2024-08-17 11:19:45 -07:00
PatR
45690624e5 fix pyrolisk egg panic when eating from floor
From a change made about two and half months ago:  eating a pyrolisk
egg tried to use it up from inventory even when it was on the floor.
That would trigger an object lost panic.
2024-08-17 11:02:28 -07:00
PatR
d441d6159b zillionth+1 and +2 comment typo fixes 2024-08-16 22:18:46 -07:00
PatR
5617f32eb4 region bit
When hero was swallowed and a temporary region at swallower's spot
expired, hero was told "the gas cloud around you dissipates".  This
just suppresses the message rather than changing it into "the gas
cloud around <engulfer> dissipates".
2024-08-16 12:26:17 -07:00
PatR
4fb7dd2cd0 more monster display vs gas clouds
Various bits tried while flailing about with map display of monsters
in visible regions.  The newsym()/mon_overrides_region() part is
definitely an improvement because the logic about whether to show a
monster in a region or just the region wasn't easy to comprehend and
was even harder to extend.

I'm not sure whether the _map_location() part is necessary.
2024-08-16 11:59:38 -07:00
PatR
061f564928 monster display vs gas cloud regions
This fixes the bug where a monster displayed instead of a gas cloud
because the hero was next to it didn't revert to gas cloud when hero
moved and was no longer next to the monster.
2024-08-16 11:40:12 -07:00
PatR
c63b493904 tweak paranoid_confirm:trap vs regions
It is possible to have a known trap be at the same location as a gas
cloud region.  When paranoid_confirm:trap is set, ask for confirmation
about entering the region before confirmation about entering the trap
since the map will be showing the region rather than the trap.

Dual confirmations will be annoying but not new.  Before this change,
it would ask about entering the trap, and if the answer was yes, it
would ask about entering the region.  The situation seems to be too
rare to warrant implementing a single combined confirmation, and the
code to accomplish that would likely be messy.
2024-08-13 13:53:41 -07:00
PatR
fd57c9ca83 wizard mode #timeout command vs gas regions
Show visible regions among the other timed events.  Turn number is
relative rather than absolute.  Location is the internal bounding box
which tends to cover more area than just the gas cloud spots.

When multiple regions are present (common on Plane of Fire), they're
listed in arbitrary order.  It would be better to order them by
timeout or by location or both, but the extra effort to do that seems
unjustified.
2024-08-13 13:28:24 -07:00
PatR
0eb8896301 paranoid_confirm:Trap vs vapor+gas cloud regions
Extend paranoid_confirm:trap to also ask for confirmation when
attempting to enter a gas cloud region (scroll of stinking cloud,
breath from green dragons or iron golems, steam clouds from boiling
water, vapor left by fog cloud movement, no doubt several others).

Like with traps, can be overridden for a given move by using the
'm' prefix.  Unlike traps, doesn't try to guess whether moving into
a region will be harmless.

Doesn't affect movement into cloud terrain (Plane of Air).

Update the Guidebook to describe the revised behavior of
paranoid_confirm:trap and to mention how #terrain deals with regions.

'any_visible_region()' got mixed in with this but isn't used yet.
Affects extern.h and region.c.
2024-08-11 14:59:57 -07:00
nhkeni
37ad527512 make git ignore checksums temp file 2024-08-10 21:18:34 -04:00
PatR
3ed2110757 monsters in regions vs #terrain
While trying to track down a display problem with regions
    [when a monster is shown over a region because the hero is
    adjacent, it doesn't revert to the region's cloud glyph when
    hero moves farther away; that's not resolved yet],
I discovered a different display problem for the same thing.  If
you pick a #terrain choice that keeps traps it is supposed to show
region spots too, but that didn't work when there was a monster at
the same spot.  It removed the monster but showed background there.
2024-08-10 16:24:51 -07:00
nhkeni
3436fbc87e Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-08-10 16:26:00 -04:00
nhkeni
3f2d46823a add nhlua target (for internal use) 2024-08-10 16:25:35 -04:00
PatR
9e4237f6f7 couple of weapon.c bits
Some trivial stuff I've had sitting around for a while.
2024-08-10 12:38:56 -07:00
nhmall
2ed95119f1 update tested versions of Visual Studio 2024-08-02 2024-08-02 13:24:20 -04:00
nhmall
35dfcb6810 NetHack Daily Cron Output (1 commits) 2024-08-01 09:57:18 -04:00
PatR
e550436755 shapechanger crash fix
A recent change was setting mon->data prior to canspotmon(mon) but
that triggered a crash if the temporary mon->data was Null.  All the
testing was done with vampshifers and this affects non-vampshifers.

Push even more shapechange messaging into newcham() by not trying to
determine whether requesting a message from it will oblige.
2024-07-30 11:52:34 -07:00
PatR
e911c71320 Guidebook: more map symbols 2024-07-29 23:58:55 -07:00
nhkeni
90cfeccdfd Merge branch 'NetHack-3.7' into keni-fetchlua 2024-07-29 17:07:17 -04:00
nhmall
4353ee49d8 sed substitution went too far (wasm cross-compile)
Also, link with hacklib
2024-07-28 12:27:02 -04:00
nhkeni
93ece2c9b4 update fetch-lua-TARGET targets 2024-07-27 18:24:41 -04:00
PatR
2d68ee8f9f fix #K4210 - vampshifter fog clouds
Messaging for vampires changing into fog clouds was inconsistent
in 3.6.x but already fixed in to-be-3.7.

However, maintaining an extra set of shape change messages (one
in newcham(), the other in vamp_shift() which turns out to only be
used when a vampshifter turns into a fog cloud in order to pass
under a closed door) was a nuisance.  Redo vamp_shift() to use
newcham() feedback.  Update that feedback to be accessibility-aware
and also to use "Your <mon>" instead of "The <mon>" when appropriate.

While in there, remove a couple of trailing spaces and eliminate
use of one dynamically constructed format string that necessitated
warning manipulation.
2024-07-27 14:49:17 -07:00
nhkeni
190aeb921b fetch-lua bits
make it clearer how to change the fetch try order
avoid odd output if more than one lua .gz file exists
make it clearer if we don't have a checksum for a fetched file
2024-07-26 21:19:41 -04:00
nhkeni
e3cabd95ee Merge branch 'NetHack-3.7' into keni-fetchlua 2024-07-26 20:20:34 -04:00
PatR
5adabc07a3 missing comment: YMonnam() variant of x_monnam()
YMonnam() was added three weeks ago but the comment preceding
x_monnam() didn't get updated to list it.
2024-07-26 14:53:33 -07:00
nhkeni
c1d18e03ea add checksum for lua 5.4.7 2024-07-26 15:59:16 -04:00
nhkeni
3913cebdb4 make "make fetch-lua" handle multiple lua versions 2024-07-26 14:47:16 -04:00
PatR
d963c6dd6f github issue #1263 - lich attacks
Issue reported by loggersviii:  monsters killed by liches can
produce corpses which auto-revive as zombies, but liches aren't
able to harm zombies and get stuck in an endless slap fight when
those revive.

Liches have a touch attack for cold damage and they have a spell
casting attack.  They don't use their spell attack in monster vs
monster combat, so cold resistant foes don't receive any damage.
Prevent them from becoming harmless by changing the cold damage to
physical damage if the target resists cold.

Fixes #1263
2024-07-24 11:01:23 -07:00
nhmall
faca234055 follow-up for dig_check changes
Use the is_hole() macro to cover off holes and trapdoors.
2024-07-23 16:22:30 -04:00
PatR
b08fb9fb93 github issue #1262 - #terrain vs gas regions
Issue reported by elunna:  none of the display choices for #terrain
offered a way to show the terrain beneath temporary gas/cloud
regions (except "full map" in wizard mode or explore mode).  That
prevented the command from being used to find stairs and portals
which had been mapped before becoming covered up.

Adding extra menu choices to deal with visible regions would result
in #terrain becoming a mess.  Instead, treat regions as if they were
traps.  Picking a choice that includes traps will show region spots
which are in view as cloud or poison cloud, picking one that excludes
traps will show the underlying terrain.  Region spots which aren't
within view are handled the same as before:  whatever the hero
remembers at their location gets displayed.

The default menu choice excludes traps so will display stairs that are
covered by gas cloud regions, but not portals, same as when no regions
are present.  When showing traps and one is covered by a gas cloud,
the trap will be shown rather than the gas cloud, making it possible
to see known portals.

At the moment the new "#terrain handles regions like traps" feature
hasn't been documented anywhere.  That might get rectified someday.

I'm not sure whether trap detection ought to also detect regions now.
This doesn't attempt to tackle that and I think that I'll pretend
that the idea never occurred to me.

'parnoid_confirm:traps' definitely ought to prompt for confirmation
when entering a visible harmful region.  This doesn't add that.

Bonus fix:  it's possible for a visible region to cover up a not yet
explored location.  Searching next to such a spot wasn't changing the
spot to be marked as explored (unless hero was blind).  Now it will.

Fixes #1262
2024-07-23 10:40:28 -07:00
nhmall
082671ab0d follow-up for digcheck_fail_message() 2024-07-23 10:51:42 -04:00
nhmall
906813f0b2 fixes update
Closes #1245

Previous commit had a typo of 1254 in the reference
2024-07-23 01:11:04 -04:00
nhmall
d5785f287e GitHub issue #1254
> If there's a trap on a no-dig level, the floor beneath it will always be "too hard to dig into", making it impossible to remove the trap.
>
> As you can still dig pits in these levels (just not holes), the floor under the trap itself resisting to become a pit seems inconsistent.
>
> Steps to reproduce:
>
> Go to no-dig level like Mine's End
> Make a trap
> Dig a pit next to it -> works
> Dig on the trap -> does not work

Return more information about the dig_check() results to caller (was
just a boolean).

Move the messaging that was in dig_check() into a separate
digcheck_fail_message() function that uses the expanded return
information.

Resolves #1254

.
2024-07-23 01:06:24 -04:00
PatR
dfa9d9df3c untested Guidebook.tex fix
A recent change accidentally put a dash where a hyphen (default
value for S_golem) is intended.  I'm not sure whether verbatim is
necessary here, but it ought to work.
2024-07-19 15:34:38 -07:00
PatR
75561da3be zillionth comment typo fix
Plus a bit of reformatting where extending "static" to "staticfn"
on the first segment of a would-have-wrapped line made the other
segment(s) no longer line up.
2024-07-17 13:33:22 -07:00
PatR
5f36d47110 Guidebook.mn comment
"\(ah" transposed the letters; should have been "\(ha", matching
the actual usage on the same line.  Also, the reference to
"circumflex accent" wasn't appropriate since that's the small
caret you get with "^" or "\^".
2024-07-17 07:37:19 -07:00
nhmall
a7240f8689 update tested versions of Visual Studio 2024-07-17 2024-07-17 10:02:25 -04:00
nhmall
e44bfe4eb2 fix sentence structure in Guidebook.tex
Commit 59fbffd1 neglected to include the closing ')'
2024-07-17 08:13:11 -04:00
nhmall
afe0d03678 fix Guidebook.tex 2024-07-17 08:00:46 -04:00
PatR
474edb46f8 more Guidebook map characters
Previous update left out a couple of classes of monsters that are
represented by punctuation.  <space> for ghosts is deliberately not
included.
2024-07-16 19:48:10 -07:00
PatR
59fbffd170 Guidebook update: "Map (rest of screen)"
The description of the default map display was out of date:

Sinks aren't conditional anymore, and were changed from '#' to '{'.
Statues were still listed as '`' but aren't displayed as that.
Room and corridor engravings weren't mentioned.
Wall of water and wall of lava weren't mentioned.
Drawbridge portcullis ('#' when closed) and span ('.' when open)
weren't mentioned.

This splits introductory "- and |" into two entries.

I've forced CR font (similar to TeX's tt font) for the initial
character of all the entries.

The formatting of letters for monsters left something to be desired
so I've tried to redo it.  The 'roff edition seems ok (as least when
there's no page break in the middle of it) but I'm not sure how the
LaTeX version will fare.  I didn't try to include the trailing "and"
on the first two lines the way the 'roff version does since I wasn't
sure how to accomplish that.
2024-07-16 14:49:34 -07:00
PatR
ce206b813f a couple more monst food bits
Fix misleading indentation that the polyfood() macro inherited from
the misformated polyfodder() macro.

Fix a case where a non-pet monster would avoid eating a cockatrice
corpse but would eat Medusa's corpse.
2024-07-16 00:01:43 -07:00
PatR
64f6ae6d19 github pull request #1184 - polyfood()
Pull request from entrez:  rename polyfodder() to polyfood() and
use it instead of is_shapeshifter() when deciding whether a pet will
avoid eating a corpse or an egg because of the risk of polymorphing.

The PR was in response to issue #1183 by Umbire:  pets that avoid
eating shapechanger corpses didn't avoid genetic engineer corpses.

polyfodder()/polyfood() includes genetic engineer corpses because
they have an attack for AD_POLY damage.  But pets weren't caring
because is_shapeshifter() doesn't include that.

There's no particular need to rename polyfodder() to polyfood() but
I've used the PR as-is instead of reversing the name change.

Closes #1184
Closes #1183
2024-07-15 23:45:53 -07:00
Michael Meyer
b363b702d7 Make pets unwilling to eat all polyfood() corpses
The previous is_shapeshifter() test meant that pets were still perfectly
willing to eat genetic engineer corpses and be polymorphed.  Use
polyfood() instead.

Fixes #1183.
2024-07-15 23:42:29 -07:00
Michael Meyer
d09a5beab3 Rename polyfodder() to polyfood()
'Polyfodder' is already a term frequently used by players to describe
items which are useful to hang on to specifically to zap polymorph at
(for example, extra unicorn horns, which can be turned into magic
markers).  Using it as the name of a macro which tests whether a food
item will polymorph the creature consuming it is somewhat confusing, and
I think 'polyfood' is a lot clearer.
2024-07-15 23:42:29 -07:00
PatR
61affaed37 fix #K4202 - O/mO for prompted values treated \
player's input as a comma-separated list of option:value settings

Several compound values that aren't amenable to menus prompt for a
line of input and pass it to parseoptions() as if it came from the
run-time configuration file.  That shouldn't be treating commas as
option separators.

The fix is trival, at least for handling the text properly without
introducing new warnings to complain about rejections.  Some options
notice an unwanted comma and complain, others don't notice and the
extra text gets ignored.
2024-07-15 13:13:01 -07:00
PatR
1dc9f7324a fix #K4201 - bhitpos is clobbered by lookat()
The look-at-screen code was setting bhitpos before calling
look_at_monster() but that hasn't been needed for around 25 years.
Fix is trivial.

However, having such a low level routine as show_glyph() call
do_screen_description() seems like a recipe for trouble.
2024-07-14 11:24:49 -07:00
PatR
e3b2fd1818 pull request #1260 - move throwit() cleanup to \
separate function

Pull request from argrath:  remove most goto's from throwit().

Closes #1260
2024-07-13 19:39:48 -07:00
SHIRAKATA Kentaro
82e6eacfbb split returning from throwit() into separate function 2024-07-13 19:38:23 -07:00