Commit Graph

15984 Commits

Author SHA1 Message Date
nhmall
e4e8eea4e8 track the handedness of the hero
Don't make either LEFT_HANDED or RIGHT_HANDED be an advantage
or a disadvantage.

use suggested macros
2023-12-02 11:23:43 -05:00
nhmall
8ee8d89814 optlist.h
Currently, options.c is the only file that #includes "optlist.h".

In theory, if a source file did want to include optlist.h (perhaps
for the struct allopt_t declaration so they could deal with a
pointer to such a struct), they wouldn't be able to include it
because of a static function prototype that it contains.

Add some protection to only include that static function
prototype when optlist.h is included from options.c.
2023-12-02 11:09:41 -05:00
Alex Smith
4a00b66b30 TDTTOE: oil has a higher boiling point and flashpoint than water
As such, it shouldn't be affected by the heat of the ground in
Gehennom (which is hot enough to boil but not to burn). The oil
still heats but won't break its bottle.
2023-12-02 14:25:09 +00:00
Alex Smith
6acf5a7784 Potions are often destroyed when dropped onto very hot ground
In Gehennom and on the Plane of Fire, the ground is hot enough to
boil potions (although not hot enough to, e.g., burn scrolls).
The potions sometimes survive this (almost always if it's your
potion, it's blessed, and you have maxed Luck), but often don't.

In addition to making a lot of flavour sense, this serves a
gameplay purpose in that it reduces the number of potions that
are deathdropped by monsters in the late game. In Gehennom,
monsters often generate with potions to use defensively, but then
get killed before they have a chance to use them: this produces a
surfeit of potions that players tend to convert into holy water or
potions of full healing (and in general it doesn't make much sense
that the basic potion of healing primarily generates in Gehennom).
This commit approximately halves the number of useful potion
deathdrops, whilst still allowing monsters access to their
potions; when the monster dies, it drops the potion and this has a
chance of destroying it.
2023-12-02 08:18:01 +00:00
Alex Smith
87f3b4809f Add extra food rations to the Monk quest home level
The previous commit makes things somewhat harder for vegetarian
characters. Normally, making a conduct harder isn't a huge issue,
but vegetarian Monk is an intended/encouraged combination. As such,
compensate by adding some additional food rations to Monk games
specifically; the Quest home level is early enough to provide the
extra food, and as the level is Monk-specific, it will provide the
food only to Monks specifically.  (Although the Quest generally
requires level 14 to enter, the Quest home level specifically
doesn't.)
2023-12-02 08:18:01 +00:00
Alex Smith
39a7dc1c52 Most monsters no longer deathdrop comestibles other than their corpse
Playtesting has shown that there is too much permafood in the game
at present: in the late-game the only food-related problem is how
much to carry in order to avoid burdening yourself. In the early
game, food could previously have been a problem prior to
Minetown/Sokoban (thus the recent commit to add a guaranteed ration
in the upper dungeons), but past that point, there is easily enough
food generated on the ground. Additionally, the recent commits to
make healing sources more available in the early game reduce the
amount of time that needs to be spent waiting to heal, thus
further reducing food requirements.

The main purposes of food as a mechanic are to given an incentive
to press onwards and to discourage grinding. However, if monsters
are deathdropping non-corpse permafood, then beyond the very
early game, grinding actually generates more food than it uses up,
so the nutrition mechanic doesn't do its job properly.

Playtesting (including a full ascension!) has shown that there is
still plenty of food available even without deathdrops available
(my test game had 8 spare non-deathdrop food rations upon reaching
the Castle, at which point nutrition is no longer an issue due to
the Castle food stores and the huge numbers of C- and K-rations
dropped by the soldiers). I will address the potential problems
this causes for vegetarian Monks in a future commit.
2023-12-02 08:18:01 +00:00
Alex Smith
e8ca614e5c Reduce yields for multi-step alchemy recipes
With potions of healing becoming much more common, the multi-step
alchemy recipe from potion of healing to potion of extra healing to
potion of full healing is likely to become even more overpowered
(and it was somewhat unbalancing even beforehand).

This change restricts alchemy involving diluted dipped potions to
alchemize only two potions at a time. This means that potions of
healing can stil be alchemized into potions of extra healing as
efficiently as before this commit, and so can potions of extra
healing into potions of full healing; but the multi-step recipe
is now limited by requiring a lot of potions of gain level or gain
energy. As such, this is intended to make potions of healing into
an item primarily useful in the early game, and discourage hoarding
them for the late game.
2023-12-02 08:18:01 +00:00
Alex Smith
62fb875931 Make the potion of healing much more common and easier to identify
At present, potions of healing generate primarily in Gehennom,
which causes significant balance issues (e.g. you don't have them
to heal in the early game, or even if you do, you can't identify
them in time to use them). In this series of commits, I'm aiming to
make potions of healing a more viable early-game healing source,
which means making them both (much) more likely to generate, and
easier to identify so that they are actually usable in the early
game.

This commit radically increases the generation chance of potions
of healing (reducing the chance of most other potions slightly to
compensate), and gives them a unique base price. This should make
them fairly easy to identify either by price-ID or quantity-ID
(and the unique base price is chosen to be fairly easy to figure
out even for unspoiled players).
2023-12-02 08:18:01 +00:00
Alex Smith
ae3e5d281f Add bonus items to some early-game Dungeons levels
These are primarily in chests (apart from one guaranteed good food
item on the Mines branch level), and are quite likely to be potions
of healing, although other items that are useful for early-game
survivability are also possibilities.

This is part of a series of commits that aim to make the early game
less about waiting to heal up and more about pressing forwards. In
particular, this means that characters need likely access to
healing sources other than waiting/backtracking/hiding in closets.
In a future commit, I plan to make permafood generate primarily
through exploration (rather than drops from monsters) in order to
deter waiting around or grinding; the early guaranteed food drop is
present to give the more nutrition-intensive characters (e.g. orc
wizard or vegetarian Monk) a fair chance to reach the more abundant
food sources in Minetown or Sokoban.
2023-12-02 08:18:01 +00:00
PatR
ea57b9d8ca bones fix - clear monst->seen_resistance
When saving bones, forget observations of current hero's resistances
because they'll be stale when the bones are used in a future game.
2023-12-01 23:05:11 -08:00
PatR
a0008f7376 --windowtype:foo on command line
There's no need to process windowtype a second time after options
parsing.  The sequence set windowtype, process options, set
windowtype again was intended to deal with the options setting it
to some other value, but there's a flag available to disable that
from happening.
2023-12-01 22:58:53 -08:00
Alex Smith
9d910773d0 Make starting inventory magic markers more likely, but fewer charges
In particular, Wizards now get a magic marker guaranteed (but with
fewer charges than magic markers naturally generate with). This is
intended to improve the game in two ways: it reduces the incentive
for startscumming, and it gives Wizards a method to gain an
additional low-level spell early if they wish (but the marker does
not have enough charges to get higher-level spells quickly using
this method).
2023-12-02 03:59:29 +00:00
Alex Smith
319dfbdaa3 Wizards learn about spellbooks as they enhance their spell skills
Previously, Wizards got a boost to the chance of writing unknown
spellbooks based purely on being a Wizard (with the chance still
luck-based), leading to a very large power spike when the Wizard
gained access to a luckstone and the ability to max out luck.
This had two main issues: this power spike came *after* the major
early-game difficulty spike, often leaving Wizards forced to deal
with it without having appropriate spells; and it promotes
grinding (for Luck and for Magicbane) at an early point in the
game, meaning that the Wizard early game effectively followed a
sequence of extreme difficulty -> grinding -> minimal difficulty,
which isn't very good balance-wise.

With this commit, Wizards lose their advantage to writing unknown
spellbooks by guessing, and instead learn spellbook IDs based on
their spell skills (advancing a skill gives knowledge of higher-
level spellbooks). This means that writing unknown spellbooks
becomes guaranteed with sufficient skill, but has no advantage
over non-Wizards in schools where the Wixard does not have
sufficient skill.

Due to Wizards' skill caps, there are two spells which they can't
ever write guaranteed: create familiar and charm monster. Create
familiar is a fairly niche spell (that doesn't match the Wizard
playstyle that well) and being unable to write it is not a major
problem. The inability to easily write charm monster is
intentional.
2023-12-02 03:46:55 +00:00
Pasi Kallinen
a30a205c45 Fix sanity error with migrating monster 2023-12-01 22:15:10 +02:00
Pasi Kallinen
e6ea551150 Fix segfault when trying to create tame lights 2023-12-01 22:13:46 +02:00
PatR
eb212c1676 refine PR #1139 - m_move() and postmov()
Remove a stale comment and update one or two others.
Remove several trailing spaces.
Change the data type of a couple of variables from schar to int and a
couple others from int to coordxy.
Redo a nested 'if' sequence to un-nest; results in a bloated diff due
to reducing indentation for a big chunk of code.
Change monster movement to use u_on_newpos() when swallowed hero's
location moves along with engulfer so that a clipped map will be kept
up to date.
2023-12-01 04:53:20 -08:00
PatR
f3bcec6c53 generic objects bit
u_on_newpos() bit:  player can't see the map while swallowed so hero
can't see objects on the map, hence shouldn't gain more info about
any generic objects if engulfer moves closer to some.

At the moment engulfer movement is manipulating <u.ux,u.uy> directly
rather than going through u_on_newpos(), but that's about to change.
Otherwise a clipped map doesn't get updated properly until the hero
is eventually expelled.
2023-12-01 04:52:21 -08:00
PatR
aff6df1095 PR #1139 - split postmov code out of m_move()
Pull request from argrath:  reduce the size of m_move() and eliminate
several goto's by splitting off 'goto postmov' into a separate routine.

Some of the comments have ended up out of date, referring to 'above'
or 'below' for stuff that moved away.  That can be fixed up later.

Closes #1139
2023-12-01 03:38:21 -08:00
SHIRAKATA Kentaro
fffb1d53ff split 'postmov' of m_move() into separate function 2023-12-01 03:37:47 -08:00
PatR
c899d3645f pull request #1141 - refine washing hands
Pull request from entrez:  when dipping gloved hands into pools or
fountains to wash them, subject those gloves to water damage.  Also,
showing '-' as a likely candidate when picking an inventory item to
dip while at a pool or fountain location didn't work if player had
the 'force_invmenu' option set.

Closes #1141
2023-11-30 19:00:13 -08:00
Michael Meyer
03801773a8 Allow #dipping bare hands from pickinv menu
This wasn't being provided as an option because apparently all actions
which allow hands needed to be explicitly added to the list in getobj().
Add a fallback default 'hands' entry for any action which permits hands,
which both allows #dipping your hands and means that future additions of
hands as a target to other actions will work with OPTIONS=force_invmenu
without needing to remember this.

I made it so that hands will only be presented in the pickinv menu if
they are actually one of the suggested/likely items, which was a little
tricky because pickinv was only looking at actual inventory to determine
whether some items were excluded and the "show everything" option should
be presented.  I had to add a parameter to inform it that hands are
allowed so it would know to display that option if they were allowed but
no 'hands' entry was passed in xtra_choice.  Not sure if there was a
better way to let it figure that out...
2023-11-30 18:36:09 -08:00
Michael Meyer
abafc849e9 Rust gauntlets when washing hands even if Glib
Make it so that washing your gloved hands in a fountain, pool, or sink
can still rust your gauntlets even if it successfully removes the grease
from your fingers.  There wasn't much logic behind the two effects being
mutually exclusive, since the oily fingers of the Glib effect don't
normally protect against water damage like the item being 'greased'
does, and this introduces a possible tradeoff that could make whether or
not to clear Glib by washing your hands a more interesting tactical
decision.
2023-11-30 18:36:08 -08:00
PatR
697a85aa4a pull request #1149 - mimic misbehavior
Pull request from entrez:  a 3.6 problem with mimics coming out of
hiding when they shouldn't was indirectly fixed by an earlier change.
Fix it directly.

Also, add a fixes entry since there didn't seem to be one.

Closes #1149
2023-11-30 18:10:23 -08:00
Michael Meyer
fe8710532e Fix: latent bug with finish_meating on catchup
Some players of 3.6 recently noticed that sometimes, mimics in shops
seemed to have moved around even before the player had entered the shop
or done anything to uncloak them.  I found that this was because
finish_meating was being called for all non-eating monsters when
restoring a level (monsters that weren't eating anything would have
meating == 0 so always pass the 'imv > meating' check).  This would
uncloak mimics -- but not all the time, because the 'mappearance != 0'
test meant mimics disguised as strange objects weren't uncloaked.  I
think that was meant to be an additional check to confirm the monster
really did have a disguise, but in reality it meant that M_AP_OBJECT
"strange object", M_AP_MONSTER "giant ant", etc disguises wouldn't be
removed by finish_meating.

As it turns out, this was mostly fixed by coincidence in 221e4a7, which
fixed the "exclude actual mimics" check in finish_meating.  So at this
point in 3.7 it's largely a latent bug, but it still had the potential
to improperly uncloak non-mimics who can disguise themselves (like the
Wizard of Yendor, maybe?), and could cause other problems if
finish_meating were updated to have additional effects, or if some
monster types were made to disguise themselves as a strange object when
eating a mimic.
2023-11-30 18:05:34 -08:00
PatR
97238fc01a github issue #1157 - wand of striking
Issue reported by elunna:  hero witnessing a wand of striking being
zapped by a monster didn't have that type of wand become discovered.
Monsters observing hero resisting--or failing to resist--the effect
on hero didn't learn about target's current resistance capability.

Barely tested.

Fixes #1157
2023-11-30 16:37:07 -08:00
nhmall
14bdbc8a04 Merge branch 'do-play-instrument' of https://github.com/argrath/NetHack into NetHack-3.7 2023-11-30 13:50:28 -05:00
nhmall
a6772da65d pull request 1156 follow-up bit 2023-11-30 12:19:16 -05:00
nhmall
182d7d27b8 Merge branch 'fix-mkobj' of https://github.com/argrath/NetHack into NetHack-3.7 2023-11-30 12:16:46 -05:00
SHIRAKATA Kentaro
3ab0d92ac9 remove unnecessary condition on save_mtraits()
`mtmp->data` here is always non-null, otherwise it leads segv at earlier code.
2023-12-01 02:05:38 +09:00
nhmall
706232faf0 invlet_basic follow-up 2023-11-30 11:23:29 -05:00
nhmall
d7fef5f194 avoid another magic number
Some of the hardcoded +1 scattered about are likely
invlet_gold or invlet_overflow, but I didn't hunt those down.
2023-11-30 11:15:32 -05:00
PatR
9847fcb5b1 improve the menu for setting pickup_types option
For
|Autopickup what?
| a - amulets
 ...
| A - all classes
prevent invert all and set all from setting the 'A - all classes'
entry.  For invert, toggling it is wrong.  For set, suppressing it
from being set is academic since all other entries get set.

Simplify the notes about what happens when no classes are selected,
and when autopickup is On about how to not autopickup anything at all.
Add one when it's Off, about how to make the chosen classes matter.
2023-11-29 21:37:40 -08:00
PatR
6332b17177 pull request #1138 - hands glowing red
Pull request from entrez:  "Your hands begin glowing red even more"
when hands are already glowing red is inaccurate and poorly phrased.

Closes #1138
2023-11-29 12:13:45 -08:00
Michael Meyer
4e008bb52f Reword feedback for repeated confuse monster use
I didn't like "your hands begin to glow red even more" very much (the
hero's hands aren't really 'beginning' to glow if they already have an
active confuse monster effect, and "glow red even more" was an awkward
turn of phrase on top of that).  Rephrase it to "The red glow of your
hands intensifies."
2023-11-29 12:11:43 -08:00
PatR
8764ae123b pull request #1137 - digging fixes
Pull request from entrez: if breaking a wand of digging or playing
a drum of earthquake destroys an altar, provoke the god's wrath.
Likewise for shop damage, have the shopkeeper demand payment for
repairs.

Also revise the handling for some digging messages.

Closes #1137
2023-11-29 11:43:31 -08:00
Michael Meyer
392f300fa6 Blame hero for broken digging wand shop damage 2023-11-29 11:36:57 -08:00
Michael Meyer
e49c488f18 Streamline digactualhole messaging
Merge some nearly-duplicate code for the two trap types.  Also include
alignment name when referring to an altar's destruction, since it
provides some context for the immediate follow-up by its god.
2023-11-29 11:36:57 -08:00
Michael Meyer
0473fff5b5 Make destruction of altar incite its god's wrath
This is for completely destroying an altar with extra-powerful magical
digging -- the normal altar_wrath() punishment didn't seem sufficient
for such an outrage to me, so skip straight to slinging the lightning
bolts.  Destroying an altar is unlikely to happen by accident (though
it's possible with poorly timed usage of a drum of earthquake).
2023-11-29 11:36:56 -08:00
Michael Meyer
5cbc16a3bd Improve digging vs furniture messaging
When a wand of digging explosion overwrites furniture, describe it
appropriately.  "A pit appears in the altar" doesn't sound right.
2023-11-29 11:36:56 -08:00
Michael Meyer
06ef415c4f Remove unneeded furniture vs earthquake hack
This is no longer needed after ab37888b36.
2023-11-29 11:36:55 -08:00
PatR
44954b61b2 pull request #1136 - remove unnecessary test
Pull request from argrath:  no need to test for Null pointer when it
has already been unconditionally dereferenced.

Closes #1136
2023-11-29 11:28:55 -08:00
SHIRAKATA Kentaro
5f6535728d remove unnecessary condition on use_offensive()
`otmp` here is always non-null, otherwise it leads segv at earlier code.
2023-11-29 11:27:20 -08:00
PatR
5120764560 ^P in getlin()
Replace magic number 020 with ^P.
2023-11-29 11:24:46 -08:00
PatR
585e6373b5 drop_uswapwep()
drop_uswapwep() avoided calling makeplural() in a pline which also
had a call to Yobjname2(), with a comment about the possibility of
clobbering its static return buffer.  uswapwep might be a stack that
results in Yobjname2 indirectly calling makeplural to produce a
plural description.  But makeplural() has used xname's pool of obufs
since before uswapwep became a thing, so the code was evidently
cloned from some other out of date usage.

I was going to just move the makeplural() call into pline() but it
dawned on me that uswapwep must be one handed, so don't pluralize
hands at all.  And since uswapwep might have the same description as
uwep, explicitly mention "left hand" to distinguish.
2023-11-29 11:23:25 -08:00
Pasi Kallinen
94d44e433b Fix sanity error when pet ate a mimic corpse
When a pet ate a mimic corpse and started mimicking a monster,
and the user then used #wizmakemap, the sanity checker complained
about "non-mimic posing as foo" - the code was clearing the
pet eating counter, but didn't clear the appearance.
2023-11-29 12:15:08 +02:00
nhmall
5dd12fdc83 mandoc follow-up 2023-11-29 00:40:48 -05:00
nhmall
05c720bf9d more macOS make manpages follow-up 2023-11-29 00:11:04 -05:00
nhmall
dc7685f33c update MANDIR for macOS 2023-11-28 23:58:51 -05:00
nhmall
cbeb8a51a3 some macOS doc updates
Allow 'make USE_MANDOC=1 distrib' to be used for generating
the doc/*.txt files for systems that have mandoc and may not have groff.
(macOS Ventura doesn't include groff in the OS).
USE_MANDOC=1 is not restricted only to macOS.

Have hints/macOS.370 specify the /usr/share/man/man6 directory for the macOS
man pages, so that 'make manpages' will target the correct directory on
that platform.
2023-11-28 23:44:23 -05:00
nhmall
571de1528d some doc updates
add a 'distrib' target to the top level Makefile so that the
distribution doc/*.txt files can be created via 'make distrib'
from the top directory.  It utilizes the existing 'distrib'
target in the doc/Makefile.

Have hints/linux.370 specify the correct directory for Linux
man pages of /usr/share/man/man6, so that 'sudo make manpages'
works on that platform,
2023-11-28 22:49:31 -05:00