Commit Graph

15550 Commits

Author SHA1 Message Date
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
nhkeni
8c095b009a Add CRASHREPORT, show contact form on panic/impossible
When calling panic() or impossible(), create the option
of opening a browser window with most of the fields
already populated.  Code for MacOS and linux is included;
other ports are affected by argument change to early_init
which are done but not tested.

To enable, define CRASHREPORT in config.h and set
CRASHREPORTURL in sysconf to (for the moment at least)
http[s]://www.nethack.org/common/contactcr.html

Adds --grep-defined option to makedefs for Makefiles.

Adds "bid" (binary identifier), an MD4 of the main nethack
binary.  This is ONLY for helping (in the future) contact.html
to set the "NetHack from" field automatically for our own
binaries.  This can be faked, but the user can lie so nothing
lost.  There's nothing magic about MD4; other ports can use
anything that prodcues a long apparently random string we can
match against.

- new option --bidshow for us to get the MD4 of a
  released binary so I can add it to the website.
  Only available in wizard mode and not in nethack.6.
- typo macos -> macosx in hints file

No support for packaging builds as I'm not sure what that
would look like.

Adds a javascript helper for MacOS.
Adds a lua helper for linux (and builds and installs
 nhlua).
2023-09-06 12:27:13 -04:00
nhkeni
87434a49ab Merge branch 'keni-luacksum2' into NetHack-3.7 2023-09-06 12:20:02 -04:00
nhkeni
1a2836577b check the checksum for Lua in "make fetch-lua"
Works for MacOS and linux.
2023-09-06 12:15:54 -04:00
Pasi Kallinen
50084750c4 Ring of hunger prevents choking on food
... but you will not be prompted to stop eating,
and you will vomit enough to be hungry afterwards.
2023-09-03 18:27:00 +03:00
PatR
67513c96bb options help
Update the 'optmenu' data file to describe the simple options menu
(new paragraph containing just a one sentence) as well as the full
options menu (still several paragraphs).  Visible by choosing '?' in
the full options menu or the 'how to set options' choice in the main
help menu.

Add a line to the simple options menu about how to get the full
options menu.  Only shown if you type '?' to toggle on "show help";
taken away again if you use '?' to toggle back to "hide help".
2023-08-31 14:58:51 -07:00
PatR
bc93ee5d04 pet petrified by eating Medusa's corpse
From a reddit thread:  a tame mind flayer ate Medusa's corpse and was
turned to stone.  Pets won't eat cockatrice corpses unless stoning
resistant but would eat Medusa's corpse if merely poison resistant.
Mind flayers aren't normally poison resistant but could be if wearing
green dragon scales/mail.

Augment the touch_petrifies() test when classifying food for pets.
2023-08-30 13:38:08 -07:00
nhkeni
9136c75425 nhgitset.pl tid
Older versions of git, when cloning a repo and
the expected source templates directory does not
exist, does not create .git/hooks, which causes
nhgitset.pl to fail.  So do it here.
2023-08-29 21:04:32 -04:00
PatR
6bb9b8a955 missing dependency in sys/unix/Makefile.utl
The dependencies in util/Makefile duplicate those in src/Makefile for
objects.o and monst.o but the latter got changed last year and the
change wasn't replicated.
2023-08-29 11:38:06 -07:00
Michael Meyer
8fa53d6ac5 Adjust seenres when observed attack succeeds
If a monster sees an elemental attack succeed from some other creature
or environmental danger, it will be willing to try those attacks again.
2023-08-29 12:05:48 +03:00
PatR
82d83dc83d \#wizkill vs dmonsfree
When testing the high priest livelog/#chronicle feedback I used #wizkill
on the Sanctum level to kill Moloch's high priestess and immediately
level teleported to the Astral level to target the other high priests.
I got impossible "dmonsfree: 0 removed doesn't match 1 pending" there.
2023-08-29 00:45:11 -07:00
PatR
05a99064b6 fix #K3997 - livelog feedback for high priests
If you killed a second high priest (either two on Astral or first in
the Sanctum and another on Astral) the livelog/#chronicle message
would report "killed high priest of Foo (2nd time)" even though the
first was the high priest of Bar, or even just "killed high priest
(2nd time)" if second kill happened when not adjacent.

High priests pass the 'unique monster' test (even though they aren't
actually unique--there will be four of them) so get logged for killing
such.  Always report "killed high priest of Foo" and only do so if the
specific high priest[ess] monster hasn't been revived and re-killed.

Logging deaths of unique monsters normally reports the 1st, 2nd, 3rd,
5th, 10th, and various later instances.  If you were to kill Moloch's
high priest and all three on Astral, the last one wouldn't be logged
because 4th instance gets skipped.  This forces each one to be treated
as the 1st (provided that the mrevived flag is clear), so for logging
purposes it will now behave as if there are 4 distinct high priests.
2023-08-29 00:02:19 -07:00
nhkeni
06a3bd0424 mac: don't fail "make install" if SHELLDIR already exists 2023-08-28 19:18:36 -04:00
nhkeni
068a460d05 fix various typos in NHDT lines 2023-08-28 16:17:41 -04:00
Michael Meyer
38cda5ad52 Adjust seenres on visible gear removal
If a monster sees you remove some piece of gear that grants a
resistance, it will remove that resistance from its list of remembered
resistances and be willing to try attacking you with that adtyp again.
This avoids the situation where you put on a ring of cold, get hit with
one cold attack, and then can remove it because all the monsters nearby
will permanently remember you as being cold resistant (but even after
this change a wily hero could still step into a niche and do it without
any monsters seeing, so trick them into thinking she's still cold
resistant...).  The hero could still be resistant if there were multiple
sources to begin with, of course, but the monsters will test it and
learn that again if necessary.

It's a little weird that the monsters can recognize the intrinsic
granted by the item being removed, but they display knowledge of
unidentified (by the hero) objects in many other circumstances too, so I
hope it's forgivable in the pursuit of having them act more cleverly
about resuming previously-resisted attacks like this.  Another approach
that avoids the gear recognition, blanking seenres on any gear change,
can result in odd situations like orcs treating their own cloaks as
potential sources of many different resistances, which also seems silly.
2023-08-26 14:13:03 +03:00
PatR
99683d94b4 fixes entry for PR #1087 - Magicbane cancellation
Pull request from entrez:  if Magicbane's cancellation effect hit a
shapeshifter and caused it to revert to base form, further messages
for the rest of that attack referred to it by the cached name of its
shifted shape.

Fixes #1087
2023-08-25 12:14:02 -07:00
Michael Meyer
9a5b6e8e77 Fix: name confusion after MB cancels shapeshifter
The cancellation effect of Magicbane can cause shapeshifters to change
to their base forms.  Since the name of the monster being attacked is
cached earlier, the name used for subsequent messages from Mb_hit would
be outdated after this happened.  For example, as encountered in a
recent game: "The magic-absorbing blade cancels the vampire bat! The
vampire bat turns into a vampire lord! The vampire bat is confused."
Insert the new name into hittee[] if cancellation caused the targeted
monster to change form.
2023-08-25 12:03:32 -07:00
PatR
6ad9eef25d update a couple of comments
Fix a couple of typos and rephrase 'livelog_mon_nam()' description.
2023-08-25 11:43:00 -07:00
nhmall
a627e83a81 nested comment warning 2023-08-25 14:02:57 -04:00
Pasi Kallinen
b5a43a60f2 Asmodeus' cold magic attack when hero is resistant
Asmodeus kept using the cold magic attack when hero was cold resistant.
The distance magic attack already considered hero resistances, so
use the same logic for the close-up magic attack.
2023-08-25 10:58:11 +03:00
Pasi Kallinen
e407af4477 Allow defining random-teleport exclusion zones in lua
Adds a new lua command

  des.exclusion({ type = "teleport", region = { x1,y1, x2,y2 } });

which allows defining "exclusion zones" in the level, areas where
random teleports (or falling into the level) will never place the hero.
Does not prevent targeted teleportation into the area.

Breaks saves and bones.
2023-08-24 18:38:39 +03:00
Pasi Kallinen
0794a64b9d Fix lua object added to container error
The reference count of the deleted object was changed,
instead of the object that it was merged into.
2023-08-24 09:22:57 +03:00
PatR
9ee6f29c06 vt_tiledata/vt_sounddata comment bit 2023-08-18 12:09:27 -07:00
PatR
78607a37a5 more obufs - two-handed weapon in "hands"
Pointed out by entrez:  prevent doname() from consuming two obuf[]
buffers when it constructs the plural of "hand" while formatting a
wielded two-handed weapon.

Since only one such item should be able to occur in any list of
objects, it is not likely to be the cause of any message oddities
that might happen when a cached value is in a formatting buffer gets
re-used too soon.  However, not releasing a second buffer right away
prevents an attempt to release the first one from succeeding because
it won't be the last one allocated anymore, so some buffer churn was
happening.
2023-08-16 18:16:11 -07:00
nhmall
f625d2efcf more tabs to spaces 2023-08-16 10:22:10 -04:00
nhmall
d421e2512e tab to spaces 2023-08-16 10:07:01 -04:00