Commit Graph

12308 Commits

Author SHA1 Message Date
Pasi Kallinen
5d3e237ffc Izchak occasionally stocks wands/scrolls/spellbooks of light
This comes from xNetHack by copperwater <aosdict@gmail.com>
2021-09-19 20:52:19 +03:00
Pasi Kallinen
b23ff20c6a Gas clouds expand around terrain rather than being rhomboid
The gas will expand from its chosen center point via breadth-first
search instead of hardcoding a diagonal shape. The search is performed
with a randomized list of directions, and has 50% chance of not spreading
to a space it otherwise would have spread to. This has the effect of fuzzing
the cloud edges in open areas, helping the clouds on, for instance,
the Plane of Fire not be big rhombuses.

Also some other code refactoring related to stinking clouds in read.c

This comes from xNetHack by copperwater <aosdict@gmail.com>
2021-09-19 13:57:47 +03:00
Pasi Kallinen
12800bf84b Walking near buried zombifying corpses wakes them up
Moving without stealth will reduce the zombifying timeout
of buried corpses under and around hero's location.
2021-09-18 21:24:52 +03:00
Pasi Kallinen
2dce29e965 Move Pw regen into separate routine 2021-09-18 20:23:20 +03:00
nhw_cron
74a0ede6d9 This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2021-09-18 11:02:33 -04:00
nhmall
9b57784348 rename explosion symbols
Use a slightly more meaningful name for each one rather than
a sequential numerical name.

S_explode1 to S_expl_tl
S_explode2 to S_expl_tc
S_explode3 to S_expl_tr
S_explode4 to S_expl_ml
S_explode5 to S_expl_mc
S_explode6 to S_expl_mr
S_explode7 to S_expl_bl
S_explode8 to S_expl_bc
S_explode9 to S_expl_br
2021-09-18 10:04:25 -04:00
nhmall
22b2ef8f2b Guidebook.tex update from cron daily 2021-09-18 07:32:25 -04:00
nhmall
b6e882d79d fix error in Guidebook.tex and Guidebook date bump 2021-09-17 22:44:16 -04:00
nhmall
0973743e83 build warning compiling with visual studio 2019 2021-09-17 22:32:06 -04:00
Pasi Kallinen
b30061b5ad Allow dropping just picked up items
When using a menu to drop or put in items into a container,
allow putting in the item (or items) you picked up previously,
by selecting the 'P' entry from the item class menu

Inspired by the itemcat patch by Stanislav Traykov.

Invalidates saves and bones.
2021-09-17 21:00:06 +03:00
PatR
e43ec0cef1 fix odd messages caused by buffer re-use
Reported and diagnosed by entrez:
"The <mon> yanks <two-handed weapon> from your corpses!"

It became unwielded and that triggered a perm_invent update and
such updates reformat entire inventory, so if that contains a dozen
or more items it will use all the obuf[] static buffers as least
once.  In this case, the bullwhip code had plural of "hand" in one
of those buffers and by the time it delivered the message which
used that, the value had been clobbered.

As the diagnosis mentioned, it can be tricky to reproduce since
either &obuf[0] or &obuf[PREFIX] might be used and if the value
being clobbered didn't overlap, the effect wasn't noticeable.

Instead of fixing the bullwhip message, this changes inventory
display so that it should no longer churn through all the buffers.

It also adds a fixes entry for #K3401, which was already fixed for
3.7 but I hadn't been able to reproduce it for 3.6.x (which I now
blame on the PREFIX trickiness).
2021-09-15 20:56:06 -07:00
nhmall
fde51720f4 Windows Makefile.msc updates
Recognize latest version of Visual Studio Community 2017 version 15.9.39
Recognize latest version of Visual Studio Community 2019 version 16.11.3
The removal of the generated $(SRC)\tile.c file moved from
    nmake spotless
to
    nmake clean
2021-09-15 21:45:50 -04:00
nhmall
8ca0ce4b12 Makefile.gcc follow-up
Errors in the CI after dependency update
2021-09-14 23:39:22 -04:00
nhmall
3a5ba5a81a msdos Makefile.gcc dependency update
Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/msdos/Makefile.gcc.
2021-09-14 12:48:42 -04:00
nhmall
db9059f735 Windows Makefile.gcc dependency update
Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/windows/Makefile.gcc.
2021-09-14 12:36:29 -04:00
nhmall
ef1af7c951 Windows Makefile.msc dependency update
Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/windows/Makefile.msc.
2021-09-14 10:25:49 -04:00
PatR
84b4eb9888 Unix 'make depend'
I recently changed a comment in objclass.h and that should have
triggered a full or nearly full rebuild but only resulted in a
couple of files being recompiled.  Instead of trying to figure out
why, I just ran Makefile.src through 'make depend' to force it to
be up to date.

A side-effect is that version.c won't be unnecessarily recompiled
every time nethack gets relinked.  The reason for that (date.h
being regenerated with new data) is handled by date.c now.
2021-09-14 02:06:14 -07:00
nhmall
15ec24a524 windows visual studio project build tweaks 2021-09-13 11:32:59 -04:00
Pasi Kallinen
408aa4b3cb remove sp_lev execute bits 2021-09-12 22:34:19 +03:00
Pasi Kallinen
e3a2dd7f40 Reveal the monster your strike moved
When you hit a small hidden monster (by eg. force-fighting)
that got moved by the strike, the monster stayed hidden, possibly
causing a sanity checking error.

Reveal the monster before hurtling it.
2021-09-12 19:44:39 +03:00
PatR
583fb60835 fix github issue #587 - incompatible save files
Save files from before the 'disambiguate WHACK' patch were not
necessarily compatible with ones after it, leading to potential
restore problems.

Comments in objclass.h (from before the patch) suggested that
inappropriate assumptions were being made about field layout.
This deliberately introduces new incompatibility and increments
EDITLEVEL to caused earlier save and bones files to be thrown
away.

Fixes #587
2021-09-12 05:31:01 -07:00
PatR
d118ac52af fix github issue #589 - gremlin crash
when fleeing hero who was wearing gold dragon scales/mail and not
wielding any weapon.

When a gremlin was made to flee "artifact light", code originally
intended for Sunsword attempted to format 'uwep' as an artifact.  For
gold scales/mail instead of that, it gave a sane but inappropriate
value if wielding something or segfaulted if not wielding anything.

Fixes #589
2021-09-11 03:04:04 -07:00
PatR
dc3f1447c7 fix #K3440/github issue #586 - losing object info
when an unseen monster picks up an item that the hero knows some
things about.  That's intentional, but vision is turned off while
engulfed so throwing or dropping something while swallowed always
treated it as being handled by an unseen monster.

If hero is swallowed or held by a monster or poly'd and holding a
monster, behave as it the monster can 'seen' by touch when items are
added to its inventory.

Closes #586
2021-09-07 17:50:50 -07:00
PatR
56dfa5a749 obj->spe doc: scroll of scare monster 2021-09-06 17:36:52 -07:00
Pasi Kallinen
e7e7bca2a3 fixes entry 2021-09-06 21:02:48 +03:00
Guillaume Clemens
67295bc706 Non-metallic gloves protect worn rings from shock 2021-09-06 21:01:53 +03:00
Pasi Kallinen
9942b65df7 Resistances gained from worn or wielded items also protect inventory 2021-09-06 20:24:44 +03:00
PatR
9f230c3cd4 fix #K3436 - crash during restore
triggered by Grayswandir's hallucination resistance.  If the game
is saved while hero is hallucinating but having that be suppressed
by wielding Grayswandir, is riding, and the steed is on an object,
then during restore the hero's location will be updated because
of the presence of the object but the attempt to display the hero
there is made before u.usteed has been restored and fails.
2021-09-05 15:44:00 -07:00
Pasi Kallinen
e813cf5b05 Move sanity checking to start of main loop
... just after clearing the object bypasses, as some
of the monster movement code may use object bypass flags.
2021-09-05 10:14:16 +03:00
PatR
c97e3e1db7 Fixes entry for "Disambiguate blunt weapons"
and additional comments.  Pull request #584 expands the oc_dir field
of objects[] from 2 bits to 3 in order to hold the weapon strike-
type bit mask.

Closes #584
2021-09-04 14:46:24 -07:00
copperwater
52585b00ab Disambiguate blunt weapons
Currently weapons are set up as piercing, slashing, or whacking, using
their object's oc_dir field, with the intention that certain weapons
can classify as both. However, since oc_dir is only 2 bits and WHACK is
0, there's no way to unambiguously express some of these combinations.
Certain weapons such as the lucern hammer are defined as combination
piercing/blunt weapons, but the game just sees it as a piercing weapon.

This commit adds a third bit to oc_dir and promotes the WHACK constant
to its own bit. Nothing should be affected by this (wand directions and
the like should remain working as usual) other than the
blunt-and-something-else weapons being defined properly.
2021-09-04 14:46:11 -07:00
PatR
dd7b9f2a8a fixes entry for "Suddenly you cannot see it"
Pull request #585 fixes incorrect XOR logic caused by changes
accompanying introduction of gold dragons 5 or 6 weeks ago.

Closes #585
2021-09-04 14:29:15 -07:00
Michael Meyer
1b6dddc281 Fix: 'Suddenly you cannot see it'
Updates to m_dowear_type(worn.c) in 5a09a01a13 inadvertently reversed
the effect of an xor near the end of the function, causing it to go from
testing whether a monster's status as 'seen' or 'unseen' changed over
the course of the function to testing whether it remained the same.

As a result, whenever an unseen, invisible monster donned a piece of
armor anywhere on the map, the message 'suddenly you cannot see it'
would be printed.  Fix the xor so that it goes back to testing whether
visibility changed since the start of the function.
2021-09-04 14:21:41 -07:00
Pasi Kallinen
e61d149171 Fix eel hiding in dry land
When an eel was hiding in a pool and a rolling boulder trap
launched a boulder on top of the pool, and the boulder then
filled the pool, the eel ended up hiding on the dry land.

As a stopgap measure, kill off any monster that is in the
pool location when the boulder hits the pool. This should
probably be expanded to handle flying monsters differently.
2021-09-03 13:27:40 +03:00
copperwater
1bb686f744 Fix: replace_terrain used wrong y2 coordinate 2021-09-03 08:27:44 +03:00
Pasi Kallinen
c0dc72b3d2 Test for replace_terrain coordinates 2021-09-03 08:27:17 +03:00
PatR
3a99a5e388 fixes entry for pull request #565 - booze
Drinking booze has more impact on hero with an empty stomach.

Closes #565
2021-09-02 15:54:17 -07:00
Michael Meyer
e44de71499 Amplify booze effect if drinking on empty stomach
Drinking booze on an empty stomach will amplify its effects
(i.e. increase the duration of the resulting confusion); stuffing
yourself before drinking will have the opposite effect.
2021-09-02 15:52:39 -07:00
Pasi Kallinen
cf44cb3382 Handle buried zombifying corpses
When a zombifying corpse is buried, allow it to zombify and
dig itself out of the ground.

Also allow wishing for zombifying corpses.
2021-09-02 20:54:36 +03:00
PatR
43db84cd13 fixes entry for polyfodder patch
Add a fixes entry for the "Count all poly'ing tins as potential sliming
cures" commit.

Closes pull request #578
2021-08-29 15:40:05 -07:00
Michael Meyer
6596718acd Count all poly'ing tins as potential sliming cures
Popeye, used to check whether eating a particular tin is a potential
lifesaving action, considered tins of chameleon meat a cure for sliming
(since you can polymorph into a fiery monster), but didn't credit the
same possible curative power to other tins which can polymorph the hero.

Use the polyfodder macro (used elsewhere to check whether eating
something will polymorph a monster/pet) to determine whether a tin will
polymorph the hero.
2021-08-29 15:36:35 -07:00
nhmall
a772751745 build failure detected in CI
The build in the CI was failing after commits today due to this error:
prob error for class 4 (28%)

It was caused by running
	makedefs -o

Remove unnecessary invocation of makedefs with outdated options from
aftermakedefs.proj
2021-08-28 23:10:49 -04:00
PatR
c57abab020 delete obsolete variable 'monstermoves'
Fixes entry and EDITLEVEL increment for 'Remove g.monstermoves'
commit.  Invalidates old save file contents.

Closes pull request #579
2021-08-28 16:24:23 -07:00
copperwater
f855fb5e45 Remove g.monstermoves
It's redundant with g.moves, so there is no more need for it.

Way, way back, it looks like g.moves and g.monstermoves can and did
desync, where g.moves would track the amount of moves the player had
gotten (and would therefore increase faster if the player were hasted)
and g.monstermoves would track the amount of monster move cycles, aka
turns. But this has not been the case for a long time, and they both
increment together in the same location in allmain.c. There are no
longer any cases where they will not be the same value.

This is a save-breaking change because it changes struct
instance_globals, but I have not updated the editlevel in this commit.
2021-08-28 16:22:38 -07:00
Pasi Kallinen
b76a213caf Fixes entry 2021-08-28 17:07:56 +03:00
copperwater
0e05c94400 Remove requirement of object probs adding to 1000
When discussing the recent commit that removed makedefs -o from the
build process, nhmall pointed out that a sanity check ensuring all
objects within one class add up to 1000 probability had been removed as
well. This requirement was a perennial thorn in the side for anyone
doing anything that touches object probabilities, because allocating
probability to something meant deciding what to take it away from,
without a good way to evenly distribute that across all the other
members of the object class.

I had gotten around this in xNetHack by removing the sanity check and
making mkobj() total up the probability within an object class and then
using that instead of 1000. This commit takes a similar approach, but
instead of inefficiently recalculating the sum every time mkobj() is
called, it instead computes it at the start of the game or when
restoring the save file and stores it in a global variable.

This fixes a slight bias problem with rings - they are all supposed to
be of equal probability, but there are 28 of them and 1000 is not evenly
divisible by that, so the old formula made the later rings slightly more
likely. Now instead of a 35/1000 or 36/1000 chance, they are all
uniformly 1/28. (Internally they have a oc_prob of 1 now, not 0).

Gems are also weird, because their oc_prob values change every level.
This ought to have still worked without a change, because the arcane
formula for assigning the probabilities would still end up with them
adding to 1000. But I added in code to reset the total gem probability
anyway; this may help make the formula less arcane in the future.

There is still a sanity check against object classes having a nonzero
number of objects but zero total probability, in which case an
impossible will be thrown and every member of the class will be given
equal probability. I also downgraded the "probtype error" panic in
mkobj() to an impossible because it has a reasonable failure case -
return the first item in that class.
2021-08-28 17:03:39 +03:00
PatR
ecee4e8610 Guidebook tweaks for ^E, section 5 header
Describe #wizdetect as revealing hidden things rather than searching
for hidden things since the latter is described more than once as
possibly needing multiple tries.

For plain text output, the "Rooms and corridors" section header was
harder than necessary to notice because it seemed to run together
with the list of commands preceding it.
|
| u    #untrap
|
| 5.  Rooms and corridors
|
Inserting an extra blank line in between them is helpful.  That isn't
needed for Postscript/PDF output because the text of the section
title is rendered with bold font, but I didn't attempt to make the
extra line be conditional.  The 'roff directive is added as a comment
to the TeX source without knowing whether an extra blank line would
be useful there (doubtful).
2021-08-26 15:32:52 -07:00
Pasi Kallinen
2aaee76c5c Fix ball bypass sanity complaint
Be punished, get swallowed, drop the ball inside the monster
via the 'D' drop, kill the swallower - this issued a sanity
check complaint about the ball bypass flag.

In this case, the ball was "floating", not on any object chain,
when dropped inside the monster, so clear_bypasses didn't
clear the flag.
2021-08-26 18:46:25 +03:00
Pasi Kallinen
2f94ad489f Reindent main loop
No code change, just reindenting the main loop, as it wasn't
reindented when the inner part was split into separate function.
2021-08-26 14:19:39 +03:00
Pasi Kallinen
70b953db44 Clear bypasses at beginning of main loop
Object bypass flag is used to check if an object was already
handled in an iteration loop, in cases where the linked list order
may change during iteration. The flags should never stay set
past a turn, if any were used.

Reset the bypass flags at the beginning of the main loop, without
checking g.context.move -flag; that flag gets reset if hero lifesaved.
2021-08-26 14:12:00 +03:00