Commit Graph

15575 Commits

Author SHA1 Message Date
nhmall
e4c3d87a4c fix a small memory allocation that was never freed 2023-09-23 10:16:07 -04:00
nhmall
384d726b9c adjust some fmod integration bits 2023-09-23 10:01:37 -04:00
PatR
a0d96de89c PR #1096 - more quest leader interactions
Pull request from entrez:  implement a couple of features that were
mentioned in new comments in the 'fixes entry' commit when PR #1093
was adopted.
1) throwing/kicking an unIDed fake amulet of Yendor at the quest
   leader will identify it rather than be considered an attack;
2) throwing/kicking the Bell of Opening, Candelabrum of Invocation,
   or Book of the Dead at the leader will ID the item as in #1093,
   but if the invocation has already been performed, the leader will
   keep the item rather than return it.

Closes #1096
2023-09-22 21:40:56 -07:00
Michael Meyer
602af21ca3 Have leader keep already-used invocation items
The other suggestion from Pat about potential extensions to bda0b3b.  I
think it's interesting from a story perspective, and hopefully nobody
will run into this by mistake when they hoped to use the Candelabra as a
light source later!  The specific language used by the leader could be
changed if someone has a better idea (as could the code itself, for that
matter).
2023-09-22 21:40:12 -07:00
Michael Meyer
dedf1ade18 Have quest leader ID thrown unknown fake Amulet
If the hero throws an unidentified fake Amulet of Yendor at the quest
leader, the leader will identify it and toss it back, similar to the
behavior for the real Amulet.

This was one of Pat's suggestions for continuing in the same key as
bda0b3b; I think this makes a lot of sense, especially now that people
may be encouraged to throw things called "Amulet of Yendor" at the quest
leader.  Arguable about whether a _known_ fake Amulet should still anger
the leader and quest helpers; as I have it in this commit, it will, but
I'm somewhat ambivalent about what makes more sense.
2023-09-22 21:40:12 -07:00
PatR
2b47ef9670 some wintty.c cleanup
Mostly undefining macros when they're no longer needed.
2023-09-22 21:00:07 -07:00
PatR
9eb938fe06 tty status_sanity_check()
While experimenting with a potential status change I managed to get
a corrupted message in paniclog:
|status_sanity_check failed on tty_status[NOW][Jan].
where "Jan" was intended to be a "BL_" name.

Make tty's status_sanity_check() be a bit more robust.  This fix
shouldn't have any effect on the stable code.
2023-09-22 17:58:41 -07:00
nhmall
14faa682c4 improve selectsave handling for Windows
If there were outdated savefiles encountered during
startup, each individual one was getting a wait_synch
that required a <return> even though a message window
wasn't being used at that point.

Allow suppression of the individual per-file wait_synch()
calls on Windows, so that a single one can be done once
the selectsave processing is overwith.

This was a little messy because an indicator had to flow
down through validate(), uptodate(), etc.

There shouldn't be any change in how things behave on
any non-Windows platforms.
2023-09-22 15:14:53 -04:00
PatR
c868feb383 impossible "ceiling hider hiding without ceiling"
Reported by a hardfought user, a ceiling_hider monster hid on the
Astral level, triggering a sanity check warning that gets repeated
each move until the hider comes out of hiding.  Normally sanity_check
can only be set in wizard mode, but hardfought must force it on for
to-be-3.7.

I was able to reproduce it before this fix and unable to do so
afterward, but there is a random factor involved hence no guarantees.
I think that lack of ceiling for Astral is recent, but this could
have happened on other levels which lack a ceiling.  I didn't try to
figure out whether it might happen with 3.6.x, just put the fixes
entry in the "exposed by git" (found in code not yet released, that
is) section.
2023-09-21 14:17:01 -07:00
nhmall
0c2004c0d1 visual studio build with curses wide support 2023-09-21 16:50:58 -04:00
nhmall
61cc98af3c quiet a couple of Windows warnings 2023-09-21 16:31:34 -04:00
PatR
b6c942d062 inappropriate 'object 0' in makemon() 2023-09-21 13:23:15 -07:00
nhmall
49c7a136c8 fix a symbols file issue encountered under Windows 2023-09-21 15:12:34 -04:00
PatR
14c7b2015d PR #1093 - quest leader vs thrown invocation items
Pull request from entrez:  if hero throws (or kicks) an invocation
item or the Amulet at the quest leader, identify it and give it back
instead of treating the throw (or kicked item) as an attack.

In addition to the fixes entry I've made several tweaks to related
code, mostly to refer to the leader as "Someone" rather than "It" if
unseen.

Closes #1093
2023-09-20 12:10:57 -07:00
Michael Meyer
bda0b3b807 Allow quest leader to catch and return unique item
It's been possible for a while to throw your quest artifact to your
quest leader, completing the quest (he will then throw the object back
to you).  The quest leader will also react to being brought the Amulet
of Yendor (i.e. having it in inventory when you approach or #chat), but
tossing it over like the quest artifact was treated as a hostile act and
would cause the quest leader and guardians to become hostile and attack
the hero.

Make throwing the Amulet of Yendor at the quest leader work like
throwing the quest artifact, and treat the invocation items similarly
just in case people try throwing those (maybe because they are lost,
unsure what to do, and have already seen their quest leader catch and
react to the quest artifact -- regardless of the reason, throwing over
the Book of the Dead is almost certainly not intended to be an attack).
Doing so for invocation items will ID them but not do much more than
that.  The Amulet of Yendor triggers the existing quest pager message.
2023-09-20 11:00:32 -07:00
PatR
e2203ef9a1 stone-to-flesh of wielded rocks
Wielding one or more rocks while other rocks were quivered and casting
stone-to-flesh at self wasn't subject to the "null obj after quiver
merge" panic but it did result in a combined stack of meatballs that
was neither wielded nor quivered.  Keep inventory items that turn into
meat and are wielded/alt-wep/quivered separate and still wielded/&c.
2023-09-19 14:43:17 -07:00
PatR
dd05f5183e addinv_nomerge()
Replace several instances of
 obj->nomerge = 1;
 addinv(obj);
 obj->nomerge = 0;
with new
 addinv_nomerge(obj);
and add various related comments.
2023-09-19 14:40:33 -07:00
PatR
3fdcd5f4e0 fix #K4006 - 'null obj after quiver merge' panic
Using apply to unlight a lit potion of oil makes it unlit, removes
it from inventory, and then re-adds it to try to force it to merge
with other potions of oil.  If it was wielded and the other potions
were quivered, the game would panic.  When merging, they get forced
into the weapon slot in preference to the quiver slot.

Unwearing it before freeinv+addinv would solve this but also leave
the hero with nothing wielded, even if it didn't merge with another
stack.  Instead, don't try to merge if the potion being unlit happens
to be worn.

3.6.x was subject to this too and the fix is small+isolated but the
situation is so uncommon that I haven't bothered backporting it.

Applying a lump of royal jelly and then not picking anything to rub
it on had a similar problem.  It also panicked if the applied lump
was wielded and other lumps were quivered.  The fix is different
because the stack it gets split from during apply is known.  This one
doesn't impact 3.6.x; applying jelly to eggs wasn't implemented yet.
2023-09-19 07:16:00 -07:00
Pasi Kallinen
44a649b0b4 Wand of probing reveals map locations in ray path 2023-09-18 19:20:01 +03:00
PatR
4f2c913925 another paranoid_confirm:Autoall revision
For Autoselect-all confirmation, accept yes|n|q (or yes|no|quit)
rather than just yes|n (or yes|no).  An extra query routine is needed
to support it, but the existing paranoid_query() can just call the
new paranoid_ynq() with an extra argument, keeping things painless.

For menustyle:full plus paranoid_confirmation:Autoall, if you include
'A' in the class filtering choices then you're prompted for whether
you really meant it.  (Same behavior as in the past few weeks.)  Yes
auto-selects items matching all other chosen classes, or from all
classes if 'A' is the only choice.  (Again, same behavior.)  n|no
moves on to menu:full's second menu.  If anything else was chosen
along with 'A', that's what the second menu will offer.  (Same as
past few weeks but revised from initial implementation.)  If 'A' was
the only choice, it will now use 'a' and offer a choice of everything
in the second menu.  (That's a change; it used to cancel if declining
to honor 'A' and nothing else was present.)  Now <return> without
answering or q|quit or ESC skips the second menu, whether or not the
rejected 'A' was the only choice made in the first menu.  (New.)

Other paranoid confirmations still just accept yes and n|no responses,
treating ESC as n|no.
2023-09-18 00:17:33 -07:00
PatR
11bfb09daa fix #4005 - paranoid_confirm:Autoall
When paranoid confirmation for menustyle:full's "Autoselect all" is
enabled, it is handling yes vs no backwards.

The initial implementation had it right, then a negation got dropped
when it was expanded to support yes|no via paranoid_confirm:Confirm.

ESC is being treated as 'n' rather than as cancel.  Fixing that will
take some more work.  This just adds the missing negation to make 'y'
and 'n' behave properly.
2023-09-17 16:43:26 -07:00
PatR
56036ed5c7 status bit: trucated gold count
Gold on status line can be truncated, so testing the display value
might miss up/down/changed highlights.  I don't think that it actually
matters since a hero cannot pick up enough gold to reach the 999999
truncation threshold.

Normal amounts still seem to highlight correctly after this.
2023-09-16 17:48:51 -07:00
nhmall
ca7ca6393a add a reminder to comment 2023-09-16 20:16:51 -04:00
nhmall
b25512f7a1 fix broken build as of 2a5f03a3
gcc-9 -g -I../include -DNOTPARMDECL -Wall -Wextra -Wno-missing-field-initializers -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -pedantic -Wmissing-declarations -Wformat-nonliteral -Wunreachable-code -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes -Wformat-overflow -Wmissing-parameter-type -fPIC -DCURSES_GRAPHICS -D_XOPEN_SOURCE_EXTENDED=1 -DX11_GRAPHICS -DQT_GRAPHICS -DSND_LIB_QTSOUND -DUSER_SOUNDS -DSND_SOUNDEFFECTS_AUTOMAP -DDLB -DHACKDIR=\"/home/vsts/nh/install/games/lib/nethackdir\" -DDEFAULT_WINDOW_SYS=\"tty\" -DSYSCF -DSYSCF_FILE=\"/home/vsts/nh/install/games/lib/nethackdir/sysconf\" -DSECURE -DTIMED_DELAY -DDUMPLOG -DCONFIG_ERROR_SECURE=FALSE -DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" -DCURSES_UNICODE -DUSE_XPM  -c -o decl.o decl.c
decl.c:223:15: error: incompatible types when initializing type ‘enum statusfields’ using type ‘void *’
  223 |             , UNDEFINED_PTR, UNDEFINED_PTR
      |               ^~~~~~~~~~~~~
decl.c:219:44: warning: missing braces around initializer [-Wmissing-braces]
  219 | const struct instance_globals_b g_init_b = {
      |                                            ^
decl.c:219:44: warning: missing braces around initializer [-Wmissing-braces]
decl.c:219:44: warning: missing braces around initializer [-Wmissing-braces]
decl.c:219:44: warning: missing braces around initializer [-Wmissing-braces]
decl.c:219:44: warning: missing braces around initializer [-Wmissing-braces]
decl.c:219:44: warning: missing braces around initializer [-Wmissing-braces]
make[1]: *** [Makefile:1837: decl.o] Error 1
2023-09-16 20:02:11 -04:00
PatR
2a5f03a3b4 status hilites: Hp and Pw percentages
The hitpoints and power/energy status values (and corresponding
maxima) shown on the screen are capped at 9999 to control status line
width.  The actual values can be bigger than that.  Highlights based
on percentages were doing their calculations on the potentially
truncated values rather than on the actual ones.

Add another field to the blstat[] structure, populate it for BL_HP,
BL_HPMAX, BL_ENE, and BL_EXEMAX and switch to it for their percentage
calculations.

Doesn't seem to break highlighting of 'normal' range values but hasn't
been tested for extreme ones.
2023-09-16 12:42:26 -07:00
PatR
1958daef4c update code_style.txt
Primarily to describe comments.

Also strips a couple of trailing spaces.
2023-09-16 11:59:55 -07:00
PatR
e451966266 botl.c cleanup
Mainly miscellaneous source formatting, plus some expanded comments
and #undef of macros when done with them.
2023-09-16 10:15:05 -07:00
nhw_cron
bb115466e8 This is cron-daily v1-May-8-2022. 000files updated: Files 2023-09-16 12:45:41 -04:00
nhmall
c1e7240b03 fixes entry for sound/fmod file addition
Closes #962
2023-09-16 11:47:37 -04:00
nhmall
2e975cffed move fmod copyright comment to line 2 2023-09-16 11:40:12 -04:00
MrEveryDay98
6164357ed9 Added FMOD library support (needs work)
removed extra initializer
fmod.c int to int32_t
fmod support now functional
Added snd_lib check in windmain
fmod_ambience func for future implementation
updated some funcs
(CAN'T BUILD) -- static'd vars
2023-09-16 11:37:56 -04:00
nhmall
499a3654e5 typo fix in Makefile.nmake for 3rd party soundlib 2023-09-16 09:03:42 -04:00
PatR
450efa0dc4 status hilites fix
The options menu for status hilites wouldn't work as intended if the
entries in the initblstats[] array were changed to not be in BL_xyz
order.  (No effect on current behavior since they are in that order.)
2023-09-15 12:35:42 -07:00
nhmall
8845ead907 update tested versions of Visual Studio 2023-09-14 2023-09-14 10:18:07 -04:00
nhmall
c1f4afbd28 Guidebook.txt update 2023-09-12 17:54:02 -04:00
nhmall
6018d3e4d4 build fix 2023-09-12 08:23:34 -04:00
PatR
6636db94e7 corridor engravings in black and white
The default engraving-in-corridor character is the same as the default
corridor symbol (and also default lit corridor one), distinguished by
color.  Show it differently (in inverse vidoe, like lava vs water and
sink vs fountain) if color is Off.

It might be better to change the engraving-in-room symbol to be the
same as the room one so that they'll be more consistent with corridors;
color is probably sufficient without resorting to back-tick.  But this
update hasn't done that.
2023-09-12 01:34:47 -07:00
PatR
9016d65df4 another wall of lava fix
Use inverse video for wall of lava if color is disabled, same as is
done for ordinary lava.  The two won't have any visible distinction
from each other but at least wall of lava won't look like water.
2023-09-10 14:25:41 -07:00
Pasi Kallinen
ef296e7ad9 Change wall of water color to bright blue
Differentiates it from a pool of water, with the same logic as
wall of lava is different from pool of lava.
2023-09-10 20:48:41 +03:00
PatR
0a7cdeae3c viewing geno'd monsters at "genocide what?" prompt
At either of the genocide prompts,
|What type of monster do you want to genocide?
or
|What class of monsters do you want to genocide?
answering "?<return>" will show the list of monster types that have
already been genocided, then re-prompt.
2023-09-09 16:56:24 -07:00
nhkeni
9472c0b797 Guidebook formatting typo 2023-09-09 15:10:49 -04:00
PatR
1a64ee1c28 github PR #259 - paranoid_confirmation:trap
Fairly old pull request from copperwater:  add new paranoid_confirm
setting 'trap'.

The old commit suffered from bit rot and merging needed too much
fixing up despite there not being many bands of change in the commit's
diffs.  I ultimately redid it from scratch, although the two biggest
chunks of code started with copy+paste of the pull request's commit.

It operates like paranoid:pray.  Setting paranoid:trap adds a new
"Really step into <trap>?" y/n prompt when attempting to move
into/onto a known trap, even if an object covers it on the map.
Setting both 'paranoid:Confirm trap' turns that into a yes/no prompt.
(Adding 'Confirm' affects other paranoid confirmations; in addition
to requiring yes<return> rather than just y to accept, it also forces
no<return> to reject.)

However, moving into a known trap that is considered to be harmless
behaves as if no trap was present.  Some of the trap classification
might be out of date; several types of traps have undergone changes
since implementation of the original pull request, notably anti-magic
field.  When the hero is hallucinating, all known traps are considered
harmful since the map no longer reliably describes them.

Preceding a movement command with the 'm' prefix also behaves as if
no trap was present, bypassing confirmation for that move, similar to
how paranoid:swim currently behaves.  Being stunned or confused also
behaves as if no trap was present, taking priority over hallucination.

This updates the documentation.

Supersedes #259
Closes #259
2023-09-08 15:55:31 -07:00
nhkeni
33d85bfe08 CRASHREPORT cleanup
make deprecation warning suppression unconditional
formatting/whitespace
2023-09-07 20:55:07 -04:00
nhkeni
b75bc87662 Improve run fetch-lua required message - it has to be run in top. 2023-09-07 12:17:53 -04:00
PatR
48516857f9 pull request #1092 - monster blindness
Pull request from entrez:  a monster can become permanently blind via
camera flash but being hit by vapors from thrown potion of blindness
would set a blindness countdown timer and blindness would be cured
when that expired.

Closes #1092
2023-09-07 06:01:21 -07:00
Michael Meyer
9d7378ec57 Fix: undoing monsters' permablindness by accident
Monsters can become permanently blind (in very narrow circumstances -- I
think limited only to a very short-range camera flash), in which case
they have both mon->mblinded and mon->mcansee set to 0.  Such
permanently blinded monsters can counterintuitively regain their sight
by being blinded a second time from a different source: for example, by
being hit with a cream pie.  That second blinding will increase
mon->mblinded (which functions as a blindness timeout) by some amount,
and when it runs out the monster will regain its sight.  Try to make
sure that doesn't happen by skipping any blinding attacks if the monster
has already been permanently blinded.
2023-09-07 05:59:50 -07:00
PatR
0178886990 fixes entry for PR #1091 - hero zombie
Pull request from entrez:  hero of race other than human that got
killed by a zombie would 'rise from the grave' as a human zombie for
bones level.
2023-09-07 05:42:33 -07:00
Michael Meyer
1dab134fce Fix: rising from the grave as a zombie
When the hero is killed by a zombie, she is supposed to arise from the
grave as a zombie of a type matching her race.  Commit 580c5a6 broke
this inadvertently -- done_in_by was passing gy.youmonst.data to
zombie_form() and relying on the old behavior where it attempted to
include the hero's race in is_elf, is_orc, etc if the permonst matched
the hero's role.  Because this no longer works, zombie_form was only
returning PM_HUMAN_ZOMBIE when passed the role permonst of an
unpolymorphed hero.  Use gu.urace.zombienum instead.  This would have to
be a little more sophisticated (falling back to zombie_form() if Upolyd)
if a polymorphed hero with unchanging could die via done_in_by but
that's not currently possible as far as I can tell.
2023-09-07 05:35:51 -07:00
nhkeni
ee2510eb2f blind attempt to fix Windows build 2023-09-06 13:55:06 -04:00
nhkeni
385d860bef Merge branch 'keni-crashweb3' into NetHack-3.7 2023-09-06 12:39:17 -04:00